Fix Suspended Database steps,and reset mirroring
-- Removemirroring
ALTER DATABASE token SET PARTNER off
-- dropdatabase on secondary
drop DATABASE token
--disable job on primary
USE msdb;
GO
EXECdbo.sp_update_job
@job_name = N'LSBak_token',
@enabled = 0;
GO
-- backup database on primary and copy to secondary
Backup database token TODISK='c:\MSSQL\DATA\token.bak'
Backup log token TO DISK='c:\MSSQL\DATA\token_log.bak'
--restore database on secondary
restore 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 secondary
ALTER DATABASE token SET PARTNER = 'TCP://CPCWRBISQLATP03:5022'
-- setmirroring on primary
ALTER DATABASE token SET PARTNER = 'TCP://CPCWRBISQLATS03:5022'
-- enablejob on primary
USE msdb;
GO
EXECdbo.sp_update_job
@job_name = N'LSBak_token',
@enabled = 1;
GO
Q:
Msg 3101,Level 16, State 1, Line 1
Exclusiveaccess could not be obtained because the database is in use.
Msg 3013,Level 16, State 1, Line 1
BACKUP LOG is terminating abnormally.
A:checkthe session for databasename, and kill it. try again.
sp_who2
kill 55
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341