Oracle Application Server 10g Administrator's Guide 10g (9.0.4) Part Number B10376-01 |
|
This chapter describes how to install, configure, and use the Oracle Application Server Backup and Recovery Tool (OracleAS Backup and Recovery Tool).
It contains the following topics:
The Oracle Application Server Backup and Recovery Tool (OracleAS Backup and Recovery Tool) is a Perl script and associated configuration files you can use to backup and recover configuration files and the Metadata Repository in your Oracle Application Server environment. The types of files you can back up and recover using the tool are shaded in Figure 12-1.
The tool can be used in different ways, depending on your level of experience and requirements:
You can obtain the Oracle Application Server Backup and Recovery Tool from the "OracleAS RepCA and Utilities" CD-ROM. The tool is located on the CD-ROM in the utilities/backup
directory.
See Also:
Oracle Application Server 10g Installation Guide for information about the "OracleAS RepCA and Utilities" CD-ROM |
Before you install the OracleAS Backup and Recovery Tool, review the following notes:
You cannot use the tool on a Metadata Repository installation that was created by running OracleAS RepCA in an existing database. Refer to Section 11.5, "Assumptions and Restrictions".
Note:
To install the OracleAS Backup and Recovery Tool:
backup_restore.tar
file from the "OracleAS RepCA and Utilities" CD-ROM to your disk. You can install in the Oracle home, or in another directory outside of the Oracle home. For example, to install it in the Oracle home:
cdORACLE_HOME
tar xvfCD_ROM
/utilities/backup/backup_restore.tar
bkp_restore.pl
file has execute permission, for example:
chmod 755
ORACLE_HOME/
backup_restore/bkp_restore.pl
Table 12-1 OracleAS Backup and Recovery Tool Files
FileFoot 1 | Description |
---|---|
|
The Perl script that you execute to perform backup and recovery operations |
|
The main configuration file that contains parameters for customizing the tool for your environment |
|
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. |
|
Templates for scripts for performing database backup and recovery operations using RMAN. When you initially configure the tool, a customized |
query_dbid.sql |
A SQL script called by the tool to initialize your configuration |
1
Paths are relative to the root of the OracleAS Backup and Recovery Tool directory. |
This section describes how to configure the OracleAS Backup and Recovery Tool. You must follow these steps for each installation in your environment.
Recommendations for creating these directories are as follows:
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
config.inp
and modify the parameters as described in Table 12-2. Notice that some of the instructions are different depending on whether this is a middle-tier or Infrastructure installation.
Table 12-2 Parameters in config.inp
ORACLE_HOME
environment variable to the Oracle Application Server Oracle home.
-m configure
option, for example:
cd BACKUP_TOOL_DIR
./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.
As shipped, the OracleAS Backup and Recovery Tool backs up all of the Oracle Application Server configuration files that are necessary to reconstruct an Oracle Application Server installation.You can customize the tool to include any additional files that you would like to back up regularly, or to exclude any configuration files you do not want to back up.
Before you customize the tool, you should understand how it works. When you use the tool to back up your configuration files, it:
config.inp
(unless another environment file was specified with the -e
option) and retrieves config_files_list
.
config_files_list
and exits with an error if it cannot open all of the files.
config_exclude_files.inp
. The tool will not attempt to back up the files listed in this file.
config_files_list
and examines the first entry in each file. This entry is the key file. The key file is used to determine if the component exists in this installation.
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:
You may want to add your own local configuration files or any other files you would like to back up regularly, such as log files
You may want to exclude files from being backed up
To add a files to a backup, add entries to the config_misc_files.inp
file as follows:
${OH}/directorypath
/file
${OH}/directorypath/
${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
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
.
You can exclude files from a backup in either of the following ways:
config_
component
.inp
file.
config_
component
.inp
file specifies an entire directory to back up, and you would like to exclude a specific file from that directory, you can add an entry for that file to config_exclude_files.inp
. The tool will back up the entire directory except for the file you specify. You cannot specify directories or use wildcards in config_exclude_files.inp
--only single file entries are allowed.
Note that you do not need to specify a key file in config_exclude_files.inp
.
This section summarizes usage for the OracleAS Backup and Recovery Tool.
It contains the following topics:
Before running the OracleAS Backup and Recovery Tool:
ORACLE_HOME
environment variable is set.
ORACLE_SID
environment variable is set. The default is asdb
.
cd
) to the directory in which the tool resides.
The syntax for the OracleAS Backup and Recovery Tool is:
bkp_restore.pl [-defsv] -mmode
[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
-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 12-3 describes the OracleAS Backup and Recovery Tool modes and their arguments. All modes and arguments are case-sensitive.
Mode and Arguments | Description |
---|---|
|
Performs a complete cold backup of the Metadata Repository.
|
|
Performs an incremental backup of the Metadata Repository.
Works the same as There are two types of incremental backups, cumulative and differential. The tool uses the default type, which is differential. For more information, refer to Oracle9i Recovery Manager User's Guide in the Oracle9i Documentation Library. |
|
Performs a full configuration file backup.
|
|
Performs an incremental configuration file backup.
Works the same as |
|
Performs an online backup of the Metadata Repository.
|
|
Performs an incremental online backup of the Metadata Repository.
Works the same as There are two types of incremental backups, cumulative and differential. The tool uses the default type, which is differential. For more information, refer to Oracle9i Recovery Manager User's Guide in the Oracle9i Documentation Library. |
|
When using this on an Infrastructure, make sure the Metadata Repository is up before you run this command.
|
configure_nodb |
Same as "
Note: You should use " |
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't 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. |
[ |
Restores configuration files.
The |
|
Restores and recovers the Metadata Repository from the available cold and online backups.
By default, this command restores and recovers the database to its most recent state. You can use the
By default, this command does not restore the control file. You can use the
If you use the
The Refer to Section 12.7, "Best Practices for Restoring and Recovering the Metadata Repository" for more information. |
This section contains usage examples for the OracleAS Backup and Recovery Tool.
config.inp
file:
bkp_restore.pl -m configure
myconfig.inp
:
bkp_restore.pl -m configure -e myconfig.inp
bkp_restore.pl -v -m backup_config
myconfig.inp
:
bkp_restore.pl -v -m backup_config -e myconfig.inp
bkp_restore.pl -v -m backup_config_incr
bkp_restore.pl -m restore_config -t config_bkp_2003-02-27_13-45
bkp_restore.pl -m backup_cold
bkp_restore.pl -m backup_cold_incr -l 2
bkp_restore.pl -m backup_online
bkp_restore.pl -m backup_online_incr -l 0
bkp_restore.pl -m restore_db
bkp_restore.pl -m restore_db -u 7/26/2003_13:45:06
This section describes best practice tips for using the OracleAS Backup and Recovery Tool to restore and recover the Metadata Repository. It contains the following sections:
This section covers several circumstances under which you may need to restore and recover the Metadata Repository to the same host:
If a datafile is corrupted or lost, you can use the following command to restore from the latest backup and perform a full recovery:
bkp_restore.pl -m restore_db
If a control file is corrupted or lost, you can use the following command to restore a control file backup, restore the datafiles, and perform a full recovery:
bkp_restore.pl -m restore_db -c
When you use the -c
option, it restores the control file. This causes entries for tempfiles in locally-managed temporary tablespaces to be removed. You must add a new tempfile to the TEMP tablespace, or Oracle will display error ORA-25153: Temporary Tablespace is Empty.
To add a tempfile to the TEMP tablespace:
SQL> alter tablespace "TEMP" add tempfile 'ORACLE_HOME
/oradata/GDB
/temp01.dbf' size 5120K autoextend on next 8k maxsize unlimited;
GDB
is the first part of the global database name.
Note that when you restore a control file, the tool performs an "alter database open resetlogs." This invalidates all backups and archivelogs. You should immediately perform a complete cold backup of the Metadata Repository, which will serve as the new baseline for your subsequent partial online backups.
If you lost configuration files in your middle-tier or Infrastructure installation and restored those, you may want to restore the database to the same point-in-time as the configuration file backup. You can do this using the following command:
bkp_restore.pl -m restore_db -u timestamp
You can specify any time between the time of your first backup and the current time, as long as none of the online redo logs were compromised. If any online redo logs are missing or corrupted, the latest time that can be specified is the time at which the last backup was made.
Note that when you do point-in-time recovery, the tool performs an "alter database open resetlogs." This invalidates all backups and archivelogs. You should immediately perform a complete cold backup of the Metadata Repository, which will serve as the new baseline for your subsequent partial online backups.
When you restore the Metadata Repository to a new host (with the same hostname and IP address), the new host will not have the online redo logs that existed on the original host. Therefore, you cannot perform a full recovery--RMAN would give an error stating that it cannot find a certain log file (the online redo log file). Instead, you should do a point-in-time recovery using a time sometime between the first and most recent backup. You can do this using the following command:
bkp_restore.pl -m restore_db -c -u timestamp
If this command returns an error and the log shows that the datafiles were restored and recovered, then issue an "alter database open resetlogs" and the database will be opened in a consistent state. If no datafiles were restored and recovered, it is most likely an early timestamp was specified and you should retry the command with a later timestamp.
When you use the -c
option, it restores the control file. This causes entries for tempfiles in locally-managed temporary tablespaces to be removed. You must add a new tempfile to the TEMP tablespace, or Oracle will display error ORA-25153: Temporary Tablespace is Empty.
To add a tempfile to the TEMP tablespace:
SQL> alter tablespace "TEMP" add tempfile 'ORACLE_HOME
/oradata/GDB
/temp01.dbf' size 5120K autoextend on next 8k maxsize unlimited;
GDB
is the first part of the global database name.
Note that whenever you restore the Metadata Repository to a new host, the control file will be restored from backup. This means that an "alter database open resetlogs" is always done, which invalidates all backups and archivelogs. You should immediately perform a complete cold backup of the Metadata Repository, which will serve as the new baseline for your subsequent partial online backups.
This section lists OracleAS Backup and Recovery Tool error messages you can ignore for certain configurations.
Could not copyORACLE_HOME
/Apache/Apache/conf/osso/osso.conf toBACKUP_DIR
/Apache/Apache/conf/osso/osso.conf: No such file or directory
Could not copyORACLE_HOME
/Apache/Apache/conf/osso/osso.conf toBACKUP_DIR
/Apache/Apache/conf/osso/osso.conf: No such file or directory
Could not copyORACLE_HOME
/toplink/config/workbench.xml toBACKUP_DIR
/toplink/config/workbench.xml: No such file or directory
|
![]() Copyright © 2002, 2003 Oracle Corporation. All Rights Reserved. |
|