Fix Suspended Database steps,and reset mirroring
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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
本文出自 “Ricky's Blog” 博客,请务必保留此出处http://57388.blog.51cto.com/47388/1881239
以上是关于Fix Suspended Database steps,and reset mirroring的主要内容,如果未能解决你的问题,请参考以下文章
Borland InterBase Server数据库损坏,通过ib fix 无法修复,提示,不可用数据库【unavailable database
坚持使用 apt --fix-broken install (libc6:amd64 软件包安装后)
如何检测 App 何时移入/移出 Suspended 状态?
Do waiting or suspended tasks tie up a worker thread?
使用 CREATE_SUSPENDED 标志和 JobObject 从 CreateProcessAsUser 为 C# 进程设置 ProcessStartInfo