Truncate Log in Database Mirroring SQL Server 2008 2012

select log_reuse_wait_desc from sys.databases where name = ‘AdventureWorks’

If Output is “LOG_BACKUP”

— Execute 2 Times just in case —

BACKUP LOG AdventureWorks TO DISK=’NUL:’

— Now Truncate the Log —

USE AdventureWorks
GO
ALTER DATABASE AdventureWorksSET RECOVERY SIMPLE WITH NO_WAIT;
GO
DBCC SHRINKFILE(AdventureWorks_LOG, 100);
GO
ALTER DATABASE AdventureWorks SET RECOVERY FULL WITH NO_WAIT;
GO

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s