简体   繁体   English

如何将数据库备份放入Sql Server 2008中的另一台PC?

[英]How to take database backup into another PC in Sql Server 2008?

I have configured an Auto Backup option for my database, which makes database backups in regular intervals. 我为数据库配置了“自动备份”选项,该选项可以定期进行数据库备份。 This backup file is saved on the same Server PCs HDD (in another partition), from where I transfer (copy - paste) it into another PC (let's say, Backup PC) in the same network. 该备份文件保存在同一台服务器PC硬盘上(在另一个分区中),从那里我将其传输(复制-粘贴)到同一网络中的另一台PC(例如备份PC)上。 Is there any option/way to configure the Auto Backup option such that it will save the Backup file into that Backup PC? 是否有任何选项/方式来配置“自动备份”选项,以便它将备份文件保存到该备份PC中? I am using SQL Server 2008. 我正在使用SQL Server 2008。

Edit: 编辑:
I tried to create a backup plan and execute it, but getting below error (actual error message provided). 我试图创建一个备份计划并执行它,但是出现错误(提供了实际错误消息)。

BACKUP DATABASE [CheckMateDB] TO  DISK = N''\\192.168.44.17\IIML4_MiniRaps_DB_Backup\CheckMateDB_backup_2014_01_27_132201_3595000.bak'' WITH NOFORMAT, NOINIT,  NAME = N''CheckMateDB_backup_2014_01_27_132201_3595000'', SKIP, REWIND, NOUNLOAD,  STATS = 10
GO
declare @backupSetId as int
select @backupSetId = position from msdb..backupset where database_name=N''CheckMateDB'' and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=N''CheckMateDB'' )
if @backupSetId is null begin raiserror(N''Verify failed. Backup information for database ''''CheckMateDB'''' not found.'', 16, 1) end
RESTORE VERIFYONLY FROM  DISK = N''\\192.168.44.17\IIML4_MiniRaps_DB_Backup\CheckMateDB_backup_2014_01_27_132201_3595000.bak'' WITH  FILE = @backupSetId,  NOUNLOAD,  NOREWIND

GO

However, the user id I have used to create this plan, has admin privileges to the other PCs share folder. 但是,我用来创建此计划的用户ID具有对其他PC共享文件夹的管理特权。 For example, I can locate the share folder of the Backup PC from Server PC using the user id from Start>Run>Backup PC's IP and can create/read/delete file to that folder. 例如,我可以使用开始>运行>备份PC的IP中的用户ID从服务器PC中找到备份PC的共享文件夹,并可以创建/读取/删除文件到该文件夹​​。

You need to map your target sytem with your system by network share 您需要通过网络共享将目标系统与系统映射

You can by using SQL 您可以使用SQL

BACKUP DATABASE Foo TO DISK = '\\myserver\myshare\foo.bak' WITH INIT

Make sure the account used for the sql services has enough rights to write to the other pc. 确保用于sql服务的帐户具有足够的权限来写入另一台PC。


For the reason the mapped network drives don't show up made with your user account. 由于这个原因,映射的网络驱动器无法显示为您的用户帐户。 This has to do with the Sql Server service running under another user account then the one you've used for mapping the drive. 这与在另一个用户帐户(然后用于映射驱动器)下运行的Sql Server 服务有关。

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

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