简体   繁体   English

在受限权限的共享主机上自动执行SQL Server 2008备份和还原

[英]Automate SQL Server 2008 backup and restore on shared hosting with limited permissions

I have a windows virtual private server (VPS) Windows Server 2012, with SQL Server 2008, on which I have complete access to the Production database for my web application. 我有一个带有SQL Server 2008的Windows虚拟专用服务器(VPS)Windows Server 2012,可以在其上完全访问Web应用程序的Production数据库。 This allows me to use SQLBackupAndFTP to backup the database and place it on my mirror hosting, which is a shared hosting with limited privileges (no restore privilege). 这使我可以使用SQLBackupAndFTP备份数据库并将其放置在我的镜像主机上,该主机是具有有限特权(没有还原特权)的共享主机。

I want to automatically restore the mirror server database every night to the copy of the production database. 我想每晚自动将镜像服务器数据库还原到生产数据库的副本。

The mirror server is used as a fall back in case the production server was to ever go, we would could at a minimum restore to last nights production environment. 如果生产服务器要使用,则将镜像服务器用作回退,我们至少可以还原到昨晚的生产环境。

How can I achieve this given I have limited permissions? 如果我的权限有限,该如何实现?

I have no access to the shared hosting via RDP, or SSH etc. 我无权通过RDP或SSH等访问共享主机。

In case you don't have full access to SQL Server and the machine that is running it you can't really initiate a restore command (maybe there are some workarounds but I'm not familiar with any). 如果您没有对SQL Server和运行它的计算机的完全访问权限,则不能真正启动还原命令(也许有一些解决方法,但我不熟悉)。

What you can do if SQL Server is on a public IP address is setup some kind of replication between two servers so they synchronize automatically. 如果SQL Server位于公共IP地址上,您可以做的是在两台服务器之间设置某种复制,以便它们自动同步。 Again, not sure if this is possible w/o full access to machine but you can give it a try. 同样,不确定是否可以完全不访问计算机,但是您可以尝试一下。

Final solution would be to use one of the third party comparison and synchronization tools to synchronize databases at a given time. 最终的解决方案是使用第三方比较和同步工具之一在给定时间同步数据库。 Just find a tool that has command line interface such as Data Diff from Apex . 只需找到具有命令行界面的工具,例如Apex的Data Diff Another one you can use is Data Compare from Red Gate but I'm sure there must be others too. 您可以使用的另一个工具是Red Gate的 Data Compare,但我敢肯定也必须有其他工具。

Note that these tools are not free … 请注意,这些工具不是免费的……

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM