Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Restore verifyonly on mapped network drive

Author  Topic 

Pruffty
Starting Member

14 Posts

Posted - 2012-06-26 : 13:48:53
I have my backups stored on another server. I would like to check the backups and whether they ran successfully by running the following query:
Restore verifyonly from disk = `path\name.bak

My backups are on the network drive as follows:

\\<servername>\SQLbackups\<servername>\application_backup_2012.bak.

This is what I see when I go into SQL Management Studio and search for backups. That is the path it is being backed up to.

How would I input this into the query?

Thanks

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-06-26 : 14:14:27
Verifyonly does not verify if the backup is good. The only way to be sure it's good is to do a test restore on it. This is why all dbas should have a test system where they automatically restore backups.

As for your question, like this: restore ... from disk = '\\<servername>\SQLbackups\<servername>\application_backup_2012.bak'

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Pruffty
Starting Member

14 Posts

Posted - 2012-06-26 : 15:27:22
Hi Tara,

Yes, I`ve heard about restore verifyonly not being complete. Sadly, the syntax you gave me did not work to verify a backup saved to a remote drive :(
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-06-26 : 15:30:15
Well something is wrong with your path then as that syntax is fine. Show us exactly what you have and the error.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Pruffty
Starting Member

14 Posts

Posted - 2012-06-26 : 16:06:07
Here it is:

restore verifyonly from disk = '\\storeserver\SQLbkups\firstserver\EventReports_backup_201206260200.bak'

Error message as follows:

Msg 3201, Level 16, State 2, Line 1
Cannot open backup device '\\storeserver\SQLbkups\\firstserver\PuddingPlans_backup_201206260200.bak'. Operating system error 2(failed to retrieve text for this error. Reason: 15105).
Msg 3013, Level 16, State 1, Line 1
VERIFY DATABASE is terminating abnormally.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-06-26 : 16:28:18
You've got an extra slash in there according to the error.

The easiest way to validate it is to connect to the database server via Remote Desktop using the SQL Server service account. Then put your path into start..run and see what you get. You will likely get an error here. You need to get rid of that error in order for your command to work.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Pruffty
Starting Member

14 Posts

Posted - 2012-06-27 : 14:48:23
Tara:

putting the syntax into the start - run didn't work.
Says:
Windows cannot find 'restore'. Make sure you typed the name correctly, and then try again.

So...
I have rdp'd to the server where the backups are saved.

I ran query analyzer on the actual server (no Management Studio is installed).

syntax is as follows:

restore verifyonly from DISK = 'Y:\ServerBkps\appserver\fly_bkup_2012.bak'

I am getting error:

Server: Msg 3201, Level 16, State 2, Line 1
Cannot open backup device <Pathname>'. Operating system error 3(failed to retrieve text for this error.
Server: Msg 3013, Level 16, State 1, Line 1
VERIFY DATABASE is terminating abnormally.

There are adequate permissions on the folder that the backups are being sent to.

Under security, the sql service account is added with up to modify and the sql server account is also added.

Not sure why it is not working.

Please advise.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-06-27 : 14:54:59
Don't put the entire command in start/run. Only your path, that entire string: \\storeserver\SQLbkups\firstserver\EventReports_backup_201206260200.bak

On the server, verify that Y drive path too in start/run: Y:\ServerBkps\appserver\fly_bkup_2012.bak

You have to get these working first before it'll work with the restore command.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Pruffty
Starting Member

14 Posts

Posted - 2012-06-27 : 15:06:05
It works on both the server (local path) and remotely (UNC).

I get the windows cannot open this file obviously since it is only readable by SQL server but it does take me there.

So the path works..gahh!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-06-27 : 15:33:06
Sorry I meant to exclude the file/extension from both:

\\storeserver\SQLbkups\firstserverY:\ServerBkps\appserver
Do the paths contain spaces at all? I know what you've posted here doesn't, but I also know that you are modifying the string for us.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Pruffty
Starting Member

14 Posts

Posted - 2012-06-27 : 15:59:40
No spaces in the path.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-06-27 : 19:06:14
Copy the bak file to a local drive and see if the restore command works locally.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Pruffty
Starting Member

14 Posts

Posted - 2012-07-03 : 14:28:31
Hi Tara,

I finally figured it out last Thursday but I had other issues crop up and I felt like slapping myself when I did.
I missed the semi colon at the end after the word 'bak'. It should have been 'bak';
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-07-03 : 14:34:43
A semi colon is not required. I never use semi colons actually, but I do need to get in the habit as it's considering a best practice.

Some other issue is happening here. Maybe you've got a larger script or something.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -