维护计划失败但查询运行
我有一个 SQL Server 2005 Enterprise Edition,其维护计划不断失败并出现错误:
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
运行正常并给出了预期的结果。
这是一个错误吗? 我在这里缺少什么? 备份到网络位置的优雅方法是什么?
I have an SQL Server 2005 Enterprise Edition whose Maintenance plan fails constantly with the error:
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.
But 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
runs normally and gives me the expected results.
Is this a bug?
What am I missing here?
What is the elegant way to backup to a network location?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要检查 SQL Server 代理服务运行的帐户。如果该帐户没有该网络共享的权限,则它将无法看到该路径。在 SQL Server 代理作业外部执行该查询(间接通过维护计划)不会使用 SQL Server 代理服务的安全上下文。
使 SQL Server 代理服务作为有权访问该网络共享的域帐户运行。
You need to check the account that SQL Server Agent service runs as. If the account doesn't have permissions on that network share, then it won't be able to see that path. Executing that query outside of a SQL Server Agent job (indirectly through a maintenance plan) doesn't use the security context of the SQL Server Agent service.
Make the SQL Server Agent service run as a domain account with access to that network share.