使用 ASP.NET 备份 SQL Server
我有 SQL Server 虚拟主机。我没有对 SQL Server 的物理访问权限。我想备份并下载。我怎样才能从asp.net页面做到这一点?
I have virtual hosting with SQL Server. I don't have physical access to SQL Server. I want to make backup and download it. How can I do it from asp.net page?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
即使您没有对 mssql 的物理访问权限,您的托管提供商也可能有办法通过您的控制面板 GUI 来制作 mssql 备份并下载它。您可能想先咨询他们。
乔恩
Even if you do not have physical access to mssql your hosting provider may have a way through your control panel GUI to make a mssql backup and download it. You might want to check with them first.
Jon
我认为这里有些人正在采取心理捷径并建议您备份 SQL,就好像您具有对计算机的完全访问权限(您明确声明您没有)。
您无法在托管环境上对 C:\Backup 或 C:\[anything] 进行标准备份。
您需要查看是否可以通过 SQL Server Management Studio 远程访问您的 SQL Server 实例(我使用过允许远程访问 SQL Server 端口的主机),然后,不要对 BAK 文件进行正常备份(意味着可以访问 SQL Server 中的本地硬盘),右键单击数据库并尝试从那里创建脚本。您将得到一个类似于 mysqldump 为 MySQL 创建的脚本的脚本。
如果失败,请查看您的控制面板,他们可能有一种工具也可以执行此操作,或者向您发送通过控制面板生成的 BAK 文件。
如果失败,请询问您的主人。
I think some people here are taking mental shortcuts and suggesting you backup the SQL as if you had full access to the machine (which you specifically state you do not have).
You will not be able to do a standard backup to C:\Backup or C:\[anything] on a hosted environment.
You need to see if you can remotely access your SQL Server instance through SQL Server Management Studio (I have used hosts that do allow remote access to the SQL Server port), and then, instead of doing a normal backup to a BAK file (which implies having access to a local hard drive in the SQL Server), right click on the database and try to create a script from there. You will get a script similar to the scripts that mysqldump creates for MySQL.
If that fails, then look into your control panel, they may have a tool that does that as well, or one that sends you a BAK file generated through the control panel.
Failing that, ask your host.
您可以像执行任何其他 SQL 查询或命令一样从 ASP.NET 发出 BACKUP 命令。
http://msdn.microsoft.com/en-us/library/ms186865。 aspx
You could issue the BACKUP commands from ASP.NET the same way as you would any other SQL query or command.
http://msdn.microsoft.com/en-us/library/ms186865.aspx