新聞中心
MSSQL 從 2005 開始推出鏡像功能.

我們提供的服務(wù)有:做網(wǎng)站、成都做網(wǎng)站、微信公眾號開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認證、朗縣ssl等。為上千余家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學管理、有技術(shù)的朗縣網(wǎng)站制作公司
SQL Server鏡像是不可讀的.整個庫在個 norecovery模式.
SQL Server鏡像只能是1對1 但可以用鏡像+logshipping 混合實現(xiàn)一對多和鏡像鏈.
SQL Server鏡像認證分為 證書 和windows驗證.windows驗證必須在一個域里面實現(xiàn).
并不是每個公司的生產(chǎn)環(huán)境都是一個域.域的好處是可以做故障轉(zhuǎn)移群集+鏡像混合實現(xiàn)保障.
下面就說下認證方式的鏡像
環(huán)境:win2008 +mssql2008
1 在主庫上面創(chuàng)建數(shù)據(jù)庫主密鑰
- create master key encryption by password ='123!@#abc';
2 創(chuàng)建證書
- create certificate host_105with subject='host_105_c'
3創(chuàng)建端點
- create endpoint endport_mirrorstate=started
- as tcp(listener_port=1522, listener_ip=all)
- for database_mirroring(authentication=certificate host_105,
- encryption=required algorithm AES, role=all );
4 備份證書并把證書復(fù)制到鏡像服務(wù)器上
- backup certificate host_105 to file='c:\host_105.cer';
5 在備份機上面重復(fù)1-4步驟 (證書名不一樣 把 所有帶 host_105替換成host_106)
6 在主機上創(chuàng)建sql驗證賬戶并和證書綁定
- create login mirror_b with password='xwj1234!@#$'
- create user mirror_b
- for login mirror_bcreate certificate host_106
- authorization mirror_bfrom file='c:\host_106.cer'grant
- connect on endpoint:: endport_mirror to mirror_b
7 在鏡像機上創(chuàng)建sql驗證賬戶并和證書綁定
- create login mirror_a with password;='xwj1234!@#$'
- create user mirror_a for login mirror_a;
- grant connect on endpoint::
- endport_mirror to mirror_a;
- create certificate host_105authorization mirror_afrom file='c:\host_105.cer';
8 在主庫新建mirror_test數(shù)據(jù)庫 日志模式設(shè)置為完全模式 并在鏡像庫上面還原,還原模式為 norecovery
9 同步鏡像
- --- 在鏡像服務(wù)器上運行alter database mirror_test
- set partner='TCP://192.168.1.105:1522'
- ---在主機上面運行alter database mirror_test
- set partner='TCP://192.168.1.106:1522'
- ---設(shè)置為高性能模式alter database mirror_testset safety off
10 測試
- --在主機執(zhí)行
- create table test(id int);
- insert into test select 1;
- --在鏡像庫上執(zhí)行
- create database mirror_test_snp
- on primary
- (name='mirror_test',filename='c:\mirror_test.mdf')
- as snapshot of mirror_test;
- use mirror_testselect * from test
11 打開鏡像監(jiān)控器
11 mirror+logshipping
分享題目:手把手教你學會SQLServer鏡像操作
網(wǎng)站網(wǎng)址:http://m.fisionsoft.com.cn/article/dhgoscp.html


咨詢
建站咨詢
