将发布者和订阅者DB移动到同一服务器上的另一个驱动器 [英] Move publisher and subscriber DB's to another drive on same server

查看:78
本文介绍了将发布者和订阅者DB移动到同一服务器上的另一个驱动器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算将发布商和订阅者数据库移到同一服务器上的另一个驱动器上,我打算按照以下步骤进行操作



停止SQL服务器 


将数据和日志文件移动到新驱动器 


切换驱动器号 


在线提供SQL服务器 



上述步骤是否充足且 我在这里缺少的任何其他项目。复制属性是否会移动到新位置 复制后?

解决方案

您好SQLKSH,

您可以按照以下步骤将发布者和订阅者数据库移至另一台驱动器在同一台服务器上。

1.停止复制代理商

2.使用以下命令离线进行数据库测试:  ALTER DATABASE测试SET OFFLINE

3.将数据和日志文件移动到新位置

   一个。使用以下命令更改了系统目录中的路径:

    ALTER DATABASE测试MODIFY FILE(NAME = test,FILENAME ='NewPath\test.mdf')

    ALTER DATABASE测试MODIFY FILE(NAME = test_log,FILENAME ='NewPath\test.ldf')

  &NBSP,B。从当前位置手动复制它们并将它们粘贴到新位置

4.使用以下命令在线进行数据库测试:ALTER DATABASE test SET ONLINE

5.确认是否我们的正在通过执行以下命令从新位置读取文件:  SELECT * FROM sys.sysaltfiles WHERE DB_NAME(dbid)='test'

6.启动复制代理商

最好的问候,

Cathy Ji

I am planning to move publisher and subscriber DB's to another drive on same server and I am planning to follow below steps

Stop SQL server 

Move the data and log files to new drive 

Switch drive letters 

Bring SQL server online 

Are the above steps sufficient and  any other items I am missing here .Will the replication properties move to the new location  after copying it over?

解决方案

Hi SQLKSH,
You can follow the below steps to move publisher and subscriber DB's to another drive on same server.
1. Stop replication Agents
2.Take the database test offline with following commands:  ALTER DATABASE test SET OFFLINE
3.Move the data and log file to the new location
   a. Changed the path in system catalog with following commands:
    ALTER DATABASE test MODIFY FILE ( NAME = test , FILENAME = 'NewPath\test.mdf')
    ALTER DATABASE test MODIFY FILE ( NAME = test_log , FILENAME = 'NewPath\test.ldf')
   b. Manually copy them from current location and paste them in new location
4. Take the database test online with following commands: ALTER DATABASE test SET ONLINE
5. Confirm that whether our files are being read from new location or not by executing following command:  SELECT * FROM sys.sysaltfiles WHERE DB_NAME(dbid) = 'test'
6. Start the replication Agents
Best regards,
Cathy Ji


这篇关于将发布者和订阅者DB移动到同一服务器上的另一个驱动器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆