Skip Headers
Oracle® Application Server Installing and Getting Started with Standard Edition One
10g Release 2 (10.1.2) for Linux x86
B16043-02
  Go To Documentation Library
Home
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

14 Backup and Recovery

This chapter describes how to back up and recover the Oracle Application Server Standard Edition One configuration files and OracleAS Metadata Repository. It contains the following sections:

14.1 Comparison of Backup and Recovery Services

There are two methods for performing back up and recovery, through Application Server Control Console and using OracleAS Backup and Recovery Tool. It is important to note, however, that Application Server Control Console backs up configuration files and OracleAS Metadata Repository only. You must use OracleAS Backup and Recovery Tool to perform a full environment backup. Table 14-1 summarizes the differences between the two backup and recovery methods.

Table 14-1 Comparison of Backup and Recovery Services

File/Data Type Backed up by Application Server Control Console Backed up by OracleAS Backup and Recovery Tool
Oracle Software Files

Static files such as libraries and binaries. They reside in the middle-tier and infrastructure Oracle homes. These files change only after applying Oracle product patches or installation/reinstallation of the software.

No Yes
Oracle Configuration Files

Configuration files for various components such as OracleAS Portal or J2EE. They reside in the middle-tier and infrastructure Oracle homes. These files change frequently, typically after a configuration change or deployment of a new application.

Yes Yes
OracleAS Metadata Repository Files

These are the datafiles and control files that make up your Metadata Repository. They reside in the infrastructure Oracle home. These files change constantly during regular operations of Oracle Application Server Standard Edition One.

Yes Yes

14.2 Backup and Recovery Using Application Server Control

On Application Server Control Console, as shown in Figure 14-1, click Backup/Recovery to access the Backup and Recovery page:

Figure 14-1 Backup and Recovery Page

Description of seone_backup.gif follows
Description of the illustration seone_backup.gif

Before you can perform a backup or recovery, you need to configure your backup and recovery settings. You only need do this the first time you access this page. Your configuration settings are saved for all subsequent backup and recovery operations. You can access this page to change your settings at any time.

14.2.1 Configuring the Backup and Recovery Settings

On the Backup and Recovery page, as shown in Figure 14-2, click the Configure Backup/Recovery Settings link to open the Configure Backup/Recovery Settings page.

Figure 14-2 Configuring Backup and Recovery Settings

Description of seone_backup_config.gif follows
Description of the illustration seone_backup_config.gif

For both OracleAS Infrastructure and middle tier instances, you must provide the following information:

  • Log File Location

    The backup and recovery procedure generates a log, which is useful for any type of troubleshooting. In the Log File Location field, specify the full path to the directory where you want the log file to be located. If the specified directory does not already exist, it is created for you.

  • Configuration Files Backup Location

    Enter the full path to the directory where you want your backed up data to be located. It is recommended that you either specify a location independent from where your Oracle Application Server Standard Edition One files are located, or move them to such a location immediately after the backup. If the specified directory does not already exist, it is created for you.

    If you are backing up an OracleAS Infrastructure instance, you are also prompted for the following information:

    • Metadata Repository Database Backup Location

      Enter the full path to the location of your Metadata Repository database. The default location is:

      INFRA_ORACLE_HOME/oradata/seone
      
      

      For example:

      /product/10.1.2/OracleAS/infra/oradata/seone
      
      
    • Metadata Repository SID

      Specify the database Service ID (SID). The default is seone.

Click OK when you are finished specifying your backup and recovery settings.

14.2.2 Performing a Backup

On the Backup and Recovery page, click the Perform Backup link to open the Perform Backup page (Figure 14-3).

On this page, you can select one of the following backup types:

  • Full Online Backup

    A complete backup of all the configuration files for this Oracle Application Server Standard Edition One instance. This option does not stop the instance.

  • Incremental Online Backup

    An incremental backup of all the configuration files for this Oracle Application Server Standard Edition One instance. In an incremental backup, only the files that have changed since the last full or incremental backup are backed up. This option does not stop the instance.

  • Full Cold Backup

    A complete backup of all the configuration files for this Oracle Application Server Standard Edition One instance. This option stops the instance.

  • Incremental Cold Backup

    An incremental backup of all the configuration files for this Oracle Application Server Standard Edition One instance. This option stops the instance.

After you select the type of backup you want to perform, click OK to begin the backup.

14.2.3 Performing a Recovery

On the Backup and Recovery page, click the Perform Recovery link to open the Perform Recovery page (Figure 14-4).

Select one of the available backups from the list of available backups, then click OK to perform the recovery.

14.3 Backup and Recovery Using OracleAS Backup and Recovery Tool

OracleAS Backup and Recovery Tool is used to perform configuration file and Metadata Repository backup and recovery. In addition, you can use it to set up your own configuration file and Metadata Repository backup and recovery scripts.

This section contains the following topics:

14.3.1 Obtaining OracleAS Backup and Recovery Tool

OracleAS Backup and Recovery Tool can be obtained from either the Oracle Application Server Standard Edition One installation or the OracleAS Metadata Repository Creation Assistant CD-ROM.

From the Oracle Application Server Standard Edition One Installation

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

Table 14-2 OracleAS Backup and RecoveryTool Files

File Description
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 is created from each .tmpl file.
*.sql

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


Note:

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 Oracle Application Server

From the OracleAS Metadata Repository Creation Assistant CD-ROM

If you are running RepCA 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 directory 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:

    $ORACLE_HOME/perl/bin/perl
    
    
  • The tool requires that Java Runtime Environment (JRE) be installed. You can download 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 Standard Edition One.

  2. Extract the contents of the backup_restore.jar file, which is located in the directory:

    CD_ROM/stage/Components/oracle.iappserver.backup_restore/10.1.2.0.0/1/DataFiles/backup_restore.jar.

    For example, to install it in the Oracle home, use the following commands:

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

    If you install OracleAS Metadata Repository Creation Assistant, then the file backup_restore.jar is automatically extracted for you and put in $ORACLE_HOME/utilities/backup directory.

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

    /> cd $ORACLE_HOME
    /> $ORACLE_HOME/> jar xvf utilities/backup/backup_restore.jar
    
    
  3. Ensure that the bkp_restore.pl file has execute permission, for example:

    chmod 755 $ORACLE_HOME/backup_restore/bkp_restore.sh
    
    

Familiarize yourself with the OracleAS Backup and Recovery Tool files, which are described in the Table 14-2. Instructions for editing the configuration files are in subsequent steps.

14.3.2 Configuring the OracleAS Backup and Recovery Tool

To configure the OracleAS Backup and Recovery Tool:


Note:

You must follow these steps for each installation in your environment.

  1. The tool creates log files and backup files, and you must create the following directories to hold these:

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

    2. Configuration file backup directory: (middle tier and infrastructure) This directory holds configuration file backups. This directory should have several hundred megabytes of free 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 free 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 is the best method for recovering data in the event of a hardware failure.

    • Ensure your backup directories are writable by the user who installed Oracle Application Server.

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

      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
      
      
  2. Open config.inp and modify the parameters as described in Table 14-3. Notice that some of the instructions are different for middle-tier and infrastructure installations.

    Table 14-3 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 is 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 the following script:

    bkp_restore.pl -m configure.

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

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

    For J2EE and Web Services installation, this value does not change.

    pfile J2EE and Web Services Installation:

    Leave this line commented out.

    OracleAS Portal:

    If required, then specify an alternative pfile to use when starting up the database. Otherwise, leave the line commented out and the default spfile is used:

    $ORACLE_HOME/dbs/spfileSID.ora

    Ensure that you 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, then the following file is used as pfile:

    $ORACLE_HOME/dbs/initSID.ora
    
    

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

    database_backup_path J2EE and Web Services Installation:

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

    OracleAS Portal Installation:

    Specify the full path of the database backup directory.


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

  4. If this is an infrastructure installation, then:

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

    2. Ensure the Metadata Repository is started.

  5. Configure the tool by running it with the -m configure option. For example:

    ./bkp_restore.sh -m configure
    
    

    For RepCA installations, run the following after specifying the correct version of perl.exe:

    bkp_restore.pl -m configure
    
    

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

14.3.3 Customizing the Tool for Your Configuration Files

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.

The tool determines the configuration files that exist in the installation. Although it is not necessary to customize the tool, you can 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.

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 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 want to exclude a specific file from that directory, then you can add an entry for that file to config_exclude_files.inp. The tool backs 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.

14.3.4 OracleAS Backup and Recovery Tool Usage Summary

This section describes the usage of OracleAS Backup and Recovery Tool.

It contains the following topics:

14.3.4.1 Prerequisites for Running the Tool

Before running the OracleAS Backup and Recovery Tool:

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

  • Ensure the ORACLE_HOME environment variable is set.

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

14.3.4.2 OracleAS Backup and Recovery Tool Syntax

The syntax for the OracleAS Backup and Recovery Tool is:

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

It accepts the options described in the following table:

Item Description
-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 14-4 describes the OracleAS Backup and Recovery Tool modes and their arguments. All modes and arguments are case-sensitive.

Table 14-4 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.
  • Opens config.inp (or the alternative 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, then the backup_cold 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, 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.
  • Opens config.inp (or the alternative 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, then it is treated as a fatal error. Otherwise, backs up all files in the list. If any other files do not exist, then 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, then creates a log file in log_path/config_bkp_timestamp.

Process Prerequisites:

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

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

  • The database needs to be up and running.

  • The listener process must be up.

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_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_online Performs an online backup of the Metadata Repository. If you are running this command on an infrastructure, then ensure that the Metadata Repository is up before running the following command.
  • Opens config.inp (or the alternative 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, then the backup_cold option backs both of them up as a set. This would be the case where a file based repository exists in an infrastructure installation.

To check whether a particular OracleAS instance hosts a file based repository or a database, 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 on an infrastructure, ensure the Metadata Repository is up before you run this command.

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

  • If using this on an infrastructure, then update 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, then 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. configure_nodb 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 doesn 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.
  • Opens config.inp (or the alternative 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, then it restores that full backup.

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

  • If the -t option is not supplied, then it 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, then it 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 causes restore_config failures. Run restore_config on one node at a time.

restore_db This command is deprecated. Use restore_repos instead.
restore_repos

[-u timestamp]

[-c] [-n]

Restores and recovers the OracleAS Metadata Repository and DCM file based repository from the available cold and online backups. The command performs the following operations:
  • Opens config.inp (or the alternative 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

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, then ensure 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 20.2.4, "Restoring and Recovering the Metadata Repository" in Oracle Application Server Administrator's Guide for more information.

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

  • Check for timestamp input. If not provided, then list the available backup timestamps corresponding to the file-based repository.

  • Run 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

If both the metadata repository and a file based repository coexist in an application server instance, then 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 installation.


14.3.4.3 Usage Examples

This section contains usage examples for the OracleAS Backup and Recovery Tool.

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

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

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

    bkp_restore.sh -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
    
    
  • Perform an incremental configuration file backup:

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

    bkp_restore.sh -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
    
    
  • Perform a level 2 incremental cold backup of the Metadata Repository:

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

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

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

    bkp_restore.sh -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
    
    
  • Flashback the Metadata Repository to its state at a particular time:

    bkp_restore.sh -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
    
    
  • Perform a cold backup of an Oracle Application Server Standard Edition One instance:

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

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

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

    bkp_restore.sh -m backup_instance_online_incr -l <level>
    
    
  • Restore an Oracle Application Server Standard Edition One instance to its state at a particular time:

    bkp_restore.sh -m restore_instance -t 07/26/2003_13:45:06 -c
    
    

14.4 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 take a backup of each of your Oracle Application Server instances (middle-tier and infrastructure) at the same time. While taking a backup of one instance, ensure that no configuration changes are made in any of the other instances.

It contains the following topics:

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


See Also:

Backup and Recovery Basics in the Oracle Database 10g Release 1 (10.1) Documentation Library for information about block change tracking

14.4.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 enables to perform the recovery strategies in this book.


See Also:

Oracle Database Administrator's Guide 10g Release 1 (10.1.2) for more information about the parameters in this section, and setting up archive logging in general

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 setup, 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 being 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 equals a number of 1 to 10.

    If pfile is used, then the following initialization file needs to be edited:

    INFRA_ORACLE_HOME/database/initSID.ora
    
    

    Change the LOG_ARCHIVE_DEST_n parameter to:

    LOG_ARCHIVE_DEST_n = '/disk1/oraHome/archive'
    
    

    (Optional) The default file name format for archive logs is:

    %t_%s.dbf
    
    

    You can change the LOG_ARCHIVE_FORMAT. If you need to use a different format, then include the initialization parameter LOG_ARCHIVE_FORMAT in the initialization file, for example:

    LOG_ARCHIVE_FORMAT = arch_%t_%s_%r.arc
    
    

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

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

  4. Ensure nobody 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
    

14.4.3 Creating a Record of Your Oracle Application Server Standard Edition One Configuration

In the event you need to restore and recover your Oracle Application Server Standard Edition One 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 Standard Edition One environment on a new disk or host.

You should maintain an up-to-date record of your Oracle Application Server Standard Edition One 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 Standard Edition One environment.

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

  • The following information for each host in your environment:

    • Host name

    • Virtual host name (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:

      The $ORACLE_HOME/install/portlist.ini file 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

14.4.4 Performing an Instance Backup

This section describes how to perform various Oracle Application Server Standard Edition One instance backups. An instance level backup backs up all the required components in an application server instance: configuration files, repositories (database or file-based) for the infrastructure and mid-tier.

You can use the Application Server Control Console to manage backup and recovery of an application server instance. Using the Control Console, you can perform all of the following commands instead of entering commands on the command line. For instructions on how to use the Application Server Control Console to backup an application server instance, refer to the online help.

Performing a Cold Backup of an Oracle Application Server Standard Edition One Instance

Use the following command to perform a cold backup of an Oracle Application Server Standard Edition One instance:

bkp_restore.sh -m backup_instance_cold

Performing an Incremental Cold Backup of an Oracle Application Server Standard Edition One Instance

Use the following command to perform an incremental cold backup of an Oracle Application Server Standard Edition One instance:

bkp_restore.sh -m backup_instance_cold_incr -l <level>

Performing an Online Backup of an Oracle Application Server Standard Edition One Instance

Use the following command to perform an online backup of an Oracle Application Server Standard Edition One instance:

bkp_restore.sh -m backup_instance_online

Performing an Incremental Online Backup of an Oracle Application Server Standard Edition One Instance

Use the following command to perform an incremental online backup of an Oracle Application Server Standard Edition One instance:

bkp_restore.sh -m backup_instance_online_incr -l <level>

14.4.5 Performing a Complete 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

  • Oracle Application Server Metadata Repository

Both 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. It is a snapshot or point-in-time image of the database. When you use the OracleAS Backup and Recovery Tool to restore an online backup, any ongoing changes to the database occurring during the time of the online backup is recovered by applying the redo logs.

Refer to the Oracle Database Backup and Recovery Advanced User's Guide, Section 2, "RMAN Backup Types" for more information.

This section contains the following steps:

Task 1: Shut Down Your Oracle Application Server Standard Edition One Environment

If this is the first backup after installing the Oracle Application Server Standard Edition One, then you should take the following steps to shut down the Oracle Application Server Standard Edition One Environment and perform a cold backup of the database 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, then like a rolling- software upgrade, you can perform either a cold backup or an online backup of the database. If you choose the online backup so that your business applications remain up and running, then you can skip this task and proceed with Task 2 and Task 3.

  1. Stop the middle-tier instances.

    Refer to Section 9.3.2 for instructions.

  2. Stop the infrastructure.

    Refer to Section 9.2.2 for instructions.

Task 2: Back Up the Middle Tier

To back up the middle-tier:

  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.

    Ensure 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
    
    
  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 must be up. The opmnctl start command can be used to bring it up.

    • The OID process must to be up. The command opmnctl startproc ias-component=OID can be used to start this process. The OID process exists on infrastructure (IM + MR) or IM installation.

    • The database needs to be up and running.

    • The listener process must be up.

    Perform a backup 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. Following is an example of how to do this using the OracleAS Backup and Recovery Tool:

    bkp_restore.sh -m backup_config
    
    

    See Also:

    Chapter 18, "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, in case you start to reconfigure your system and then you want 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_2005-05-10_18-33-15.jar
    dcm_archive_2005-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. Following is an example of how to do this using the OracleAS Backup and Recovery Tool:

    bkp_restore.sh -m backup_cold
    or
    bkp_restore.sh -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 18, "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.

    Ensure that you 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
    
    
  3. Back up the infrastructure configuration files.


    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.

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

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

    • The OID process must to be up. The command opmnctl startproc ias-component=OID can be used to start this process. The OID process exists on infrastructure (IM + MR) or IM installation.

    • The database needs to be up and running.

    • The listener process must be up.

    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. Following is an example of how to do this using the OracleAS Backup and Recovery Tool:

    bkp_restore.sh -m backup_config
    
    

    See Also:

    Chapter 18, "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 want 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 /etc directory.

  2. If the oraInventory directory resides outside the 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 /etc/oraInst.loc.

Task 5: Start Your Oracle Application Server Environment

  1. Start the infrastructure.

    Refer to Section 9.2.1 for instructions.

  2. Start the middle-tier instances.

    Refer to Section 9.3.1 for instructions.

For More Information...

For more information about any of these tasks, refer to:

14.4.6 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 up and running), and should include the following:

  • Configuration Files

  • Identity Management metadata

  • OracleAS 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

  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
    
    

    See Also:

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

  2. Perform a full or incremental database backup of the OracleAS Metadata Repository.

    You can perform this step using your own procedure or the OracleAS Backup and Recovery Tool. Following is an example of how to do this using the OracleAS Backup and Recovery Tool:

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

    See Also:

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

Task 2: Back Up the Middle-Tier

Perform a full or incremental backup of the configuration files in the middle-tier. You can perform this step using your own procedure, Application Server Control Console, or the OracleAS Backup and Recovery Tool. Following is an example of how to do this using the OracleAS Backup and Recovery Tool:

For a full backup:

bkp_restore.sh -m backup_config

or

For an incremental backup:

bkp_restore.sh -m backup_config_incr


See Also:

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

For More Information...

For more information about either task, see: