Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Shrinking log file

Author  Topic 

aatishpatel
Starting Member

8 Posts

Posted - 2014-01-30 : 11:42:46
In SQL Server 2008 R2 can someone please tell me how to shrink log file and also the data file.
. I have Log shipping going on so really don't want to break the log chain.
I know shrinking is not good but i really need this right now to free up some space and this is a dev environemnt so shrinking doesn't matter.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-01-30 : 12:37:47
DBCC SHRINKFILE, just don't truncate the log.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

aatishpatel
Starting Member

8 Posts

Posted - 2014-01-30 : 13:10:12
Can you please give me the exact script to shrink log file without breaking logshiping chain?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-01-30 : 13:45:52
See A and B examples: http://msdn.microsoft.com/en-us/library/ms189493.aspx

Depending upon how much you need to shrink, you may need to do it in increments of say 200MB at a time.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -