September 10, 2008 at 1:30 pm
Hi!
I have a problem with my test server when i generate a backup
BACKUP DATABASE ADVENTUREWORKS
TO DISK= N'C:\AW.bak' <-- is not a backup device
WITH STATS= 5
Msg 3201, Level 16, State 1, Line 1
Cannot open backup device 'C:\AW.bak'. Operating system error 5(Access is denied.).
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.
Thanks for yours answers.
September 10, 2008 at 1:36 pm
brownsea (9/10/2008)
Hi!I have a problem with my test server when i generate a backup
BACKUP DATABASE ADVENTUREWORKS
TO DISK= N'C:\AW.bak' <-- is not a backup device
WITH STATS= 5
Msg 3201, Level 16, State 1, Line 1
Cannot open backup device 'C:\AW.bak'. Operating system error 5(Access is denied.).
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.
Thanks for yours answers.
You are attempting to create a backup file (AW.bak) in the root directory of the c: drive. The error indicates that you are having a permissions issue with creating the backup file.
😎
September 10, 2008 at 1:37 pm
Is the backup file in use?
September 10, 2008 at 2:09 pm
I don't use a backup device, i will generate a file.
But when used
BACKUP DATABASE ADVENTUREWORKS
TO DISK= N'C:\backup\AW.bck'
WITH STATS= 5
is accomplished successfully generate backup
¿?
September 10, 2008 at 2:14 pm
BACKUP DATABASE ADVENTUREWORKS
TO DISK= N'C:\AW.bak' -- Attempting to create backup file in root directory
WITH STATS= 5
BACKUP DATABASE ADVENTUREWORKS
TO DISK= N'C:\backup\AW.bck' -- Creating backup file in the backup directory
WITH STATS= 5
To repeat what I said earlier. The first backup command failed due to a permissions error.
The second backup worked because permission were appropriately set.
😎
September 10, 2008 at 3:12 pm
hi...this is my first attempt trying to give a soln..i had the same error which u had and i realized that i was trying to save the bak file which was already there in the drive with the same..i cld be wrong...just make sure there is no other file with the same name..
September 10, 2008 at 3:38 pm
If it is the case described by firasatahmed, add WITH INITI at the end of your command to overwrite the existing backup file.
September 10, 2008 at 3:54 pm
Ok, thanks for yours answers.
September 11, 2008 at 10:17 am
Your SQL Server service startup account probably does not have adequate rights to write to c:\, but has adequate rights to write to C:\backup.
If the file existed, and is not part of a multi-device backup, running the backup command using the same file name would simply append backups to the file, and will not result in an error, unless you run out of space.
The option to use to overwrite existing files (assuming no retention options are set) is WITH INIT, not WITH INITI (typo error). If retention options are in place and you simply want to start anew everytime, use the WITH FORMAT option.
SQL BAK Explorer - read SQL Server backup file details without SQL Server.
Supports backup files created with SQL Server 2005 up to SQL Server 2017.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply