zhouweifeng
自我介绍
切换风格
订阅我的Blog
博客日历
文章归档...
最新发表...
最多阅读文章...
博客统计...
网站链接...
资源
===========================================================
含有replication环境的sqlserver切换到standby
===========================================================
含有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.

zhouwf0726 发表于:2008.03.18 09:31 ::分类: ( SQLSERVER ) ::阅读:(90次) :: 评论 (0) :: 引用 (0)

发表评论
标题

在此添加评论

称呼

邮箱地址(可选)

个人主页(可选)

authimage