sql2005数据库镜像配置过程
SQL Server 2008 R2 Database MirroringSQL Server 2008 R2 Database Mirroring EnvironmentEnvironment::OS Windows 2008 enterprise R2OS Windows 2008 enterprise R2 SQL Server 2008 R2SQL Server 2008 R2 Master host INMS1Master host INMS1 Internal ip:10.10.10.1/24 gw:noreInternal ip:10.10.10.1/24 gw:nore Outbound ip 142.2.70.208/16 gw:142.2.70.13Outbound ip 142.2.70.208/16 gw:142.2.70.13 Mirror host INMS2Mirror host INMS2 Internal ip:10.10.10.2/24 gw:nore Internal ip:10.10.10.2/24 gw:nore Outbound ip 142.2.70.209/16 gw:142.2.70.13Outbound ip 142.2.70.209/16 gw:142.2.70.13 Prepare environment:Prepare environment: Create a login for sql serviceCreate a login for sql service’’s restart on INMS,INMS2 HOSTs restart on INMS,INMS2 HOST Setting classic auth mode on group policy, otherwise INMS1 DB instance could notSetting classic auth mode on group policy, otherwise INMS1 DB instance could not connect INMS DB instance!connect INMS DB instance! Login:sql-servicesLogin:sql-services Password:Wec251InmsPassword:Wec251Inms When you install sql 2008 R2,please set login sql-services as service be restartedWhen you install sql 2008 R2,please set login sql-services as service be restarted login, local administrator as sql server admin.login, local administrator as sql server admin. YouYou mustmust openopen protocolprotocol andand namednamed pipe,pipe, otherwiseotherwise youyou couldcould notnot connectconnect thethe databasedatabase engineer.engineer. Run the below script on master host:Run the below script on master host: A:backup the DB; run the below script on masterA:backup the DB; run the below script on master Backup database test to disk=Backup database test to disk=’’d:\backup\test.bakd:\backup\test.bak’’ Backup log test to disk=Backup log test to disk=’’d:\backup\testlog.bakd:\backup\testlog.bak’’ Copy the upper DB and Log backup to mirror host to restore!Copy the upper DB and Log backup to mirror host to restore! B:run the below script on mirror host:B:run the below script on mirror host: Restore databse test from disk=Restore databse test from disk=’’d:\back\test.bakd:\back\test.bak’’ with norecovery with norecovery Restore log test from disk=Restore log test from disk=’’d:\back\testlog.bakd:\back\testlog.bak’’ with norecovery with norecovery After run the upper script, you will see the database status is in restoring mode!After run the upper script, you will see the database status is in restoring mode! master DB transaction log must is full recovery mode mirror DB use norecovery recover mirror DB Setting EndpointSetting Endpoint Run the below script on master hostRun the below script on master host Use masterUse master gogo create endpoint DbMirroring state=started as tcp(listener_port=5022, LISTENER_IP=(10.10.10.1)) for database_mirroring(role=partner,encryption=supported) you can see it, its listen port have been created! Run the below script on mirror host:Run the below script on mirror host: Use masterUse master gogo create endpoint DbMirroring state=st