- •About the Authors
- •Contents at a Glance
- •Contents
- •Table of Exercises
- •Introduction
- •Assessment Test
- •Answers to Assessment Test
- •What Is ASM?
- •Working with the ASM Instance
- •Overview of ASM Data Dictionary Views
- •Using ASM Storage
- •Using RMAN with ASM
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Understanding the Oracle Database as It Relates to Backup and Recovery
- •Performing Oracle Offline Backups
- •Performing Oracle Online Backups
- •Backing Up the Control File
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Performing Incomplete Recoveries
- •Performing Other Types of Recoveries
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Why Use RMAN?
- •Exploring the RMAN Architecture
- •Connecting to RMAN
- •Configuring RMAN for Use
- •Backing Up Your Database with RMAN
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Introducing the Recovery Catalog
- •Creating the Recovery Catalog User and Schema Objects
- •Using a Recovery Catalog
- •Maintaining the Recovery Catalog
- •Using the RMAN Virtual Private Catalog
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •RMAN Database-Recovery Basics
- •Using Image Copies to Recover Your Database
- •Other Basic Recovery Topics
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Switching Between RMAN Incarnations
- •Overview of RMAN Database Duplication
- •Performing an RMAN Tablespace Point-in-Time Recovery
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Overview of Flashback Technology
- •Using Automatic Undo Management
- •Using Flashback Technologies
- •Using Additional Flashback Operations
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Diagnosing the Database
- •Managing Database Performance
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Managing Memory
- •Managing Space
- •Managing Resources
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Automating Tasks with the Scheduler
- •Exploring the Scheduler Architecture
- •Exploring Common Administration Tools
- •Using Scheduler Jobs
- •Using Scheduler Programs
- •Using Schedules
- •Creating Lightweight Jobs
- •Using Job Chains
- •Using Scheduler Windows
- •Creating and Using Job Classes
- •Using Advanced Scheduler Concepts to Prioritize Jobs
- •Using Scheduler Views
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •An Overview of Globalization Support
- •Using NLS Parameters
- •Using Datetime Datatypes
- •Using Linguistic Sorts and Searches
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Lab 1.1: Creating an ASM Instance
- •Lab 1.2: Creating ASM Disk Groups
- •Lab 1.3: Using ASM Disk Groups from a Database
- •Lab 2.2: Putting the Database in ARCHIVELOG Mode
- •Lab 2.3: Executing a Manual Online (Hot) Backup
- •Lab 3.1: Executing a Time-Based Point-in-Time Recovery
- •Lab 3.2: Recovering from Control-File Loss with a Backup Control File
- •Lab 3.3: Recovering from Loss of the Current Online Redo Log
- •Lab 4.1: Creating an RMAN Offline Backup
- •Lab 4.2: Creating an RMAN Incremental Backup
- •Lab 4.3: Creating an Image-Copy Backup
- •Lab 5.1: Implementing RVPC
- •Lab 6.1: Restoring a Datafile Online
- •Lab 6.2: Performing a Change-Based Recovery with RMAN
- •Lab 6.3: Restoring a Control File from an Autobackup
- •Lab 7.1: Monitoring RMAN Backups
- •Lab 7.2: One of My Backups Is Missing!
- •Lab 8.1: Duplicating a Database Using Active Database Duplication
- •Lab 8.2: Duplicating a Database Using Backup-Based Duplication to a Different Point in Time
- •Lab 9.1: Using the Recycle Bin
- •Lab 9.3: Using Flashback Data Archive
- •Lab 10.1: Using Support Workbench to Report a Problem to Oracle Support
- •Lab 11.1: Exporting a Transportable Tablespace
- •Lab 11.2: Testing Resumable Space Allocation
- •Lab 11.3: Manually Configuring the SGA
- •Lab 12.1: Creating a Local External Job
- •Lab 12.2: Creating a Job Window
- •Lab 13.1: Using the Locale Builder to Create a New Linguistic Sort
- •Lab 13.2: Setting NLS Parameters
- •Lab 13.3: Performing Linguistic Sorts
- •What You’ll Find on the CD
- •System Requirements
- •Using the CD
- •Troubleshooting
- •Glossary
- •Index
The RMAN recovery catalog is an optional component that you can use with RMAN. In this chapter, we will review the recovery catalog so you will be prepared to answer recovery-
catalog OCP exam questions. This chapter will contain the following information on the recovery catalog:
NN |
Introducing the recovery catalog |
|
|
NN |
Creating the recovery catalog |
NN |
Using the recovery catalog |
NN |
Recovery-catalog RMAN scripting |
|
|
NN |
Recovery-catalog maintenance |
NN |
Virtual private catalog |
So, let’s get on with learning about the recovery catalog!
Exam objectives are subject to change at any time without prior notice and at Oracle’s sole discretion. Please visit Oracle’s Training and Certification website (http://www.oracle.com/education/certification/) for the most current exam-objectives listing.
Introducing the Recovery Catalog
The RMAN recovery catalog is a schema that sits in an Oracle database. This schema is designed to store RMAN-related information. The information stored in the recovery catalog is in large part just like that stored in the control file. Since most RMAN information is stored in the control file of a database, the recovery catalog serves as a backup repository for RMAN information.
Using the recovery catalog has some clear benefits that need to be carefully considered. The first is that it acts as a single location to store all your RMAN backup-related information. The views of the recovery catalog are well documented, and as a result you can build reports off of those views that will help you to understand the current status of your database backups.
The second benefit is that the recovery catalog also makes global scripting of RMAN operations much easier. You simply store the scripts in the recovery catalog and call them as needed.
Creating the Recovery Catalog User and Schema Objects |
211 |
Another benefit is that the recovery catalog enables a few RMAN operations not available without a recovery catalog, like using the keep forever option (discussed in Chapter 4) or keeping RMAN-related records for a period of time greater than a year.
As you can see, the recovery catalog adds to the overall RMAN architecture nicely. It provides redundancy and additional features that make it very useful. Not all environments will need a recovery catalog. If you have just one or two databases, then a recovery catalog may be more trouble than it’s worth. If you have a large environment though, the recovery catalog can make managing that environment much easier.
Database duplication can cause the recovery catalog all sorts of problems if you are not careful. This is because each database in the recovery catalog is uniquely identified by its database ID, or DBID. If you duplicate a database manually, you must change the DBID of the newly created duplicate database with the Oracle NID utility. If you do not do this and you register the new database in the recovery catalog, RMAN will get confused as to who the individual catalog records belong to. This can put your ability to recover your database with RMAN at risk. Note that when you do an RMAN database duplication, it will change the DBID for you automatically when the duplication is complete.
The recovery catalog provides a number of views (called recovery catalog views) into the metadata contained therein. The OCP exam will likely not expect you to memorize these views, but it’s still best to be aware of them. All the recovery catalog views start with an RC_ prefix and then end with a descriptive name of the data contained in the view. The following are some more popular recovery catalog views:
NN RC_DATABASE
NN RC_BACKUP_PIECE
NN RC_PIECE_DETAILS
NN RC_ARCHIVED_LOG
NN RC_BACKUP_ARCHIVELOG_SUMMARY
NN RC_BACKUP_SET
NN RC_BACKUP_SET_DETAILS
NN RC_BACKUP_SPFILE
Creating the Recovery Catalog
User and Schema Objects
As we mentioned, the recovery catalog is a schema in an existing Oracle database. This schema typically will have its own tablespace, where the RMAN recovery-catalog schema data will be stored. Creating the recovery catalog user and schema is fairly easy. You use
212 Chapter 5 n Using the RMAN Recovery Catalog
the create user command to create the database user first. You will then need to create the tablespace that will store the recovery catalog data.
To Use the Recovery Catalog or Not to Use the Recovery Catalog; That Is the Question
Adding components to any system has the potential to inject problems into that system. The same is true with the recovery catalog. One database shop implemented the Oracle recovery catalog at the same time they started using RMAN (this was using Oracle Database 10g).
Initially things worked great, but over time backup performance became slower and slower. These performance problems were not seen when the recovery catalog was not in use. In the end, after lots of troubleshooting, it was discovered that a couple of queries being issued against the recovery-catalog schema were not tuned well and that these queries would slow down a great deal as the catalog schema got larger. They opened a service request with Oracle and after some time Oracle found the problem and made
a patch available.
The moral of this story, in our minds, is to use the KISS (keep it simple, stupid) principle when deciding if you need a recovery catalog or not. If you can justify the additional component because it will provide significant benefit, then by all means use it. Just understand that it’s something else that may well break, and things always break at the most inopportune times.
In Exercise 5.1, you’ll create a recovery-catalog schema.
How much space you will need for the recovery-catalog schema is a function of how often you back up the database and how long you retain the RMAN backup database in the recovery catalog. Oracle indicates that for one database with one backup per day and one archive-log backup per day, you can estimate metadata storage requirements of between 15MB and 120MB per year, per database, depending on how many backups (database, archive log, and so on) you do per day. The Oracle documentation provides more guidelines. You will not need to be familiar with these sizing guidelines when taking your OCP exam.
Creating the Recovery Catalog User and Schema Objects |
213 |
E x e r c i s e 5 .1
Creating a Recovery-Catalog Schema
Here are the steps to follow when creating the recovery-catalog schema:
1.Open a command-line window. For this example, you will use a database called RCAT. You need to set the ORACLE_SID to RCAT as shown here:
C:\Documents and Settings\dstuns>set ORACLE_SID=RCAT
2.Sign into the database using SQL*Plus:
C:\Documents and Settings\Robert>sqlplus sys/robert as sysdba SQL*Plus: Release 11.1.0.6.0 - Production on Mon Sep 15 21:48:06 2008 Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
3.Create a tablespace called RCAT_DATA. This tablespace will be used to store the recovery-catalog schema data:
SQL> create tablespace rcat_data
2datafile ‘c:\oracle\oradata\rcat\rcat_data_01.dbf’ size 60m
3autoextend on next 10m maxsize 200m; Tablespace created.
4.Create the user that will store the catalog. Use the name RMAN with the password RMAN. Make RCAT_DATA the default tablespace (we assume you have a default temporary tablespace already defined). Also, you will grant an unlimited quota on RCAT_ DATA to RCAT_USER:
SQL> create user rcat_user identified by rcat_user 2 default tablespace rcat_data
3quota unlimited on rcat_data;
User created.
5.The recovery catalog–owning user requires only a grant to the RECOVERY_CATALOG_ OWNER role using the grant command:
SQL> grant recovery_catalog_owner to rcat_user; Grant succeeded.