Sometimes it is necessary to shrink a transaction log in a database manually if the log file grows unexpectedly in order to save some disk space.Here are the steps use to truncate transaction log in a database:BACKUP LOG <databasename> TO DISK = '<backupfile>'DBCC SHRINKFILE (<filename>, <targetsize>) WITH NO_INFOMSGSe.g.:BACKUP LOG NORTHWND TO DISK = 'C:\NorthwindLog.bak'DBCC SHRINKFILE (Northwind_log, 100) WITH NO_INFOMSGSTo check your logical file name of your log file, you can run the query as below...
Wednesday, September 16, 2009
Shrinking Transaction Log File in SQL SERVER
Author: xiaoyu
| Posted at: 12:10 PM |
Filed Under:
sql server
Subscribe to:
Posts (Atom)