Oracle RMAN 11g Backup and Recovery (78 page)

BOOK: Oracle RMAN 11g Backup and Recovery
11.65Mb size Format: txt, pdf, ePub

Chapter 10: Using the Recovery Catalog
219

files known to the recovery catalog, regardless of whether the file is a backup set, datafile copy, or proxy copy.

To use this view, you must first call DBMS_RCVMAN.SETDATABASE to indicate which database you are looking for:

CALL DBMS RCVMAN.SETDATABASE(null,null,null,2283997583,null);

select backup type, file type, status, bytes from rc backup files;

RC_BACKUP_PIECE (V$BACKUP_PIECE)

Reference this view for information about specific backup pieces that have been created during normal backup operations. Remember that a backup set contains more than one backup piece, and that the backup piece is the physical file that corresponds to the logical unit of the backup set.

RC_BACKUP_REDOLOG (V$BACKUP_REDOLOG)

The name of this view is something of a misnomer: RMAN cannot back up online redo logs; it can back up only archived redo logs, which most often are simply referred to as archive logs. This view lists archive logs that exist in backup sets. It has a record for each archive log that has been backed up; if the same archive log is backed up twice, there will be two records.

The following query provides information for a particular range of archive logs, with backup set information, the status of the backup set, and the completion time:

alter session set nls date format 'DD-MON-YYYY:HH24:MI:SS';

select db name, bs key, sequence#, thread#, first change#, status

from rc backup redolog;

RC_BACKUP_SET (V$BACKUP_SET)

Information in this view refers to each logical backup set. You have to specify what type of backup set you would like to review: full backups, incremental backups, or archive log backups.

RC_BACKUP_SPFILE (V$BACKUP_SPFILE)

In this view, you will find information on SPFILE backups that exist in backup sets.

RC_CONTROLFILE_COPY (V$DATAFILE_COPY)

Like RC_BACKUP_CONTROLFILE, the corresponding view here, V$DATAFILE_COPY, also includes information about control files, encoded as file number 0. In the catalog, this view contains control file copy information for control files created with the
copy
command or cataloged with the
catalog
command.

RC_COPY_CORRUPTION (V$COPY_CORRUPTION)

This view is the same as RC_BACKUP_CORRUPTION, except that it reports blocks that are corrupt in copies instead of in backup sets. The
select
statement, then, would omit a
piece#
, but would otherwise be identical:

select db name, file#, block#, blocks, corruption type

from rc COPY corruption where db name 'V102';

220
Part II: Setup Principles and Practices

RC_DATABASE (V$DATABASE)

This view contains basic information about each database registered in the catalog: the database name, DBID, current incarnation number, and last RESETLOGS time and SCN.

RC_DATABASE_BLOCK_CORRUPTION (V$DATABASE_

BLOCK_CORRUPTION)

This view provides the corruption list that is populated when a
backup
or
backup validate
operation discovers corrupt blocks. Remember that these are the actual corrupt blocks in the database, and not in the backups or copies themselves. This view is refreshed on each backup operation to reflect current corruption (if any). V$DATABASE_BLOCK_CORRUPTION is the view used during block media recovery when you specify
blockrecover corruption list
and is therefore the one that you will most often be referencing. The following code is an example
select
statement against this view:

select file#, block#, corruption type

from v$database block corruption;

DATABASE_INCARNATION (V$DATABASE_INCARNATION)

This view contains a record for each incarnation of each database registered in the catalog. The most important information here is the RESETLOGS information, which by definition defines each incarnation. The following code is an example
select
statement against this view: select dbid, name, dbinc key, resetlogs time, current incarnation

from rc database incarnation

where db key

and dbinc key ;

RC_DATAFILE (V$DATAFILE)

This view exists so that the catalog has access to the same schematic information as does the control file about the location and specifics of each datafile in the database. You are much more likely to use V$DATAFILE when you want to look at your datafile information; however, in a recovery situation, this view can be extremely helpful if a current control file is not available.

It also contains tablespace information in addition to datafile information, and in that way resembles the fixed view DBA_DATA_FILES. In addition, this view contains permanent configuration information for the commands
configure exclude
and
configure auxname
.

The following code is an example
select
statement against this view: select db name, ts#, tablespace name, file#, name,

bytes, included in database backup, aux name

from rc datafile

where db name 'V102';

RC_DATAFILE_COPY (V$DATAFILE_COPY)

This view provides metadata about datafile copies created by the
copy
command or OS copies that have been registered with the
catalog
command.

Chapter 10: Using the Recovery Catalog
221

RC_LOG_HISTORY (V$LOG_HISTORY)

V$LOG_HISTORY is the view that contains historical information about online redo logs, such as when they switched and what the SCN was at the time of the switch. This is a little redundant with V$ARCHIVED_LOG, but V$LOG_HISTORY does not concern itself with any current files, just the historical log switching information.

RC_OFFLINE_RANGE (V$OFFLINE_RANGE)

Offline ranges set the parameters for when a datafile went offline or read-only, and when it came back to read/write mode (if ever). It is important for RMAN to know this about a file when doing backups and restores. From a recoverability standpoint, it is critical to know the entire time range when a file was offline. If a backup of a datafile exists from before a transition from online to offline (or read-only), archive logs will be required from the moment the file was taken offline or read-only until the current point in time.

RC_REDO_LOG (V$LOG, V$LOGFILE)

From a schematic point of view, this is the same for RMAN as knowing the information in V$DATAFILE—on rebuilds, it needs to know where the online redo log files are located. This view is a combination of both V$LOG and V$LOGFILE, so that thread and group membership is available alongside the name of each log.

RC_REDO_THREAD (V$THREAD)

Thread information is really only important in RAC environments, where there is more than a single thread of redo being generated at once. This view lists a record for each separate thread in the current database incarnation, along with the status of the thread and its redo stream. The following code is an example
select
statement against this view:

select db name, thread#, status, sequence# from rc redo thread

where db name 'V102';

RC_RESYNC

This view provides information for each catalog resync operation that occurs. Obviously, there is no corresponding v$view for this one. You can use this view to determine if any of your enterprise databases need a resync, or to troubleshoot possible resynchronization problems. The following code is an example
select
statement against this view:

select db name, controlfile time, controlfile sequence#,

resync type, resync time

from rc resync where db name 'V102';

RC_RMAN_CONFIGURATION (V$RMAN_

CONFIGURATION)

This view is equivalent to a
show all
command, giving the name and value for each configuration parameter that is set for each of your target databases. It is worth noting that three configuration parameters are not stored here:
configure exclude
information is found in RC_TABLESPACE

222
Part II: Setup Principles and Practices

Other books

The Name of God Is Mercy by Pope Francis
Embers of Love by Tracie Peterson
Chaos Bites by Lori Handeland
Las Vegas Honeymoon by Francis Drake
Ancient Fire by Mark London Williams
Gone with the Wind by Margaret Mitchell
Darkness Series Epilogue by Contreras, Claire