Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Oracle Database 11g.pdf
Скачиваний:
78
Добавлен:
10.06.2015
Размер:
12.69 Mб
Скачать

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.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]