dcsimg

Transact SQL batch file for restoring SQL database

Products

Webtrends Analytics 8.x
Webtrends Analytics 9.x

Cause

You need to restore a SQL backup and SQL Management Studio is not available.

Resolution

The attached zip file contains two files that will restore the backups. To restore the database from the backups, follow the steps below:
1. Extract the contents of the .zip file to the root of drive C: on the Webtrends server running the “SQL Server (WTSYSTEMDB)” or “SQL SERVER (MSSQLSERVER)” service.

2. Edit the file “r.sql” and enter the names of the backup files along with the directory path.

3. Open a command prompt, change to the root of C: and type “r”, then hit Enter.

More Information

If you try to manually create the databases first, or the backup does not match the existing database (i.e., it comes from another version or server) you may receive an error and restoring the database will not work.

This restore method works best with the backup method detailed in Article1183.

The restore command is explained in greater detail on the MSDN web site at the following URL:

http://msdn.microsoft.com/en-us/library/ms186858.aspx

Alterations of the restore command may be necessary depending on the backup method.