Restoring Microsoft SQL Server databases

Note

Depending on configuration, the default database name is CAS, (ADS, CVA (RUM Console) or delta in older installations.

Copy the latest version of the backed up database to your local hard drive and if the backup file is compressed, unpack it.

Launch SQL Server Management Studio.

Log in to the SQL Server Management Studio.
A login screen prompts for your user name and password.

In Object Explorer, on the left side of the screen, select Databases

Right-click the database of your choice and choose Tasks ► Restore ► Database.

Restore database dialog, general page
Restore database dialog, general page

Select to restore From device.

Click ... and, in the Restore column on the General page, select the check box next to the name of the CAS database backup file.

On the Options page, select Overwrite the existing database and click OK.

Ensure the file names and paths are correct. For example:

\mssql\data\CAS_log.ldf for the database log file and

\mssql\data\CAS_dat.mdf for the database file.

Restore database dialog, options page
Restore database dialog, options page
Database activation

Execute the following script only if you are restoring to a MS SQL server that is different from the server where you performed the backup.
To activate the restored database, right-click the database, choose New Query from the menu, and type script as in the example. Note that the example assumes the default database user name and password. Change those to applicable values.

ALTER AUTHORIZATION ON SCHEMA::delta TO dbo;
GO
drop user delta
go
IF  EXISTS (SELECT * FROM sys.server_principals WHERE name = N'delta')
ALTER LOGIN delta
WITH PASSWORD = 'delta',
DEFAULT_DATABASE = CAS,
CHECK_POLICY = OFF;
ELSE
CREATE LOGIN delta
WITH PASSWORD = 'delta',
DEFAULT_DATABASE = CAS,
CHECK_POLICY = OFF;
GO
create USER delta for login delta WITH DEFAULT_SCHEMA = delta;
GO
ALTER AUTHORIZATION ON SCHEMA::delta TO delta;
GO

EXEC sp_addsrvrolemember @loginame = N'delta', @rolename = N'bulkadmin'
GO

grant all to delta
RECONFIGURE WITH OVERRIDE
go

Select the database from the menu and press [F5] to execute the script.

The database is now restored and available.

Set Recovery model to “Simple”.

Right-click the database and select Properties.

Select Options.

Set Recovery model to “Simple”.

Click OK.

Shrink the log file.

Right-click the database and select Tasks ► Shrink ► Files.

Set File type to “Log”.

Click OK.

Start the component service.