User databases

The following sections provide examples for backing up and restoring user database.


Specifying a database and device

This section provides examples on using a tape drive and a .dat file as the backup and recovery resources.

Using a tape drive

In the commands in this section, the physical device name TAPE0 replaces the stripe_device variable.

To use the first tape device to back up and load a database:

1> dump database pubs2 to "\\.\TAPE0"
2> go
1> load database pubs2 from "\\.\TAPE0"
2> go

Using a .dat file

To back up and load the pubs2 database using a .dat file:

1> dump database pubs2 to "d:\backups\backup1.dat"
2> go
1> load database pubs2 from "d:\backups\backup1.dat"
2> go

Specifying a remote Backup Server

To back up to and restore from the first tape drive on a remote NT Backup Server named REMOTE_BKP_SERVER:

	1> dump database pubs2 to "\\.\TAPE0" at REMOTE_BKP_SERVER
	2> go
	1> load database pubs2 from "\\.\TAPE0" at REMOTE_BKP_SERVER
	2> go

Naming a backup file

To back up a transaction log and create a default backup file name:

1> dump tran publications to "\\.\TAPE0"
2> go

To restore the log using the default file name in the file clause:

1> load tran publications from "\\.\TAPE0"
2> with file = "cations930590E100"
3> go

NoteThe dump command uses the last 7 characters in the database name publications to create the transaction log backup file 930590E100. See the System Administration Guide.

In the following example, as directed by the user, the 15-character file name, personnel97sep111800 records the following backup information:

To back up the personnel database using the file clause to create the file name:

1> dump database personnel to "\\.\TAPE0"
2> with file = "personnel97sep111800"
3> go

To restore the personnel database by advancing the tape automatically to personnel97sep111800 before restoring:

1> load database personnel from "\\.\TAPE0"
2> with file = "personnel97sep111800"
3> go

NoteThe file names in the preceding examples are valid only for systems that use the NTFS file system. If you are using a FAT-based file system, file names are limited to 8 characters with a 3-character extension.


Specifying additional dump devices

To back up the database to three devices using the stripe on parameter and three devices:

1> dump database personnel to "\\.\TAPE0"
2> stripe on "\\.\TAPE1"
3> stripe on "\\.\TAPE2"
4> go

To restore the database using the stripe on parameter and two devices:

1> load database personnel from "\\.\TAPE0"
2> stripe on "\\.\TAPE1"
3> go

To back up a database using three devices, each attached to the remote Backup Server, REMOTE_BKP_SERVER:

1> dump database personnel 
2> to "\\.\TAPE0" at REMOTE_BKP_SERVER
3> stripe on "\\.\TAPE1" at REMOTE_BKP_SERVER
4> stripe on "\\.\TAPE2" at REMOTE_BKP_SERVER
5> go

Tape handling options

To initialize two devices to overwrite the existing contents with the new transaction log backups:

1> dump transaction personnel to "\\.\TAPE0"
2> stripe on "\\.\TAPE1" with init
3> go

Getting information about files

To return header information for the first file on the tape:

1> load database personnel from "\\.\TAPE0" 
2> with headeronly
3> go

To return header information for the file personnel9229510945:

1> load database personnel from "\\.\TAPE0"
2> with headeronly, file = "personnel9229510945"
3> go