Sample script details
The backup and recovery scripts that are described
in this document are functional samples. However, the scripts are
created to perform backup only a simple environment for the purposes
of illustration.
These scripts perform single channel backups to disk by using a recovery catalog. Customers need to add some level of customization to these scripts for the scripts to work in their environment. Examples of common changes include:
- Support for multichannel backups
- Support for tape backups
- Backups without using a recovery catalog
The specifics of how to perform these customizations are not covered within this document; however, an experienced Oracle DBA must be familiar with the concepts and changes that are needed.
If you decide not to use a recovery catalog, you must read the
Oracle documentation concerning the CONTROL_FILE_RECORD_KEEP_TIME parameter.
This parameter must be set to a value that is larger than the window
of time that is needed for backup retention. The default value of
this parameter (14 days) is not sufficient for the typical Tivoli
Netcool Performance Manager Wireline deployment. Most installations
set this parameter to 40 days (assuming a full backup reset is done
one time a month). But the actual value for your installation needs
to be determined based on your requirements.
logon.info
This file provides a common location of environment information that is used in the following scripts. It stores information such as user names and passwords instead of storing them in each script. The following scripts extract the necessary information from the logon.info file. Therefore, a copy of this file must exist and be accessible by the user who is running these scripts.
PV_Tbsp_Alter_ReadOnly.ksh
The ALTER_TBSP_TO_READONLY procedure is called directly through SQL*Plus or through the dbMgr utility. This sample script is a wrapper around the SQL*Plus call of this stored procedure. The script detects whether the previous iteration of the script is still running. As mentioned in an earlier section, an edit to READ ONLY command can hang if there are open uncommitted transactions on the database. (For example, someone updates a row in SQL*Plus and then goes home for the weekend. This sample script exits if the previous run is still active. The script can be customized for specific locations. Examples of customizations include the following:
- Sending an email if the previous iteration is still running.
- Sending a page if the previous iteration is still running.
- Executing another script if the previous iteration is still running.
- Changing the number of days worth of logs to keep.
If this script, or one like it, call the associated dbMgr command in the crontab. The command must normally be called once or twice per day. For more information about the dbMgr utility, see QLAB1026D
PV_Hot_Skip_Readonly.ksh
The PV_Tbsp_Alter_ReadOnly.ksh script
uses Oracle's RMAN utility to perform a hot backup of all tablespaces
that are not in READ ONLY mode.
PV_Readonly_Tbsp_Backup.ksh
The PV_Readonly_Tbsp_Backup.ksh script
queries the TBSP_BACKUP_DESC table and dynamically creates RMAN commands.
The RMAN commands perform a tablespace-level backup of every tablespace
that is in READ ONLY mode but is not backed up. It also formats the
commands that call the BACKUP_COMPLETE_FOR_RO_TBSP procedure. This
script then calls the generated script to perform the backup. By default,
this script backs up all eligible tablespaces, but you can restrict
the backup to a particular set type by using the “-st” command-line
option.
PV_Reset_Backup_Status.ksh
The PV_Reset_Backup_Status.ksh script
resets the backup state of the tablespaces that are stored in the
TBSP_BACKUP_DESC table. This script is used with the alternative backup
method. The script has a “-st” command-line option that you can use
to specify which set type to reset.
PV_partition_purge.ksh
The PV_partition_purge.ksh script
automates the management of metric data retention in the database.
You can call a dbMgr procedure purge data for a given
channel and set type, which results in the purging of metric data tablespaces.