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

For Mac OS X, enter:

1> dump database pubs2 to /Volumes/volname
2> go
1> load database pubs2 from /Volumes/volname
2> go

where volname is the name of a FireWire device, USB device, or a locally mounted disk drive.

Using a .dat file

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

1> dump database pubs2 to "/work/backups/backup1.dat"
2> go
1> load database pubs2 from "/work/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

For Mac OS X, enter:

1> dump database pubs2 to /Volumes/volname
2> go
1> load database pubs2 from /Volumes/volname
2> go

where volname is the name of a FireWire device, USB device, or a locally mounted disk drive.


Naming a backup file

To back up a transaction log, the syslogins system table and create a default backup file name:

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

For Mac OS X, enter:

1> dump tran publications to /Volumes/volname
2> go

where volname is the name of a FireWire device, USB device, or a locally mounted disk drive.

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

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

For Mac OS X, enter:

1> load tran publications from /Volumes/volname with file = "cations930590E100"
2> go

where volname is the name of a FireWire device, USB device, or a locally mounted disk drive.

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

For Mac OS X, enter:

1> dump database personnel to "/Volumes/volname
2> with file - "personel97sept111800"
3> go

where volname is the name of a FireWire device, USB device, or a locally mounted disk drive.

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

For Mac OS X, enter:

1> load database personnel from "/Volumes/volname"
2> with file = "personnel97sep111800"
3> go

where volname is the name of a FireWire device, USB device, or a locally mounted disk drive.

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

For Mac OS X, enter:

1> dumpt database personnel to "Volumes/volname
2> stripe on /Volumes/volname
3> stripe on /Volumes/volname
4> go

where volname is the name of a FireWire device, USB device, or a locally mounted disk drive.

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

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

For Mac OS X, enter:

1> load database personnel from /Volumes/volname
2> stripe on /Volumes/volname
3> go

where volname is the name of a FireWire device, USB device, or a locally mounted disk drive.

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

For Mac OS X, enter:

1> dump database personnel 
2> to /Volumes/volname at REMOTE_BKP_SERVER 
3> stripe on /Volumes/volname at REMOTE_BKP_SERVER
4> stripe on /Volumes/volname at REMOTE_BKP_SERVER 
5> go

where volname is the name of a FireWire device, USB device, or a locally mounted disk drive.


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

For Mac OS X, enter:

1> dump transaction personnel to "/Volume/volname" 
2> stripe on /Volumes/volname with init 
3> go

where volname is the name of a FireWire device, USB device, or a locally mounted disk drive.


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

For Mac OS X, enter:

1> load database personnel from /Volumes/volname 
2> with headeronly 
3> go

where volname is the name of a FireWire device, USB device, or a locally mounted disk drive.

To return header information for the file personnel9229510945:

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

For Mac OS X, enter:

1> load database personnel from /Volumes/volname 
2> with headeronly, file = "personnel92295190945" 
3> go

where volname is the name of a FireWire device, USB device, or a locally mounted disk drive.