Monitoring actual sessions during RMAN backups or recoveries can be performed utilizing RMAN dynamic views. There are a few dynamic views that provide valuable information not provided in the general RMAN reporting features of the LIST, REPORT, and SHOW commands. These dynamic views are accessed through SQL*Plus as any database table or view would be. The RMAN dynamic views listed in Table 2.3 are stored in the target database.
Dynamic View | Description |
---|---|
V$RMAN_OUTPUT | Displays messages reported by an RMAN job in progress. |
V$RMAN_STATUS | Displays the success or failure of all completed RMAN jobs. |
V$PROCESS | Shows currently active processes. |
V$RECOVER_FILE | Shows the datafiles that require recovery. |
V$SESSION | Shows active sessions. |
V$SESSION_LONGOPS | Shows progress reports on RMAN backups and restores. |
V$SESSION_WAIT | Shows the events causing sessions to wait. |
V$BACKUP_SYNC_IO | Shows the rows when the I/O is synchronous to the backup process. |
V$BACKUP_ASYNC_IO | Shows the rows when the I/O is asynchronous to the backup process. |
It is important to know some information about the database that you will be using the RMAN or recovery catalog dynamic view on. Most of the recovery catalog views contain the columns DB_KEY and DBINC_KEY. It is important to get the target database value for these columns so that you can quickly specify the incarnation of the target database. This information is required to access the recovery catalog views.
Let's see how to get these values from querying some recovery catalog views:
First, query from the target database ora101c and get the database identifier (DBID) value:
SQL> connect system/manager@ora101c Connected. SQL> SQL> select dbid from v$database; DBID ---------- 1736563848 SQL>
If there are multiple incarnations of the target database, the most current incarnation can be identified by the following query:
SQL> select bs_key, backup_type, completion_time 1 from rc_database_incarnation a, rc_backup_set b 2 where a.db_key = b.db_key 3 and a.db_key = b.db_key 4 and a.current_incarnation = 'YES';
An incarnation is a unique backup of the target database that is identified by a unique DB_KEY value. A new incarnation is generated each time a database is opened with RESETLOGS or BACKUP CONTROLFILE, which essentially means an incomplete recovery. Recovery catalog views provide most the information about the target databases. All the recovery catalog views are stored in the recovery catalog database.