欢迎来到天天文库
浏览记录
ID:41961782
大小:75.69 KB
页数:4页
时间:2019-09-05
《数据库镜像实验》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、主服务器设置(10.36.64.251)DROPENDPOINTEndpoint_MirroringALTERDATABASEst_ccerpSETPARTNEROFFdropmasterkeyrestoredatabasest_ccerpfromdisk='E:tmpccerp_jzt-bakfwithreplace,recovery,move1ccerp_jzt1to1E:ccerp_dataccerp_jztccerp_jzt.mdf1,move1ccerp_jzt_log1to1E:ccerp_dataccerp_jztccerp_jzt_log.ldfalterd
2、atabasest_ccerpsetrecoveryfullUSEmaster;CREATEMASTERKEYENCRYPTIONBYPASSWORD=xlenovoz;CREATECERTIFICATEHOST_A_certWITHSUBJECT=1HOST_Acertificate1,START_DATE=12012-01-091,EXPIRY_DATE=12112-01-101;CREATEENDPOINTEndpoint_MirroringSTATE=STARTEDASTCP(LISTENER_PORT=5022,LISTENER_IP=ALL)FORDATABASE_MIRROR
3、ING(AUTHENTICATION=CERTIFICATEHOST_A_cert,ENCRYPTION=REQUIREDALGORITHMAES,ROLE=ALL);BACKUPCERTIFICATEHOST_A_certTOFILE1d:镜像证书HOST_A_cert•cer'CREATELOGINHOST_B_loginWITHPASSWORD=1lenovo1;CREATEUSERHOST_B_userFORLOGINHOST_B_login;CREATECERTIFICATEHOST_B_certAUTHORIZATIONHOST_B_userFROMFILE=!e:镜像证
4、书HOST_B_cert.cer*;GRANTCONNECTONENDPOINT::Endpoint_MirroringTO[HOST_B_login];CREATELOGINHOST_C_loginWITHPASSWORD=1lenovo1;CREATEUSERHOST_C_userFORLOGINHOST_c_login;CREATECERTIFICATEHOST_c_certAUTHORIZATIONHOST_c_userFROMFILE=!e:镜像证书HOST_c_cert.cer*;GRANTCONNECTONENDPOINT::Endpoint_MirroringTO[H
5、OST_c_login];--GRANTCONNECTONENDPOINT::Endpoint_MirroringTO[HOST_A_login];--queryusersidselectloginname,name,sidFromsyslogins--那就是设置服务器之间的伙伴关系,一定要现在Mirr。工服务器上设置,代码如下:ALTERDATABASESt_ccerpSETPARTNER=1TCP://10.36•64.250:50221;ALTERDATABASEst_ccerpSETwitness=1TCP://10.36.64.201:50221;镜像服务器设置(10.36.64
6、.250)restoredatabaseccerp_smxfromdisk=1E:tmpccerp_smx.bakfwithmove1ccerp_smx1to1E:ccerp_smxccerp_smx.mdf1,move1ccerp_smxl'to'E:ccerp_smxccerp_smxl•ndf1,move1ccerp_smx21to'E:ccerp_smxccerp_smx2•ndf1,move1ccerp_smx_log1to1E:ccerp_smxccerp_smx_log.ldf1rmove1ccerp_smxl_log1to'E:ccerp_smxcc
7、erp_smxl_log.ldf1,NORECOVERY,REPLACEUSEmaster;CREATEMASTERKEYENCRYPTIONBYPASSWORD=1lenovo1;CREATECERTIFICATEHOST_B_certWITHSUBJECT='HOST_Bcertificate1,START_DATE=*2011-05-10*,EXPIRY_DATE=*2111-05-10';CREATEENDPOI
此文档下载收益归作者所有