博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SQL Server 2008 Database Mirror - DB 镜像 - Some Key Learnings
阅读量:4962 次
发布时间:2019-06-12

本文共 2281 字,大约阅读时间需要 7 分钟。

It's always easier to say than to do.

Key learnings:

1. Never expect a simple piece of document help you out. There will be lots of unknown traps waiting for you. You need to figure out by yourself.

2. Log! Log! Log! A simple error code tells you nothing. Try to find the log, you might find more details to help you solve the problem.

==================================

DB mirror without witness server. Principle => Mirror

NOTE: This might not be a standard way of setup(No encryption, not secure etc.), but at least it is functioning.

== Preconditions:

1. Two servers with SQL server 2008 running. One for Principle, one for Mirror.

2. Servers already joined domain. There is one Domain account to control them, and "sa" account is also set locally.

== Setup:

1. Backup DB(Full mode) to file from Principle server

2. Restore DB and transaction Log separately to Mirror server with option: RESTORE WITH NORECOVERY. Now the DB should be in a state which you cannot use it.

3. Configure DB mirror.

  3.1 Uncheck "Encrypt data ......" option. (I didn't make the mirror happen with encrypt option checked.)

==Errors:

There will always be errors

1. Right click DB on Principle server, Aspect=>RemoteDacEnabled set to True

2. Windows firewall. Make sure port 5022 is open(Default port is 5022)

3. Error Code 1418: This annoyed me for half a week.

  Check the SQL server log on both current server & target mirror server. See error like:

    Logon Database Mirroring login attempt by user 'XXX\YYY$.' failed with error: 'Connection handshake failed. The login 'XXX\YYY$' does not have CONNECT permission on the endpoint. State 84.'. 

  Obviousely, the DB network is working fine, but the user account has no authority to login, so don't waste time checking the firewall, hostname, port etc. Check the user permission instead!

  I need to double check what I did for my instance.

  Looks like I used domain account, Administrator, sa account, all failed. But when i added a user called "XXX\YYY$" and this issue disappeared. This definitely not the correct answer but I just don't have time to do more research.

==How to make the mirror working

1. Physically disconnect Principle, the mirror needs manual setup to become a new principle.

 

转载于:https://www.cnblogs.com/anbosun/p/6725256.html

你可能感兴趣的文章
smarty模板中如何嵌入javascript脚本
查看>>
二十三种设计模式之:工厂方法模式
查看>>
HDU 1856 More is better
查看>>
2016 Multi-University Training Contest 2 总结
查看>>
Linux 下安装python
查看>>
出租车费(贪心算法)
查看>>
[leetcode] Best Time to Buy and Sell Stock with Cooldown
查看>>
canvas基础一
查看>>
jQuery插件扩展实例
查看>>
【bzoj2199】[Usaco2011 Jan] 奶牛议会
查看>>
ThreadLocal源码分析(转)
查看>>
MySQL 事务
查看>>
python构建bp神经网络_鸢尾花分类(一个隐藏层)__2.代码实现
查看>>
爬虫_糗事百科(正则表达式)
查看>>
JMS【四】--Spring和ActiveMQ整合的完整实例
查看>>
最少拦截系统
查看>>
Python—字符串的操作
查看>>
SQL Server 复制系列(文章索引)
查看>>
AngularJS学习笔记之初步了解
查看>>
IE8 CSS样式兼容性清单
查看>>