Skip Headers
Oracle® Application Server Administrator's Guide
10g Release 2 (10.1.2)
B13995-06
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

20 Oracle Application Server Backup and Recovery Tool

This chapter describes how to install, configure, and use the Oracle Application Server Backup and Recovery Tool.

It contains the following topics:

20.1 How to Obtain the Oracle Application Server Backup and Recovery Tool

The Oracle Application Server Backup and Recovery Tool is installed as part of an Oracle Application Server installation. The tool is located in the Oracle_Home/backup_restore directory. Table 20-1 lists the files that may reside in the backup_restore directory.

Table 20-1 OracleAS Backup and Recovery Tool Files

FileFoot 1  Description
bkp_restore.pl

bkp_restore.sh

bkp_restore.bat

If you have installed TopLink or MRCA, run this Perl script.

A shell script used to run the Perl script on UNIX.

A batch command file used to run the Perl script on Windows.

config/config.inp

The main configuration file that contains parameters for customizing the tool for your environment. The orainst_loc_path field must be changed only if the instance is installed with the –invPtrLoc option installer command-line option. It must be changed to reflect the nonstandard location of oraInst.loc.

config/config_<component>_files.inp

Component configuration files—each contains a list of configuration files for a particular component. These specify which files to back up when performing a configuration file backup. See Section 19.2.2, "Oracle Application Server Component Backup Input Files" for a list component configuration files.


Footnote 1 Paths are relative to the root of the OracleAS Backup and Recovery Tool directory.

See Also:

"Oracle Application Server Installation Guide" for information about installing the Oracle Application Server.

20.1.1 Manually Installing the OracleAS Backup and Recovery Tool

If you are running TopLink, in standalone mode, or RepCA, in an existing database, you must install the OracleAS Backup and Recovery Tool manually. Before you install the OracleAS Backup and Recovery Tool, review the following notes:

  • You must install the tool on the same host as its corresponding installation. You can install the tool in the Oracle home of its corresponding installation, or you can install it into a directory outside of the Oracle home.

  • The tool requires a Perl 5.6.1 interpreter, or later. You can obtain the interpreter from the Perl site: http://www.perl.org, or you can use the Perl interpreter that ships with Oracle Application Server:

    • On UNIX systems:

      ORACLE_HOME/perl/bin/perl
      
      
    • On Windows systems:

      ORACLE_HOME\perl\5.6.1\bin\MSWin32-x86\perl.exe
      
      
  • The tool requires that J2SE Development Kit (JDK) be in the execution path. You can obtain the JDK at: http://java.sun.com/j2se.

To install the OracleAS Backup and Recovery Tool:

  1. Log in as the user who installed Oracle Application Server.

  2. Extract the backup_restore.jar from the MRUA + Utilities cd which is located in the directory: CD_ROM/utilities/backup/backup.jar, for example:

    cd ORACLE_HOME
    jar xvf
    CD_ROM/utilities/backup/backup.jar
    
    

    If you install the Oracle Application Server Metadata Repository Upgrade Assistant, then the file backup_restore.jar is automatically extracted for you and put in directory ORACLE_HOME/utilities/backup

    Once you have obtained the backup_restore.jar, extract its contents into the Oracle home of the Toplink or RepCA installation. For example:

    cd ORACLE_HOME
    jar xvf utilities/backup/backup_restore.jar
    
    
  3. On UNIX, make sure the bkp_restore.sh file has execute permission, for example:

    chmod 755 ORACLE_HOME/backup_restore/bkp_restore.sh
    
    
  4. Familiarize yourself with the OracleAS Backup and Recovery Tool files, which are described in the Table 20-1. Instructions for editing the configuration files are in subsequent steps.

20.2 Using Oracle Application Server Control to Configure the Backup and Recovery Tool

You can use Oracle Application Server Control to configure the Backup and Recovery Tool by performing the following steps:

  1. Login into Oracle Application Server Control. The Application Server Control Console displays:

    Oracle Application Server Control Console
    Description of the illustration asadm038.gif

  2. Click BackupRecovery. The Backup and Recovery screen displays:

    Screen with warning that Backup/Recovery not configured
    Description of the illustration asadm039.gif

  3. If the Backup and Recovery Tool has not been configured, a warning screen displays stating that the tool is not configured. Click Configure BackupRecovery Settings. Depending on the type of installation, the midtier configuration screen or the Infrastructure configuration screen displays:

    Midtier backup and recovery configuration screen.
    Description of the illustration asadm040.gif

    For the midtier configuration screen, enter the following information for each field:

    • Log File Location—Enter the directory where you want the log file for backup and recovery stored. You should allow for several megabytes of disk space. In the preceding example screen the default location is shown.

    • Configuration Files Backup Location—Enter the directory where you want the backups of configuration files stored. You should allow for several hundred megabytes of disk space. In the preceding example screen, a location is filled in as an example. If the Backup and Recovery Tool is not configured, this field is blank.

    Infrastructure backup and recovery configuration screen.
    Description of the illustration asadm041.gif

    For the Infrastructure configuration screen, enter the following information for each field:

    • Log File Location—Enter the directory where you want the log file for backup and recovery stored. You should allow for several megabytes of disk space.

    • Configuration Files Backup Location—Enter the directory where you want the backups of configuration files stored. You should allow for several hundred megabytes of disk space.

    • Metadata Repository Database Backup Location—Enter the directory where you want the backups of the metadata repository database stored. You should allow for several hundred gigabytes of disk space.

    • Metadata Repository Database SID—This field is automatically filled in. Change it only in the case where the database SID has changed since installation.

  4. Click OK. If any of the specified directories do not exist, a confirmation screen displays:

    Confirmation screen about existence of specified directories
    Description of the illustration asadm042.gif

  5. Click Yes to have the directories created, or click No to create the directories manually. Once a successful configuration completes, a confirmation screen displays a message stating that configuration was successful, or the screen displays a message stating that the configuration was unsuccessful.

    Corfirmation screen about the success of the configuration
    Description of the illustration asadm043.gif

20.3 How to Configure the OracleAS Backup and Recovery Tool Manually

This section describes how to configure the OracleAS Backup and Recovery Tool manually. You must follow these steps for each installation in your environment.


Note for Windows Users:

Do not use a rich text editor, such as WordPad, when editing files in the Backup and Recovery Tool directory. It inserts a return character at the end of each line that may cause the tool to fail. Oracle recommends that you use a basic text formatter, such as Notepad, instead.

  1. Prior to running the Backup and Recovery Tool, set ORACLE_HOME for your environment. If the instance is an Infrastructure installation, set ORACLE_SID to the Metadata Repository SID.

  2. If the installation is an Infrastructure or metadata repository, ensure that the database and the listener are up.

  3. The tool writes out log files and backup files, and you must specify the following directories to hold these. The default log file directory is ORACLE_HOME/backup_restore/logs. Edit config.inp to create the following directories:

    1. Log file directory: (Middle tier and Infrastructure) This directory holds log files created by the tool. This directory should have several megabytes of space.

    2. Configuration file backup directory: (Middle tier and Infrastructure) This directory holds configuration file backups. This directory should have several hundred megabytes of space.

    3. Database backup directory: (Infrastructure only) This directory holds datafile and control files backups of the Metadata Repository, as well as archived redo logs. This directory should have several gigabytes of space.

    Recommendations for creating these directories are as follows:

    • Create your backup directories on a file system on a separate disk and, if possible, a separate disk controller, than your Oracle Application Server Oracle home. This gives you the best chance of recovering data in the event of a hardware failure.

    • Make sure your backup directories are writable by the user that installed Oracle Application Server.

      For example, to create a log file directory, configuration file backup directory, and database backup directory on /disk1:

      On Unix:

      mkdir -p /disk1/backups/log_files
      mkdir -p /disk1/backups/config_files
      mkdir -p /disk1/backups/db_files
      cd /disk1/backups
      chmod 755 log_files config_files db_files
      chown OracleAS_user log_files config_files db_files
      
      

      On Windows:

      mkdir C:\backups\log_files
      mkdir C:\backups\db_files
      mkdir C:\backups\config_files
      
      
  4. Edit config.inp and modify the parameters as described in Table 20-2. Notice that some of the instructions are different depending on whether this is a middle-tier or Infrastructure installation.

Table 20-2 Parameters in config.inp

Parameter Value

oracle_home

Do not insert a value for this. If you invoke the Backup and Recovery Tool through Oracle Application Server Control, it will pass the oracle_home value corresponding to the instance. If you are using the command-line interface, set ORACLE_HOME in the shell environment first.

log_path

Specify the full path of the log file directory. If the full path is not specified, the default log directory ORACLE_HOME/backup_restore/logs is automatically created when the -m configure command is executed. If a log_path is specified in the config.inp file, but the specified directory does not exist, the Backup and Recovery Tool automatically creates the specified log directory whether or not the -f (force) option is used in the -m configure command. However, the configuration file backup directory and the database backup directory are not automatically created unless the -f option is specified.

config_files_list

Do not insert a value for this; leave it as config_files_list=DO_NOT_SET.

This parameter will be updated with the appropriate list of configuration files for your installation when you run bkp_restore.pl -m configure.

config_backup_path

Specify the full path of the configuration file backup directory.

install_type

Do not insert a value for this; leave it as install_type=DO_NOT_SET.

This parameter is updated with the appropriate value for your installation when you run bkp_restore.pl -m configure.

dbid

Do not insert a value for this; leave it as dbid=DO_NOT_SET.

For Infrastructure installations, this value is updated when you run bkp_restore.pl -m configure. By default, the tool obtains the dbid from the Metadata Repository. Or, you can supply a dbid in special cases involving migrating a Metadata Repository from one host to another, such as for Disaster Recovery.

For middle-tier installations, this value is untouched.

pfile

Middle-tier Installation:

Leave this line commented out.

Infrastructure:

If desired, specify an alternate pfile to use when starting up the database. Otherwise, leave the line commented out and the default spfile will be used:

  • For UNIX systems:

    ORACLE_HOME/dbs/spfileSID.ora
    
  • For Windows systems

    ORACLE_HOME\database\spfileSID.ora
    

Be sure to leave the pfile entry commented out if you want to use the default because blank values are not allowed in this file.

If the spfileorcl.ora file is not present at the default location, the following file will be used as pfile:

For UNIX:

ORACLE_HOME/dbs/initSID.ora

For Windows:

ORACLE_HOME\database\initSID.ora

If you want to use a different pfile, specify an alternate pfile name for starting up the database.

database_backup_path

Middle-tier Installation:

Do not insert a value for this; leave it as database_backup_path=VALUE_NOT_SET.

Infrastructure:

Specify the full path of the database backup directory.

orainst_loc_path

This parameter is used for UNIX platforms only. If the default path is overridden during installation, specify the full path of the directory where the oraInst.loc file exits. Otherwise, leave the parameter with the default value.

infra_with_portal

Do not insert a value for this; leave it as infra_with_portal=VALUE_NOT_SET. This parameter indicates whether the instance is an Infrastructure installation with registered portal middle-tiers.


Configure the tool by running it with the -m configure option, for example:

This updates parameters in config.inp and, in the case of an Infrastructure, creates customized .dat files, which are used to backup, restore, and recover the Metadata Repository.

You are now ready to use the OracleAS Backup and Recovery Tool.

20.4 Running the Portal Validation/Cleanup Utility

If your Oracle Application Server installation has a Metadata Repository Database (MRDB) with a registered Portal middle-tier, by default, the Portal Schema Validation/Cleanup Utility (SVU) runs during a backup of the MRDB. Running SVU provides a way to ensure the integrity of your data whenever you perform a backup of your database. If you do not want to run SVU, uncheck the Validate Portal Schema checkbox in the Oracle Application Server Control Backup screen. If you are using the command line, you can disable SVU by using the -z option:

For UNIX systems:

bkp_restore.sh -z -m backup_instance_cold

For Windows systems:

bkp_restore.bat -z -m backup_instance_cold

If you want to run SVU and your installation has Identity Management running in a different instance than the instance where the MRDB is installed, ensure that Oracle Internet Directory is running in the instance where Identity Management runs before performing a backup of the MRDB.

The Backup and Recovery tool runs SVU in "reporting" mode to flag data inconsistencies after performing a backup. Output from the SVU is saved in a file in the same directory as the backup log: <log_path>/YYYY-MM-DD_HH-MM-SS_portal_validation.log. The <log_path> is the value of the log_path parameter in the config.inp file. You can clean up the inconsistencies by running the SVU in "cleanup" mode. After that, you can delete the SVU output files (*_portal_validation.log) to conserve space.

When you run the Backup and Recovery tool in configure or backup mode and you are not disabling SVU, it checks to see if the Oracle Application Server instance has a MRDB with a registered Portal middle-tier. If it does and the infra_with_portal parameter is not set to yes, the tool changes the value to yes.

With the portal_validation parameter set to yes, the Backup and Recovery tool runs SVU after the database backup is taken as a result of running the tool in one of the following modes:

20.5 Customizing the Tool for Your Configuration Files

As shipped, the OracleAS Backup and Recovery Tool backs up all of the Oracle Application Server configuration files that are necessary to reconstruct an Oracle Application Server installation. You can customize the tool to include any additional files that you would like to back up regularly, or to exclude any configuration files you do not want to back up.

20.5.1 How the Tool Works When Backing Up Configuration Files

Before you customize the tool, you should understand how it works. When you use the tool to back up your configuration files, it:

  1. Opens config.inp (unless another environment file was specified with the -e option) and retrieves config_files_list.

  2. Attempts to open each file in config_files_list and exits with an error if it cannot open all of the files.

  3. Examines the contents of config_exclude_files.inp. The tool will not attempt to back up the files listed in this file.

  4. Walks through each file in config_files_list and examines the first entry in each file. This entry is the key file. The key file is used to determine if the component exists in this installation.

    • If the tool finds the key file, it knows the component is installed, and attempts to back up all of the entries in the file. It logs an error whenever it cannot find a key file. For all other files that the tool does not find, a warning is issued and the backup continues.

    • If the key file does not exist, the tool does not attempt to back up any entries in the configuration file. It logs an error to the log file and skips to the next configuration file.

  5. The configuration files are stored in jar files located in the directory specified by the config_backup_path parameter in the config.inp file. Two jar files are created, one for DCM-managed components and one for all the other components. The jar files are paired by the timestamp incorporated in each jar file name, for example:

    config_bkp_2004-05-10_18-33-10.jar
    dcm_archive_2004-05-10_18-33-10.jar
    

20.5.2 How to Customize the Tool

Since the tool knows how to determine which configuration files exist in your installation, it is not necessary to customize the tool. However, you may want to customize the tool by:

Adding Files to a Backup

To add files, such as Oracle Application Server component specific log files, to a backup, add entries to the config_misc_files.inp file as follows:

  • To specify a particular file:

    ${OH}/directorypath/file
    
    
  • To specify an entire directory:

    ${OH}/directorypath/
    
    
  • To use wildcards:

    ${OH}/directorypath/*.html
    
    

You can add as many entries as you like. The config_misc_files.inp file is always included in the config_files_list parameter in config.inp, so there is no need to edit config.inp.

In some cases Oracle Backup and Recovery Tool might not be aware of additional configuration or content files stored outside a typical directory structure. For example, in following cases you must edit config_misc_files.inp to ensure proper backup of the following configuration files:

  • Virtual paths defined in the Oracle HTTP configuration file -- httpd.conf. The web server configuration is pointing to a set of static files located in specific directory. These files should be considered a part of the runtime and metadata information.

  • An application deployed to a OC4J container that uses files located outside the container directory. The Backup and Recovery Tool automatically backs up all the files located in the container directory. If your application uses any additional directories, you should consider them as part of configuration backups.

  • Java Messaging Service (JMS) with the file-based persistence. The JMS runtime data (messages) are stored in physical files and should be a part of the backup process.

Note that you do not need to specify a key file in config_misc_files.inp.

Excluding Files from a Backup

You can exclude files from a backup in either of the following ways:

  • You can simply remove the file entry from its config_component.inp file.

  • If you have a situation where a config_component.inp file specifies an entire directory to back up, and you would like to exclude a specific file from that directory, you can add an entry for that file to config_exclude_files.inp. The tool will back up the entire directory except for the file you specify. You cannot specify directories or use wildcards in config_exclude_files.inp. Only single file entries are allowed.

    Note that you do not need to specify a key file in config_exclude_files.inp.

20.6 OracleAS Backup and Recovery Tool Usage Summary

This section summarizes usage for the OracleAS Backup and Recovery Tool.

It contains the following topics:

20.6.1 Prerequisites for Running the Tool

Before running the OracleAS Backup and Recovery Tool:

  • Log in as the user that installed Oracle Application Server.

  • Make sure the ORACLE_HOME environment variable is set.

  • If you are performing a database backup, make sure the ORACLE_SID environment variable is set.

  • All remote database instances must be shutdown before performing any of the following operations on a RAC database:

    • backup_cold

    • backup_cold_incr

    • backup_instance_cold

    • backup_instance_cold_incr

    • restore_repos

    • restore_instance

20.6.2 Syntax

The following commands and syntax for the commands is provided for instances of MRCA, TopLink, and standalone J2EE. While they can also be used with other components, Oracle highly recommends that you use Oracle Application Server Control to manage and run the Backup and Recovery Tool.

The syntax for the Oracle Application Server Backup and Recovery Tool is:

On UNIX:

bkp_restore.sh [-defsv] -m mode [args]

On Windows:

bkp_restore.bat [-defsv] -m mode [args]

It accepts the following options:


-c Restore control file as part of the database restore
-d Print a trace without executing.
-e Specify an environment file (default is config.inp).
-f Force log file, database backup, and configuration file directories to be created if they are required by the current command and do not exist.
-n Suppress prompts so the tool can run in batch mode.
-o Loss of Host Automation (LOHA) operation
-s Run in silent mode.
-v Run in verbose mode.
-z Suppress Portal Validation This option applies to Infrastructure installations only.

Use the -m option to specify which mode to run. Some modes take arguments. Table 20-3 describes the OracleAS Backup and Recovery Tool modes and their arguments. All modes and arguments are case-sensitive.

Some of the modes in the following table are included for use with OracleAS TopLink, OracleAS Metadata Repository Creation Assistant (MRCA), and custom database installations. The modes are:

  • backup_cold

  • backup_cold_incr -1 incr_backup level

  • backup_online

  • backup_online_incr -1 incr_backup level

  • restore_repos

  • flashback_repos

Table 20-3 Oracle Application Server Backup and Recovery Tool Modes and Arguments

Mode and Arguments Description

backup_cold

Performs a complete cold backup of the Metadata Repository. The command performs the following operations:

  • Opens config.inp (or the alternate file specified with the -e option) and retrieves log_path.

  • Shuts down the database, starts it in mounted mode, but does not open it.

  • Performs a backup of the datafiles and control files using RMAN. The commands are in backup_cold.dat.

  • Stores the backup in the directory specified in backup_cold.dat. (This is usually set to the database_backup_path in config.inp.)

  • Stores a log file in log_path.

  • Opens the database.

For a DCM file-based Metadata Repository:

  • Executes the dcmctl exportrepository command to perform a backup of the file-based repository.

  • Stores the backup in the directory, specified by config_backup_path parameter in config.inp.

If both a metadata repository and a file-based repository coexist in an application server instance, the backup_cold option backs up both of them as a set. This would be the case where a file-based repository exists in an Infrastructure install.

To check whether a particular OracleAS instance hosts a file-based repository or a database repository, use the following command:

ORACLE_HOME/dcm/bin/dcmctl whichfarm

Repository Type: Database (host) => Hosts a database repository

Repository Type: Distributed File Based (host) => Hosts a file based repository

backup_cold_incr

-l incr_backup_level

Performs an incremental backup of the Metadata Repository.

Works the same as backup_cold, except:

  • The -l option specifies the increment level (0 - 4).

  • Uses the backup_cold_incrlevel.dat file

There are two types of incremental backups, cumulative and differential. The tool uses the default type, which is differential. For more information, refer to Oracle Database Backup and Recovery Basics in the Oracle Database 10g Documentation Library.

backup_config

Performs a full configuration backup. The backup includes the configurations for DCM managed components and non-DCM managed components. The command performs the following operations:

  • Opens config.inp (or the alternate file specified with the -e option) and retrieves config_files_list, config_backup_path, and log_path.

  • Creates an archive for configuration of DCM managed components:

    1. dcmctl createarchive -archive <archive_name>

    2. dcmctl exportarchive -archive <archive_name> -f <unique name in config_backup_path>

    3. dcmctl removearchive -archive <archive_name>

  • Attempts to open each file in config_files_list. Exits with an error if it cannot open all of the files.

  • For each file in config_files_list, checks if the first entry (the key file) exists. If the key file does not exist, it is treated as a fatal error. Otherwise, backs up all files in the list. If any other files do not exist, logs an error and continues.

  • Excludes files listed in config_exclude_files.inp.

  • When finished, stores the backup in config_backup_path/config_bkp_timestamp.jar and config_backup_path/dcm_archive_timestamp.jar for DCM-managed components.

  • If any errors are encountered, creates a log file in log_path/config_bkp_timestamp.

Process Prerequisites:

If the DCM repository type is a database, the following processes should be up:

  • The Oracle Internet Directory process must to be up. The command opmnctl startproc ias-component=OID can be used to start this process. The Oracle Internet Directory process exists on Infrastructure (IM + MR) or IM installation. Before starting the Oracle Internet Directory process, the OPMN process must be up. The command opmnctl start can be used to bring it up.

  • The database must be up and running.

  • The listener process must be up.

To check whether a particular Oracle Application Server instance hosts a file based repository or a database repository, use the following command:

ORACLE_HOME/dcm/bin/dcmctl whichfarm

Repository Type: Database (host) => Hosts a database repository

Repository Type: Distributed File Based (host) => Hosts a file based repository

backup_config_incr

Performs an incremental configuration file backup.

Works the same as backup_config, except:

  • Backs up all configuration files that have changed since the last full or incremental configuration file backup.

For process prerequisites, refer to the backup_config option.

backup_instance_cold

Performs a complete cold backup of the Oracle Application Server instance. The command performs the following operations:

  • Stops all OPMN managed processes.

  • Starts the OPMN administrative process.

  • Checks all of the OPMN managed processes to ensure that the processes are stopped. If not, tries to stop them one more time. If the processes still cannot be stopped, issues a fatal error.

  • Performs repository backup (database and file-based). For a database repository, shuts down the database for the duration of the backup.

  • Starts Oracle Internet Directory and DCM-daemon processes for database repositories.

  • Performs configuration backup.

  • Starts all OPMN managed processes.

  • Checks to ensure that all OPMN processes are running. If not, issues a warning message.

backup_instance_cold_incr -1 <level number>

Performs an incremental cold backup of the Oracle Application Server instance. The command performs the following operations:

  • Stops all OPMN managed processes.

  • Starts the OPMN administrative process.

  • Checks all of the OPMN managed processes to ensure that the processes are stopped. If not, tries to stop them one more time. If the processes still cannot be stopped, issues a fatal error.

  • Performs repository backup (database or file-based). For a database repository, shuts down the database for the duration of the backup. The level option applies to database repositories only. Backup is performed to the specified level. The default level is 1.

  • Starts Oracle Internet Directory and DCM-daemon processes for database repositories.

  • Performs configuration backup.

  • Starts all OPMN managed processes.

  • Checks to ensure that all OPMN processes are running. If not, issues a warning message.

backup_instance_online

Performs an online backup of the Oracle Application Server instance. The Metadata Repository database must have ARCHIVELOG mode enabled. The command performs the following operations:

  • Performs repository backup (database or file based). For a database repository, the database remains up while being backed up.

  • Performs configuration backup.

backup_instance_online_incr -1 <level number>

Performs an incremental online backup of the Oracle Application Server instance. The command performs the following operations:

  • Performs an incremental repository backup (database or file-based). For a database repository, the database remains up while being backed up. The level option applies to database repositories only. Backup is performed to the specified level. The default level is 1.

  • Performs incremental configuration backup.

backup_online

Performs an online backup of the Metadata Repository. If you are running this command on an Infrastructure, ensure that the Metadata Repository is up before running this command. The Metadata Repository database must have ARCHIVELOG mode enabled. The command performs the following operations:

  • Opens config.inp (or the alternate file specified with the -e option) and retrieves log_path.

  • Assumes the database is open.

  • Performs a backup of the datafiles and control files using RMAN. The commands are in backup_online.dat.

  • Stores the backup in the directory specified in backup_online.dat. (This is usually set to the database_backup_path in config.inp.)

  • Stores a log file in log_path.

  • Leaves the database open.

For a DCM file-based Metadata Repository:

  • Executes the dcmctl exportrepository command to perform a backup of the file-based repository.

  • Stores the backup in the directory, specified by config_backup_path parameter in the config.inp file.

If both a metadata repository and a file-based repository coexist in an application server instance, the backup_online option backs both of them up as a set. This would be the case where a file-based repository exists in an infrastructure install.

To check whether a particular OracleAS instance hosts a file-based repository or a database repository, use the following command:

ORACLE_HOME/dcm/bin/dcmctl whichfarm

Repository Type: Database (host) => Hosts a database repository

Repository Type: Distributed File Based (host) => Hosts a file based repository

backup_online_incr

-l incr_backup_level

Performs an incremental online backup of the Metadata Repository.

Works the same as backup_online, except:

  • The -l option specifies the increment level (0 - 4).

  • Uses the backup_online_incrlevel.dat file

There are two types of incremental backups, cumulative and differential. The tool uses the default type, which is differential. For more information, refer to Oracle Database Backup and Recovery Basics in the Oracle Database 10g Documentation Library.

configure

[-i dbid]

Configures the tool. When using this command on an Infrastructure, make sure the Metadata Repository is up before you run this command. The command performs the following operations:

  • Updates config_files_list and install_type in config.inp with the appropriate information for your installation.

  • If using this on an Infrastructure, updates the configuration file with the database id (dbid) and creates customized *.dat files from the database backup *.tmpl files. By default, it queries the Metadata Repository for the dbid. If you use the -i option, you can supply the dbid (this is used for migrating the Metadata Repository from one node to another, such as for Disaster Recovery).

configure_nodb

Same as configure but does not perform the Infrastructure configuration.

Note: You should use configure for all middle-tier and Infrastructure installations. The configure_nodb applies to disaster recovery strategies described in Oracle Application Server High Availability Guide.

help

Prints a usage message.

list_backups

Lists the metadata repository and configuration backups taken for the instance.

list_instance_backups

Lists instance level backups taken for the instance.

list_changed_config

Lists any configuration files that have changed since the last full or incremental backup. This command checks the modification date of each file; it does not check the actual contents of the file. It writes the list of files to a log file and prints the name of the log file. Deleted files or deleted directories are not listed in list_changed_config. Only modified files or directories containing modified files are listed.

node_backup -o image_backup -P <directory for the image archive>

Creates an image archive of the original host. The image includes the original Oracle home, oratab, central inventory and so forth depending on the installation. On UNIX, this operation must be run as root.

node_backup -o prepare

Prepares the node for backup. Preparation includes discovering the operating system type, host name/ip, user/group id, install type, the location of the central inventory, oracle home locations if there are multiple of them, Windows registry, Windows service database scanning to find all services created for Oracle homes. The information is placed in a file to be used in node restoration.

This mode also creates a config backup and a cold database backup.

node_restore -o inst_reconfigure -t config_bkp_timestamp

Reconfigures the instance on the new host including ip changing, database restore, database tempfile setup, config backup restore and so forth depending in the installation type.

node_restore -o inst_register

Registers the instance with the oratab and the central inventory. It also sets up the daemon start and stop script and so forth by running root.sh, or on Windows, Windows services are created.

It must be run as root on UNIX systems.

node_restore -o sys_init

Restores Oracle Universal Installer related metadata such as oratab(Unix), Windows registries (Windows) and central inventor. It should be run once only on the new host.

It must be run as root on UNIX systems.

restore_config

[-t config_bkp_timestamp]

[-n]

Restores configuration files. The command performs the following operations:

  • Opens config.inp (or the alternate file specified with the -e option) and retrieves config_backup_path and log_path.

  • If the -t option is supplied and it is the timestamp from a full backup, it restores that full backup.

  • If the -t option is supplied and it is the timestamp from an incremental backup, it restores the full backup and all incremental backups up to and including the specified incremental backup.

  • If the -t option is not supplied, displays a list of configuration file backups in config_backup_path and exits. You can then rerun the command and supply one of these files with the -t option.

  • Restores all files from the configuration file backup to the Oracle home, preserving owner, group, permissions, and timestamp.

  • If any errors are encountered, creates a log file in log_path/config_rst_timestamp.

  • Restore configuration for DCM managed components

    dcmctl importarchive -f <location in config_backup_path that contains dcm archive>
    dcmctl applyarchiveto -archive <archive name> [-cluster <cluster_name>]
    dcmctl removearchive -archive <archive name>
    

The -n option suppresses prompts so you can use the tool in batch mode.

For the process prerequisites, refer to the backup_config option.

Do not run restore_config on multiple nodes in a J2EE cluster in parallel. Doing so will cause restore_config failures. Run restore_config on one node at a time.

restore_db

This command is deprecated. Use restore_repos instead.

restore_instance -t <timestamp> -c

Restores an instance of Oracle Application Server. If the timestamp argument is not specified, then a list of backup timestamps is displayed to the user. The command performs the following operations:

  • Stops all OPMN managed processes.

  • Checks to verify that the OPMN processes have stopped. If OPMN processes cannot be stopped (maybe an opmn.xml file is missing), a file system restore is performed. Then tries to stop the OPMN processes again. If the OPMN processes still cannot be stopped, issues a fatal error.

  • Starts the OPMN administration process.

  • Performs repository restore. The -c option is applicable for database repositories only. If the -c option is specified, the control file is restored also.

  • Starts Oracle Internet Directory and DCM-Daemon processes (applicable to database repositories only).

  • Performs configuration restore.

  • Starts all OPMN managed processes.

  • Checks to ensure that all OPMN managed processes are up. If not, issues a warning message.

restore_repos

[-u timestamp]

[-c] [-n]

Restores and recovers the Metadata Repository and the DCM file-based repository from the available cold and online backups. To perform restore_repos, the Metadata Repository database must be started and open. The command performs the following operations:

  • Opens config.inp (or the alternate file specified with the -e option) and retrieves log_path.

  • Restores the control files and datafiles, and performs recovery using RMAN. The commands are in restore_repos.dat.

  • Stores a log file in log_path.

  • Leaves the database open.

By default, this command restores and recovers the database to its most recent state. You can use the -u option to restore and recover the database to its state at a particular point in time. The format for the timestamp is MM/DD/YYYY_HR24:MIN:SEC, for example:

On UNIX:

bkp_restore.sh -m restore_repos -u 07/26/2003_13:45:06

On Windows:

bkp_restore.bat -m restore_repos -u 07/26/2003_13:45:06

By default, this command does not restore the control file. You can use the -c option to restore the control file.

If you use the -u or -c option, be sure to do a full backup right away because all past backups are invalidated.

The -n option suppresses prompts so you can use the tool in batch mode.

Refer to Section 22.2.5, "Restoring and Recovering the Metadata Repository" for more information.

This command performs the following operations to restore a file-based repository:

  • Checks for timestamp input. If not provided, lists the available backup timestamps corresponding to the file-based repository.

  • Executes dcmctl importrepository -file <location in config_backup_path that stores the repository backup>

On UNIX:

bkp_restore.sh -m restore_repos -t  2004-05-10_18-33-12

On Windows:

bkp_restore.bat -m restore_repos -t  2004-05-10_18-33-12

If both the metadata repository and a file-based repository coexist in an application server instance, the restore_repos option restores both of them as a set. This would be the case where DCM uses a file-based repository in an infrastructure install.

flashback_repos

-u timestamp |

-b timestamp

[-n]

Rewinds the Metadata Repository to a specified time by using the before images of changed data blocks to back out changes made to the database since the specified time. To perform Flashback, the Metadata Repository database must be started and open. The command performs the following operations:

  • Opens the config.inp file (or an alternate file specified with the -e option) and retrieves log_path.

  • Recovers the database to or before a specified time by performing Flashback. The commands are located in:

    flashback_repos_to.tmpl

    flashback_repos_before.tmpl

  • Stores a log file in log_path.

  • Leaves the database open.

Flashback requires a database repository. Flashback is not supported on file-based repositories.

Flashback supports recovery of a Metadata Repository back to the point in time where resetlogs occur. Once resetlogs occur, Flashback cannot recover any change blocks that occurred before the resetlogs.

You do not need to perform a cold backup before running Flashback. Flashback does not require restoring previous backups in order to recover the database. This means the flashback_repos operation is faster than the restore_repos operation. Flashback can undo any logical data corruption or user error, such as deleting an Oracle Application Server schema or undeploying an application by mistake.

To perform Flashback, the database must be configured with a Flash Recovery Area, and ARCHIVELOG mode and Flashback must be enabled. Use the following SQL statements to configure and enable Flashback:

ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = <size> SCOPE=BOTH SID='*';
ALTER SYSTEM SET DB_RECOVERY_FILE_DEST = <directory_path> SCOPE=BOTH SID='*';
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE FLASHBACK ON;

Refer to the Oracle Database Backup and Recovery Basics manual, Chapter 3, the section on "Setting up a Flash Recovery Area for RMAN" for more detail. Also, refer to Section 21.2.2, "Enabling ARCHIVELOG Mode" in this manual for information on enabling ARCHIVELOG mode.

Either the -u or -b option must be specified. The -u option returns the database to its state at the specified time. The -b option returns the database to its state prior to the specified time. The format for the timestamp is MM/DD/YYYY_HR24:MIN:SEC.

  • On UNIX systems:

    bkp_restore.sh -m flashback_repos -u 07/26/2003_13:45:06
    
    
  • On Windows systems:

    bkp_restore.bat -m flashback_repos -u 07/26/2003_13:45:06
    

The -n option suppresses prompts so the tool can be run in batch mode.

For more information on Flashback technology, refer to the Oracle Database Backup and Recovery Advanced User's Guide.

After running flashback_repos, do a full backup immediately because all past backups are invalidated. See Section 22.2.5, "Restoring and Recovering the Metadata Repository" for more information.


20.6.3 Usage Examples

This section contains usage examples for the OracleAS Backup and Recovery Tool. The Unix command is listed first and then the Windows command.

  • Configure the tool using the default config.inp file:

    bkp_restore.sh -m configure
    bkp_restore.bat -m configure
    
    
  • Configure the tool using a configuration file called myconfig.inp:

    bkp_restore.sh -m configure -e myconfig.inp
    bkp_restore.bat -m configure -e myconfig.inp
    
    
  • Perform a full configuration file backup:

    bkp_restore.sh -v -m backup_config
    bkp_restore.bat -v -m backup_config
    
    
  • Perform a full configuration file backup using an environment file called myconfig.inp:

    bkp_restore.sh -v -m backup_config -e myconfig.inp
    bkp_restore.bat -v -m backup_config -e myconfig.inp
    
    
  • Perform an incremental configuration file backup:

    bkp_restore.sh -v -m backup_config_incr
    bkp_restore.bat -v -m backup_config_incr
    
    
  • Restore configuration files.

    bkp_restore.sh -m restore_config -t 2004-09-21_06-12-45
    bkp_restore.bat -m restore_config -t 2004-09-21_06-12-45
    
    
  • Perform a full cold backup of the Metadata Repository:

    bkp_restore.sh -m backup_cold
    bkp_restore.bat -m backup_cold
    
    
  • Perform a level 2 incremental cold backup of the Metadata Repository:

    bkp_restore.sh -m backup_cold_incr -l 2
    bkp_restore.bat -m backup_cold_incr -l 2
    
    
  • Perform an full online backup of the Metadata Repository:

    bkp_restore.sh -m backup_online
    bkp_restore.bat -m backup_online
    
    
  • Perform a level 0 incremental online backup of the Metadata Repository:

    bkp_restore.sh -m backup_online_incr -l 0
    bkp_restore.bat -m backup_online_incr -l 0
    
    
  • Restore the Metadata Repository to its most recent state:

    bkp_restore.sh -m restore_repos
    bkp_restore.bat -m restore_repos
    
    
  • Restore the Metadata Repository to its state at a particular time:

    bkp_restore.sh -m restore_repos -u 07/26/2003_13:45:06
    
    bkp_restore.bat -m restore_repos -u 07/26/2003_13:45:06
    
    
  • Flashback the Metadata Repository to its state at a particular point in time:

    bkp_restore.sh -m flashback_repos -u 07/26/2003_13:45:06
    bkp_restore.bat -m flashback_repos -u 07/26/2003_13:45:06
    
    
  • Restores the file based repository to its state at a particular time:

    bkp_restore.sh -m restore_repos -t  2004-05-10_18-33-12
    bkp_restore.bat -m restore_repos -t  2004-05-10_18-33-12
    
    
  • Perform an cold backup of an Oracle Application Server instance:

    bkp_restore.sh -m backup_instance_cold
    bkp_restore.bat -m backup_instance_cold
    
    
  • Perform an incremental cold backup of an Oracle Application Server instance:

    bkp_restore.sh -m backup_instance_cold_incr -l <level>
    bkp_restore.bat -m backup_instance_cold_incr -l <level>
    
    
  • Perform an online backup of an Oracle Application Server instance:

    bkp_restore.sh -m backup_instance_online 
    bkp_restore.bat -m backup_instance_online
    
    
  • Perform an online incremental backup of an Oracle Application Server instance:

    bkp_restore.sh -m backup_instance_online_incr -l <level>
    bkp_restore.bat -m backup_instance_online_incr -l <level>
    
    
  • Restore an Oracle Application Server instance to its state at a particular time and include the control file in the restore:

    bkp_restore.sh -m restore_instance -t 2004-09-21_06-12-45 -c
    bkp_restore.bat -m restore_instance -t 2004-09-21_06-12-45 -c
    
    
  • Node backup preparation using Loss of Host Automation (LOHA)

    bkp_restore.sh -m node_backup -o prepare
    bkp_restore.bat -m node_backup -o prepare
    
    
  • Create an image backup of the original host using LOHA

    bkp_restore.sh -m node_backup -o image_backup -P <directory for image archive>
    bkp_restore.bat -m node_backup -o image_backup -P <directory for image archive>
    
    
  • Restore OUI related metadata on the new host using LOHA

    bkp_restore.sh -m node_restore -o sys_init
    bkp_restore.bat -m node_restore -o sys_init
    
    
  • Register the instance on the new host using LOHA

    bkp_restore.sh -m node_restore -o inst_register
    bkp_restore.bat -m node_restore -o inst_register
    
    
  • Configure the instance on the new host using LOHA

    bkp_restore.sh -m node_restore -o inst_reconfigure -t config_bkp_timestamp
    bkp_restore.bat -m node_restore -o inst_reconfigure -t config_bkp_timestamp
    

20.6.4 Purging Backups and Moving Them to Tertiary Storage

The Backup and Restore Tool saves records of successful backups in a catalog file (data/catalog.txt) in the backup_restore directory. Each backup is identified by a timestamp, which is also embedded in the filenames of jar files saved in the configuration file backup directory in the case of a instance or configuration only backup. If you delete all the .jar files corresponding to a timestamp or move them somewhere else, for example offline storage, although the catalog still contains a record of the timestamp, you will not see this record when you run -m list_backups, nor will you be able to restore using this timestamp as the -t value. This is the expected behavior.

In the case of a repository only backup, a jar file is not created in the configuration backup directory. To delete obsolete database backups or move them to tape, you should use rman. When the backup files corresponding to a repository only backup are purged or moved to tertiary storage, the Backup and Restore Tool still lists the corresponding timestamp when you run -m list_backups although the database backup is not available for restore.