Skip Headers
Oracle® Application Server Quick Administration Guide
10g Release 2 (10.1.2)
B14126-02
  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
 

9 Backup and Recovery

This chapter describes how to configure and use the Oracle Application Server Backup and Recovery tool and how to backup your Oracle Application Server installation.

The OracleAS Backup and Recovery tool can be used in different ways, depending on your requirements. You can use the tool to perform configuration file and OracleAS Metadata Repository backup and recovery and also use it to set up your own configuration file and OracleAS Metadata Repository backup and recovery scripts.

This chapter contains the following topics:

9.1 Locating the OracleAS Backup and Recovery Tool

The OracleAS 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 9-1 lists the files that may reside in the backup_restore directory.

Table 9-1 OracleAS Backup and Recovery Tool Files

FileFoot 1  Description
bkp_restore.pl

bkp_restore.sh

bkp_restore.bat

If you have installed OracleAS TopLink or REPCA, then 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

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.

*.tmpl

Templates for scripts for performing database backup and recovery operations using RMAN. When you initially configure the tool, a customized .dat file will be created from each .tmpl file.

*.sql

SQL scripts used by the tool to check the repository database.


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

9.1.1 Manually Installing the OracleAS Backup and Recovery Tool

If you are running OracleAS TopLink in standalone mode, or ran the OracleAS Metadata Repository Creation Assistant to create a metadata repository in an existing database, then 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 is a Perl script that 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 Java Runtime Environment (JRE) be installed. You can obtain JRE at: http://java.sun.com/j2se/desktopjava/jre/index.jsp.

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 file from the backup.jar file which is located in the directory: CD_ROM/stage/Components/oracle.iappserver.backup_restore/10.1.2.0.0/1/DataFiles/backup.jar> For example:

    cd ORACLE_HOME
    jar xvf CD_ROM/stage/Components/oracle.iappserver.backup_restore/10.1.2.0.0 /1/DataFiles/backup.jar
    
    

    If you ran the OracleAS Metadata Repository Creation Assistant (REPCA) to create a metadata repository in an existing database, 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 OracleAS 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 9-1. Instructions for editing the configuration files are in subsequent steps.

9.2 Configuring the OracleAS Backup and Recovery Tool

This section describes how to configure the OracleAS Backup and Recovery Tool. 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. The tool writes out log files and backup files, and you must create the following directories to hold these.;

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

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

    • 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 will give you the best chance of recovering data in the event of a hardware failure.

    • Ensure 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
      
      
  2. Edit config.inp and modify the parameters as described in Table 9-2. Notice that some of the instructions are different depending on whether this is a middle-tier or Infrastructure installation.

Table 9-2 Parameters in config.inp

Parameter Value

oracle_home

Specify the full path of the Oracle home.

log_path

Specify the full path of the log file directory.

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:

(UNIX) ORACLE_HOME/dbs/spfileSID.ora
(Windows) 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:

(UNIX) ORACLE_HOME/dbs/initSID.ora
(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.


  1. Set the ORACLE_HOME environment variable to the Oracle Application Server Oracle home.

  2. If this is an Infrastructure installation:

    1. Set the ORACLE_SID environment variable to the Metadata Repository SID. The default is orcl.

    2. Ensure the Metadata Repository is started.

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

    • For UNIX systems:

      ./bkp_restore.sh -m configure
      
      
    • For Windows systems:

      bkp_restore.bat -m configure
      
      
    • For OracleAS TopLink or REPCA installations on UNIX or Windows, after specifying the correct version of perl.exe, run:

      bkp_restore.pl -m configure
      
      

    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.

9.3 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.

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 a files, such as Oracle Application Server component specific log files, to a backup, add entries to the config_misc_files.inp file as follows:

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

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:

9.4 OracleAS Backup and Recovery Tool Usage Summary

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

It contains the following topics:

9.4.1 Prerequisites for Running the Tool

Before running the OracleAS Backup and Recovery Tool:

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

  • Ensure the ORACLE_HOME environment variable is set.

  • If you are performing a database backup, then ensure the ORACLE_SID environment variable is set. The default is orcl.

9.4.2 Syntax

The syntax for the OracleAS 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:

  • -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 be run in batch mode.

  • -s: Run in silent mode.

  • -v: Run in verbose mode.

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

Table 9-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:

  • 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 (Identity Management and Metadata Repository or Identity Management only) 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 needs to be up.

  • 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 that it 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 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 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 started 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 argument applies to disaster recovery strategies described in Oracle Application Server High Availability Guide.

help

Prints a usage message.

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.

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.

  • Restores configuration for DCM managed components

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 runs using the bkp_restore.sh -m restore_instance -F noDCM command. Then, it 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 also restored.

  • 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 started. 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.

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.

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,Section 9.5.2, "Enabling ARCHIVELOG Mode" 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 that 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 the section "Restoring and Recovering the Metadata Repository" in the Oracle Application Server Administrator's Guide for more information.


9.4.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
    

9.5 Backup Procedures

This section describes the backup procedures in detail. There is some data interdependency between the configuration files in your Oracle Application Server middle-tier installations, the Distributed Management Repository, the Identity Management metadata, and the Oracle Application Server Metadata Repository in the Infrastructure. To maintain configuration data consistency, you should back up each of your Oracle Application Server instances (middle-tier and Infrastructure) at the same time. While backing up one Oracle Application Server instance, ensure that no configuration changes are made in any of the other instances.

This section contains the following topics:

9.5.1 Enabling Block Change Tracking

To increase performance on incremental database backups, enable block change tracking using the following command:

alter database enable block change tracking using file file_name;

If the db_create_file_dest parameter is set in the spfile or init.ora file of the database, then the following command can be used:

alter database enable block change tracking;

Once you enable block change tracking, incremental database backup will use block change tracking.

For more information about block change tracking, refer to Backup and Recovery Basics in the Oracle Database 10g Release 1 (10.1) Documentation Library.

9.5.2 Enabling ARCHIVELOG Mode

By default, the Metadata Repository does not have ARCHIVELOG mode enabled. You must enable ARCHIVELOG mode, which enables the archiving of online redo logs. This will allow you to perform the recovery strategies in this book.


See Also:

You can find more detailed information about the parameters in this section, and setting up archive logging in general, in Oracle Database Administrator's Guide 10g Release 1 (10.1).

To enable ARCHIVELOG mode:

  1. Run the following sql query to check if the flashback_recovery_area is setup:

    SQL> show parameters db_recovery
    
    

    If the flashback_recovery_area is setup, the query returns:

    Name                         Type        Value
    db_recovery_file_dest        string      /private2/AS1012Installs/AS1012Infra/
                                              flash_recovery_area
    db_recovery_file_dest_size   big integer  2G
    
    

    If the flashback_recovery_area is set up, then the destination specified by the db_recovery_file_dest parameter is used as the archivelog destination, and you do not need to specify the destination directory for your archives in the following step.

  2. Specify the destination directory for your archives by including the initialization parameter LOG_ARCHIVE_DEST_n in the initialization file. If spfile is used, then the following command can be issued:

    alter system set log_archive_dest_n="LOCATION=<backup directory>" scope=spfile;
    
    

    In the log_archive_dest_n parameter, n is a number of 1 through 10.

    If pfile is used, the following initialization file must be edited:

    For UNIX systems:

    INFRA_ORACLE_HOME/dbs/initSID.ora
    
    

    For Windows systems:

    INFRA_ORACLE_HOME\database\initSID.ora
    
    

    Change the LOG_ARCHIVE_DEST_n parameter to:

    LOG_ARCHIVE_DEST_n="LOCATION=<backup directory>"
    
    

    (Optional) The default filename format for archive logs is:

    • For UNIX systems:

      %t_%s_%r.dbf
      
      
    • For Windows systems:

      ARC%S_%R.%T
      
      

    If you would like to use a different format, include the initialization parameter LOG_ARCHIVE_FORMAT in the initialization file, for example:

    LOG_ARCHIVE_FORMAT = 'log%t_%r_%s.arc'
    
    

    In the preceding example, t represents the thread number, r represents the reset log ID, and s represents the log sequence number.

  3. Make sure that the ORACLE_HOME and ORACLE_SID (the default is orcl) environment variables are properly set.

  4. Make sure that no one is using the database.

  5. Perform a clean, normal shutdown of the database instance.

    INFRA_ORACLE_HOME/bin/sqlplus /nolog
    SQL> connect sys/password as sysdba
    SQL> shutdown
    
    
  6. Start up the instance and mount, but do not open the database.

    SQL> startup mount;
    
    
  7. Enable database ARCHIVELOG mode.

    SQL> alter database archivelog;
    
    
  8. Shut down and restart the database instance.

    SQL> shutdown
    SQL> startup
    
    
  9. Verify the database is now in ARCHIVELOG mode.

    Execute the following command and verify that Database log mode is Archive Mode and Automatic archival is Enabled.

    SQL> archive log list;
    Database log mode             Archive Mode
    Automatic archival            Enabled
    Archive destination           /disk1/oraHome/archive
    Oldest on-line log sequence   997
    Next log sequence to archive  999
    Current log sequence          999
    

9.5.3 Creating a Record of Your Oracle Application Server Configuration

In the event you need to restore and recover your Oracle Application Server environment, it is important to have all the necessary information at your disposal. This is especially true in the event of a hardware loss that requires you to reconstruct all or part of your Oracle Application Server environment on a new disk or host.

You should maintain an up-to-date record of your Oracle Application Server environment that includes the information listed in this section. You should keep this information both in hardcopy and electronic form. The electronic form should be stored on a host or e-mail system that is completely separate from your Oracle Application Server environment.

Your Oracle Application Server hardware and software configuration record should include:

  • The following information for each host in your environment:

    • Hostname

    • Virtual hostname (if any)

    • Domain name

    • IP address

    • Hardware platform

    • Operating system release level and patch information

  • The following information for each Oracle Application Server installation in your environment:

    • Installation type (for example: Infrastructure or J2EE and Web Cache)

    • Host on which the installation resides

    • User name, userid number, group name, groupid number, environment profile, and type of shell for the operating system user that owns the Oracle home (/etc/passwd and /etc/group entries)

    • Directory structure, mount points, and full path for ORACLE_HOME

    • Amount of disk space used by the installation

    • Port numbers used by the installation


      Note:

      ORACLE_HOME/install/portlist.ini contains the port numbers assigned during installation. However, this file is not updated if you change port numbers after installation, so you need to keep track of those changes manually.

  • The following information for the Metadata Repository:

    • Database version and patch level

    • Base language

    • Character set

    • Global database name

    • SID

9.5.4 Performing a Complete Oracle Application Server Environment Backup

This section describes how to perform a complete Oracle Application Server environment backup. A complete Oracle Application Server environment backup includes Identity Management metadata and Oracle Application Server Metadata Repository, which can be stored in the same database or different databases. There are two modes for backing up the databases: cold backup and online backup. Before performing a cold backup on an open database, the Backup and Recovery Tool performs a clean shutdown and rolls back any ongoing changes to the database. As a result, a cold backup is a copy of the database at a consistent state. A consistent backup can be restored without recovery. An online backup does not require shutting down the repository database. There is no need to bring down your business applications, providing a higher degree of continuous availability. An online backup is a snapshot or point-in-time image of the database. When you use the Backup and Recovery Tool to restore an online backup, any ongoing changes to the database occurring during the time of the online backup will be recovered by applying the redo logs. Refer to the Oracle Database Backup and Recovery Advanced User's Guide, "RMAN Backup Types" for more detail.

This procedure contains the following steps:

Task 1: Shut Down Your Oracle Application Server Environment

If this is the first backup after installing the Oracle Application Server, then you should take the following steps to shut down the Oracle Application Server Environment and perform a cold backup of the databases where the Identity Management metadata and the Oracle Application Server Metadata Repository are stored. If you are performing a complete Oracle Application Server environment backup after a major change, like a rolling- software upgrade, you can perform either a cold backup or an online backup of the databases. If you choose the online backup so that your business applications remain up and running, you can skip this task and proceed with Task 2 and Task 3.

  1. Stop the middle-tier instances.

    Refer to Section 3.1.6, "Stopping a Middle-Tier Instance" for instructions.

  2. Stop the Infrastructure.

    Refer to Section 3.1.4, "Stopping OracleAS Infrastructure" for instructions.

Task 2: Back Up the Middle-Tier Installations

For each middle-tier installation in your environment:

  1. Back up the middle-tier Oracle home.

    Perform a complete backup of all files in the middle-tier Oracle home using your preferred operating system command, such as tar or cpio.

    Be sure to perform this backup as root because some of the files in the Oracle home are owned by root. It is important to perform the backup so that file owners, groups, permissions, and timestamps are preserved.

    For example:

    cd MID_TIER_ORACLE_HOME
    tar cvf full_path_of_backup_file
    Backup the registry entry HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
    
    
  2. Back up the middle-tier configuration files.

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

    • The OPMN process. The command opmnctl start can be used to start it.

    • The OID process. The command opmnctl startproc ias-component=OID can be used to start this process. The OID process exists on Infrastructure (Identity Management and Metadata Repository or Identity Management only) installation.

    • The database.

    • The listener process.

    Back up of all configuration files in the middle-tier Oracle home. You can perform this step using your own procedure or the OracleAS Backup and Recovery Tool. For example, to do this using the tool:

    • For UNIX systems:

      bkp_restore.sh -m backup_config
      
      
    • For Windows systems:

      bkp_restore.bat -m backup_config
      

    See Also:

    Chapter 20, "Oracle Application Server Backup and Recovery Tool" in Oracle Application Server Administrator's Guide for more information.

    The reason for backing up configuration files immediately after backing up the entire Oracle home is that it provides a snapshot of your initial configuration files, in case you start to reconfigure your system and then would like to restore the configuration files to their original state.

    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 kept in sync by the timestamp incorporated in each jar file name. For example:

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

Task 3: Back Up the Infrastructure

  1. Perform a cold database backup of the Metadata Repository.

    You can perform this step using your own procedure or the OracleAS Backup and Recovery Tool. For example, to do this using the tool:

    • For UNIX systems:

      bkp_restore.sh -m backup_cold
      or
      bkp_restore.sh -m backup_online
      
      
    • For Windows systems:

      bkp_restore.bat -m backup_cold
      or
      bkp_restore.bat -m backup_online
      
      

    Note that the tool leaves the database running when finished. Shut down the database before continuing with the rest of these steps.


    See Also:

    Chapter 20, "Oracle Application Server Backup and Recovery Tool" in Oracle Application Server Administrator's Guide for more information.

  2. Back up the Infrastructure Oracle home.


    Note:

    If your Infrastructure is split and has Identity Management in one Oracle home, and the Metadata Repository in another Oracle home, then perform this step on both Oracle homes. If your Identity Management is split between Oracle Internet Directory in one Oracle home and Single Sign-On, Delegated Administration Service, and so on in another Oracle home, then you also should perform this step on each of those Oracle homes.

    Perform a complete backup of all files in the Infrastructure Oracle home using your preferred operating system command, such as tar or cpio.

    Be sure to perform this backup as root because some of the files in the Oracle home are owned by root. It is important to perform the backup so that file owners, groups, permissions, and timestamps are preserved.

    For example:

    cd INFRA_ORACLE_HOME
    tar cvf full_path_of_backup_file
    Backup the registry entry HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE 
    
    
  3. Back up the Infrastructure configuration files.


    Note:

    If your Infrastructure has Identity Management in one Oracle home, and the Metadata Repository in another Oracle home, perform this step on both Oracle homes. If your Identity Management is split between Oracle Internet Directory in one Oracle home and Single Sign-On, Delegated Administration Service, and so on in another Oracle home, then you also should perform this step on each of those Oracle homes.

    If the DCM repository type is a database, then the following processes must be started:

    • The OPMN process. Use the command opmnctl start to start it.

    • The OID process. Use the command opmnctl startproc ias-component=OID to start this process. The OID process exists on Infrastructure (Identity Management and Metadata Repository or Identity Management only) installation.

    • The database.

    • The listener process.

    Perform a backup of all configuration files in the Infrastructure Oracle home. You can perform this step using your own procedure or the OracleAS Backup and Recovery Tool. For example, to do this using the tool:

    • For UNIX systems:

      bkp_restore.sh -m backup_config
      
      
    • For Windows systems:

      bkp_restore.bat -m backup_config
      

    See Also:

    Chapter 20, "Oracle Application Server Backup and Recovery Tool" in Oracle Application Server Administrator's Guide for more information.

    The reason for doing a configuration file backup immediately after backing up the entire Oracle home is that it provides a snapshot of your initial configuration files. You can use this if you start to reconfigure your system and then would like to restore the configuration files to their original state.

Task 4: Back Up the Oracle System Files

On each host in your Oracle Application Server environment:

  1. Make a backup of your Oracle system files using your preferred operating system command, such as tar or cpio.

    Consult your operating system-specific documentation to determine which directory contains your Oracle system files. For example, on UNIX systems, they may be in the /var/opt/oracle or /etc directory.

  2. If the oraInventory directory resides outside of your Oracle Application Server Oracle home, then make a backup of it using your preferred operating system command, such as tar or cpio.

    If you are not sure of the location of your oraInventory directory, then you can find it in the oraInst.loc file. For example, on UNIX systems, look in /var/opt/oracle/oraInst.loc or /etc/oraInst.loc. On Windows systems, the location of the oraInventory can be obtained from the registry: HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\INST_LOC.

Task 5: Start Your Oracle Application Server Environment

To start the environment, take the following steps:

  1. Start the Infrastructure.

    Refer to Section 3.1.3, "Starting OracleAS Infrastructure" for instructions.

  2. Start the middle-tier instances.

    Refer to Section 3.1.5, "Starting a Middle-Tier Instance" for instructions.

9.5.5 Performing a Configuration and Metadata Backup

Once you have performed a complete Oracle Application Server environment backup, you should perform subsequent configuration and metadata backups after every administrative change, or, if this is not possible, on a regular basis.


See Also:

Appendix G, "Examples of Administrative Changes" in Oracle Application Server Administrator's Guide to learn more about administrative changes

These backups can be performed online (while Oracle Application Server is running), and only contain configuration files, Identity Management metadata, and the Metadata Repository.

This section describes how to perform a configuration and metadata backup of your Oracle Application Server environment. It contains the following steps:

Task 1: Back Up the Infrastructure

To backup the Infrastructure:

  1. Perform a full or incremental backup of the configuration files.

    You can perform this step using your own procedure or the OracleAS Backup and Recovery Tool. For example, to do this using the tool:

    • On UNIX systems:

      bkp_restore.sh -m backup_config
      or
      bkp_restore.sh -m backup_config_incr
      
      
    • On Windows systems:

      bkp_restore.bat -m backup_config
      or
      bkp_restore.bat -m backup_config_incr
      

    See Also:

    Chapter 20, "Oracle Application Server Backup and Recovery Tool" in Oracle Application Server Administrator's Guide for more information.

  2. Perform an online database backup of the Metadata Repository. It can be a full or incremental online backup.

    You can perform this step using your own procedure or the OracleAS Backup and Recovery Tool. For example, to do this using the tool:

    • On UNIX systems:

      bkp_restore.sh -m backup_online
      or
      bkp_restore.sh -m backup_online_incr -l 2
      
      
    • On Windows systems:

      bkp_restore.bat -m backup_online
      or
      bkp_restore.bat -m backup_online_incr -l 2
      

    See Also:

    Chapter 20, "Oracle Application Server Backup and Recovery Tool" in Oracle Application Server Administrator's Guide for more information.

Task 2: Back Up the Middle-tier Installations

For each middle-tier installation in your environment, perform a full or incremental backup of configuration files. You can perform this step using your own procedure or the OracleAS Backup and Recovery Tool. For example, to do this using the tool:

  • For UNIX systems:

    bkp_restore.sh -m backup_config
    or
    bkp_restore.sh -m backup_config_incr
    
    
  • For Windows systems:

    bkp_restore.sh -m backup_config
    or
    bkp_restore.bat -m backup_config_incr
    

    See Also:

    Chapter 20, "Oracle Application Server Backup and Recovery Tool" in Oracle Application Server Administrator's Guide for more information.