September 20, 2006 at 3:29 am
Hi All,
Hi all, I have a transaction log that has been sized to 100GB, If I wanted to resize this, the way I know how to do it is to detach the database and put make up a new transaction log.
Does anyone know if there is a better/faster way of doing this ?
Thanks in advance.
September 20, 2006 at 4:36 am
Firstly back up the transaction log.
Next run sp_helpdb 'YourDatabaseName'
Note the name of the log device
now run DBCC SHRINKFILE('TheLogFileName','Your desired size')
September 20, 2006 at 5:09 am
September 20, 2006 at 12:48 pm
After shrinking the log look up ALTER DATABASE MODFIY FILE in Books on Line.
September 20, 2006 at 3:35 pm
before shrink put the DB in simple mode, full backup, run shrink, then set to full (restore mode).
This should help you to set the size to original one
September 20, 2006 at 4:43 pm
FYI: My databases are in Simple mode. This will only work if you only have one log file.
I detach the database, rename the log file to *.ldfold and then attach the database. A new log file is created based on the size of the Model DB's log. Then you can alter the size to what you need.
At that point, you can delete the *.ldfold.
HTH,
Michelle
May 24, 2007 at 5:53 am
Hi all,
we had similiar issue. Thanks to NETs solution above we are able to resize the transaction log to reasonble sizes.
My question is if this can be done via script someway.
thx
May 24, 2007 at 6:49 am
Yes,
detaching and attaching is another solution
Thank
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply