Oracle® Application Server Administrator's Guide
10g Release 2 (10.1.2) Part No. B13995-02 |
|
![]() Previous |
![]() Next |
This chapter describes the Oracle Application Server backup strategy and procedures.
It contains the following topics:
This section describes the recommended backup strategy for Oracle Application Server. Using this strategy ensures that you can perform the recovery procedures described in this book.
The backup strategy is as follows:
Task 1: Perform a Complete Oracle Application Server Environment Cold Backup
Task 2: Perform Configuration and Metadata Backups on a Regular Basis
Task 3: Perform a New Complete Oracle Application Server Environment Backup After a Major Change
Task 4: Perform Configuration and Metadata Backups on a Regular Basis (Return to Task 2)
The flow chart in Figure 19-1 provides an overview of how to decide which type of backup is appropriate for a given circumstance.
Figure 19-1 Decision Flow Chart for Type of Backup
Task 1: Perform a Complete Oracle Application Server Environment Cold Backup
The first backup you perform should be a complete Oracle Application Server environment backup, which includes all of the files in your environment. Before you perform your first backup, make sure ARCHIVELOG
mode is enabled in the Metadata Repository. You should also create a record of your environment.
Enable ARCHIVELOG
mode in the Metadata Repository.
By default, the Metadata Repository does not have ARCHIVELOG
mode enabled. You should enable it immediately so your online redo logs are archived. You should enable ARCHIVELOG
mode before you perform your first complete cold backup. Otherwise, your backup control files will contain the NOARCHIVELOG
mode setting. You cannot use the Backup and Recovery Tool in the NOARCHIVELOG
mode.
Perform a complete Oracle Application Server environment backup.
This will serve as the baseline for all subsequent non-environmental backups.
Refer to Section 19.2.6, "Performing a Complete Oracle Application Server Environment Backup".
Create a record of your Oracle Application Server environment.
In the event you need to reconstruct your environment, you can refer to this record.
Refer to Section 19.2.3, "Creating a Record of Your Oracle Application Server Configuration".
Task 2: Perform Configuration and Metadata Backups on a Regular Basis
After every administrative change, or, if this is not possible, on a regular basis, perform a configuration and metadata backup of your Oracle Application Server environment.
See Also: Appendix G, "Examples of Administrative Changes" to learn more about administrative changes |
Refer to Section 19.2.7, "Performing a Configuration and Metadata Backup".
Task 3: Perform a New Complete Oracle Application Server Environment Backup After a Major Change
If you make a major change to your Oracle Application Server environment, you must perform a new complete Oracle Application Server environment backup. This backup will serve as the basis for subsequent non-environmental backups. You should also update the record of your environment with the new configuration information.
Perform a new complete Oracle Application Server environment backup after:
An operating system software upgrade
An Oracle Application Server software upgrade or patch application
To do so:
Update the record of your Oracle Application Server environment.
Refer to Section 19.2.3, "Creating a Record of Your Oracle Application Server Configuration".
Perform a complete Oracle Application Server environment backup.
Refer to Section 19.2.6, "Performing a Complete Oracle Application Server Environment Backup".
Task 4: Perform Configuration and Metadata Backups on a Regular Basis (Return to Task 2)
After you establish a new complete Oracle Application Server environment backup, return to Task 2 and continue to perform configuration and metadata backups on a regular basis.
Additional Tips:
Create a backup of the JRE/JDK on your system. This is not an Oracle product, but it is utilized by Oracle Application Server and, if accidentally lost or corrupted, would need to be restored in order for Oracle Application Server to function. This issue only applies to HP-UX, HP Tru64, and IBM AIX systems.
Make sure your backups are valid by routinely verifying that they can be restored.
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. In order 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 Oracle Application Server instance, ensure that no configuration changes are made in any of the other instances.
This section contains the following topics:
Creating a Record of Your Oracle Application Server Configuration
Performing a Complete Oracle Application Server Environment Backup
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, 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 on block change tracking, refer to Backup and Recovery Basics in the Oracle Database 10g Release 1 (10.1) Documentation Library.
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 on 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:
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.
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.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 above example, t
represents the thread number, r
represents the reset log ID, and s
represents the log sequence number.
Make sure that the ORACLE_HOME
and ORACLE_SID
(the default is orcl
)
environment variables are properly set.
Make sure that no one is using the database.
Perform a clean, normal shutdown of the database instance:
INFRA_ORACLE_HOME/bin/sqlplus /nolog SQL> connect sys/password as sysdba SQL> shutdown
Start up the instance and mount, but do not open the database:
SQL> startup mount;
Enable database ARCHIVELOG
mode:
SQL> alter database archivelog;
Shut down and restart the database instance:
SQL> shutdown SQL> startup
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
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
This section describes how to perform various Oracle Application Server 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.
Performing a Cold Backup of an Oracle Application Server Instance
Use the following command to perform a cold backup of an Oracle Application Server instance:
bkp_restore.sh -m backup_instance_cold bkp_restore.bat -m backup_instance_cold
Performing an Incremental Cold Backup of an Oracle Application Server Instance
Use the following command to perform an incremental cold backup of an Oracle Application Server instance:
bkp_restore.sh -m backup_instance_cold_incr -l <level> bkp_restore.bat -m backup_instance_cold_incr -l <level>
Performing an Online Backup of an Oracle Application Server Instance
Use the following command to perform an online backup of an Oracle Application Server instance:
bkp_restore.sh -m backup_instance_online bkp_restore.bat -m backup_instance_online
Performing an Incremental Online Backup of an Oracle Application Server Instance
Use the following command to perform an incremental online backup of an Oracle Application Server instance:
bkp_restore.sh -m backup_instance_online_incr -l <level> bkp_restore.bat -m backup_instance_online_incr -l <level>
You can use the Oracle Enterprise Manager 10g Application Server Control Console to manage backup and recovery of an Oracle Application Server instance. The Application Server Control Console provides a graphical user interface to perform backup of an instance.
From the Home page for an application server instance, click Backup/Recovery to display the Backup/Recovery page. For more information about how to backup a server instance, click Help.
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 database(s): 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, Section 2, "RMAN Backup Types" for more detail.
This section 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, 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.
Stop the middle-tier instances.
Refer to Section 3.2.4, "Stopping a Middle-Tier Instance" for instructions.
Stop the Infrastructure.
Refer to Section 3.2.2, "Stopping OracleAS Infrastructure" for instructions.
Task 2: Backup the Middle-Tier Installations
For each middle-tier installation in your environment:
Backup 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
Backup the middle-tier configuration files.
If the DCM repository type is a database, the following processes must be up:
The OPMN process must be up. The command opmnctl start
can be used to bring it up.
The Oracle Internet Directory process must be up. The command opmnctl startproc ias-component=OID
can be used to start this process. The Oracle Internet Directory process exists on Infrastructure (IM + MR) or IM installation. The Oracle Internet Directory process must be running to perform any backup operations on a middle tier.
The database must 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. 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
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 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: Backup the Infrastructure
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.
Backup 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, 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, 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
Backup 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, 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, you also should perform this step on each of those Oracle homes. |
If the DCM repository type is a database, the following processes must be up:
The OPMN process. The command opmnctl start
can be used to bring it up.
The Oracle Internet Directory process. The command opmnctl startproc ias-component=OID
can be used to start this process. The Oracle Internet Directory process exists on Infrastructure (IM + MR) or IM installation.
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
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: Backup the Oracle System Files
On each host in your Oracle Application Server environment:
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.
If the oraInventory
directory resides outside of your Oracle Application Server Oracle home, 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, 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
Start the Infrastructure.
Refer to Section 3.2.1, "Starting OracleAS Infrastructure" for instructions.
Start the middle-tier instances.
Refer to Section 3.2.3, "Starting a Middle-Tier Instance" for instructions.
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" to learn more about administrative changes |
These backups can be performed online (while Oracle Application Server is up and 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: Backup the Infrastructure
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
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
Task 2: Backup 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