ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 含有replication环境的sqlserver切换到standby

含有replication环境的sqlserver切换到standby

原创 Linux操作系统 作者:zhouwf0726 时间:2019-04-30 22:36:06 0 删除 编辑
含有replication环境的sqlserver切换到standby(自己创建的standby,非sqlserver自带的logshipping)

On db-core-r1,restore newjoyo2,service2,userinfo2 database with recover,KEEP_REPLICATION

restore master and msdb

RESTORE DATABASE dddddd2 WITH KEEP_REPLICATION, RECOVERY
RESTORE DATABASE eeeeee2 WITH KEEP_REPLICATION, RECOVERY
RESTORE DATABASE ffffff2 WITH KEEP_REPLICATION, RECOVERY

c:Program FilesMicrosoft SQL ServerMSSQLBinn>sqlservr.exe -c -m -f(if necessary)

login db by using sql query analyzer(windows authentication) on the server to restore masterdb

restore database master from disk='f:master_full_XXX' WITH RECOVERY,STATS=5,

MOVE 'master' TO 'D:Microsoft SQL ServerMSSQLDatamaster.mdf',

MOVE 'mastlog' TO 'D:Microsoft SQL ServerMSSQLDatamastlog.ldf'

restore database msdb from disk='f:msdb_full_XXX' with recovery

restart 10.104.14.143 database.

check error log on 10.104.14.134

on master db, modify correct data file location. Then, Start db to check.

select top 50 * from master..sysaltfiles

where name like '%newjoyo2%'

select * from master..sysdatabases where name='newjoyo2'

update master..sysdatabases

set filename='D:Program FilesMicrosoft SQL ServerMSSQLDataxxxxxxxxxxxx_Data.mdf'

where name='xxxxxx'

--update master..sysaltfiles

set filename='D:Program FilesMicrosoft SQL ServerMSSQLDataxxxxxxxxxxxx_Data.mdf'

where filename='F:Program FilesMicrosoft SQL ServerMSSQLDataxxxxxxxxxxxx_Data.mdf'

and name='xxxxxx_Data'

--update master..sysaltfiles

set filename='E:Program FilesMicrosoft SQL ServerMSSQLDataxxxxxxxxxxxx_data02.mdf'

where filename='G:Program FilesMicrosoft SQL ServerMSSQLDataxxxxxxxxxxxx_data02.mdf'

and name='xxxxxx_data02'

--update master..sysaltfiles

set filename='F:Program FilesMicrosoft SQL ServerMSSQLDataxxxxxxxxxxxx_data02.mdf'

where filename='H:Program FilesMicrosoft SQL ServerMSSQLDataxxxxxxxxxxxx_Log.LDF'

and name='xxxxxx_Log'

select top 50 * from master

stop and restart db. And to modify large memory to 16G.

on cluster, to test failover from one node to other.

add standby DB regedit to start replication manually.

open replication on db-dist according to every db setup and enabled all jobs.

diff backup database

Start all JOBs on. If have time,dbcc checkdb ('dbname') …

update cluster name from updatedbtemp to updatedb

test updatedb cluster name.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/756652/viewspace-242520/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2006-02-22

  • 博文量
    458
  • 访问量
    416594