-- RemovemirroringALTER DATABASE token SET PARTNER off -- dropdatabase on secondarydrop DATAB
-- Removemirroring
ALTER DATABASE token SET PARTNER off
-- dropdatabase on secondary
drop DATABASE token
--disable job on primary
USE msdb;
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
--结束END--
本文标题: Fix Suspended Database steps,and reset mirroring
本文链接: https://lsjlt.com/news/52139.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0