How to restore Microsoft SQL Server databases using Veritas System Recovery (VSR) without restoring entire system

book

Article ID: 100021160

calendar_today

Updated On:

Cause

N/A

 

Resolution

Currently, there is no agent or method to restore individual databases when backed up using VSR. When restoring an entire system all databases that were attached in Microsoft SQL Server at the time of backup are recovered and functional. This is by design. However, there are 2 possible methods to restore databases from within Microsoft SQL Server as long as SQL Server is fully operational.  
 
Method 1 -  Create and run a manual backup of user databases and store locally so the backups are included in the VSR backup image 
 
1)   Create a batch file and schedule to run prior to the daily / weekly backup using Windows Scheduler
 
 Batch file should include the following command:
 
 SQLCMD -S \ -E -Q "Backup database to disk = '' with init"
 
Example:
 
SQLCMD -S MyServer\BKUPEXEC -E -Q "Backup database BEDB to disk = 'C:\temp\bedb.bak' with init"
 
Switches:
 
-S   SQL Server name and instance
-E   Use trusted connection (may also use -U for user then -P for password if trusted connection not authorized)
-Q   SQL command
with init  -  overwrites existing backups if they exist
 
 2)  Restore the BAK file from the date needed using the Recovery Point Browser. See document below if needed:
 
 

3)  Download and install the Microsoft SQL Server Management Studio Express if a full version of Microsoft SQL is not on the server.

4)  Launch the Microsoft SQL Server Management Studio Express and connect to the \sqlexpress instance.

5)  Under the Object Explorer expand the server

6)  Right click on Database and choose "Restore Database"

7)  Select database to restore or type name under "Destination for Restore"

8)  Under "Source for Restore" change radio button to "From Device"

9)  Click the browse button and select the location of the backup file created in step#1 then click OK

10) Verify the information is correct under "Select the backup sets to restore:" then check the Restore box

11)  Click OK to restore database

Note:  If original database is still operational, a 2nd database can be restored for side-by-side comparison by typing a different database name in Step#7

 

Method 2 -  Detach existing database and attach previously backed up database files
 

1) Download and install the Microsoft SQL Server Management Studio Express if a full version of Microsoft SQL is not on the server.

2)  Launch the Microsoft SQL Server Management Studio Express and connect to the \sqlexpress instance.

3)  Under the Object Explorer expand the server

4)  Expand Databases and find the database that needs to be restored

5)  Right click on the database and choose "Properties"

6)  Determine the physical file names and location of both the database and transaction log listed under Files

7)  Right click on the database and goto Tasks / Detach to detach the database.  Check the box to "Drop Connections" and remove check from "Keep Full Text Catalogs" then click OK

8)  Restore the .ldf and .mdf files noted in Step#7 from the date needed using the Recovery Point Browser.
 

9)  Right click on Databases and choose "Attach"

10)  If successfully attached, the database should now be listed again under Databases
 

 

 

Issue/Introduction

How to restore Microsoft SQL Server databases using Veritas System Recovery (VSR) without restoring entire system