Views

How do I back up a Netbackup Catalog Database that is too large to fit on a single tape?

This Wiki is brought to you by Backup Central, where you can find the Mr. Backup Blog, Forums, and a mailing list for each forum!

Backup FAQs Service Providers Backup Software Backup Hardware Backup Book Wiki Free Stuff Miscellaneous


For a long time, this was an "unsupported, but we'll tell you how to do it" tactic from Veritas support. With the release of 3.4, it became the official way to do it and it's documented on page 157 of the NetBackup Admin Guide.

But if you're running NBU 3.2 you might wonder how to do this. Here it is, as excerpted from the 3.4 documentation:

Multiple-Tape Backups


The basic concept behind the protection of large NetBackup catalogs is to split the catalog-backup process into two steps. The first step backs up the majority of the data from the images subdirectory on the master server, while the second step backs up a small sub-set of the images subdirectory, together with the remainder of the NetBackup and Media Manager catalog files and directories from the master and media servers.

Since the first backup contains the majority of the data, it must be able to span tapes. This is achieved by using a normal NetBackup job to back up the data. As a result of this normal backup, an entry is placed in the images subdirectory tree for the master server. This catalog entry allows the user to browse the catalog for files during a restore operation.

The second backup must back up the portion of the images subdirectory that contains the catalog entries for the master server, together with the other parts of the NetBackup and Media Manager catalogs. Since this is a relatively small amount of data, it fits onto a single tape. It must also be possible to recover this backup without the NetBackup catalogs being available. This is achieved by using the normal NetBackup catalog-backup mechanism to perform the backups.

Setting up Multiple-Tape NetBackup Catalog Backups

======================================

In order to configure NetBackup to perform multiple-tape backups of its catalogs, you must define both a normal NetBackup class and make changes to the NetBackup catalog-backup configuration. In addition, you must create a shell script or executable file that will initiate the multiple-tape catalog backups. These steps are detailed below.


Define a NetBackup Class

1. Use the NetBackup Administration interface to create a new class.

Set the class attributes as follows:

--Set the Class type to Standard if the master server is a UNIX machine or MS-Windows-NT if the master server is a WindowsNT/2000 machine.

--Do not choose Cross mount points if the master server is a UNIX or Windows 2000 machine.

--Do not choose Follow NFS for UNIX or Backup network drives for Windows NT.

--Pick a suitable storage unit and volume pool.

--Set Limit jobs per class to 1.

--Do not choose Compression.

--Set Job priority to 0.

2. Add the master server to the client list

3. Put the following path in the file list: /usr/openv/netbackup/db/images

Note On UNIX, if /usr/openv/netbackup/db/images is a symbolic link to another filesystem, you MUST specify the true location of the images directory here. Symbolic links do not apply to Windows NT/2000.

4. Set up schedules to meet your requirements. VERITAS recommends that the class contain only a full backup schedule, since this will minimize tape mounting and positioning during restores.

Do not set any backup windows for the schedules that you define. This ensures that the backup class is never initiated automatically by the NetBackup scheduler. Instead, you must initiate the backup job manually.

5. Save your changes.


Configure the NetBackup Catalog Backups

Use the NetBackup Administration interface to set up the configuration of the NetBackup catalog backups. Make the following changes:

1. Ensure that the Media server setting is for the required backup server.

2. Specify the following for Absolute pathname.

 masterserver:/usr/openv/netbackup/db/[A-Za-hj-z]*
 masterserver:/usr/openv/netbackup/db/images/masterserver
 masterserver:/usr/openv/var
 mediaserver1:/usr/openv/netbackup/db/media
 mediaserver1:/usr/openv/volmgr/database (repeat for all media servers)

3. Change the schedule to Only when manually initiated. This stops the NetBackup catalog backups from running automatically and allows you to control when they run manually.

4. Select appropriate media types, densities, and IDs for the two catalog-backup media.

5. Save your changes.



Create a Shell Script to Initiate the Backups

It is also important that the second-stage backup of the NetBackup catalogs occurs directly after the first-stage backup. A good way to ensure this is to write a script that initiates both backups, one after the other. The following is an example catalog-backup script:

 #!/bin/sh
 #
 # catalog_backup script
 #
 # Performs a two-stage backup of the NetBackup catalogs
 #
 CLASS=nbu_cat_backup # Change to the name of the correct class
 SCHED=full_backup # Change to the name of the correct schedule
 LOGDIR=/usr/openv/netbackup/logs/catalog_backup
 if [ -d $LOGDIR ]; then
 exec >> $LOGDIR/log.`date ~S+%m%d%y~T` 2>&1
 else
 exec > /dev/null 2>&1
 fi
 echo "Running first stage catalog backup"
 /usr/openv/netbackup/bin/bpbackup ~Vw ~Vi ~Vc $CLASS ~Vs $SCHED
 EXIT_STAT=$?
 if [ $EXIT_STAT ~Vne 0 ]; then
 echo "First stage catalog backup failed ($EXIT_STAT)"
 exit 1;
 fi
 echo "Running second stage catalog backup"
 /usr/openv/netbackup/bin/admincmd/bpbackupdb
 EXIT_STAT=$?
 if [ $EXIT_STAT ~Vne 0 ]; then
 echo "Second stage catalog backup failed ($EXIT_STAT)"
 exit 1;
 fi
 exit 0;
 ## end of script



How To Initiate a Multiple-Tape Catalog Backup

Similar to how the automatic-catalog backup works, it is important to ensure that no other NetBackup operations that modify the NetBackup catalogs are in progress while the two catalog backups are performed.

Such operations include:

--Backups and archives

--Catalog compression

--TIR record expiration or retrieval (during a restore operation)

--Catalog image record expiration

--Image imports

--Image duplication

Performing the catalog backups when any of these operations are in progress can cause an inconsistent catalog backup. Since both image import and image duplication operations must be initiated manually by the NetBackup administrator, it is relatively easy to ensure that these are not in progress during the catalog backup. However, it is more difficult to ensure that no backups or restores are running, since both the NetBackup scheduler and other users can initiate these.

More difficult still are operations that are started automatically by NetBackup, such as catalog compression, TIR record expiration or retrieval, and image record expiration. Due to the way the NetBackup scheduler interlocks processes, do not start the two-step backup script with the /usr/openv/netbackup/bin/session_notify script.

We suggest using another scheduler (such as cron on UNIX) to start the two-step backup script or execute it manually when the above operations are not occurring.



Multiple-Tape Restores

A restore of the NetBackup catalogs is also achieved in two steps. The first step is to use the most recent NetBackup catalog backup to recover the portion of the image catalog containing information about the backups taken from the master server, together with the other parts of the NetBackup and Media Manager catalogs on the master and, if configured, the media servers.

Once this information has been recovered, NetBackup can be started and one of the user interfaces can be used to browse the files backed up from the master. These will include the files and directories that constitute the NetBackup images catalog, which were backed up using the first step of the catalog backup described above. Using the normal restore process, these files and directories are restored, completing the operation. You must ensure the option Overwrite Existing Files is not selected, since this replaces the files previously recovered in stage 1. In this faq is stated that "if the master server is a windows server...", but in windows you can't use the entry that contains [A-Za-hj-z]* since windows doesn't support file expansion, neither NBU. My question is, if the master server is a windows machine, which should be the entry?