Typical archive database command sequence

The following syntax could be a typical archive database command sequence.

First, create the scratch database if necessary, using the create database command.

create database scratchdb
      on datadev1 = 100
      log on logdev1 = 50

This creates a 150MB traditional database called scratchdb.

Use sp_dboption to designate the database you just created as a scratch database:

sp_dboption “scratchdb”, "scratch database", "true"

Create the archive database.

create archive database archivedb
      on datadev2 = 20 
      with scratch_database = scratchdb

This creates an archive database called archivedb, with a 20MB modified pages section.

Materialize your archive database using load database:

load database archivedb
      from “/dev/dumps/050615/proddb_01.dmp”
      stripe on “/dev/dumps/050615/proddb_02.dmp”

Bring the database online:

online database archivedb

Check the consistency of the archive database using dbcc commands. For example:

dbcc checkdb(archivedb)

An object can be restored from the archive database using the select into or bcp commands. For example, to restore a table called orders from the archive database, use:

select * into proddb.dbo.orders from       archivedb.dbo.orders