惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
Forbes - Security
Forbes - Security
雷峰网
雷峰网
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
V
Visual Studio Blog
月光博客
月光博客
博客园 - Franky
有赞技术团队
有赞技术团队
宝玉的分享
宝玉的分享
博客园 - 三生石上(FineUI控件)
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
The Register - Security
The Register - Security
S
SegmentFault 最新的问题
博客园 - 司徒正美
P
Proofpoint News Feed
Know Your Adversary
Know Your Adversary
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
A
Arctic Wolf
Cyberwarzone
Cyberwarzone
Simon Willison's Weblog
Simon Willison's Weblog
U
Unit 42
P
Proofpoint News Feed
Scott Helme
Scott Helme
MyScale Blog
MyScale Blog
T
Tenable Blog
Hugging Face - Blog
Hugging Face - Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
小众软件
小众软件
C
CERT Recently Published Vulnerability Notes
P
Palo Alto Networks Blog
V
V2EX
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tailwind CSS Blog
V
Vulnerabilities – Threatpost
Latest news
Latest news
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
I
Intezer
Microsoft Azure Blog
Microsoft Azure Blog
爱范儿
爱范儿
博客园 - 【当耐特】
B
Blog RSS Feed
N
Netflix TechBlog - Medium
Recent Announcements
Recent Announcements
NISL@THU
NISL@THU
C
Cisco Blogs
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Schneier on Security

博客园 - nzperfect

PAGELATCH_EX Contention on 2:1:103 SQL Server AlwaysON 同步模式的疑似陷阱 XEvent – SQL Server Log文件对磁盘的写操作大小是多少 SQL Server Log文件对磁盘的写操作大小是多少 Initializing the FallBack certificate failed . TDSSNIClient initialization failed Error after SQL Server 2012 installation: Login Failure for "SQL Server Integration Services 11.0" SSIS service SQL Server 灾难恢复31天之第6天:管理区分配页损坏处理 SQL Server 灾难恢复31天之第5天:处理损坏的非聚集索引 SQL Server 灾难恢复31天之第3天:在还原数据库时确定需要哪些备份文件 SQL Server 灾难恢复31天之第4天:备份 SQL Server 灾难恢复31天之第2天:包含数据库备份在还原时的保护 SQL Server 灾难恢复31天之第1天:DBCC CHECK命令会自动使用已经存在的数据库快照吗? 发布订阅延迟故障排查案例:分发读进程延迟 Query Hint FAST number_rows 改变SQL Server 执行计划 SQL Server 通过界面生成修改列类型脚本时的一个风险(或Bug) 是什么引起执行计划变得极其糟糕? 应该使用更新统计信息来解决它吗? 如何完整的修改一个数据库的名称 update值与原值相同时,SQL Server会真的去update还是忽略呢? performance monitor没有SQL Server性能计数器
How can I bring mirror database online after principal server is down ?
nzperfect · 2012-08-22 · via 博客园 - nzperfect

Safety FULL with Witness :

Well the answer for this ‘depends on the mode in which mirroring is configured’. If mirroring is configured in High Availability mode (Full safety) then we don’t need to worry about failover as the mirror server will form a quorum with witness and will initiate an automatic failover. The safety level can be set using the below command,

1

2

ALTER DATABASE dbname SET SAFETY FULL

ALTER DATABASE dbname SET SAFETY OFF

Safety FULL without Witness :

This scenario provides high safety, but automatic failover is not allowed. This mode is called as High Protection mode. In the event of failure of the principal, the database service becomes unavailable. You need manual intervention to make the database service available. You must break the mirroring session and then recover the mirror database.

For example, prior to the failure, Server_A and Server_B acted as principal and mirror respectively. Server_A fails. You need to execute the following on Server_B to make the database service available:

1

2

ALTER DATABASE dbname SET PARTNER OFF

RESTORE DATABASE dbname WITH RECOVERY

Safety OFF :

In the event of failure of the principal, the database service becomes unavailable. You can perform a force service to make the database service available on the mirror. However, since the safety level is OFF, it is possible that there were transactions that didnt make it to the mirror at the time of the failure of the principal. These transactions will be lost. Therefore, manual failover with safety OFF involves acknowledging the possibility of data loss.

For example, prior to the failure, Server_A and Server_B acted as principal and mirror respectively. Server_A fails. You need to execute the following on Server_B to make the database service available:

1

ALTER DATABASE dbname SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS

Once the database on Server_A becomes operational, it automatically assumes the role of the mirror. However, the mirroring session remains SUSPENDED, and you will need to manually RESUME the mirroring session.

Login Failures while connecting to new principal database after failover ?

After configuring database mirroring in SQL Server 2005 and performing failover, the original mirror database now becomes the new principal database. We might have even created the same login (as in principal) in original mirror server prior to failover. But after failover if we try to connect or if the application tries to connect, the following error will be returned,
Cannot open database requested by the login. The login failed.
In that case we need to map the login to the user in the database using the procedure sp_change_users_login after which the application or the user will be able to successfully connect to the new principal database.

This problem occurs because the SIDs the SQL Server logins on each server do not match. Although the names for the logins are the same, the login is resolved via the SID. This is not a problem with Windows/Domain user/group logins because the SIDs for these logins are created based on the domain SID for the user/group, and hence will be the same for the same given user/group no matter what SQL Server the user/group is added to.

In order to make the sp_change_users_login synchronization step unnecessary, we need to create the SQL Server logins on the mirror server not only with the same name, but also with the same SID as on the principal server. This can be accomplished by using the SID specification in the ‘CREATE LOGIN statement when creating the logins on the mirror server. Here is an example where we create a the same login in mirror server as the one in principal server.

1

CREATE LOGIN WITH PASSWORD ='password',SID ='sid for same login on principal server'

To retrieve the SID for each login from the principal server query the sys.sql_logins catalog view.

You can also create all the logins with same SID in mirror server from principal server using sp_helprevlogin procedure. Consider this step as pre-requisite for configuring db mirroring.