Oracle
  Home arrow Oracle arrow Page 5 - Availability and Recovery
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ORACLE

Availability and Recovery
By: McGraw-Hill/Osborne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 17
    2004-09-01

    Table of Contents:
  • Availability and Recovery
  • New and Changed Oracle Database 10g Database Backup Commands
  • RMAN Improvements
  • Setting Up the Flash Recovery Area
  • Using Backup Copies and Fast Recovery
  • Changes to Incremental Backups
  • Compressing RMAN Backups
  • New Flashback Features
  • Using Flashback Database
  • Flashback Database Views
  • Configuring Guaranteed Undo Retention
  • New Transaction Recovery Monitoring Features
  • The valid_for Attribute
  • New Standby Database Parameters
  • New SQL Apply Support for Data Types

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Availability and Recovery - Using Backup Copies and Fast Recovery


    (Page 5 of 15 )

    RMAN allows you to back up the entire database now as a copy image via the backup as copy command. In addition, RMAN allows you to easily switch over to these copy images during a recovery situation, speeding up your recoveries significantly. Let’s look at these new features in a bit more detail.

    Using the RMAN backup as copy Command RMAN introduces the backup as copy command, which allows you to create file image copies of the database datafiles, rather than creating backup sets (which is the default). You can use this command for the following kinds of backups:

    • Database

    • Tablespace

    • Datafile

    Examples of the use of these commands are shown here:

    RMAN> backup as copy database plus archivelog;
    RMAN> backup as copy datafile 1;
    RMAN> backup as copy tablespace users;

    The file backup copies are exact duplicates of the database datafiles, thus they are larger than normal RMAN backup sets. Backup copies can be made to any disk location (and only to disk) via the format parameter. You can also configure a default device for disk copies with the configure command (discussed in more detail shortly) or, if you have configured a flash recovery area (also covered shortly), RMAN will create your backup copies in that area.

    NOTE -- An error will be generated if the datafiles are in backup mode during a backup copy.

    RMAN Backup File Image Copies: The Up Side and the Down Side

    So, what are the benefits of RMAN backup file image copies? As you will see later in this section, RMAN backup copies can reduce your mean time to recover significantly. Use of image copies comes with a price, however, chiefly the requirement for additional disk space to store the copies, as opposed to RMAN backup sets. Since copies are not compressed, each full database copy essentially requires that an amount of space equivalent to the size of your database be allocated.

    Another risk with datafile copies is the fact that these copies are stored on disk by RMAN. This leads to a pretty obvious single point of failure that you will want to address in your overall backup and recovery scheme.

    Configure the Default Device Type to Copy

    Oracle Database 10g allows you to configure your default backup type to be a copy backup with the configure device type command, as shown here:

    RMAN> Configure device type disk backup type to copy;

    Fast Recovery Using RMAN Copies

    Previously, if you wanted to restore a database from an RMAN backup, you had a couple of options. The first was to restore the backup-set pieces via RMAN and then recover the database. Even if the backup-set pieces were on disk, this could take a significant amount of time. The second option was to make RMAN copies of each individual datafile and then manually restore from those copies, or locate those copies on a different set of disks and then rename the datafiles from within Oracle Database 10g. This was time- and labor-intensive.

    Oracle Database 10g allows you to create a backup copy of the database to a different disk location and then quickly switch over to that disk location via the switch database to copy RMAN command. When the switch database command is issued, RMAN resets the location of the datafiles in the control file to the location of the datafile backup copies previously made via RMAN. After this switch is complete, you then recover the database, using those copies. This method of recovering the database can significantly reduce the overall mean time to recover your database.

    Note also that when you switch your database to your datafile copies, you effectively lose one backup of your database. Also, the entire database is then located in one file system, such as the flash recovery area, which can be problematic.

    Use RMAN to Back Up the Current Control File

    In Oracle Database 10g, RMAN offers a new command, backup current controlfile, which is effectively the same as the alter database backup controlfile command that you would issue from the SQL prompt. The result is a copy of the control file, stored in the location defined (e.g., a location defined via the format command, the default copy value, or the flash recovery area). RMAN also allows you to create a standby control file with the backup current controlfile for standby command. The backup controlfilecopy command allows you to create backups of previous control file copies.

    Using the catalog and uncatalog Commands

    Oracle Database 10g offers additional commands that allow you to manipulate the catalog entries of backup sets. The catalog command allows you to enter new backup set–related information into the catalog. RMAN will overwrite any preexisting catalog information that conflicts with the information being cataloged. This command can be handy if you need to move the location of your backup-set pieces. Here is an example of the use of this command:

    RMAN> catalog backuppiece
    '/opt/oracle/oracle-10.0.0/dbs/backup';

    The change backuppiece uncatalog command will remove backup-set pieces from the catalog. If the change backuppiece uncatalog command removes the last remaining backup-set piece, then it will also remove the backup-set record. Here is an example of using the change backuppiece uncatalog command:

    RMAN> Change backuppiece '/u01/oracle/RMAN/mydb/mydb_user01_01.bak' uncatalog;

    One of the nice uses of the catalog command is to allow you to catalog moved backup-set pieces. If you have moved a large number of backup-set pieces, then it can be a great deal of work to generate a bunch of catalog statements to catalog the moved pieces. Instead, you can use the catalog command with the start with option. The start with option allows you to define the directory that contains the RMAN backup-set pieces to be cataloged. RMAN will then catalog all backup-set pieces in that directory. Here is an example of using the catalog command this way:

    RMAN> catalog start with '/u01/oracle/RMAN/mydb';

    Once you press ENTER, this command prompts you with a list of files to catalog, and asks if you wish to catalog the files listed. If you respond in the affirmative, RMAN catalogs all the backup-set pieces listed (which will be contained in the /u01/oracle/RMAN/mydb directory). This command also allows you to catalog several like-named backup-set pieces. For example, if you want to catalog several backup-set pieces that start with the name backup (e.g., backupset01, backupset02, etc.), then you could issue the following command:

    RMAN> catalog start with '/u01/oracle/RMAN/mydb/backup';

    When you use the catalog start with command, it is indiscriminate about the files it tries to catalog; it will try to catalog everything that matches the argument list. However, as the catalog process proceeds, files that are not backup-set pieces will fail the catalog process and an error will occur. Files that are backup-set pieces will be cataloged successfully, in spite of other errors.

    Dropping a Database in RMAN

    In Oracle Database 10g, RMAN provides the capability to drop a database to remove all physical database files, by using the drop database command. To drop the database, first log in to the database to be dropped. Then, make sure the database is mounted in exclusive mode, but is not open. Finally, issue the drop database command. If you also want to remove all RMAN database-related backups (but not recovery catalog information), you can include the including backups option when you issue the drop database command. Here is an example call:

    RMAN> shutdown
    RMAN> startup mount
    RMAN> drop database;

    Unregistering a Database in RMAN

    Prior to Oracle Database 10g, unregistering a database from the recovery catalog was a manual process. Now, Oracle Database 10g makes removing a database from the recovery catalog as easy as issuing the command unregister database. Here is an example:

    RMAN> Unregister database mydb;

    Note that the backup files for this database, and any associated control file records, are not deleted by this command; only the recovery catalog references to those backup files are deleted. Also note that you only need to be connected to the recovery catalog to issue this command.

    This chapter is from Oracle Database 10g New Features, by Robert Freeman (McGraw-Hill/Osborne, 2004, ISBN: 0072229470). Check it out at your favorite bookstore today. Buy this book now.

    More Oracle Articles
    More By McGraw-Hill/Osborne


       · Why pollute DevShed?
     

       

    ORACLE ARTICLES

    - Implementing and Using Oracle`s Restore Poin...
    - Tuning PL/SQL Code
    - Debugging PL/SQL Code
    - Testing PL/SQL Code
    - Working With PL/SQL Code
    - Conditional Compilation for Oracle Database ...
    - Compile-Time Warnings for Oracle DB 10g
    - Compiling PL/SQL Code for an Oracle Database
    - Troubleshooting PL/SQL Code
    - Managing PL/SQL Code
    - Data Manipulation and More for HTML DB Appli...
    - Oracle Database Fundamentals
    - Adding Processes to HTML DB Applications
    - Adding Computations, Processes, and Validati...
    - Sub-templates and More with Oracle HTML DB





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT