Skip Headers
Oracle® Secure Backup Administrator's Guide
Release 10.1

Part Number B14234-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

12 Using obtar

The primary user interfaces for file system backup and restore operations are the Web tool and obtool. The underlying engine that Oracle Secure Backup uses to back up and restore data is obtar. You can use the obtar command-line interface directly, although this practice is recommended only for advanced users. This chapter includes the following topics:

See Also:

Oracle Secure Backup Reference for obtar command syntax, semantics, and examples

About obtar

obtar is the underlying Oracle Secure Backup engine that moves file system data to and from tape. obtar, which is a descendent of the original Berkeley UNIX tar(1) command, enables you to use features not exposed through obtool or the Web tool.

The main purpose of obtar is to back up and restore file systems. You can specify files or directories on the obtar command line or in a Backup Description File (BDF), which is an ASCII file that contains a list of path names to include and exclude from a backup image.

Note:

When you specify a dataset file for a backup job with the Web tool or obtool, Oracle Secure Backup turns the dataset file into a BDF internally and supplies it as input to obtar.

You can operate the obtar utility in a number of modes, for example, obtar -g or obtar -x. Table 12-1 groups these modes into basic tasks.

Table 12-1 obtar Operations

Operation Modes Description Section

Back up file system data

-g, -c

Use obtar -g to create archives for the directories and files specified in a backup description file (BDF). Use obtar -c to create an archive of the directories and files specified on the command line.

"Backing Up Data with obtar"

Restore file system data

-x

Use obtar -x to restore files and directories.

"Restoring Data with obtar"

List and catalog contents of backups

-t, -z, -zz

Use obtar -t to list the table of contents for a backup image and -tG to add the contents of the image to the Oracle Secure Backup catalog.

Use obtar -z to display an archive or volume label on the tape in the specified device; use obtar -zz to display a brief table of archives for the volume. Note that you can also specify -z when running in the -g and -c modes.

"Listing and Cataloging the Contents of Backups and Volumes with obtar"

Label, reuse, or unlabel a volume

-Xlabel, -Xreuse, -Xunlabel

Use obtar -Xlabel to write a volume label to the tape contained in the specified device. Use obtar -Xreuse to mark the volume in the specified device as being reusable. Use obtar -Xunlabel to remove the label from the volume in the specified device. These options effectively erase the contents of the tape.

"Pre-Labeling Tape Volumes with obtar"


If you back up directories and files so that the necessary Oracle Secure Backup catalog data is generated (such as when using the -g, -G, or -N options), then you can use obtool or the Web tool to browse the catalog and restore the files. If you do not generate the catalog files, however, then you can still perform a raw restore operation.

Backing Up Data with obtar

You can use obtar to perform backup tasks that range from on-demand backups of single files to full and incremental backups of entire file systems and networks.

You initiate a backup by executing the obtar -g or obtar -c command. The host on which you execute the obtar command is called the operator host. The host that contains the data you want to back up is called the client host.

This section contains the following topics:

Creating Backup Images on Tape

The data that you back up is saved in a special structure called a backup image, which was called an archive in previous product versions. The backup images created with obtar adhere to the IEEE POSIX.1 data recording format. You can create a backup image on media that is loaded into a tape device.

Note:

Oracle Secure Backup does not have native virtual tape support.

One of the options you can use with obtar -g is -f, which specifies the name of the tape device on which to create the backup image. The argument to -f is the name of a tape device that you have configured through the Web tool or with the mkdev command in obtool. If you do not specify the -f option, then obtar uses the device specified by the TAPE environment variable, if it is defined.

When you are backing up a large amount of data, obtar may need to continue a backup image from one volume to the next. If the tape drive resides in a library, then obtar automatically unloads the current volume and searches the inventory of the library for another eligible volume on which to continue the backup. The way that you install and configure obtar indicates whether or not it considers a device to reside inside a library.

If you are using a standalone tape drive (a drive that is not in a library), then obtar rewinds the tape and then unloads it, displaying a message like the following on the operator host, where vol-id refers to the next volume in the volume set:

End of tape has been reached. Please wait while I rewind and unload the tape. The
Volume ID of the next tape to be written is vol-id.
The tape has been unloaded.

obtar then prompts you to load the next volume and press the Return key when you are ready:

Please insert new tape on device
and press <return> when ready:

The backup continues onto the next volume.

Using Backup Description Files

When you use obtar -g, you specify the data you want to back up in backup description file. A backup description file (BDF) is an ASCII file that contains a list of path names to include and exclude from a backup image. Typically, you create a BDF for each host whose data you plan to back up, and execute a separate obtar -g command for each of those BDFs.

The following example backs up the data described in all_bdf to the volume in tape1:

obtar -g all_bdf -f tape1

A BDF consists of a list of statements, with one statement on each line. Each statement consists of a one-character directive, which must be in column 1, and a path name or host name.

You can specify the following types of statements:

  • A host name statement specifies the name of the client host to be backed up. The host name statement begins with a colon (:) directive, as in :dlsun1976.

  • An inclusion statement specifies a directory or file to include in the backup image. This statement begins with the plus (+) directive, as in +/private/lashdown.

  • An exclusion statement specifies a directory or file to exclude from the backup image. A BDF can include the following types of exclusion statements:

    • A global exclusion statement specifies a path name or wildcard pattern that is to be excluded at every level in the tree. This type of statement has the following format:

      !pathname
      
      
    • An Oracle database exclusion statement specifies that Oracle database files be excluded at every level in the tree. This type of statement has the following format:

      ~files
      
      
    • A top-level exclusion statement specifies a path name or wildcard pattern that is to be excluded if found directly under the current top-level tree. This type of statement has the following format:

      -pathname
      
      
  • An include file statement specifies a file to include in the BDF. An include file statement begins with the dot (.) directive, as in ./home/bdf. You might use an include file to specify a list of exclusions statements that are common to all BDFs.

Example 12-1 shows an example of a BDF. Comment lines are preceded by # (pound sign).

Example 12-1 Sample BDF

# Use the host named chicago as the client
# host
:chicago

# Back up all files and directories in the /home
# directory
+/home

# Do not back up any directories or files with the
# extension ".bak" that are in the /home directory
# or any of its subdirectories
!*.bak

# Do not back up any directories or files that begin
# with the letters "tmp" that are directly under
# the /home directory
-tmp*

# Do not back up any Oracle database files in the /home 
# directory or any of its subdirectories
~files

See Also:

Making Incremental Backups

"Full and Incremental File System Backups" provides an overview of incremental backups. With a full backup, obtar backs up all data, whether or not it has changed since the last backup. With an incremental backup, obtar backs up only the data that has changed since a previous backup. You can request that obtar back up only data that has changed since a previous full backup, or data that has changed since a particular level of incremental backup.

Note:

If you specify a backup level other than 0, and if obtar encounters data that has never been backed up before, then obtar reverts to a level 0 backup and sends a message to standard output.

obtar uses the client host's backup-dates file, which is stored in the administrative data on the administrative server (see "Administrative Data"), to determine when the last backup at a particular level was performed.

To perform incremental backups you must use obtar -g. You specify a backup level with the obtar -L option. Table 12-2 lists arguments to the -L option.

Table 12-2 Arguments to the -L Option

Argument Description

0-9

Enables you to save only those files that have changed since the last backup at a lower level. obtar supports ten backup levels to be compatible with the UNIX dump utility, which also provides ten backup levels.

This type of backup is known as a cumulative incremental backup. Backup level 0 is the same as full; level 1 is the same as exincr.

full

Saves all files specified in the BDF.

incr

Saves any files modified since an incremental backup at any level. This type of backup is known as a differential incremental backup and is equivalent to a backup at level 10.

exincr

Saves only the data that was modified since the last full backup. This backup is equivalent to a backup at level 1.

offsite

Equivalent to a full backup except that obtar keeps a record of the backup in such a manner that it does not affect the full/incremental backup schedule. This option is useful when you wish to create a backup image for offsite storage without affecting your schedule of incremental backups.


obtar -L also enables you to back up only those files modified since a specified date and time.

obtar supports ten backup levels to be compatible with the UNIX dump utility, which also provides ten backup levels.

The following example demonstrates one way that you might create a backup schedule. Suppose that you determine that most changes to data occur during the week and that few changes, if any, occur on the weekend. In this situation, you might use the following schedule:

  • Full backup (level 0) on Sunday night

  • Level 1 incremental backups on Monday through Thursday nights

  • Level 2 incremental backups on Friday night

On Sunday, you specify the following command to perform a full backup using the BDF all_bdf (you do not need to specify -L full because obtar performs a full backup by default):

obtar -g all_bdf

On Monday, you perform an incremental backup, which backs up only the data changed since the full backup on Sunday:

obtar -g all_bdf -L 1

On Tuesday, Wednesday, and Thursday you perform level 1 backups, which back up any data changed since Sunday, effectively supplanting the level 1 incremental backup made on the previous day:

obtar -g all_bdf -L 1

On Friday, you perform a level 2 backup, which backs up any data changed since the Thursday backup:

obtar -g all_bdf -L 2

Given the preceding backup schedule, a restore operation on Monday would require the volumes written during the full backup on Sunday. A restore operation on Tuesday through Friday would require the volumes from the following backups:

  • The full backup from Sunday

  • The most recent incremental backup

A restore operation on Saturday or Sunday would require the volumes from the following backups:

  • The full backup from Sunday

  • The level 1 incremental backup from Thursday

  • The level 2 incremental backup from Friday

See Also:

Oracle Secure Backup Reference for obtar -L syntax

Creating a Single Backup Image

You can use obtar -c to create a single backup image. You might use obtar -c to perform an on-demand backup or to back up data to a volume that you could transport to another site.

To create a backup image on a tape, specify a tape drive name with the -f option. The following example backs up the directory /doc to the volume loaded on the tape drive named tape1:

obtar -c -f tape0 /doc

See Also:

Backing Up Windows Database Components

You need to take special action to back up Windows components that maintain non-relational databases. These components include the following:

  • Active Directory

  • Certificate Service

  • Cluster Configuration

  • Removable Storage Manager

The preceding Windows database components define special-purpose APIs with which the associated data is backed up and restored. This section describes how to back up these Windows database components.

Understanding Windows Database Identifiers

Oracle Secure Backup uses text strings to identify the type and name of a database. These text strings appear in place of a path name (or leaf name) where Oracle Secure Backup consumes or creates the identity of data to back up or restore (or that has been backed up). These locations are as follows:

  • File header (in the backup image)

  • Interim ASCII index file

  • Backup catalog for each client host

  • obtar command-line interface

  • obtar Backup Description File (BDF)

Database identifiers are comma-delimited, as in the following example:

database,db-type[,db-name]

In the preceding syntax, database is a literal text string, whereas db-type is one of the strings that you define. If the database has a name, then it follows the db-type and is separated from it with a comma.

Active Directory

To backup the Directory Services database, use a database identifier with a db-type of ActiveDirectory in a BDF or on a obtar command line:

database,ActiveDirectory

Note that db-type is case-insensitive. For Active Directory, there is no associated db-name in the database identifier.

To back up the Active Directory database, Directory Services must be running. To restore the Active Directory database, you must restart in Directory Service Restore mode as follows:

  1. Restart Windows.

  2. When the Starting Windows progress bar appears, press F8.

  3. From the Windows 2000 Advanced Options menu, select Directory Service Restore Mode.

The preceding steps will restart the computer as a standalone server. Because the Security Access Manager (SAM) then uses a minimal set of user/group definitions stored in the registry, you may have to adjust the Oracle Secure Backup service account to enable the Oracle Secure Backup service (observiced) to log in successfully.

Certificate Service

To backup the Certificate Service database, use a database identifier with a db-type of CertificateService in a BDF or on a obtar command line:

database,CertificateService

The db-type is case-insensitive. For Certificate Service, there is no associated db-name in the database identifier.

To back up the Certificate Service database, the Certificate Service must be running. To restore the database, Certificate Service must be stopped. Similar to the Exchange and SQL databases, you can ask Oracle Secure Backup to automatically start and stop the Certificate Service with the windowscontrolcertificatecervice policy.

Cluster Configuration

To backup the Cluster Configuration database, use a database identifier with a db-type of ClusterConfiguration in a BDF or on a obtar command line:

database,ClusterConfiguration

The db-type is case-insensitive. For Cluster Configuration, there is no associated db-name in the database identifier (only the local database is backed up).

The Cluster Configuration service must be running for both a backup and restore of the Cluster Configuration database.

Removable Storage Manager

To backup the Removable Storage Manager database, use a database identifier with a db-type of RemovableStorageManager in a BDF or on a obtar command line:

database,RemovableStorageManager

The db-type is case-insensitive. For the Removable Storage Manager, there is no associated db-name in the database identifier.

The Removable Storage Manager must be running for both a backup and restore of the Removable Storage Manager database.

Restoring Data with obtar

The obtar -x option enables you to extract files from a backup image. You can extract the entire contents of a backup image or only part of the backup image.

To restore data to your own directories, you do not need any special rights. To restore data into directories that are not owned by you, you must be either be logged in as root or you must specify the -R option with the obtar command. If you use -R, then you must be logged in as a user belonging to a class with the perform restores as privileged user right.

Restoring Data to Its Original Location

The following command extracts the contents of backup image 4, which is on the volume loaded on device tape1:

obtar -x -f tape1 -F 4

To display the contents of the backup image as it is being extracted, use the -v option. For example, the following command extracts the contents of backup image 4 and displays the contents:

obtar -x -v -f tape1 -F 4

doc/
doc/chap1
doc/chap2
test/
test/file1
test/file2

The following command prevents obtar from overwriting any files in the /doc directory that have the same names as files in the backup image:

obtar -x -f tape1 -k /doc

The following command restores the contents of a raw file system partition:

obtar -x -f tape0 /dev/rdsk/dks0d10s1

The partition is assumed to have been previously formatted and to be currently unmounted.

See Also:

Oracle Secure Backup Reference for obtar -x syntax, semantics, and examples

Restoring Data to a Different Location

Use the -s option with obtar -x to extract the data to a location other than its original location. This option is particularly useful if you have backed up data by using absolute path names. If you do not use -s, then obtar restores the data into the original directory, overwriting any existing data with that same name.

When you use -s, obtar substitutes the replacement string for prefix in the path name being restored. prefix must include the leftmost part of the original path name. For example, if you backed up the directory /home/jane/test, and if you wanted the data restored to /home/tmp/test, then you would specify the string as follows: -s,/home/jane,/home/tmp,.

If you omit the replacement string, then obtar assumes a null string, which causes obtar to remove the prefix from every pathname where it is found. The delimiter character, shown as a comma (,) in the syntax statement, can be any character that does not occur in either the prefix or the replacement string.

The following command extracts the /doc directory and restores it to a directory named /tmp/doc:

obtar -x -f tape1 -s ,/doc,/tmp/doc, /doc

Using Advanced Restore Features

This section describes additional obtar restore options.

Ensuring that obtar Reads Full Blocks

If you are using obtar with UNIX pipes or sockets, then the system may return partial blocks of data even if more data is coming. This behavior can cause obtar to fail. You can use the -B option to cause obtar to do multiple reads to fill a block.

For example, suppose you want to restore data from a device that is attached to a host where Oracle Secure Backup is not installed. The following command restores the /doc directory from a device attached to the host named logan:

rsh logan cat /dev/nrst0 | obtar -x -B -f - /doc

Note that if you specify a remote device with the -f option, you do not need to use -B because obtar's network protocol guarantees the reading and writing of full blocks.

Changing Timestamps

Ordinarily, obtar restores data with its original timestamp. When you specify the -m option, obtar changes the timestamp of the data to the current date and time.

In the following example, the timestamp for all directories and files in the /old directory is changed to the current date and time:

obtar -x -m -f tape0 /old

Specifying Position Numbers

If you are using a device that supports direct-to-block positioning, then you can use the -q option to rapidly locate particular data on a volume. The argument to -q is a position-string that you obtain from the ls --backup --position command in obtool. When you use -q, obtar positions the volume directly to the location you specify.

For example, you can use the ls command in obtool to identify the position of the file /home/gms/output/test001:

obtool ls --backup --position /home/gms/output/test001

test001
Backup Date & Time ID  Volume ID Volume Tag File Sect  Level Position
2006/01/11.10:16:28 3  VOL000106   00000110   11    0    000045020008

After obtaining the position data, you can specify the -q option with obtar -t as shown in the following example:

obtar -t -f tape1 -q 000045020008

Avoiding File Overwrite

When restoring files, obtar will overwrite existing files unless explicitly told not to. On systems that support file locking, this replacement of existing files occurs even for files that are currently in use. Specify -u on the obtar command line to avoid overwriting files that are currently in use.

Listing and Cataloging the Contents of Backups and Volumes with obtar

This section describes how you can use obtar to list the contents of individual backup images on a volume and to list volume and backup image labels for a single backup image or an entire volume.

This section contains the following topics:

Listing the Contents of a Backup Image

You can use obtar -t to display the names of files and directories contained in a backup image. You can list the entire contents of a backup image or just part of the backup image. Note that obtar -t does not display backups of files on NDMP-accessed devices.

The following command displays the contents of the backup image located at the current position of the volume loaded on device tape1:

obtar -t -f tape1

project/
project/file1
project/file2
project/file3

To display the contents of a particular backup image on a volume set, use the -F option. For example, the following command displays the contents of backup image 4:

obtar -t -f tape1 -F 4

doc/
doc/chap1
doc/chap2
test/
test/file1
test/file2

To display additional information about a backup image, use the -v option. The following command uses the -v option to display additional information about backup image 4:

obtar -t -v -f tape1 -F 4

drwxrwxr-x jane/rd       0 Feb 24 16:53 2000 doc/
-rw-r--r-- jane/rd     225 Feb 24 15:17 2000 doc/chap1
-rwxrwxr-x jane/rd     779 Feb 24 15:17 2000 doc/chap2
drwxrwxr-x jane/rd       0 Feb 24 16:55 2000 test/
-rwxrwxr-x jane/rd     779 Feb 24 16:54 2000 test/file1
-rw-r--r-- jane/rd     225 Feb 24 16:54 2000 test/file2

To display information about a particular file or directory that is contained in the backup image, include the file or directory name as the last argument on the command line. For example, the following command displays information about the directory test, which is contained in backup image 4:

obtar -t -f tape1 -F 4 test

test/
test/file1
test/file2

You can specify more than one path name from the backup image. The following command displays information about the directories test and doc (obtar lists the directories in the order they appear in the backup image):

obtar -t -f tape1 -F 4 test doc

doc/
doc/chap1
doc/chap2
test/
test/file1
test/file2

See Also:

Oracle Secure Backup Reference for obtar -t syntax, semantics, and examples

Cataloging the Contents of a Backup Image

You can catalog the contents of a backup image by specifying obtar -Gt. You can catalog either RMAN or file system backups, but note that obtar -t does not catalog NDMP backups. You can only catalog one image at a time.

Example 12-2 catalogs backup image 1 on the volume loaded into tape drive tape1 (only partial output is shown). In this example, the image contains a file system backup of the /home/someuser directory on host stadf56.

Example 12-2 Cataloging a File System Backup Image

# obtar -f tape1 -tG -F 1

Volume label:
    Volume tag:         DEV100
    Volume ID:          VOL000001
    Volume sequence:    1
    Volume set owner:   root
    Volume set created: Tue Nov 22 15:57:36 2005

Archive label:
    File number:        1
    File section:       1
    Owner:              root
    Client host:        stadf56
    Backup level:       0
    S/w compression:    no
    Archive created:    Tue Nov 22 15:57:36 2005

/home/someuser/
/home/someuser/.ICEauthority
/home/someuser/.Xauthority
/home/someuser/.aliases
/home/someuser/.bash_history
/home/someuser/.bash_logout
/home/someuser/.bash_profile
/home/someuser/.bashrc
.
.
.

Example 12-3 also catalogs backup image 1 on the volume loaded into tape drive tape1. In this example, the image contains an RMAN backup of archived redo logs.

Example 12-3 Cataloging an RMAN Backup Image

# obtar -f tape1 -tG -F 1

Volume label:
    Volume tag:         ADE202
    Volume ID:          RMAN-DEFAULT-000002
    Volume sequence:    1
    Volume set owner:   root
    Volume set created: Mon Feb 13 10:36:13 2006
    Media family:       RMAN-DEFAULT
    Volume set expires: never; content manages reuse
 
Archive label:
    File number:        1
    File section:       1
    Owner:              root
    Client host:        stadv07
    Backup level:       0
    S/w compression:    no
    Archive created:    Mon Feb 13 10:36:13 2006
    Backup piece name:  05hba0cd_1_1
    Backup db name:     ob
    Backup db id:       1585728012
    Backup copy number: non-multiplexed backup
    Backup content:     archivelog

See Also:

Oracle Secure Backup Reference for obtar -tG syntax, semantics, and examples

Displaying Volume Labels

You can use obtar -z to display a backup image's volume label. You can also use the -z option with obtar -t and obtar -g to display a volume label, or with obtar -c to create a volume label.

For example, the following command causes obtar to display the volume label for the fourth backup image on a volume loaded on device tape1:

obtar -z -f tape1 -F 4

Volume label:
   Volume ID:          VOL000105
   Volume sequence:    1
   Volume set owner:   jane
   Volume set created: Tue Mar 2 10:13:14 2002
Backup image label:
   File number:        4
   File section:       1
   Owner:              jane
   Client host:        chicago
   Backup level:       0
   S/w compression:    no
   Archive created:    Tue Mar 2 10:13:14 2002

When you use obtar -z, obtar reads the backup image. Whenever obtar reads a backup image, it positions the volume after the backup image just read, and before the volume label of the next backup image. For example, if you entered another obtar -z command after the preceding command, obtar would display the volume label of backup image 5, if it exists:

obtar -zf tape0

Volume label:
   Volume ID:          VOL000003
   Volume sequence:    1
   Volume set owner:   gms
   Volume set created: Wed May 01 14:08:23 2000
Backup image label:
   File number:        5
   File section:       1
   Owner:              gms
   Client host:        campy
   Backup level:       0
   S/w compression:    no
   Archive created:    Wed May 01 14:08:23 2000

You can use obtar -zz to display all labels on the volume, as in the following example:

obtar -zzf tape0

Seq  Volume    Volume    Backup Image    Client    Backup    Backup Image Create
#    ID        Tag       File Sect       Host      Level     Date & Time
1    VOL000003             1   1         campy       0       05/01/00 14:08:23
1    VOL000003             2   1         phred       0       05/01/00 15:37:00
1    VOL000003             3   1         mehitibel   0       05/01/00 15:38:08

See Also:

Oracle Secure Backup Reference for obtar -z and -zz syntax, semantics, and examples

Pre-Labeling Tape Volumes with obtar

You can use obtar to pre-label tape volumes, thereby associating a printed label (the volume tag) on the tape with the recorded contents of the tape.

Use the following steps to pre-label a tape volume:

  1. Before using a volume for the first time, assign a unique identifier to it. The identifier can be between 1 and 31 characters long. Write this identifier on a printed label (the volume tag) on the outside of the tape, or use a pre-printed label.

  2. Place the write-enabled volume in any accessible tape drive.

  3. From any host on which Oracle Secure Backup is installed:

    1. Log in as root, or log in to Oracle Secure Backup as a user belonging to a class having the manage devices and change device state right.

    2. Enter obtar options in the following format:

      obtar -Xlabel -Xtag:volume-tag -f tape-device
      
      

obtar writes the volume-tag to the specified tape-device. For example, the following command labels the tape volume found in tape0 with the tag WKLY58010:

obtar -Xlabel -Xtag:WKLY58010 -f tape0

You can omit the -Xtag option if the volume has a machine-readable tag (barcode) and resides in a library equipped with a barcode reader.

Note:

Labeling, reusing, and unlabeling a tape volume effectively erases any data stored on it. Perform any of these operations only if the volume contains no useful data.

After you have labeled a tape, obtar retains the association between the volume tag and the volume ID. The tag is the external identifier, whereas the ID is the internal one. Each time obtar displays the label for that volume, it also displays the volume tag. Similarly, when obtar prompts you for a volume (at restore time) it displays both the volume ID and tag.

When you label a volume, you can optionally tell obtar to limit that volume's use to a specified media family. In this case, obtar does not allow data destined for media families other than the one you specify to be written to the volume.

To select the media family for the volume, include the option, -Xfa:family-name on the obtar command line. For example, to label the tape in the tape drive rdrive MMR-2006 and restrict its usage to media family INCR, enter the following:

obtar -Xlabel -Xtag:MMR-2006 -f rdrive -Xfa:INCR

When obtar displays the label of a volume that's permanently restricted to a certain media family, it includes the notation (permanent) next to the media family name:

Volume label:
Volume tag:         MMR-2006
Volume ID:          INCR-000007
Volume sequence:    1
Volume set owner:   root
Volume set created: Sun Dec 18 20:16 PM 2002
Media family:       INCR (permanent)

To remove the media family restriction, tell obtar to unlabel or reuse the volume. Unlabeling a volume causes all information stored on it to be effectively erased. This includes any existing volume label information. To unlabel a volume, enter the following.

obtar -Xunlabel -f device [-Xow]

Use the -Xow option only if you want obtar to disregard any expiration date extant in the volume label.

Reusing a volume is similar to unlabeling it, but a reuse operation directs obtar to preserve the existing volume label. To reuse a volume, enter the following.

obtar -Xreuse -f device [-Xow]

The -Xow option conveys the same semantic here as it does when used in the unlabel operation. It directs obtar to disregard the expiration date, if any, found in the volume label.

See Also:

Oracle Secure Backup Reference for obtar -Xlabel, -Xunlabel and -Xreuse syntax, semantics, and examples

Optimizing Your Use of obtar

This section describes ways you can optimize your use of obtar, and provides information about some of the more advanced backup features of obtar.

This section includes the following topics:

Using tar with Backup Images Created by obtar

By default, obtar generates backup images that are fully compatible with tar. This section offers tips for using tar with backup images created with obtar.

When you create a backup image with obtar -g, obtar creates several files in the backup image that provide information about the backup image. obtar knows that these file are special and never extracts them from the backup image as actual files. To tar, the files appear to be ordinary files; when you use tar to extract a backup image, tar will create several files that have the prefix ###. When you restore a backup image with obtar -x, obtar does not create these files.

You can use any of the following obtar options and still maintain compatibility with tar:

-b, -B, -c, -f, -h, -l, -m, -p, -t, -v, -x

When you are using tar to extract a backup image that spans multiple volumes, note that each section of a backup image that spans multiple volumes is a valid tar file. obtar can correctly extract the contents of the backup image, but tar will encounter an early end-of-file condition after it extracts the first section of the backup image. At this point, you will have extracted only the first part of the data for the file that continues across the volume break. To restore the file completely, you need to do the following:

  1. Move the first file fragment to a location that will not be overwritten as you continue the extraction.

  2. Load the next volume and continue the extraction. The second file fragment will be extracted.

  3. Use the UNIX cat command to append the second file fragment to the first file fragment to obtain the complete file. For example:

    cat first_frag second_frag > complete_file
    
    
  4. Delete the file fragments.

Backing Up Symbolic Links

When the data to be backed up includes symbolic links, obtar ordinarily backs up only the link text, not the data to which the link points. You can use the -h option to cause obtar to back up the data, not just the link text. The following command backs up the data that is pointed to in any paths in the BDF named home_bdf:

obtar -g home_bdf -f /dev/nwrst1 -h

If you include an explicit link path name in a BDF or when using obtar -c, then obtar backs up the data specified by that link whether or not you have used the -h option. If you do not want obtar to follow links explicitly mentioned in a BDF (or on the command line), however, then you can do so by specifying -Xnochaselinks.

Creating Offsite Backups

obtar supports a backup level called offsite. An offsite backup is equivalent to a full (level 0) backup except that obtar keeps a record of this backup in such a manner that it does not affect the full/incremental backup schedule. This option is useful when you wish to create a backup image for, say, offsite storage without disturbing your schedule of incremental backups. To request an offsite backup, specify -L offsite.

Backing Up and Restoring Raw File Systems

Normally, when obtar encounters a block or character special file when backing up a tree, it will only write the special file name and attributes to the backup image. If a block or character special file is mentioned at the top level of the backup tree, however, either explicitly or by means of a wildcard, obtar will back up the file name, attributes, and contents. For example, the following command will create a backup image consisting of all the special file names in the /dev directory, but will neither open nor read any special file:

obtar -cvf tape0 /dev

On the other hand, the following command will cause obtar to open /dev/sd0a, /dev/sd13a, sd13b, and so on and write the entire contents of the underlying raw file systems to the backup image:

obtar -cvf tape0 /dev/sd0a /dev/sd13*

Because this form of access bypasses the native UNIX file system, you can use it to back up raw file systems that contain non-UNIX data, for example, a disk partition containing a database.

Note:

You should never back up or restore a mounted file system. If a file system is mounted, activity by other processes may change the file system during the backup or restore, causing it to be internally inconsistent.

Also note the following considerations when backing up and restoring raw file systems:

  • Because obtar has no idea what blocks are used or unused on the raw file system, the entire file system will always be saved (as opposed to a backup using the vendor-supplied UNIX file system, which will only save blocks in use).

  • When restoring data to a raw file system, the size of the file system to which you are restoring must be at least the size of the file system that was backed up.

  • When restoring a raw file system, all data currently on the file system will be lost and be totally overwritten by the data from the backup image.

  • In order to restore a raw file system (or other block or character special file), the raw file system must have been previously formatted (using mkfs, mkvol, or similar tool), and the special file referring to the raw file system must preexist. Otherwise, the data will be restored as a normal file.

Controlling Device Parameters

You can use -M to set the format of Exabyte 8500, 8500c, and 8505 tape devices and turn hardware compression on or off. The syntax is as follows:

-M parameter:value

When you are using an Exabyte 8500, 8500c, or 8505 tape device, you can use -M to create backup images that can also be used with Exabyte 8200 tape devices. To set the format, specify the following:

-M format:{8200|8500}

Specify 8200 to change to 8200 format, and specify 8500 to change to 8500 format. If you do not specify either, obtar uses 8500 format.

You can also use -M to turn hardware compression on or off for any device that supports hardware compression. obtar turns hardware compression on by default. To set hardware compression, specify

-M compress:{on|off}

Specify on to turn hardware compression on, and specify off to turn hardware compression off.

If you turn hardware compression on when you create a backup image, when you restore the data, the device automatically uncompresses the data.

If you turn hardware compression on, do not specify the -Z option, which enables software compression.

If you are using the WangDAT 2600 device, changing the compression setting takes about 55 seconds because the drive automatically reformats the tape.

You can use two -M options to change format and compression with the same command. For example,

obtar -g my_bdf -f tapet0 -M format:8200 -M compress:off 

Compacting Sparse Files

A sparse file is a file with holes—areas in the file that have never be written to. Ordinarily, obtar does not perform any special handling of sparse files. When you specify the -P option when you create a backup image with obtar -g or obtar -c, obtar compacts any sparse files in the backup image. When you subsequently restore the backup image, obtar restores the sparse files to their original format.

Note:

This option does not apply to sparse files under Windows 2000, which are always backed up and restored in sparse form.

Changing Criteria for Incremental Backups

Normally, when obtar decides which files are to be included in an incremental backup, it uses the mtimes for the files, that is, the times at which the contents of the files were last modified. If files are added to a directory by using mv or cp -p, however, they may not get backed up because the modified times of such files are not changed from those of the original copies of the files. You can get around this problem by telling obtar to use the status change times (ctimes) rather than mtimes as the criteria for inclusion in an incremental backup.The status change time of a file is the time at which a file's inode was last modified.

Using ctimes results in the selection of all files that would have been selected using mtimes plus those that have been moved or copied into the directory. Specify this option by specifying -Xuse_ctime on the command line. For scheduled backups, you can include -Xuse_ctime in the operations/backupoptions policy.

Note the following drawback to using -Xuse_ctime. When using the mtime criteria, obtar resets the last accessed time (atime) of each file after it has been backed up. That is, the act of backing up a file does not change the atime of the file. If you are using ctime as the selection criteria, however, then obtar cannot reset the time last accessed because it will reset the file's change time, thus turning every incremental into a full backup. In other words, specifying -Xuse_ctime also turns on -Xupdtu.

The important points are as follows:

  • If -Xuse_ctime is not specified, then incremental test is mtime and atimes are left unchanged and moved files may be missed.

  • If -Xuse_ctime is specified, then incremental test is ctime; atimes reflect time of backup and moved files are caught.

Changing Default Backup Behavior

When you create a backup image with obtar -g, obtar ordinarily creates an index and a volume label and updates the backup dates file. You can use the -S option with obtar -g to suppress any or all of this behavior.

The syntax for the -S option is as follows:

-S{a|G|U|z}

The arguments to -S do the following:

  • a

    Suppresses the creation of the index and a volume label, and the updating the backup date file

  • G

    Suppresses the creation of the index data

  • U

    Suppresses the updating of the backup dates file

  • z

    Suppresses the creation of the volume label

Using Shell Scripts to Perform Backups

When you are performing regular backups, you may find it easier to execute the backups from shell scripts rather than from the command line.

The samples directory in the Oracle Secure Backup home contains a sample shell script called autoobtar. You may find it helpful to look at this file for ideas for creating your own shell scripts.

When you use shell scripts, you may want to use the obtar -y option, which generates a status file. The status file provides information about the backup session. The syntax of the -y option is as follows, where pathname is a file local to the operator host. If pathname already exists, obtar overwrites it:

-y pathname

Example 12-4 is a sample status file. Table 12-3 explains the status file entries.

Example 12-4 Sample Status File

status 0
devices 1
volumes VOL000017
file 5 
host chicago
start_time Wed Mar 31 2005 at 15:40:04 (733610404)
end_time Wed Mar 31 2005 at 15:40:13 (733610413)
entries_scanned 12
entries_excluded 0
entries_skipped 0
mount_points_skipped 0
files 9
directories 3
hardlinks 0
symlinks 0
sparse_files 0
filesys_errors 0
unknown_type 0
file_kbytes 9
dev_kbytes 16
dev_iorate 174.3 KB/s
wrt_iorate 305.1 KB/s
path /home/pablo/test1 0
path /home/pablo/test1 0
path /home/pablo/test2 0

Table 12-3 Status File Entries

Entry Meaning

status

Status code for the entire backup. Each status code is described in samples/obexit.sh. This value is 0 if no errors occurred.

volumes

Volume IDs used.

file

File number of the backup image on the volume.

host

Name of the client host.

start_time

Date and time the session began.

end_time

Date and time the session ended.

entries_scanned

Number of file system objects read.

entries_excluded

Number of file system objects excluded from the backup image because of exclusion statements in the backup description file.

entries_skipped

Number of file system objects skipped during an incremental backup.

mount_points_skipped

Number of mount points skipped.

files

Number of files included in the backup image.

directories

Number of directories included in the backup image.

hardlinks

Number of hard links included in the backup image.

symlinks

Number of symbolic links included in the backup image.

sparse_files

Number of sparse files included in the backup image.

filesys_errors

Number of file system errors encountered.

unknown_type

Number of items that obtar could not recognize.

file_kbytes

Number of kilobytes of file data read to create the backup image.

dev_kbytes

Number of kilobytes of data written to the backup image.

dev_iorate

I/O rate for the period of backup image creation.

wrt_iorate

I/O rate between the start and end of actually writing data to tape.

path pathname status

Data included in the backup image, where pathname is the path name included and status is a status code, as described in samples/obexit.sh. obtar creates a path entry for each path name in the backup image.


Excluding Subdirectories with .ob_no_backup Files

You may wish to exclude part of a directory tree from a backup. For example, you specify /home in a BDF or on a obtar command line, but you wish to exclude /home/bob from the backup. If you are using datasets and the scheduler, then you can perform this task by the exclude path dataset directive.

An alternative is to create a file named .ob_no_backup in the directory to be excluded. For example:

touch /home/bob/.ob_no_backup

If you include the option -Xmarkerfiles on the command line, obtar looks for files named .ob_no_backup. On encountering a file with this name, obtar skips the containing directory and its subdirectories.

Backing Up Across Mount Points

By default, obtar does not cross local or remote mount points. A local mount point mounts a local file system; a remote mount point is a local mount for a file system accessed over the network.

You can use BDF mount point statements to override the default obtar behavior and cross mount points during backups. You can also control mount point behavior with obtar options. Table 12-4 summarizes the ways of controlling how obtar handles mount points.

Table 12-4 Controlling obtar Mount Point Behavior

Means of Mount Point Control Description Section

BDF mount point statements

Direct obtar to cross mount points

"Crossing Mount Points with BDF Mount Point Statements"

-l option

Causes obtar not to cross mount points and to ignore all BDF mount point statements

"Avoiding Mount Points with the -l Option"

-Xchkmnttab

Causes obtar to consult the local mount table (/etc/mnttab) rather than use a stat(2) operation and to skip remote mount points

"Avoiding Remote Mount Points with the -Xchkmnttab Option"

-Xcrossmp

Causes obtar to cross all mount points regardless of other mount point control options or BDF mount point statements

"Crossing Mount Points with the -Xcrossmp Option"


Crossing Mount Points with BDF Mount Point Statements

You can use mount point statements in a BDF to determine whether obtar crosses local and remote mount points during backups. The BDF mount point statements are as follows:

  • @crossallmountpoints

    Specifies that all local and remote mount points should be crossed

  • @crossremotemountpoints

    Specifies that only remote mount points should be crossed

  • @crosslocalmountpoints

    Specifies that only local mount points should be crossed

The scoping rules for mount point statements are as follows:

  • A mount point statement specified before all paths is applicable to all paths.

  • A mount point statement specified immediately after a particular path is applicable only to this path.

  • If a mount point statement is specified before all paths, then any mount point statement after it supplements the first mount point statement.

For example, suppose that you have a Linux host that mounts a local file system on /loc_mt1 and a remote file system on /rem_mt1. Example 12-5 would not back up files on either mounted file system.

Example 12-5 Avoiding Crossing Mount Points

obtar -czf tape1 /loc_mt1 /rem_mt1

To cross all mounted file systems, you could create a BDF named crossmount.bdf with the following syntax:

@crossallmountpoints
/loc_mt1
/rem_mt1

You could enter the command shown in Example 12-6 to back up both mounted file systems.

Example 12-6 Crossing Mount Points

obtar -g crossmount.bdf -z -f tape1

See Also:

Oracle Secure Backup Reference to learn about BDF mount point statements

Avoiding Mount Points with the -l Option

As explained in the preceding section, you can explicitly direct obtar to cross mount points by using mount point statements in a BDF. If you do not want obtar to cross local or remote mount points, even if the BDF includes mount point statements, then you can specify the -l option.

Assuming the scenario described in the preceding section, Example 12-7 would not back up the mounted file systems because -l is specified.

Example 12-7 Avoiding the Crossing of Mount Points

obtar -g crossmount.bdf -z -f tape1 -l

See Also:

Oracle Secure Backup Reference to learn about the -l option

Avoiding Remote Mount Points with the -Xchkmnttab Option

By default, obtar performs a stat(2) operation to determine whether a file represents a mount point. If a remotely mounted file system is down or not responding, then the stat(2) operation can cause the obtar process to hang.

The -Xchkmnttab option causes obtar to consult the local mount table (/etc/mnttab) before performing these stat(2) operations and to skip directories determined to be remote mount points. Local mount points are not skipped. Note the following aspects of -Xchkmnttab usage:

  • The -Xchkmnttab option overrides statements in a BDF that direct obtar to skip or cross remote mount points.

  • You can specify -Xchkmnttab either on the command line or in the operations/backupoptions policy.

  • The -Xchkmnttab option is overridden by -Xcrossmp.

See Also:

Oracle Secure Backup Reference to learn about the -Xchkmnttab option

Crossing Mount Points with the -Xcrossmp Option

The -Xcrossmp option directs obtar to cross all mount points regardless of whether the -l or -Xchkmnttab options are specified or whether mount point statements are included in the BDF. You can include the -Xcrossmp option in the operations/backupoptions policy.

See Also:

Oracle Secure Backup Reference to learn about the -Xcrossmp option

Support for Oracle Secure Backup Catalog Files Over 2 GB

Oracle Secure Backup supports catalog files larger than 2 GB. This support is restricted to operating systems and file systems that themselves support files of over 2 GB in size. Oracle Secure Backup administrative servers that support the 2 GB file size include Solaris 2.8 and later (64-bit only).

Retaining Backup Statistics

obtar generates backup statistics in response to the -y statfile command line option, which is turned on automatically for any scheduled backup. In addition, you can retain these statistics in the media server's observiced log file by setting the scheduler/retainbackupmetrics policy.