This chapter provides details on using NetWorker to set up the system running the Oracle7 Server as a client of the NetWorker server for scheduled backups of Oracle7 Server tablespaces. It also describes the nsrdmo script that connects NetWorker and the Enterprise Backup Utility.
NetWorker can be configured to execute obackup on a regular schedule. Typically, you might schedule a backup of the archived logs daily, with a full backup of the database once per week.
NetWorker backs up your Oracle7 Server according to a schedule you set up. You add the Oracle7 Server to the NetWorker server's list of clients and specify what you want backed up and how.
For complete information on using the NetWorker administrative program, refer to the IRIX NetWorker Administrator's Guide.
When you install BusinesSuite Module for Oracle on your Oracle7 Server system, the installation places a working copy of the nsrdmo script in the same directory as the NetWorker executables. A template of the script, nsrdmo.sh, is also installed in the /etc directory for developing customized nsrdmo scripts.
You can modify the options in the nsrdmo script, or customize nsrdmo scripts to control the backup of different instances of Oracle7 Server.
To create a customized version of nsrdmo:
Copy the nsrdmo template, nsrdmo.sh, to a new file such as nsrdmo2.
# cp /etc/nsrdmo.sh /usr/etc/nsrdmo2 |
Use your text editor and open the copied script to modify it.
The OBK_HOME environment variable defines where the Oracle7 Enterprise Backup Utility is installed. The OBK_HOME variable in the nsrdmo script is not assigned any value, by default. Change the value assigned to OBK_HOME in nsrdmo to the pathname of the directory where the Enterprise Backup Utility is installed on your system.
For example, if the Enterprise Backup Utility is installed in the directory /disk/app/oracle/product/7.3.2/obackup on your system, set the OBK_HOME variable to the following value in the nsrdmo script:
# Variable: OBK_HOME # Default value: site specific # Description: Specifies where Enterprise Backup Utility is installed. # This variable must be configured to locate the obackup executable OBK_HOME = /disk/app/oracle/product/7.3.2/obackup |
![]() | Caution: By default, OBK_HOME is set to an empty string in the nsrdmo script. If this variable is not set correctly prior to starting a scheduled backup, the backup fails. |
The PATH environment variable must be configured to include the path to the Enterprise Backup Utility executables and the NetWorker program mminfo. The nsrdmo script already includes the following PATH variable settings for the different platforms:
PATH = /bin:/usr/sbin:/usr/etc |
If the NetWorker executables are in a different directory, change the PATH variable.
The nsrdmo shell script contains pre- and post-processing command variables that allow the execution of scripts before and after a scheduled backup.
Before running obackup, nsrdmo executes the pre-processing command script. If that script returns a non-zero code to nsrdmo, then nsrdmo will fail, and the database backup will not proceed. However, even when the obackup command fails, the post-processing command is executed regardless.
The nsrdmo script executes as root. To connect to a database instance, Oracle7 Server requires that the effective group of the user be dba. Just being a member of that group does not grant correct privileges. The pre- and post-processing command script must set the effective group dba.
In the pre- and post-processing command scripts, the effective group can be set to dba by using the following template:
#!/bin/sh #export required environment variables ORACLE_HOME = <path_name> export ORACLE_HOME ORACLE_SID = <sid> export ORACLE_SID PATH = /usr/etc:$ORACLE_HOME/bin export PATH #file for error logging ERRFILE = /tmp/$ORACLE_SID.log <commands> su oracle << EEOF svrmgrl << EOF > $ERRFILE <sql commands> EOF EEOF #check for errors in the error file grep -e ORA- -e error -e warning -e fatal $ERRFILE if [ $? = 0 ]; then exit 1; else exit 0; fi <commands> |
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 shuts down the database before an offline backup.
If the script returns a non-zero value, the backup session fails, and an error message indicates the failure. If the PRECMD fails, the nsrdmo script assumes the database is in a non-ready state, and the database backup does not proceed.
The following is an example script to shut down the database:
#!/bin/sh #export required environment variables ORACLE_HOME = /oracle export ORACLE_HOME ORACLE_SID = TARGET01 export ORACLE_SID PATH = /usr/etc:$ORACLE_HOME/bin export PATH #file for error logging ERRFILE = /tmp/$ORACLE_SID.log su oracle << EEOF svrmgrl << EOF > $ERRFILE connect internal shutdown normal EOF EEOF #check for errors in the error file grep -e ORA- -e error -e warning -e fatal $ERRFILE if [ $? = 0 ]; then exit 1; else exit 0; fi |
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 starts up the database.
If the script returns a non-zero value, an error message indicates the failure. Operator intervention might be required to return the database to a ready state.
If the database backup fails (the Enterprise Backup Utility reports an error), the POSTCMD is still executed. Also, if the Enterprise Backup Utility fails, its final exit status is always reported, even if the POSTCMD subsequently fails as well.
The following example script starts up the database:
#!/bin/sh #export required environment variables ORACLE_HOME = /oracle export ORACLE_HOME ORACLE_SID = TARGET01 export ORACLE_SID PATH = /usr/etc:$ORACLE_HOME/bin export PATH #file for error logging ERRFILE = /tmp/$ORACLE_SID.log su oracle << EEOF svrmgrl << EOF > $ERRFILE connect internal startup EOF EEOF #check for errors in the error file grep -e ORA- -e error -e warning -e fatal $ERRFILE if [ $? = 0 ]; then exit 1; else exit 0; fi |
The nsrdmo shell script contains several NetWorker BusinesSuite Module environment variable settings shared by NetWorker and Enterprise Backup Utility for backup tasks. The script is already configured to the default settings shown in “Appendix A, “Environment Variables.” You can modify NetWorker BusinesSuite Module for Oracle settings shown in the script to any of the valid values outlined in Appendix A.
To modify BusinesSuite Module for Oracle variables not shown in the nsrdmo script:
Copy the /etc/nsrdmo.sh template to a new file and open the new file with your text editor.
Add the NetWorker BusinesSuite Module for Oracle environment variable and the value you want assigned to it in the area of the script marked “Configuration variables, modifiable by users.”
Add the NetWorker BusinesSuite Module for Oracle 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 BusinesSuite Module for Oracle environment variables, see “Appendix A, “Environment Variables.”
A backup group is a set of NetWorker clients that starts 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.
You can assign one or more Oracle7 Server instances (NetWorker client resources) to a group. NetWorker groups are sets of NetWorker clients that are backed up at the same time. NetWorker groups allow you to distribute backups to lighten network traffic and schedule backups for a time of day when performance demands on your database and NetWorker servers are lower.
NetWorker provides a preconfigured group named “Default,” which is shipped with 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. |
If you have a large number of Oracle7 Server instances, consider creating backup groups with different start times to help reduce network traffic and load on the NetWorker server. You can have any number of backup groups configured on a 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 starts.
To send a copy of the server's bootstrap report to a NetWorker server's printer, run nwadmin and choose Groups from the Customize menu. In the Groups window, choose Details from the View menu, or choose “expert mode” (for Windows 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 (or NT cluhelp) for more details on using the “view details” or “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.
![]() | Tip: Be sure to enable the Autostart option for the group you configure. Otherwise, the group's scheduled backup will never occur. |
NetWorker uses a client-server model to provide storage management services. At least one system on the network is designated as the NetWorker server. Systems with data to back up are configured as clients of the NetWorker server.
You configure NetWorker clients using the Clients window provided by the NetWorker administration program. NetWorker maintains the resource information and contacts clients listed in a backup group configured on the server. NetWorker also performs on–demand backups when a client requests one, and restores data upon request from the client. The online file and media indexes are maintained by the NetWorker server.
A NetWorker client resource is a specific set of attributes, assigned to a client and stored 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).
To set up a system running Oracle7 Server as a NetWorker client:
Create a client resource on the NetWorker server.
Select a browse policy. If you want to be able to recover data from one month back, select one month for the browse. Also select a retention policy at least as long as the browse policy. If you want tapes to recycle after six months, set the retention policy to six months.
Select a group. For further information on NetWorker back up groups, see “NetWorker Backup Groups”.
Specify a save set by entering the full pathname of the obackup command script in the save set field. If you want the command obackup /oracle/obackup/scripts/online to run for the scheduled backup, enter the pathname of the script in the save set field:
/oracle/obackup/scripts/online |
Enter nsrdmo or the name of a customized version of nsrdmo as the entry for “Backup command.” Do not put a slash (/) in front of the name. The command name entered in this field must begin with the prefix nsr or save.
Specify all known aliases for the system where Oracle7 Server is installed.
Leave the attributes for directive, remote access, remote user, and archive users blank. Data compression is controlled by the nsrdmo script.
Save the client resource.
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 Windows NT®) to edit the NetWorker client resource for the Oracle7 Server instance. Edit the “owner notification” attribute and enter a notification command directed to the login ID of the owner. For example:
/usr/bsd/mail -s “jupiter-mars-venus backup” jdoe |
Refer to Chapter 3, “Configuring and Monitoring Clients,” in the IRIX NetWorker Administrator's Guide for details on using the NetWorker administrative graphical interface to configure a client.
NetWorker has a way to direct backups to specific sets of media, called volume pools. Volume pools establish a logical and systematic method for tracking, organizing, and sorting backup data. Volume pools always have a label template associated with them, so as to identify media assigned to a pool.
A volume pool is an assigned collection of backup volumes (such as tapes). All NetWorker volumes belong to a pool, either one preconfigured by NetWorker or one you create. Each pool has a Pool type designation, indicating whether the volume contains data that has been archived, backed up, or migrated. For BusinesSuite Module for Oracle, the only valid pool types are Backup and Backup clone.
Volume pools allow you to establish a logical and systematic method for tracking, organizing, and sorting your backup data. Volume pools must always have a label template associated with them, to allow an automated way for NetWorker to identify media assigned to a pool.
Volume pools provide the ability to segregate backed-up data such as tablespaces and archived redo logs onto different sets of media. Pools also allow you to direct backup data to specific devices.
NetWorker uses the choices you select to sort backed-up data to specific backup volumes labeled for the pool. You can sort your NetWorker filesystem backup data by categories:
Backup group
NetWorker client
For more information about using NetWorker volume pools, refer to Chapter 5, “Managing Media and Backup Devices,” in the IRIX NetWorker Administrator's Guide.
You might want to organize your backup data in different ways, such as by department, type of database maintained, or level of backup. You can send your database backups to separate media, simply by setting up a volume pool for those database backups. To customize media organization for BusinesSuite Module for Oracle:
Create label templates for Oracle7 Server data and archived redo log backups.
Create a volume pool.
NetWorker generates labels for backup volumes (tapes) according to the rules of a label template configured on the NetWorker server. To add a label template, you create a name for the label template, specify the fields to use in the label, provide the alphabetic or numeric range for the volumes, and select a separator to use between the fields. The order in which you enter the fields determines the order of the fields in the label templates. The first field you enter is the first field NetWorker will use 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. |
When you apply the configuration, NetWorker displays the label to apply to the next volume in the pool you associate with the label. The label template is also added to the choices available for label template selection for NetWorker volume pools. Figure 5-2 provides an example of a customized label template.
Refer to “Customizing NetWorker Backups” and “Labeling and Mounting Backup Volumes” in the IRIX NetWorker Administrator's Guide for complete instructions on using the NetWorker label templates.
To create a customized pool for BusinesSuite Module for Oracle, edit the Pools resource on the NetWorker server:
Create a name for the data pool; for example, DMOData.
Select Backup for the pool type.
Select the customized label template you created.
Enter the pool's name in the Save sets field and add it to the list. BusinesSuite Module for Oracle uses this designation to meet the NetWorker requirement to name at least one attribute defined for a pool.
Select a device from the choices displayed.
Select level Full. Otherwise, the indexes will write to the Default pool.
Apply the settings.
When you apply the configuration, NetWorker adds the pool to its list of volume pool resources. 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 for displaying the next label available in the series, as shown in Figure 5-3.
Refer to “Using Volume Pools” in the IRIX NetWorker Administrator's Guide for complete instructions on creating NetWorker pools.
NetWorker uses backup schedules to automate the level of a scheduled backup. The NetWorker server's administration program provides a graphical calendar that accepts entries designating the level of backup that should occur on a given day of the week.
NetWorker provides several preconfigured schedules for use in backing up filesystems. These schedules support backup levels are not available with the Enterprise Backup Utility, so you need to create a schedule for backups of your Oracle7 Server.
Figure 5-4 shows a customized Oracle7 server backup schedule that performs a full backup every Monday, Wednesday, and Friday. A backup level of skip is selected for the remaining days, so no backup is performed on those days.
Because Enterprise Backup Utility supports full backups only, BusinesSuite Module for Oracle also supports full backups only. If you select a backup level of incremental or levels 1 to 9 from the NetWorker schedule, obackup will execute as though a full level were specified. In other words, obackup is either executed or not executed.
![]() | Tip: obackup does not support incremental backups or level 1 to 9 backups of Oracle databases. Specify level full to perform your backup and level skip to skip the backup. |
NetWorker uses browse policies for the client index entries (database object tracking) and retention policies for the media index entries (tape tracking) 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 the indexes manually with the Indexes and Volumes windows. See “Manually Managing the Online Indexes” in the IRIX NetWorker Administrator's Guide for a description of manual index management and index policy concepts.
The Enterprise Backup Utility requires client index entries in order to recover database objects. Set your browse policy to a period long enough that you will retain client indexes as far back as you may need to recover them.
Keep copies of your archived redo log file backups until the associated tablespace save sets have exceeded their browse policy.
After you have finished setting up your BusinesSuite Module for Oracle environment for scheduled backups of the Oracle7 database server, run a scheduled backup manually, as a test, using the NetWorker administration program.
Be sure you have all the required environment variables set in the nsrdmo script (or your customized version of the script), the required pre- and post-processing scripts in place, and the NetWorker server correctly configured as described in the preceding sections of this chapter, run a test of your scheduled Oracle backup as follows:
Log in as superuser on the NetWorker server machine.
Run the NetWorker administration program on the NetWorker server with the following command:
# nwadmin |
In the main window, choose Group Control from the Server menu, which opens the Group Control window.
In the Group Control window, highlight the correct group name for the scheduled Oracle backup and click Start.
![]() | Note: For important information regarding the use of the Stop button in the Group Control window, see the section “Stopping Scheduled Backups” below. |
When the status of the selected group in the Group Control window changes to Finished, the backup is complete. You will receive a “savegroup completion” message by e-mail, providing a report of the scheduled backup.
The BusinesSuite Module for Oracle does not currently support use of the Stop button in the Group Control window for scheduled backups. Although the progress message may indicate that the backup has exited prematurely before finishing, BusinesSuite Module for Oracle processes may still be running on the client.
In order to stop the BusinesSuite Module for Oracle processes on the client machine, you must perform the general procedure described below on the client system.
Use a cancel command script to stop a specified job and clean up its resources. Before you can use such a cancel command script, you must know the Enterprise Backup Utility job ID of the backup job to be cancelled. To find the job identifier, you can look in the log file being generated for the active job. For example, a line similar to the following will appear in the log file:
Started job 523 with pid=1280 on 12/21/1996 14:21:08 for database: |
When an obackup job cancels successfully, a message similar to the following appears in the obackup log file of the cancelled job:
OBK-2016: Job 523 failed due to being cancelled by user request (1) on 12/21/1998 14:22:40 [ 1288 : brccmd ] BACKUP job FAILED |
Using this method to cancel the job ensures that the Enterprise Backup Utility exits gracefully. This means that all backup save sets associated with the job are removed from the media, the Backup Catalog is properly cleaned up, and, if necessary, tablespaces currently being backed up are switched out of backup mode.
For example, to stop job 523, use this obackup command script named cancel_job:
cancel job_id=523 |
To cancel the job, run this script with the following command:
% obackup cancel_job |
When the script completes successfully, it displays the following output:
Oracle7 Enterprise Backup Utility: Release 2.1.0.1.2 Copyright (c) Oracle Corporation 1979, 1994. All rights reserved. CORE Version 3.5.3.0.0 - Production NLSRTL Version 3.2.3.0.0 - Production |
NetWorker provides several reports about the results of a backup:
An e-mail “savegroup completion” notice upon completion of a scheduled backup. You can edit the Notification for this report, using the Customize menu of the NetWorker administration program. See “Setting up Event Notification” in the IRIX NetWorker Administrator's Guide for details on using the NetWorker graphical interface to customize your 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 BusinesSuite Module for Oracle messages.
The Enterprise Backup Utility log file. This log provides details about the backup, and contains any Enterprise Backup Utility errors or warnings. It is located in the directory you specified with the log parameter in the obackup command script.
A scrolling list of messages displayed in the main window of the NetWorker administrative graphical interface. For example:
Wed 15:37:00 media event cleared: backup to pool `DMOData' waiting for 1 writable backup disk or tape Wed 15:37:27 mars:170784 saving to pool 'DMOData' (DMOData.001) Wed 15:39:29 mars:170784 done saving to pool 'DMOData' (DMOData.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.
A printout of the NetWorker server's bootstrap file for the backup session. This printout shows 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 file).
The IRIX NetWorker Administrator's Guide provides complete details about the reports generated by NetWorker.