The mirror database has insufficient transaction log data

After you have restored the mirror database and configured Data mirroring, when you start the mirroring it throws this error. The solution to resolving this is to restore the backup of the transaction log to the Mirror database. 1. Take backup of the TLOG at Principal site BACKUP LOG TO DISK = N'E:\transaction_log_bkp\Tlog_Bkp.trn' WITH NOFORMAT, … Continue reading The mirror database has insufficient transaction log data

Attach Deattach Database T-SQL SQL Server 2005 2008

-- Attach a database USE master; GO CREATE DATABASE ON (FILENAME = 'd:\sql data\dbname.mdf'), (FILENAME = 'd:\sql data\dbname_Log.ldf') FOR ATTACH; GO -- Dettach database and take offline -- USE master; GO ALTER DATABASE SET OFFLINE WITH ROLLBACK IMMEDIATE go EXEC sp_detach_db @dbname = N'dbname'; GO