您的位置:首页 > 其它

Fix Suspended Database steps,and reset mirroring

2016-12-09 16:15 330 查看
-- RemovemirroringALTER DATABASE token SET PARTNER off -- dropdatabase on secondarydrop DATABASE token --disable job on primaryUSE msdb;GO EXECdbo.sp_update_job @job_name = N'LSBak_token', @enabled = 0;GO -- backup database on primary and copy to secondaryBackup database token TODISK='c:\MSSQL\DATA\token.bak' Backup log token TO DISK='c:\MSSQL\DATA\token_log.bak' --restore database on secondaryrestore database token from DISK='c:\MSSQL\DATA\token.bak'with norecovery restorel og token from DISK='c:\MSSQL\DATA\token_log.bak'with norecovery -- setmirroring on secondaryALTER DATABASE token SET PARTNER = 'TCP://CPCWRBISQLATP03:5022' -- setmirroring on primaryALTER DATABASE token SET PARTNER = 'TCP://CPCWRBISQLATS03:5022' -- enablejob on primaryUSE msdb;GO EXECdbo.sp_update_job @job_name = N'LSBak_token', @enabled = 1;GO Q:Msg 3101,Level 16, State 1, Line 1Exclusiveaccess could not be obtained because the database is in use.Msg 3013,Level 16, State 1, Line 1BACKUP LOG is terminating abnormally. A:checkthe session for databasename, and kill it. try again.sp_who2kill 55
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  database primary enabled