sql2005数据库镜像配置过程
SQL Server 2008 R2 Database MirroringSQL Server 2008 R2 Database Mirroring EnvironmentEnvironmentOS Windows 2008 enterprise R2OS Windows 2008 enterprise R2 SQL Server 2008 R2SQL Server 2008 R2 Master host INMS1Master host INMS1 Internal ip10.10.10.1/24 gwnoreInternal ip10.10.10.1/24 gwnore Outbound ip 142.2.70.208/16 gw142.2.70.13Outbound ip 142.2.70.208/16 gw142.2.70.13 Mirror host INMS2Mirror host INMS2 Internal ip10.10.10.2/24 gwnore Internal ip10.10.10.2/24 gwnore Outbound ip 142.2.70.209/16 gw142.2.70.13Outbound ip 142.2.70.209/16 gw142.2.70.13 Prepare environmentPrepare 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 instanceconnect INMS DB instance Loginsql-servicesLoginsql-services PasswordWec251InmsPasswordWec251Inms 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 hostRun the below script on master host Abackup the DB; run the below script on masterAbackup the DB; run the below script on master Backup database test to diskBackup database test to disk’’d\backup\test.bakd\backup\test.bak’’ Backup log test to diskBackup log test to disk’’d\backup\testlog.bakd\backup\testlog.bak’’ Copy the upper DB and Log backup to mirror host to restoreCopy the upper DB and Log backup to mirror host to restore Brun the below script on mirror hostBrun the below script on mirror host Restore databse test from diskRestore databse test from disk’’d\back\test.bakd\back\test.bak’’ with norecovery with norecovery Restore log test from diskRestore 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 modeAfter 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 statestarted as tcplistener_port5022, LISTENER_IP10.10.10.1 for database_mirroringrolepartner,encryptionsupported you can see it, its listen port have been created Run the below script on mirror hostRun the below script on mirror host Use masterUse master gogo create endpoint DbMirroring statest