开发者

SQL Server 2008 Backup fails: BACKUP DATABASE is terminating abnormally

I have a stored procedure, which performs a database backup for a specific database. The problem is, it does work on one server and does not work on another server (the servers are on different machines). The backup drive is开发者_如何学C a local drive of the server. On the second server I get the exception "BACKUP DATABASE is terminating abnormally."

In the log file there are the following informations:

...     Error: 18204, Severity: 16, State: 1.
...     BackupDiskFile::CreateMedia: Backup device 'D:\XXX.bak' failed to create. Operating system error 5(failed to retrieve text for this error. Reason: 15105).
...     Error: 3041, Severity: 16, State: 1.
...     BACKUP failed to complete the command BACKUP DATABASE XXX. Check the backup application log for detailed messages.

What could be the reason for that and where can I find the mentioned backup application log?


Same problem for me

Solution :

Not working

C:\
D:\
... or Any Directory

Code:

        BACKUP DATABASE [ERP] TO  DISK ='C:\ERP.bak'  
        BACKUP DATABASE [ERP] TO  DISK ='D:\ERP.bak' 
        BACKUP DATABASE [ERP] TO  DISK ='E:\ERP.bak' 

Will not work!

Working

BUT

Code :

        BACKUP DATABASE [ERP] TO  DISK ='C:\AtleastOneDir\ERP.bak'  
        BACKUP DATABASE [ERP] TO  DISK ='D:\AtleastOneDir\ERP.bak' 
        BACKUP DATABASE [ERP] TO  DISK ='E:\AtleastOneDir\ERP.bak' 

Will work for me!


Sounds like a permission problem.

  • Do you try to backup to a network drive?
  • Does the drive D: really exist?
  • What does the Eventlog tell you? Try the Applicationlog in the Eventlog -> eventvwr.msc

It's just a start...


Try to compile the SP again with "with execute as caller" and run it again.


OK. Encountered the same error in my back up too. The user creating back up had admin privileges on the server too. Make sure that the sub folder exists if not create it manually & run it. For Ex. D:\MsSQL\Backup\MyDB\mydb.bak , make sure that myDB folder exists


This answer covers the same error message, but has nothing to with machine-to-machine access permissions - posted it as a reference in case anyone else ends up here searching for the same error codes.

Ran into the same general error message (Error: 3041, Severity: 16, State: 1.) while testing scheduled automated database backups in SQL Server 2008 . Turns out I was using a feature not available in the standard version of SQL Server 2008 - backup compression. Running the generated T-SQL from my custom database backup maintenance plan task (made available through the "View T-SQL" button) got me more detailed information.

Msg 1844, Level 16, State 1, Line 1
BACKUP DATABASE WITH COMPRESSION is not supported on Standard Edition (64-bit).
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.

Changing "Set backup compression" from "Use the default server setting" to "Compress backup" broke the backup script. Changing it back fixed it.


In my case, I restart the SQL Server Service, and now I can make backup like previus.


Try to create windows login on sql server and map it to a windows user that have write permission on the D drive and make sure that the procedure runs under the security context of this user.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜