August 5, 2003 at 1:26 pm
I know to shrink and backup a transaction log, its
something like a three step process truncate, shrink, truncate could someone help me here?
August 5, 2003 at 1:38 pm
Depending on the database recovery mode. If it is 'simple', you can backup log with truncate_only and dbcc shrinkfile. If database is in 'Full Recovery' mode, you should backup the log then shrink the log file.
Which version of SQL Server do you run?
August 5, 2003 at 1:50 pm
i thought you had to enter in a certain order repeating one action twice.
August 5, 2003 at 1:55 pm
got it....
DBCC SHRINKFILE(<DatabaseName>, 1)
BACKUP LOG <DatabaseName> WITH TRUNCATE_ONLY
DBCC SHRINKFILE(<DatabaseLogName>, 1)
August 5, 2003 at 1:58 pm
Hi,
Last Sunday I shrinked a transaction log from 15GB to 1GB. I did the following:
1. Backup of transaction log
2. Ran DBCC Shrinkdatabase with TRUNCATEONLY option
You can find useful help in online help for the following topics: 1. Shrinking the transaction log. 2. DBCC Shrinkdatabase
Hope this helps.
Charles L. Nichols
Charles L. Nichols
August 6, 2003 at 3:56 pm
My DB is in full recovery mode. For some reason(say after optimizing) the trans log file grows too large, there is no romm to do transaction log backup, so I did the followings:
1. dbcc shrinkdatabase(DBname, truncateonly).
2. Change recovery mode to single.
3. dbcc shrinkfile(logfile name)
4. Change recovery mode back to full.
5. do complete database backup.
In this way shall I loss any data or transaction? Thanks!
Robert
August 6, 2003 at 5:19 pm
although this is not the correct sequence to do this, if the db is not corrupted you 'are fine. There is 'No data loss'.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply