如何将SQL日志传送文件复制到AWS EC2实例

时间:2022-12-04 08:15:32

I am using SQL Server 2008 R2 and would like to log ship from my local data center SQL instance to a log shipping target SQL Server running in AWS EC2.

我正在使用SQL Server 2008 R2,并希望从我的本地数据中心SQL实例登录到在AWS EC2中运行的日志传送目标SQL Server。

What is the best way to copy the log ship files from the local SQL Server to the remote EC2 instance?

将日志传送文件从本地SQL Server复制到远程EC2实例的最佳方法是什么?

I have seen plenty of 'how to copy a file to EC2' solutions, but am wondering what is the best method for continuous unattended file copying (such as SQL Server T-Log files every 15 minutes).

我已经看到很多'如何将文件复制到EC2'的解决方案,但我想知道连续无人值守文件复制的最佳方法是什么(例如每15分钟一次SQL Server T-Log文件)。

1 个解决方案

#1


1  

I'm doing this today using an S3 bucket and AWS CLI with the sync command. You have to configure AWS on each machine and make sure the credentials file is under the user folders of the account that the SQL Agent is running under. The simply add the Powershell call as a step in the SQL LS job to either put or get the files depending on the machine you are on (local or EC2). I also recommend staggering the EC2 machine job so it runs ~5 mins after the LS job on the source server.

我现在正在使用S3存储桶和带有sync命令的AWS CLI执行此操作。您必须在每台计算机上配置AWS,并确保凭据文件位于运行SQL代理的帐户的用户文件夹下。只需添加Powershell调用作为SQL LS作业中的一个步骤,根据您所在的机器(本地或EC2)放置或获取文件。我还建议错开EC2机器作业,使其在源服务器上的LS作业后运行约5分钟。

#1


1  

I'm doing this today using an S3 bucket and AWS CLI with the sync command. You have to configure AWS on each machine and make sure the credentials file is under the user folders of the account that the SQL Agent is running under. The simply add the Powershell call as a step in the SQL LS job to either put or get the files depending on the machine you are on (local or EC2). I also recommend staggering the EC2 machine job so it runs ~5 mins after the LS job on the source server.

我现在正在使用S3存储桶和带有sync命令的AWS CLI执行此操作。您必须在每台计算机上配置AWS,并确保凭据文件位于运行SQL代理的帐户的用户文件夹下。只需添加Powershell调用作为SQL LS作业中的一个步骤,根据您所在的机器(本地或EC2)放置或获取文件。我还建议错开EC2机器作业,使其在源服务器上的LS作业后运行约5分钟。