Wednesday, March 7, 2012

Device error or device off-line ?

Hi to All

when i m trying to execute following code

backup database web
to disk = 'c:\inetpub\wwwroot\backup\mybakup.bak'
with format

I m Getting Error like :

Server: Msg 3201, Level 16, State 1, Line 1
Cannot open backup device 'c:\inetpub\wwwroot\backup\mybakup.bak'. Device error or device off-line. See the SQL Server error log for more details.
Server: Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.

This error is Generated only when i m trying to access folders within "wwwroot" but not in any other folders , even command runs success fully for "wwwroot" folder . !!

but not for any subfolders of wwwroot.

Can Any One Help Me ?

What does show

xp_cmdshell "dir c:\inetpub\wwwroot\backup"

?

|||

DO the subfolders inherit the permission from the wwwroot folder ? Make sure that this isn′t a permission problem. What does (like the message says the error log tell you about the problem?

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||

i m using Sql Server 2000 (sp3);

command

xp_cmdshell "dir c:\inetpub\wwwroot\backup"

gives following error:

Server: Msg 2812, Level 16, State 62, Line 1
Could not find stored procedure 'xp_cmdshell'.

|||

All Permission have been set properly.

but error is still as it is.

|||

the xp_cmdshell is located in the master database, so you have to prefix the database name or need to have your curretn context in the master database.

master.xp_cmdshell "dir c:\inetpub\wwwroot\backup"

or

Use master
GO
xp_cmdshell "dir c:\inetpub\wwwroot\backup"

HTH, JEns Suessmeyer.

http://www.sqlserver2005.de

|||

Hi,

sometime people think that the path within any TSQL commands can be also used locally, so if you are working in a client server scenario and you issue the command BACKUP DATABASE with some path and filename (with absolute drive letters), the drive letters apply to the server not the client. If you want to reach a destination on the client machine, you have to copy it via a UNC share.

Don′t know if that applies to you, just to let you know. If this is not the case, please see if the listing of the directory comes back with a listing of files (then it really HAS to be a permission problem) or it comes back with an error that the directory doesn′t exists.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

No comments:

Post a Comment