Read Oracle RMAN 11g Backup and Recovery Online
Authors: Robert Freeman
(V$TABLESPACE),
configure auxname
information is found in RC_DATAFILE (V$DATAFILE), and
configure snapshot controlfile
information is found only in the target database control file (there is no catalog equivalent).
It is also important to point out that RC_RMAN_CONFIGURATION does not have a DB_
NAME column, so you have to use the primary key DB_KEY value from RC_DATABASE to get the values for the appropriate database registered in your catalog.
Furthermore, no values are listed in either V$RMAN_CONFIGURATION or RC_RMAN_
CONFIGURATION for default values. Only values that have been manually changed will appear in this list. The following code is an example
select
statement against this view: select name, value from rc rman configuration where db key 1;
RC_TABLESPACE (V$TABLESPACE)
Tablespace information is included in this view. The real benefit of this view over V$TABLESPACE
is that historical information about dropped tablespaces is kept in the catalog. Therefore, you can use this view to look back and see when a tablespace was dropped. In addition, this view contains the information recorded for any
configure exclude
commands.
RC_TEMPFILE (V$TEMPFILE)
RMAN, since version 10
g,
is tempfile aware and can rebuild tempfiles upon restore so that you do not have to do it manually, as in the past. RC_TEMPFILE provides the bridge for this functionality, and a window into the existing tempfiles for a database.
Catalog Views Intended for Use by Oracle
Enterprise Manager
A series of new views in the recovery catalog were created specifically to provide performance and functionality enhancements to the OEM Console and thus have limited functionality for end users. Most of these views do not have corresponding v$views in the target database control file.
It is worth taking a look at these views and identifying their parts, to avoid any misunderstanding.
If you are looking for a way to leverage the information in these views, you can find the same information in them in OEM’s backup and recovery functionality. The following table lists and briefly describes the RC_* views that are built primarily for use by OEM.
RC_* View
Note
RC_BACKUP_ARCHIVELOG_DETAILS
Detailed information about backed up
archive logs.
RC_BACKUP_ARCHIVELOG_SUMMARY
Summarized archive log backup information.
RC_BACKUP_CONTROLFILE_DETAILS
Detailed control file backup information.
RC_BACKUP_CONTROLFILE_SUMMARY
Summarized information about all control file
backups known to RMAN.
RC_BACKUP_COPY_DETAILS
Detailed information regarding all control file
and datafile copies.
RC_BACKUP_COPY_SUMMARY
Summarized control file and datafile copy
information.
Chapter 10: Using the Recovery Catalog
223
RC_BACKUP_DATAFILE_DETAILS
Detailed information about all datafile
backups—in backup sets as well as image
copies.
RC_BACKUP_DATAFILE_SUMMARY
Summary information about datafile backups.
RC_BACKUP_PIECE_DETAILS
Detailed information about available backup
pieces in the catalog.
RC_BACKUP_SET_DETAILS
Detailed information regarding available backup
sets in the catalog. This includes backups
created with the
backup backupset
command.
RC_BACKUP_SET_SUMMARY
Aggregated information about available
backup sets.
RC_BACKUP_SPFILE_DETAILS
Detailed information about available SPFILE
backups.
RC_BACKUP_SPFILE_SUMMARY
Summarized information about available SPFILE
backups.
RC_RMAN_OUTPUT
Assists OEM with job status tracking. The
corresponding v$view is V$RMAN_OUTPUT.
RC_RMAN_BACKUP_JOB_DETAILS
Detailed information on individual backup job
sessions, combining all operations in the same
session.
RC_RMAN_BACKUP_SUBJOB_DETAILS
Details concerning groups of similar operations
within an RMAN session.
RC_RMAN_STATUS
A historical view of RMAN sessions for all
databases in the recovery catalog. It does not
contain current session information, as does its
corresponding v$view, V$RMAN_STATUS.
RC_UNUSABLE_BACKUPFILE_DETAILS
A list of all backup files of any type that have
been marked as UNAVAILABLE or EXPIRED.
RC_RMAN_BACKUP_TYPE
Provides filtering information to OEM during its
report building.
Summary
In this chapter, we detailed what a recovery catalog is and how it can help you to manage your backups—and save you during a recovery. We discussed how to build the catalog, add managed databases to it, and how to drop it. Oracle Database 11
g
provides the option for generating virtual private catalogs to maintain privacy and security. In addition, 11
g
offers the capability to merge multiple catalogs as you work to centralize and simplify your ecosystem management. Finally, we provided an overview of the critical recovery catalog views that can be utilized to understand the metadata surrounding your backups and to help guide the backup maintenance and recovery operation planning.
This page intentionally left blank
CHAPTER
11
RMAN Backups
226
Part II: Setup Principles and Practices
ow that we have covered all the startup essentials, we are actually ready to use RMAN to back up something. In this chapter, we are going to talk all about doing
N
backups with RMAN. From offline backups to online backups, backups of archived redo logs to incremental backups, we will cover it all. We will look at how to back up entire databases and individual database datafiles. So, let’s move on!
Benefits of RMAN Backups vs. Scripted Backups
Why use RMAN to back up your databases? You may already be doing online backups with some wonderfully crafted, homegrown scripts, and you may be asking yourself, “Why should I start using RMAN when my scripts work so reliably?” In this section, we hope to answer that question.
Although your scripts may never fail, some scripts out there that others have crafted do break.
This raises two problems. First, when the script breaks, the database backup fails. Second, when the script fails, someone has to fix it. You might be a wizzo Unix scripter. Unfortunately, after you take that DBA job on the international space station, there is no guarantee that the person following you will be an equally gifted Unix scripter. That poor person is going to be sitting there looking at your marvelous code and cussing you up one side and down the other. His or her boss isn’t going to be happy, and, most importantly, the database will be at risk. Of course, the other possibility is that you will be the one having to debug the “Code from the Netherworld” since it was your predecessor, the shell scripter from nether regions, who went to work on the space station. Therein lies one big plus for RMAN—it is supported by Oracle, so, you can go to Oracle with your RMAN woes.
Of course, there are a number of other positives to using RMAN:
■ RMAN will detect corrupted blocks and report them to you.
■ RMAN can back up your database online without having to put the tablespaces in hot backup mode. Thus, the additional (sometimes quite significant) redo generated during a hot backup is reduced.
■ RMAN will automatically track new datafiles and tablespaces for you, which means you no longer have to add new tablespaces or datafiles to scripts.
■ RMAN will only back up used data blocks (up to the high-water mark [HWM]). Thus, RMAN backup images typically are smaller than those of online backup scripts.
■ RMAN offers true compression of backup images.
■ RMAN provides easy, automated backup, restore, and recovery operations. RMAN tracks all the backups that you need to recover the database if a restore is required and will restore only those objects that are needed.
■ RMAN can work fairly seamlessly with third-party media management products.
■ RMAN supports incremental backup strategies.
Chapter 11: RMAN Backups
227
■ With RMAN, you can actually test your backups without restoring them. Try that with your backup scripts!
■ If you use the repository, then RMAN provides a nice, centralized reporting facility.
■ If you are running Oracle Database 11
g,
the new Data Recovery Advisor (DRA) can simplify diagnosing difficult database recovery issues quickly. It can then provide restore and recovery recommendations and can automate restores via RMAN.
■ RMAN with DRA can simplify diagnosing difficult issues quickly and can implement the solutions to problems found using the 11
g
RMAN DRA commands.
If you used RMAN in versions prior to Oracle Database 10
g,
you will find that your earlier RMAN backup commands still work. RMAN is very backward compatible. However, if you don’t take the time to review the features that RMAN offers and to implement those that might benefit you, you will not be getting the most out of RMAN.
RMAN Compatibility Issues
Before you haul off and start doing backups, you need to consider some compatibility issues. Your enterprise probably has differing versions of Oracle running, and you need to consider RMAN
compatibility issues as you plan your backup strategy. Not all databases are compatible with all RMAN versions, and when you add the recovery catalog into the mix, things get even more complex. Table 11-1 provides a quick reference to the compatibility issues related to RMAN.
In Table 11-1, you can see the RMAN target database version (say your database is version 10.2.0) and the RMAN client that supports backups of that database version (in our example, a 10.2.0 database can be backed up by RMAN versions >=9.0.1.3 and up to version 10.2.0 of RMAN). Also, you will find the version of the RMAN catalog database that must be in place to support the backup of that database (in our 10.2.0 example, the catalog that is required is a 9.0.1
version of the catalog). Finally, the version of the catalog schema that is required is listed (>= the version of the RMAN client being used in our example).
As you can see from Table 11-1, you need to know what version your recovery catalog schema is. The RCVER view in the recovery catalog schema will give you this information.
Here is an example:
SQL> select * from rcver;
VERSION
------------
10.02.00.00
Finally, if you are faced with having to create more than one recovery catalog, there is no reason that all recovery catalogs cannot be maintained in the same database, as long as the database is version 9.0.1 or later. This still makes for a single recovery catalog database, which facilitates easy enterprise-wide reporting from that database.