Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How do I shrink log files in SQLServer 7.0 Expand / Collapse
Author
Message
Posted Monday, March 23, 2009 6:03 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, July 8, 2009 11:46 PM
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!
Post #681343
Posted Monday, March 23, 2009 7:58 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 11:08 AM
Points: 5,863, Visits: 12,941
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.


---------------------------------------------------------------------

Post #681445
Posted Monday, March 23, 2009 10:52 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, July 8, 2009 11:46 PM
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!
Post #682054
Posted Tuesday, March 24, 2009 3:35 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 11:08 AM
Points: 5,863, Visits: 12,941
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.



---------------------------------------------------------------------

Post #682157
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse