Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 

 

 

Recovery Manager (RMAN)

Oracle Application Server Tips by Burleson Consulting

A server managed backup and recovery strategy uses a tool called Recovery Manager (RMAN) to handle both the backup and recovery.  RMAN will create the backup, execute the restore and perform the recovery.  One significant advantage of using RMAN is that it normally works at the data block level rather than the file level.    RMAN backs up the data blocks to a remote locations and if needed used the data in those blocks to rebuild and recover block in the database.  RMAN uses a catalog (created in a separate database) to maintain backup information such as what backups are available and where they are located.  You can configure RMAN to maintain your backup strategy and RMAN will create the backups, and purge old backups automatically.  When you need to restore a file, RMAN will use the catalogue to locate the backup, restore the file (or data blocks) and recover the database.  RMAN is intelligent enough to determine what needs to be restored and recovered and execute the appropriate actions.  RMAN excels in environments with multiple Oracle databases and can maintain backup and recovery for both you Metadata Repository databases and you back-end databases.  For additional information on Recovery Manager, refer to the Oracle Database Documentation or a good Oracle Database book like the ones mentioned earlier in this chapter.

Database Recovery

Hopefully, you should never have to recover you database.  The Oracle9i database will automatically recover itself from most common problems.  If an instance fails or the operator issues a shutdown abort command, the database will recover itself on startup with out intervention.  However, the Oracle 9i database has all the required mechanisms to allow user recovery from serious failures. 

Note:  I recommend that you only attempt to recover a database once before contacting Oracle Support.  If the first attempt fails, repeated attempts might cause additional damage and leave the database in a state where only partial recovery is possible.  When in doubt, contact Oracle Support.

The first step is determining if and what needs recovery.  If the Metadata Repository does not open on startup, it will manifest itself in the failure of other components starting.  If you can start middle tier components, such as the OC4J instances, check the infrastructure tier to insure the OID is running.  If OID will not start then look to the Metadata Repository database.  If you find that the database is the problem, the first place to check is the database alert log.  The alert log is located in the infrastructure?s $ORACLE_HOME/admin/asdb/bdump directory and is called alertasdb.log.  Substitute your SID is you did not install the database with the SID set to asdb.  This log file will tell you why the database did not open.  If may also lead you to other trace files with more detailed information.

Because of how the Oracle9i database stores changes in the transaction logs, recovery is a two step process, roll the database forward until all changes are applied, then roll back any uncommitted (open) transactions.  At the end of this two-step operation, the database is recovered to a consistent state with no data loss. 

The Oracle9i database has two main types of recovery; complete and incomplete.  A complete recovery uses the transaction logs to recover all committed data.  An incomplete recover uses what ever logs are available to recover as much data as possible and then stops.  There is always some type of data loss in an incomplete recovery.  Incomplete recovery is required if the database is not in ARCHIVELOG mode or needed archive log files are no longer available.   The steps to execute a recovery are:

  1. Fix the Problem (replace faulty equipment, drives etc).

  2. Restore the affected files

  3. Locate (or restore) the archive log files

  4. Start the database

  5. Recover the database

  6. Open the database.

If a disk crash caused the problem, you must replace the drive or place the restored file in another location. Restore the most recent backup of the damaged files.  The older the backup, the longer it will take to roll the file forward.  Locate or restore the archive log files that cover transactions back to the data of the backup.  If restored to the archive log directory, the Oracle database will know where to find them.  If you restore the logs to another location, the database will ask you where they are.  Now start the database.  If the database can automatically recover then the database will end up in an open, ready to use state.  If not the database will startup to the mount point and issue an error stating that the data file needs recovery.  Issue the command:

SQL> RECOVER DATABASE;

Oracle will tell you the name of the first archive log file needed for the recovery.  If you place all the archive logs in the original directory press enter to apply that log.  Enter AUTO to have Oracle automatically apply all necessary log without asking.  Finally if you did not replace the log files in the original directory, enter the new location where Oracle can find the files.  Upon completion Oracle will respond:

Media Recovery Complete

Open the database and check the alert log for any other problems. 

Complete Database Recovery

A complete database recovery is required when you are recovering an Infrastructure instance from backup and are restoring all of the file in the $ORACLE_HOME/oradata directory to include all control files.  If you restored all files to include the archive log files for that backup, the database should self recover on startup.  If the backup was created using a Hot (open) backup, media recovery may be required.  Insure that you restore the archive log files that were copied with the hot backup.

Database Recovery Issues

This section discussed basic file recovery on a database that is not open.  For additional information refer to the references already mentioned.  There are entire books written covering only backup and recovery.  If in doubt, get help, call Oracle Support.  Below are some points to remember when faced with a database recovery.

  • Use the current Control File.  The Control File contains the information that defines the current status of each file. If one of the Control Files needs to be restored, copy it over from one of the other current control files.  Never use a restored copy of a Control File unless all copies of the current control file are lost. 

  • Any time you open the database with the RESETLOGS clause there is data loss.  Always contact Oracle Support before using RESETLOGS.  Once used, it can not be undone.

  • When restoring files, only restore files which are damaged of lost.  This will reduce the roll forward time.

At this point we have covered the basics of backing up and recovering both the application server and the Oracle9i database that holds the Metadata Repository.  How that you have an basic understand of the mechanisms involved, we will introduce you to a tool that will automate most of these tasks.

Oracle Application Server Backup and Recovery Tool

The Oracle Application Server Backup and Recovery Tool is a perl script that will not only handle your backup needs, but will automatically handle a restore.  This tool handles the instance configuration files to include the Metadata Repository database data files (Group 3 file described above).  Since these are the files that change often, you can build you backup strategy around this tool.  You can now take a full backup of the instance?s $ORACLE_HOME and then use the Backup and Recovery Tool to backup on the Group3 files nightly.  To restore the instance follow the same steps as above except after restoring the $ORACLE_HOME directory, run the Backup and Recovery Tool to restore the latest configuration files.   

The Backup and Recovery Tool is located on the OracleAS RepCA and Utilities CDROM in the utilities/backup directory.  The file name is backup_restore.tar  You must install and run the Tool on each server.  Once the tool is installed and configured, it will copy all the instance configuration files to the user defined backup directory.  If run against an Infrastructure instance, the script will also use RMAN to create a backup of the Metadata Repository database.  If the user application maintains local files, the Backup and Recovery Tool can be configured to also backup those files.

For additional information on the Oracle Application Server Backup and Recovery Tool refer to the Oracle Application Server 10g Administrator's Guide 10g (9.0.4) Chapter 12.


This is an excerpt from "Oracle 10g Application Server Administration Handbook" by Don Burleson and John Garmany.
 

If you like Oracle tuning, you may enjoy the new book "Oracle Tuning: The Definitive Reference", over 900 pages of BC's favorite tuning tips & scripts. 

You can buy it direct from the publisher for 30%-off and get instant access to the code depot of Oracle tuning scripts.


 

 
��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational