Truncating logs via osql

This is a discussion on Truncating logs via osql within the sqlserver-tools forums in Microsoft SQL Server category; I have an LCS2005 standard server where the rtc.ldf is 3.5GB and the rtc.mdf is 300MBs. I need to free up some space on the server so I want to truncate the logs. I have done this with other programs and the full SQL server before but never on the integrated SQL that comes with LCS. I need a step by step if someone can help out. As far as know I need to use oslq and run some commands. If I run osql -E -S servername\RTC and hit enter and I get a 1> What ...

Go Back   Database Forum > Microsoft SQL Server > sqlserver-tools

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-25-2008, 07:16 PM
Default Truncating logs via osql

I have an LCS2005 standard server where the rtc.ldf is 3.5GB and the rtc.mdf
is
300MBs. I need to free up some space on the server so I want to truncate the
logs. I have done this with other programs and the full SQL server before
but never on
the integrated SQL that comes with LCS. I need a step by step if someone can
help out.

As far as know I need to use oslq and run some commands. If I run
"osql -E -S servername\RTC" and hit enter and I get a 1>

What commands should I run at this point? Any help will be greatly
appreciated. Tx

PS: I posted in this in the livecomm newsgroup, but this is a managed one so
I'm posting here.


Reply With Quote
  #2  
Old 08-25-2008, 07:30 PM
Default Re: Truncating logs via osql

You need to enter the context of the correct database and then issue DBCC
SHRINKFILE. However, before getting any further, please read:

http://www.karaszi.com/SQLServer/info_dont_shrink.asp

My guess is that you are in FULL recovery mode and either (a) you mean to
be, but aren't taking log backups for some reason, or (b) you should be in
simple. In full recovery mode, taking regular log backups will prevent the
log from growing that large; in simple recovery mode, the log will manage
itself.

Anyway, have a full read of the article above.

A




On 8/25/08 6:16 PM, in article uo5rtAwBJHA.3512-at-TK2MSFTNGP05.phx.gbl,
"C.Kelly-at-noemail.noemail" wrote:

> I have an LCS2005 standard server where the rtc.ldf is 3.5GB and the rtc.mdf
> is
> 300MBs. I need to free up some space on the server so I want to truncate the
> logs. I have done this with other programs and the full SQL server before
> but never on
> the integrated SQL that comes with LCS. I need a step by step if someone can
> help out.
>
> As far as know I need to use oslq and run some commands. If I run
> "osql -E -S servername\RTC" and hit enter and I get a 1>
>
> What commands should I run at this point? Any help will be greatly
> appreciated. Tx
>
> PS: I posted in this in the livecomm newsgroup, but this is a managed one so
> I'm posting here.
>
>


Reply With Quote
  #3  
Old 08-25-2008, 10:48 PM
Default Re: Truncating logs via osql

thanks for the response... if you look at the last message in this thread
you'll see that something happens with LCS that a transaction doesn't get
committed and blocks others it seems. If you reboot the server the log file
stops growing but there is no way to get back the space. He said PSS helped
him truncate the log file so that's what I'm trying to do.

http://groups.google.com/group/micro...0f55eef45e828/



I'm dealing with MSDE here so everything is by commands... if I use osql
with server/RTC does that put me in the right database? If I type DBCC
SHRINKFILE I just get a 2> after that. Can you if possible give me a step by
step to the commands I would need to type? Thanks so much



"Aaron Bertrand [SQL Server MVP]" wrote in message
news:C4D8AAE0.10332%ten.xoc-at-dnartreb.noraa...
> You need to enter the context of the correct database and then issue DBCC
> SHRINKFILE. However, before getting any further, please read:
>
> http://www.karaszi.com/SQLServer/info_dont_shrink.asp
>
> My guess is that you are in FULL recovery mode and either (a) you mean to
> be, but aren't taking log backups for some reason, or (b) you should be in
> simple. In full recovery mode, taking regular log backups will prevent
> the
> log from growing that large; in simple recovery mode, the log will manage
> itself.
>
> Anyway, have a full read of the article above.
>
> A
>
>
>
>
> On 8/25/08 6:16 PM, in article uo5rtAwBJHA.3512-at-TK2MSFTNGP05.phx.gbl,
> "C.Kelly-at-noemail.noemail" wrote:
>
>> I have an LCS2005 standard server where the rtc.ldf is 3.5GB and the
>> rtc.mdf
>> is
>> 300MBs. I need to free up some space on the server so I want to truncate
>> the
>> logs. I have done this with other programs and the full SQL server before
>> but never on
>> the integrated SQL that comes with LCS. I need a step by step if someone
>> can
>> help out.
>>
>> As far as know I need to use oslq and run some commands. If I run
>> "osql -E -S servername\RTC" and hit enter and I get a 1>
>>
>> What commands should I run at this point? Any help will be greatly
>> appreciated. Tx
>>
>> PS: I posted in this in the livecomm newsgroup, but this is a managed one
>> so
>> I'm posting here.
>>
>>

>



Reply With Quote
  #4  
Old 08-26-2008, 04:32 PM
Default Re: Truncating logs via osql

> I'm dealing with MSDE here so everything is by commands...

You can download and use SQL Server Management Studio Express if you need a
GUI to manage your MSDE databases. This is a free tool to manage your
databases at a basic level.

http://www.microsoft.com/downloads/d...8-5A0F62BF7796

Do you see open transactions when you run DBCC OPENTRAN command?

--
Ekrem Önsoy




wrote in message
news:unGaq3xBJHA.4700-at-TK2MSFTNGP03.phx.gbl...
> thanks for the response... if you look at the last message in this thread
> you'll see that something happens with LCS that a transaction doesn't get
> committed and blocks others it seems. If you reboot the server the log
> file stops growing but there is no way to get back the space. He said PSS
> helped him truncate the log file so that's what I'm trying to do.
>
> http://groups.google.com/group/micro...0f55eef45e828/
>
>
>
> I'm dealing with MSDE here so everything is by commands... if I use osql
> with server/RTC does that put me in the right database? If I type DBCC
> SHRINKFILE I just get a 2> after that. Can you if possible give me a step
> by step to the commands I would need to type? Thanks so much
>
>
>
> "Aaron Bertrand [SQL Server MVP]" wrote in
> message news:C4D8AAE0.10332%ten.xoc-at-dnartreb.noraa...
>> You need to enter the context of the correct database and then issue DBCC
>> SHRINKFILE. However, before getting any further, please read:
>>
>> http://www.karaszi.com/SQLServer/info_dont_shrink.asp
>>
>> My guess is that you are in FULL recovery mode and either (a) you mean to
>> be, but aren't taking log backups for some reason, or (b) you should be
>> in
>> simple. In full recovery mode, taking regular log backups will prevent
>> the
>> log from growing that large; in simple recovery mode, the log will manage
>> itself.
>>
>> Anyway, have a full read of the article above.
>>
>> A
>>
>>
>>
>>
>> On 8/25/08 6:16 PM, in article uo5rtAwBJHA.3512-at-TK2MSFTNGP05.phx.gbl,
>> "C.Kelly-at-noemail.noemail" wrote:
>>
>>> I have an LCS2005 standard server where the rtc.ldf is 3.5GB and the
>>> rtc.mdf
>>> is
>>> 300MBs. I need to free up some space on the server so I want to truncate
>>> the
>>> logs. I have done this with other programs and the full SQL server
>>> before
>>> but never on
>>> the integrated SQL that comes with LCS. I need a step by step if someone
>>> can
>>> help out.
>>>
>>> As far as know I need to use oslq and run some commands. If I run
>>> "osql -E -S servername\RTC" and hit enter and I get a 1>
>>>
>>> What commands should I run at this point? Any help will be greatly
>>> appreciated. Tx
>>>
>>> PS: I posted in this in the livecomm newsgroup, but this is a managed
>>> one so
>>> I'm posting here.
>>>
>>>

>>

>
>


Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 09:05 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.