返回顶部
首页 > 资讯 > 数据库 >Fix Suspended Database steps,and reset mirroring
  • 845
分享到

Fix Suspended Database steps,and reset mirroring

2024-04-02 19:04:59 845人浏览 安东尼
摘要

-- 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;

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


您可能感兴趣的文档:

--结束END--

本文标题: Fix Suspended Database steps,and reset mirroring

本文链接: https://lsjlt.com/news/52139.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作