Chapter 3. Scheduled Backups

NetWorker backs up your OnLine Dynamic Server according to a schedule you set up.  You add the OnLine Dynamic Server to the NetWorker server's list of clients and specify what you want backed up and how.

This chapter provides details on using NetWorker to set up the system running OnLine Dynamic Server as a client of the NetWorker server for scheduled and on–demand backups of OnLine Dynamic Server dbobjects.  The script driving the connection between ON-Bar and NetWorker, nsrdbmi, is also described.

Be sure to read the IRIX NetWorker Administrator's Guide, shipped with your NetWorker server software, for complete information on using the NetWorker administrative program's graphical interface.

Customizing the nsrdbmi Script

When you installed BusinesSuite Module for Informix on your OnLine Dynamic Server system, the installation placed a working copy of the nsrdbmi script in the directory where the NetWorker executables reside.  A copy of the script, nsrdbmi.sh, was also installed in the /etc directory for use as a template for developing custom BusinesSuite Module for Informix scripts.

You may want to modify options in the nsrdbmi script, or you may want to have a custom script to control backups of different instances of OnLine Dynamic Server.


Caution: The nsrdbmi script must reside in the same directory on the system running OnLine Dynamic Server as the NetWorker save command.  If you create a modified version of the script, keep the modified version in the same directory.

To create a custom version of nsrdbmi:

  1. Copy the nsrdbmi template, nsrdbmi.sh, to a new file.

    # cp /etc/nsrdbmi.sh /usr/etc/nsrdbmi 
    

  2. Use your favorite text editor and open the copied script to modify it.

Using Pre- and Post-Processing Commands

The nsrdbmi script contains two variables that allow you to use OnLine Dynamic Server commands to perform tasks before and after a scheduled backup.

PRECMD

The PRECMD variable allows you to customize your backup with a command to execute before the backup starts.  For example, you could run a script that checks for corrupted dbojbects.  If the script returns a nonzero value, the backup session fails and an error message indicates the failure.

POSTCMD

The POSTCMD variable allows you to customize your backup with a command to execute after the backup completes.  For example, you could run a script that displays the status of your logical logs.  If the script returns a nonzero value, an error message indicates the failure.  Operator intervention may be required to return the database to a ready state.

Changing the Logfile Backup Setting

By default, NetWorker automatically backs up the logical logs associated with an OnLine Dynamic Server instance after completing a scheduled backup of the data.  Once a logical log is successfully backed up, OnLine Dynamic Server automatically reuses the old logical log's space.


Caution: Logical log backups allow you to restore the database to its current state at the time a disaster occurs.  If you do not maintain logical log backups and need to recover data, you will only be able to recover your database up to the time of the last backup.  Transactions that occur between the last backup and the time your database is corrupted will be lost.  Legato strongly recommends leaving DO_LOGFILE_BACKUPS enabled.

To exclude logical logs from a scheduled or on–demand backup:

  1. Copy the /etc/nsrdbmi.sh template to a new file and open the new file with your favorite text editor.

  2. Change the value assigned to DO_LOGFILE_BACKUPS and save the modified script.

    DO_LOGFILE_BACKUPS=NO 
    

  3. In the nwadmin Clients window for the NetWorker server, change the Backup command field for the OnLine Dynamic Server client to the name of the new script.

Changing the PATH Variable

The PATH environment variable must be configured to include the path to the ON-Bar executables and the NetWorker program mminfo.  The PATH variable in the nsrdbmi script is already assigned the value:

$INFORMIXDIR/bin:/bin:/usr/etc

If your ON-Bar executables are in a different path, change the value assigned to the PATH variable for $INFORMIXDIR in the nsrdbmi script.

Likewise, if your NetWorker executables are in a directory other than /usr/sbin, be sure to change the value listed in the PATH variable assignment.

Changing the Value for INFORMIXDIR

The INFORMIXDIR environment variable defines where OnLine Dynamic Server is installed.  The INFORMIXDIR variable in the nsrdbmi script is already assigned the value:

INFORMIXDIR=/usr/informix

If your OnLine Dynamic Server binaries are in a different path, change the value assigned to INFORMIXDIR in the nsrdbmi script.

Changing the Value for ONCONFIG

The ONCONFIG environment variable defines which OnLine Dynamic Server configuration file to use.  The ONCONFIG variable in the nsrdbmi script is already assigned the value:

ONCONFIG=onconfig.std

If your OnLine Dynamic Server instance uses a different configuration filename, change the value assigned to ONCONFIG in the nsrdbmi script.

Changing the Value for INFORMIXSQLHOSTS

The INFORMIXSQLHOSTS environment variable defines where the sqlhosts file used by OnLine Dynamic Server resides.  The INFORMIXSQLHOSTS variable in the nsrdbmi script is already assigned the value:

INFORMIXSQLHOSTS=$INFORMIXDIR/etc/sqlhosts

If the sqlhosts file used by OnLine Dynamic Server is in a different path, change the value assigned to INFORMIXSQLHOSTS in the nsrdbmi script.

Changing the NetWorker XBSA Environment

The nsrdbmi shell script contains several NetWorker XBSA environment variable settings shared by NetWorker and ON-Bar for backup tasks.  The script is already configured to the default settings shown in Appendix A, “XBSA Environment Variables.” You can modify NetWorker XBSA settings shown in the script to any of the valid values shown in Appendix A.

To modify NetWorker XBSA variables not shown in the nsrdbmi script:

  1. Copy the nsrdbmi.sh template to a new file and edit the new file with a text editor.

  2. Add the NetWorker XBSA environment variable and the value you want assigned to it in the area of the script marked “Configuration variables, modifiable by user.”

  3. Add the NetWorker XBSA environment variable to the list of variables exported.

    export_environment_variables()
    {
        export NSR_VOLUME_POOL 
        ...
        export new_NSR_variable 
    }
    

For complete details on the preconfigured settings and valid values for NetWorker XBSA environment variables, see Appendix A, “XBSA Environment Variables.”


Caution: NetWorker and ON-Bar rely on shared XBSA libraries for interaction during backups and restores.  Create a symbolic link, using the appropriate shared library file extension for your system.  In the following example, which creates a symbolic link between the NetWorker and ON-Bar XBSA libraries, “so” indicates the file extension for most UNIX systems.


# ln -s /usr/lib/libbsa.so /usr/lib/ibsad001.so 

Using a Backup Group

You can assign one or more OnLine Dynamic Server instances to a group of NetWorker clients.  NetWorker groups allow you to distribute backups to alleviate network traffic and schedule backups for a time of day when performance demands on your database and NetWorker servers are lower.

What Is a Backup Group?

A backup group is a NetWorker server resource that allows NetWorker clients assigned to a group to start backing up files at a designated time once you enable the autostart feature.  Data backed up for a NetWorker group can be written to a specific set of media, or allowed to mix with backup data from other NetWorker groups.

NetWorker provides a preconfigured group named “Default,” which is shipped with these preconfigured settings:

  • Autostart = Disabled

  • Start time = 3:33

  • Client retries = 0

  • Clones = No

  • Clone pool = Default Clone


    Note: You can modify the Default group's attributes, but you cannot delete Default from the list of NetWorker groups.


Suggestions for Setting Up BusinesSuite Module for Informix Groups

If you have a large number of OnLine Dynamic Server instances, consider creating backup groups with different start times to help reduce network traffic.  You can have any number of backup groups configured on your NetWorker server.

When you select a start time for each group, be sure to schedule them far enough apart so one group completes its backup before the next group begins.

To send a copy of the server's bootstrap report to a specific printer, edit the group's resource using the “view details” option (for UNIX), or “expert mode” (for NT).  Enter the designated name of the printer in the printer attribute for the group.  Refer to the IRIX NetWorker Administrator's Guide and the nwadmin(1M) reference page for details on using the “view details” and “expert mode” options.

For instructions on how to set up a backup group, refer to the section, “Configuring Backup Groups,” in the IRIX NetWorker Administrator's Guide.


Caution: Be sure to enable the Autostart option for the group you configure.  Otherwise, the group's scheduled backup will never occur.


Using Volume Pools

NetWorker provides a means for directing your backups to specific sets of media.  Volume pools allow you to establish a logical and systematic method for tracking, organizing, and sorting your backup data.  Volume pools always have a label template associated with them, so as to provide an automated method of identifying media assigned to a pool.

What Is a Volume Pool?

A volume pool is an assigned collection of backup volumes containing specific data sorted during a NetWorker backup.  All NetWorker volumes belong to a pool, either one preconfigured by NetWorker or one you create.

In the nwadmin Pools window, each pool has a Pool type designation, indicating whether the volume contains data that has been archived, backed up, or cloned.  For BusinesSuite Module for Informix, the only valid pool types are Backup and Backup clone.

Volume pools provide the ability to segregate backed-up data, such as Informix dbspaces, blobspaces, and logical logs.  Pools also allow you to direct backup data to specific devices.

You choose how NetWorker sorts backups, sending data to specific volumes labeled for the pool.  You can sort NetWorker filesystem backup data by several categories:

  • backup group

  • backup level

  • NetWorker client

  • object type

  • save set

For more information about using NetWorker volume pools see Chapter 5, “Managing Media and Backup Devices,” in the IRIX NetWorker Administrator's Guide.

Customizing Volume Pools

As part of the BusinesSuite Module for Informix installation process, you ran a script named dbmi_config, which created two volume pools and their associated label templates on the NetWorker server:

  • the DBMIData pool and a label template for dbspace and blobspace backups

  • the DBMILogs pool and a label template for logical log backups

The pool names DBMIData and DBMILogs are assigned to their respective NetWorker XBSA environment variables, NSR_DATA_VOLUME_POOL and NSR_LOG_VOLUME_POOL, in the nsrdbmi client script on the system running OnLine Dynamic Server.

BusinesSuite Module for Informix uses the NetWorker XBSA environment variables NSR_DATA_VOLUME_POOL and NSR_LOG_VOLUME_POOL to determine where to send OnLine Dynamic Server backup data—you do not need to assign a group or client to the pool.  The nsrdbmi entry in the client Backup command relays the information needed to direct dbspace, blobspace, and logical log backups to the correct backup media.


Caution: If you elect to have ON-Bar back up logical logs automatically as they become full, modify the automatic log backup script $INFORMIXDIR/etc/log_full.sh on the system running OnLine Dynamic Server to include the lines:


NSR_LOG_VOLUME_POOL="DBMILogs"
NSR_SERVER=NetWorker_servername
export NSR_LOG_VOLUME_POOL
export NSR_SERVER

If you customize a pool for log file backups, replace DBMILogs with the name of the custom pool.

Continuous log file backups require a dedicated device and media availability.  See “Performing Continuous Logical Log Backups” in Chapter 4 for more information on continuous log file backups.

You may want to organize backup data even further, for example, by department, type of database maintained, or level of backup.  To customize media organization for BusinesSuite Module for Informix do the following:

  • Create label templates for OnLine Dynamic Server data and logical log backups.

  • Create a volume pool.

  • Copy the nsrdbmi script template, and modify values assigned to the NetWorker XBSA environment variables NSR_DATA_VOLUME_POOL and NSR_LOG_VOLUME_POOL.

Creating a Volume Label Template

NetWorker generates labels for backup volumes according to the rules of a label template configured on the NetWorker server.  To create a new label template, you devise a name for the label template, specify the fields to use in the label, provide an alphabetic or numeric range for the volumes, and select a separator to use between fields.  The order in which you enter the fields determines the order of the fields in the label template.  The first field you enter is the first field NetWorker uses in the label template.


Note: The label template's name cannot include any of the characters reserved for use as field separators.  NetWorker displays a “Character invalid in name…” message if you try to save a configuration that contains a field separator in the label template name.

After you create a label template and click the Apply button, NetWorker displays the label it applies to the next volume in the pool associated with the label.  The label template is added to the list of label template choices available for NetWorker volume pools.

Figure 3-1 provides an example of a customized label template.

Figure 3-1. Custom Label Template on NetWorker Server

Figure 3-1 Custom Label Template on NetWorker Server

Refer to “Customizing NetWorker Backups” and “Labeling and Mounting Backup Volumes” in the IRIX NetWorker Administrator's Guide shipped with your NetWorker server software for complete instructions on using NetWorker label templates.

Creating a Volume Pool for BusinesSuite Module for Informix

By default, NetWorker and BusinesSuite Module for Informix use the DBMIData volume pool for dbspaces and blobspaces, and the DBMILogs volume pool for logical logs associated with backed-up dbobjects.

To create a custom pool for BusinesSuite Module for Informix, choose Pools from the Media menu of nwadmin, and in the Pools window:

  1. Create a name for the data pool.

  2. Select Backup for the pool type.

  3. Select a custom label template you created.

  4. Enter the pool's name in the Save sets field and add it to the list.  BusinesSuite Module for Informix only uses this designation to meet the NetWorker requirement for having at least one attribute defined for a pool.

  5. Select a device from the choices displayed.

  6. Apply the settings.

  7. Repeat steps 1 through 6 for the logical logs pool.

When you click the Apply button, NetWorker adds the pool to its list of volume pools.  The pool is also added to the choices available for labeling volumes.  When you select a pool for labeling volumes, NetWorker uses the label template you created and assigned to the pool to display the next label available in the series, as shown in Figure 3-2.

Figure 3-2. Label Window on NetWorker Server With Custom Pool

Figure 3-2 Label Window on NetWorker Server With Custom Pool

Modifying the Pool Variables in the nsrdbmi Script

Once you have added custom data and logical log volume pools to the NetWorker server's resource database, you need to copy and modify the nsrdbmi script to assign the new values to the NetWorker XBSA pool variables:

  • NSR_DATA_VOLUME_POOL

  • NSR_LOG_VOLUME_POOL

Refer to “Using Volume Pools” in the IRIX NetWorker Administrator's Guide shipped with your NetWorker server software for complete instructions on creating NetWorker pools.

Using NetWorker Backup Schedules

NetWorker uses backup schedules to automate the level of a scheduled backup.  The NetWorker server's administration program provides a calendar that accepts entries designating the level of backup that should occur on a given day of the week.


Tip: You can start a scheduled backup at any time by using the Group Control window in the NetWorker administration program.  Refer to “Monitoring and Controlling Backups” in the IRIX NetWorker Administrator's Guide for instructions on using this feature.

NetWorker provides several preconfigured schedules for use in backing up filesystems.  These schedules support backup levels not available with ON-Bar.  You need to create a custom schedule for backups of your OnLine Dynamic Server.

The nsrdbmi script translates ON-Bar backup levels to valid NetWorker levels, as shown in Table 3-1.  Create a schedule for your OnLine Dynamic Server backups, using the information provided in Table 3-1 and the instructions provided in “Setting up Backup Schedules” in the IRIX NetWorker Administrator's Guide.

If your OnLine Dynamic Server manages a significant amount of data, consider scheduling a full backup of an instance every one to two weeks and incremental backups on the other days to protect data that changes between full backups.

Table 3-1. ON-Bar and NetWorker Backup Levels

ON-Bar

NetWorker

Amount of Data Backed Up

0

full

All pages containing data for the instance listed in the save set entry

1

1

Pages that have changed since the last level full backup

2

2

Pages that have changed since the last level 1 backup

 

skip

Skip the scheduled backup—no data is backed up

Figure 3-3 shows a custom backup schedule that performs a full backup every Monday, followed by level 1 backups on Tuesday and Friday.  The remaining days are scheduled as level 2 backups.

Figure 3-3. Custom BusinesSuite Module for Informix Schedule

Figure 3-3 Custom BusinesSuite Module for Informix Schedule


Caution: If you use a value other than those listed for NetWorker in Table 3-1, backups will fail and generate the error message “Only level 0 (full), 1, or 2 backups allowed.”


Using NetWorker Policies

NetWorker uses browse policies for the client index entries and retention policies for the media index entries to manage and reduce the size of the online indexes.  You can choose one of the preconfigured policies provided with NetWorker or create policies of your own.  A policy can be used as either a browse or a retention policy.

You can also manage indexes manually using the Indexes and Volumes windows.  See “Manually Managing the Online Indexes” in Chapter 3 of the IRIX NetWorker Administrator's Guide for a discussion of manual index management and index policy.

You should keep copies of your logical log file backups until the associated dbobject save sets have exceeded their browse policy.


Caution: NetWorker does not allow a browse policy to exceed its retention policy.  An entry for a save set must be removed from the file index before the save set can be removed or marked recyclable in the media index.


NetWorker Backup Clients

NetWorker uses a client-server model to provide storage management services.  At least one machine on the network is designated as the NetWorker server.  Machines with data to back up are configured as clients of the NetWorker server.

You can configure NetWorker clients using the Clients window of the NetWorker administration program.  NetWorker maintains the resource information and contacts clients listed in a backup group configured on the server, performs on–demand backups when a client request is received, and restores data upon request from the client.

The NetWorker server maintains the online file and media indexes.

What is a NetWorker Client?

A NetWorker client is a resource configured on the NetWorker server.  The client resource provides the server with information about the data to back up for a client, how long to maintain entries for the data in the online index for recovery (browse policy), and how long to keep the media containing the client's backed-up data (retention policy).

Creating a NetWorker Client

To set up a system running OnLine Dynamic Server as a NetWorker client:

  1. Run the nwadmin program on the NetWorker server.

  2. Choose Client Setup from the Clients menu; the Clients window appears, as shown in Figure 3-4.

  3. Select a browse policy and a retention policy.

  4. Select a group.  You might want to create a custom group for database backups.

  5. Specify a save set.  If you want to schedule an instance backup, enter the instance name.  The entry shown in the example is the equivalent of performing an onbar –b –L level on the “venus” instance:

    INFORMIX:/venus
    

    If you want to schedule a selected-dbobject backup, include the dbspace or blobspace name in the save set string.  You can specify more than one dbobject by making a separate save set entry for each dbobject.  The entry shown in the example is the equivalent of performing onbar –b –L level dbspace01 on the “venus” instance:

    INFORMIX:/venus/dbspace01
    


    Caution: To perform a whole-system backup, you must use the ON-Bar command line interface.  See Chapter 4 for information on invoking on-demand BusinesSuite Module for Informix backups using the ON-Bar command-line interface.

    Refer to the INFORMIX—Online Dynamic Server Backup and Restore Guide included with your OnLine Dynamic Server software for further details about the types of backups supported by ON-Bar.


    Tip: You can set up multiple instances of OnLine Dynamic Server that exist on the same system as separate NetWorker client resources.  Create a custom copy of the nsrdbmi script and change the value assigned to the ONCONFIG variable to reflect the value assigned for the instance.


  6. Enter nsrdbmi or the pathname of a custom nsrdbmi in the Backup command field.

  7. Specify all known aliases for the system where OnLine Dynamic Server is installed.

  8. Leave the attributes for directives, remote access, remote user, and archive users blank.  Data compression is controlled by the nsrdbmi script.

  9. Click Apply to save the client resource.


    Tip: To send an e-mail notification of the results of a scheduled backup to the owner of a save set, use the “view details” option (for UNIX) or “expert mode” (for NT) to edit the NetWorker client resource for the OnLine Dynamic Server instance.  Scroll down to the Owner notification field and enter a notification command directed to the login ID of the owner.  For example:


    /usr/ucb/mail -s "jupiter-mars-venus backup" jdoe
    

Refer to Chapter 3, “Configuring and Monitoring Clients,” in the IRIX NetWorker Administrator's Guide shipped with your NetWorker server software for more details on using the NetWorker administrative graphical interface to configure a client.

Figure 3-4. Database Server as the BusinesSuite Module for Informix Client

Figure 3-4 Database Server as the BusinesSuite Module for Informix Client

Viewing the Results of a Backup

NetWorker provides several reports about the results of a backup:

  • An e-mail “savegroup completion” notification upon completion of a scheduled backup.  You can edit the notification setup for this report, using the Customize manu of the nwadmin program.  See “Setting up Event Notification” in the IRIX NetWorker Administrator's Guide for details about customizing notifications.

  • A series of messages written to the NetWorker message log files.  Refer to Appendix B, “Error Messages.” for more information about NetWorker and NetWorker XBSA messages.

  • A scrolling list of messages displayed in the main window of the NetWorker administrative graphical interface:

    Mon 11:56:00 media event cleared: backup to pool `DBMIData' waiting for 1 writable backup disk or tape
    Mon 11:56:39 mars:INFORMIX:/venus/dbspace01 saving to pool `DBMIData' (DBMIData.001)
    Mon 11:59:15 mars:INFORMIX:/venus/dbspace01 done saving to pool `DBMIData' (DBMIData.001)
    

  • A scrolling list of messages displayed in the Group Control window of the NetWorker administrative graphical interface.  These messages are displayed in three lists: pending save sets, completed save sets, and failed save sets.  You have the option of printing a columnar version of the details displayed in the Group Control window—first choose Tabular from the View menu.

  • A printout of the NetWorker server's bootstrap information for the backup session, showing the date, time, level, save set ID, file position in the save set entry, and the volume(s) to which the save sets were written (the last entry is for the backup of the server's bootstrap save set):

    August 26 01:30 1996 mars's bootstrap information Page 1
    date     time      level   ssid    file   record  volume
    8/26/96  11:59:15  full    16540   1      0       venus.DBMIData.001
    8/26/96  12:02:39  full    16564   1      0       venus.DBMILogs.001
    8/26/96  12:05:44  full    16566   1      0       venus.001
    

The completion reports do not show information distinguishing individual dbobject names.

To view the NetWorker server's index entries for dbobjects backed up for an OnLine Dynamic Server instance, use the nsrinfo command:

# nsrinfo -s jupiter -n informix -X informix mars 
scanning client `mars' for all savetimes on server jupiter
/venus/rootdbs/0, rootdbs, 1.2 MB, Mon Aug 26 12:05:44 1996, full
/venus/01/29, logical log, 123 KB, Mon Aug 26 12:02:39 1996, 3 objects found

Refer to the nsrinfo(1M) reference page and the IRIX NetWorker Administrator's Guide for complete information on using the nsrinfo command.

Alternatively, you can query the ON-Bar catalog tables bar_action and bar_object to determine which backup or restore action occurred on database objects in an OnLine Dynamic Server instance.  Refer to the documentation included with the OnLine Dynamic Server software for details on querying catalog tables for information.

The IRIX NetWorker Administrator's Guide provides complete details about the reports generated by NetWorker.  For suggestions on using these reports as a part of your disaster recovery plan, refer to the documentation provided with your NetWorker server software.

Chapter 4 provides information on performing a manual, on–demand backup of OnLine Dynamic Server.