Monday, July 20, 2009

10gAS Backup and Recovery Tool

10gAS provides its backup and recovery tool that can be used for performing complete 10gAS backup.

First of all we should be aware of types of files consisting 10gAS.

Types of Files for Oracle Application Server Backup and Recovery:

(1) Oracle Software Files: These are static files such as oracle binaries and libraries. Files in $ORACLE_HOME(excluding config files)

(2) Configuration Files:
These files contain configuration information and deployed applications. These files are placed at $ORACLE_HOME/config
They are created at installation or runtime and are updated during the normal operation of your application server. There are 2 types of config file,
(i) Distributed Configuration Management (DCM) files: - contain configuration information for OHS, OC4J, OPMN, Logloader, and JAZN
(ii) Non-DCM files: - Portal and wireless etc
Backup and Recovery tool creates archives for each group separately.

(3) Metadata Repository Files: DBF and control files making the infra db.
(4) Oracle System Files: These files includes: files in /etc or /var/opt/oracle and OraInventory file.


Note: Your Oracle Application Server environment contains additional files to those mentioned in this section, such as log files; database configuration files, including orapwd, and spfile/pfile; and additional files you may deploy in the Oracle home, such as staticHTML files and CGI scripts. You can add any of these files to the backup list.

Types of Backups:

(1) Image Backup: Image backup include backup of whole 10gAS. Image backup is generally used for node restore. An image backup of an Oracle Application Server instance includes the Oracle Home directory of that instance, the OraInventory directory, the oratab file, and Windows registries on that node and finally a cold instance backup of that Oracle Application Server instance

(2) Instance Backup: Following files can be backed up using this backup strategy: Configuration files(both DCM managed or Non-DCM managed) , Oracle metadata repository(hot or cold backup),

Note: You cannot take backup of Oracle Software files (oracle home excluding config files) and Oracle system files(like oraInventory, files in /var/opt/oracle etc) under instance backup strategy. Frankly, config and metadata repository files are the only important files that can easily bring back your 10gAS instance in stable state in case of any problem.

Oracle Application Server backup input file:
Oracle application server keeps track of its configuration files with the help of .inp files placed at $ORACLE_HOME/backup_restore/config directory. During the backup and restore process, backup and restore tool checks these inp files for backup/restoring files included in it.

Recommended Backup Strategy:
(i) Perform complete Image backup:-
(a) This should be done as soon as you install the 10gAS.
(b) After making any major changes: - it includes changes at software level (i.e. software system upgrade), Operating system upgrade, patch application.
(ii) Perform Instance Backup: - Instance backup should be taken on regular basis. This enables you to restore your environment to consistent state in case of any corruption.

Using Backup and Recovery Tool:
Backup and recovery related files are placed at $ORACLE_HOME/backup_restore

Configuring Backup and Recovery tool manually:
Prior to running backup_restore.sh for taking backup you need to specify following parameters in config.inp file placed at $ORACLE_HOME/backup_restore/config
Log File Directory(log_path)
Config file backup directory(config_backup_path)
Database backup directory(database_backup_path)

Configure the tool by running below mentioned command:
./bkp_restore.sh -m configure
That’s it, your backup and recovery tool is configured and you are good to start using your tool for back up or recovery activity

Usage Examples of Backup and Restore tool:

(1) Configure Tool: ./bkp_restore.sh -m configure

(2) Backup – Instance backup

(i) Perform full configuration file backup:
bkp_restore.sh -v -m backup_config

(ii) Perform an incremental configuration file backup:
bkp_restore.sh -v -m backup_config_incr

(iii) Perform a full cold backup of the Metadata Repository:
bkp_restore.sh -m backup_cold

(iv) Perform a level 2 incremental cold backup of Metadata Repos:
bkp_restore.sh -m backup_cold_incr -l 2

(v) Perform a full online backup of Metadata Repos:
bkp_restore.sh –m backup_online

(vi) Perform a level 2 incremental online backup of Metadata Repos:
bkp_restore.sh –m backup_online_incr –l 2

(vii) Perform a cold backup of an Oracle Application Server instance: This will take care of both configuration file and metadata repos.
bkp_restore.sh –m backup_instance_cold

(viii) Perform an online backup of an Oracle Application Server instance:
This will take care of both configuration file and metadata repos.
bkp_restore.sh –m backup_instance_online

(ix) Perform a incremental cold backup of an Oracle Application Server instance:
bkp_restore.sh –m backup_ instance_cold_incr -l level

(x) Perform an incremental online backup of an Oracle Application Server instance:
bkp_restore.sh –m backup_ instance_online_incr –l level


(3) Backup – Image Backup

(i) Node Backup Preparation:
Run the following command to prepare a node for backup:
bkp_restore.sh -m node_backup -o prepare

(ii) Creating an Image Backup of the Instance:
This task creates an archive of an instance that includes the Oracle home, oratab, central inventory, Windows registries and so forth. On UNIX, the command must be run from root. Run the following command to create an image backup of the instance:
bkp_restore.sh -m node_backup -o image_backup -P archive path


Restore – Instance Backup
(i) Restore configuration File:
bkp_restore.sh -m restore_config -t 2004-09-21_06-12-45
(ii) Restore Metadata Repository to most recent state:
bkp_restore.sh -m restore_repos
(iii) Restore Metadata Repository to a particular time:
bkp_restore.sh -m restore_repos -u 07/26/2003_13:45:06
(iv) Flashback Metadata Repository to particular point in time:
bkp_restore.sh -m flashback_repos -u 07/26/2003_13:45:06
(v) Restore an Oracle Application Server instance to its state at a particular time and include the control file in the restore:
bkp_restore.sh -m restore_instance -t 2004-09-21_06-12-45 –c

No comments:

Post a Comment