Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


cant get backup on drive C:\


cant get backup on drive C:\

Author
Message
vahid.arr
vahid.arr
Valued Member
Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)

Group: General Forum Members
Points: 57 Visits: 180
I write this query for getting backup of DB.when i want to save it on Drive c or desktop it give me error but on other drive it complete succefully.what is the reason?
the query:
USE [MohitZistDB]
GO
/****** Object: StoredProcedure [dbo].[DB_Backup] Script Date: 05/09/2012 11:09:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[DB_Backup]
@path nvarchar(255),
@Name nvarchar(255)
as
begin
BACKUP DATABASE [MohitZistDB]
TO DISK = @path
WITH NOFORMAT, INIT, NAME =@Name
end

this the error:

Msg 3201, Level 16, State 1, Procedure DB_Backup, Line 6
Cannot open backup device 'c:\\backup.bak'. Operating system error 5(failed to retrieve text for this error. Reason: 15105).
Msg 3013, Level 16, State 1, Procedure DB_Backup, Line 6
BACKUP DATABASE is terminating abnormally.

Divine Flame
Divine Flame
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1569 Visits: 2801
vahid.arr (5/9/2012)
I write this query for getting backup of DB.when i want to save it on Drive c or desktop it give me error but on other drive it complete succefully.what is the reason?
the query:
USE [MohitZistDB]
GO
/****** Object: StoredProcedure [dbo].[DB_Backup] Script Date: 05/09/2012 11:09:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[DB_Backup]
@path nvarchar(255),
@Name nvarchar(255)
as
begin
BACKUP DATABASE [MohitZistDB]
TO DISK = @path
WITH NOFORMAT, INIT, NAME =@Name
end

this the error:

Msg 3201, Level 16, State 1, Procedure DB_Backup, Line 6
Cannot open backup device 'c:\\backup.bak'. Operating system error 5(failed to retrieve text for this error. Reason: 15105).
Msg 3013, Level 16, State 1, Procedure DB_Backup, Line 6
BACKUP DATABASE is terminating abnormally.


Have you tried creating a directory in C:\ drive & then taking the backup on that?

What about this:

BACKUP DATABASE YourDatabaseName TO DISK = 'C:\BackupDirectory\YourDatabaseName.BAK'
WITH STATS=1


See if this works fine.


Sujeet Singh
GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47261 Visits: 44392
Windows has some restrictions about files in the root of a drive, especially C drive. Rather create a folder and write the backup into that. Make sure that the SQL Server service has full control over whatever folder you use. Operating system error 5 is Access Denied.


Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


vahid.arr
vahid.arr
Valued Member
Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)

Group: General Forum Members
Points: 57 Visits: 180
i want to create backup on desktop.i test it give that error and i check c drive it give me error.i want to exactly put file in desktop.what can i do?
anthony.green
anthony.green
SSCertifiable
SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)

Group: General Forum Members
Points: 6100 Visits: 6078
ensure that the account which is running the SQL service has the nessesary rights to write a file into the locations you wish for it to go.



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47261 Visits: 44392
The desktop is not C:\.

The desktop is a folder C:\Users\<logged in user>\Desktop. So that's where you need to write the backup, and you need to ensure that the SQL Server service has full control of that folder (and that there are no other security restrictions from windows)

Why does it have to be the desktop?


Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


vahid.arr
vahid.arr
Valued Member
Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)

Group: General Forum Members
Points: 57 Visits: 180
where can i check this?and change this?i want both of this:
on win 7 and win XP service pack2
anthony.green
anthony.green
SSCertifiable
SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)

Group: General Forum Members
Points: 6100 Visits: 6078
is the database stored on many different computers or is it on one central server?

if its on a server and you want it to backup to a users workstation you will have to use UNC paths and start sharing folders and assign the nessesary rights.

if its many different db copies on many different machines, then you need to go into services.msc, find the account running SQL SERVER, and then ensure that account has the correct access to the folders which you can do by right clicking the folder then looking at the security tab.



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


vahid.arr
vahid.arr
Valued Member
Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)

Group: General Forum Members
Points: 57 Visits: 180
yes the database is central and is in the server but i cant Find Sql Account on security tab.where exactly is that?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search