Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How do I shrink log files in SQLServer 7.0


How do I shrink log files in SQLServer 7.0

Author
Message
Cobra-1032610
Cobra-1032610
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 50
Hi guys,
I'm trying to shrink log files in SQL Server 7.0. where I couldn't find an option similar to 2000 or 2005! Please tell me how do I go ahead in Enterprise Manager. Also, tried my hand with DBCC ShrinkFile, but nothing seems to be happening when I run the SQL statement, it just returns the following values:columns "'DbId,FileId,CurrentSize,MinimumSize,UsedPages,EstimatedPages"

Help me guys!!

Thanks in advance!
george sibbald
george sibbald
SSCertifiable
SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)

Group: General Forum Members
Points: 6324 Visits: 13685
I cannot remember if there was an option to shrink files via EM in SQL 7 as I always did it via QA. If there is is I would think its right click the databases then under tasks.

The result you received from dbcc shrinkfile is the result you will always get. If the file did not shrink it is because the last virtual log file is used (see BOL for info on this)

to see it it is used run dbcc loginfo(dbname), a value of 2 in the status field means the virtual log is used, so check to see the value in the last row returned.

You will need to cycle this out, best way is to backup the log, sometimes just running the shrink twice does it.

the shrinkfile command should look like this

dbcc shrinkfile(logicallogfilename,size) where size is in MB

All the above is for info only. If you are ok on disk space don't bother to shrink the log file. If this is a one off shrink because its blown up after a one off job, just shrink it to a size it will need to be to support normal functionality.

---------------------------------------------------------------------
Cobra-1032610
Cobra-1032610
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 50
Thanks for the reply brother!!

DBCC Loginfo() did return a value 2 in the status field in the last row.
So I guess, shrinking the TLog is possible only when the active part of the TLog is at the beginning of the log file, whereas here it is at the last!!

Okie Dokie!! I'll see if I can release space by deleting some temp data.

Thanks again for your advice!
george sibbald
george sibbald
SSCertifiable
SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)

Group: General Forum Members
Points: 6324 Visits: 13685
Cobra,
what do you mean by this?


Okie Dokie!! I'll see if I can release space by deleting some temp data.


deleting data in the database itself wont wrap round the log file, you need to actually backup or truncate the log file, then shrink. If you truncate the log take a full backup afterwards.

---------------------------------------------------------------------
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search