Monday, December 5, 2011

Shrink & Truncate Log File SQL 2005

Problem

Shrink log file cannot effectife resize truncate log file in sql, use to query step this type. With decrease log size them.

Solution
This Step can used in here :
1) Get Name for name in show result

USE <database>
exec sp_helpfile

2) Execution resize increasing log data size with query :

USE <database>
GO
BACKUP LOG <database> WITH TRUNCATE_ONLY
GO
DBCC SHRINKFILE ("name log", 1)
GO
DBCC SHRINKFILE ("name data", 1)
GO
exec sp_helpfile

3) See size capacity in log file.