维护计划失败但查询运行

时间:2011-10-18 17:46:13

标签: sql-server sql-server-2005 backup database-backups maintenance-plan

我有一个SQL Server 2005企业版,其维护计划经常失败并出现错误:

backup MYSERVER (MYSERVER)
Backup Database on MYSERVER
Databases that have a compatibility level of 70 (SQL Server version 7.0) will be skipped.
Databases: All databases
Type: Differential
Append existing
Task start: 2011-10-18T00:10:09.
Task end: 2011-10-18T00:10:09.
Failed:(-1073548784) Executing the query "BACKUP DATABASE [model] TO  DISK = N'\\myNetworkDrive\\opovo\\BackupSQL\\MYSERVER\\model\\model_backup_201110180010.bkp' WITH  DIFFERENTIAL ,  RETAINDAYS = 13, NOFORMAT, NOINIT,  NAME = N'model_backup_20111018001008', SKIP, REWIND, NOUNLOAD,  STATS = 10
" failed with the following error: "Cannot open backup device 'C:\\Program Files\\Microsoft SQL Server\\MSSQL.1\\MSSQL\\Backup\\Arca\\opovo\\BackupSQL\\MYSERVER\\model\\model_backup_201110180010.bkp'. Operating system error 3(The system cannot find the path specified.).
BACKUP DATABASE is terminating abnormally.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

但查询:

BACKUP DATABASE [model] TO  DISK = N'\\myNetworkDrive\\opovo\\BackupSQL\\MYSERVER\\model\\model_backup_201110180010.bkp' WITH  DIFFERENTIAL ,  RETAINDAYS = 13, NOFORMAT, NOINIT,  NAME = N'model_backup_20111018001008', SKIP, REWIND, NOUNLOAD,  STATS = 10

正常运行并给我预期的结果。

这是一个错误吗? 我在这里错过了什么? 备份到网络位置的优雅方式是什么?

1 个答案:

答案 0 :(得分:0)

您需要检查SQL Server代理服务运行的帐户。如果该帐户没有该网络共享的权限,则它将无法看到该路径。在SQL Server代理作业之外执行该查询(间接通过维护计划)不使用SQL Server代理服务的安全上下文。

使SQL Server代理服务作为可访问该网络共享的域帐户运行。