SQL Query for Srink and Trucation of Log File in Sql Server 2005.
Here I want to describe some tricks to truncate log file for a database in SQL Server 2005.
If primary transaction log file is exceed in large volume then is it good to restrict size , there is nothing wrong impact if we restrict the size.
Here I want to describe some tricks to truncate log file for a database in SQL Server 2005.
If primary transaction log file is exceed in large volume then is it good to restrict size , there is nothing wrong impact if we restrict the size.
First get Logical name of Log file.
1. Open SQL Server Management Studio and connect
to the Sql Server.
2. Right Click on Database Name.Click on
Properties.
3. Copy the name in Red Circle this is the Log File name.
And replace this log name into given
query.
4. Result Set
Here is the SQL Query to copy and execute with replacement with your requirement.
Use AMS
dbcc shrinkfile(AIMS_LOG,1)
backup log AMS with
truncate_only
dbcc shrinkfile(AIMS_LOG,2)
Comments
Post a Comment