- •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
304 Chapter 7 n Reporting, Monitoring, and Tuning with RMAN
Tuning RMAN Operations
The final topic in this chapter is how to tune RMAN operations. Of course, standard Oracle tuning methodologies apply here; use enough backup devices to get good I/O performance. Allocate enough memory to the database, and make sure your CPUs can handle the load.
Another method of tuning your RMAN operations is through parallel channel operations. Recall that using channels is the method that RMAN uses to write backup-related information from the database to the backup device. If you can create multiple channels to different backup devices (say two channels to two different disk drives or tape devices), then you can speed up the performance of your backups in many cases.
Oracle also provides the duration parameter associated with the backup command, which allows you to indicate to Oracle how much overall impact it should allow the backup to have on the database as a whole. When using the duration parameter, you indicate the overall duration that you want the backup to run. If it runs over that (say 5 hours), then RMAN will terminate the backup. The datafiles already backed up will still be valid, but there may be datafiles that are not backed up. RMAN will prioritize any missed datafile backups on the subsequent backup operation.
Note that if a backup does not complete after the amount of time identified in the duration parameter, then the whole backup will be considered to have failed. Other backup operations within a run block will not be executed as a result. You can use the partial keyword to indicate to RMAN that it should consider the backup to have been successful and not return an error. This will allow subsequent commands (like archive-log backups) to execute. Here is
an example of the use of the partial keyword:
RMAN> Backup as compressed backupset duration 1:00 partial minimize load database ;
If you use the duration minimize load parameter when performing a backup, then you will be indicating to Oracle that you want it to reduce the load that the backup has on the database as a whole. When minimize load is used, Oracle will try to spread the backup over the entire time identified in the duration parameter. This will result in slower backup times but improved overall database performance. Here is an example of the use of the duration parameter in the backup command:
RMAN> Backup as compressed backupset duration 1:00 minimize load database;
Summary
In some ways, this is the most important chapter when it comes to RMAN overall. In previous chapters we have shown you that typical backup and recovery is not a very complex task most of the time in RMAN. When things go wrong, however, RMAN can become a bit trickier. Of course, things tend to go wrong just when the stress is the highest and the need to get your database up and running is the highest.
Exam Essentials |
305 |
To help you with these difficult moments and prepare you for the OCP exam, we covered RMAN reporting, tuning, and monitoring. Reporting is quite important because you need to be able to see what backups are available (for example, to determine what types of incomplete recovery are actually available).
Tuning is important because we want our backups and our recoveries to go as fast as possible. Everyone wants the backups to go fast, and the longer they take the more impact they have on the system. Of course, everyone wants restores to go fast. That’s where strategies like parallelism come in handy.
Monitoring is important too because we need to be able to look at backup or restore operations as they are happening and answer the question, Does this look normal? Monitoring gives us that ability. It’s important to know what is normal for your backups and your recoveries so that when the time comes, you will be able to understand just what is not normal and how deviant a statistic actually is from the norm. Then you can address the problem.
This is the last chapter on RMAN in this book. Questions on RMAN will be a significant portion of your OCP exam. Study it hard, and practice backup and recovery a lot before you take your test (both RMAN and user-managed). If you do so, we suspect you will do well on your exam.
Exam Essentials
Be able to use the list and report commands. Understanding the list and report commands is very important to RMAN operations and to being successful on your OCP exam. They allow you to review metadata contained within the database control file and recovery catalog, understand backups that have been taken, and take corrective action when certain conditions arise.
Be able to administer the RMAN environment. Understanding how to administer RMAN is quite important. Knowing how to use commands like catalog, delete, and crosscheck is critical to properly administering the RMAN environment. These commands will come in especially handy after disaster recovery when you need to get your database up and running quickly.
Be able to performance-tune your RMAN operations. Understanding how parallelism can make your database backups and restores perform faster is critical to making RMAN performant. Understand how to control the duration of a backup and how to reduce the overall I/O load with the duration command.
306 Chapter 7 n Reporting, Monitoring, and Tuning with RMAN
Review Questions
1.Which command would you use to determine what database backups are currently available for restore?
A.list database backup;
B.report database backup;
C.list backup of database;
D.list summary backup;
E.report backup of database;
2.What command would you use to ensure that backup records in the control file are pointing to actual physical files on the backup media?
A.crosscheck
B.list backup
C.confirm
D.resync
E.backup validate
3.You have backed up your database twice without connecting to the recovery catalog. What command do you issue to transfer the control-file metadata to the recovery catalog?
A.synch catalog
B.resync catalog
C.replicate catalog
D.update catalog
E.restore catalog
4.You want to make sure that your database backup does not exceed 10 hours in length. What command would you issue that would meet this condition?
A.backup database plus archivelog;
B.backup database plus archivlog until time ’10:00’;
C.backup database plus archivelog timeout ’10:00’;
D.backup database plus archivelog duration 10:00;
E.backup database plus archivelog timeout 10:00;
Review Questions |
307 |
5.You have lost all your RMAN backup set pieces due to a disk failure. Unfortunately, you have an automated cross-check script that also does a delete expired backupset command. You have restored all the backup set pieces from tape. What command would you use to get those backup set pieces registered in the recovery catalog and the control file of the database again?
A.register database
B.recover catalog
C.load backupset
D.synch metadata
E.catalog start with
6.You run the following commands:
RMAN> list expired backup; RMAN> delete expired backup;
What will happen to the backup set pieces associated with the backups that appear in the list expired backup command?
A.They will be renamed.
B.Nothing will happen to them. The backup set pieces do not exist.
C.They will be deleted immediately since they are not in the flash recovery area.
D.You will need to manually remove the physical files listed in the output of the commands.
E.They will become hidden files and removed 10 days later.
7.Why would you run the delete obsolete command? (Choose all that apply.)
A.To remove missing backup set pieces physically from disk
B.To remove metadata related to backup set pieces in the control file and the recovery catalog
C.To mark as deleted records in the control file and the recovery catalog associated with obsolete backup sets
D.To delete backup set pieces associated with backups that are no longer needed due to retention criteria
E.To remove old versions of RMAN backups
8.What does it mean if a backup is expired?
A.The backup set has exceeded the retention criteria set in RMAN and is eligible for removal.
B.The backup set has one or more invalid blocks in it and is not usable for recovery.
C.The backup set contains one or more tablespaces no longer in the database.
D.The backup set contains one or more missing backup set pieces.
E.The backup set is from a previous version of RMAN and was not upgraded.
308 Chapter 7 n Reporting, Monitoring, and Tuning with RMAN
9.If a backup set is expired, what can you do to correct the problem?
A.Change the retention criteria.
B.Make the lost backup set pieces available to RMAN again.
C.Run the crosscheck command to correct the location for the backup set piece contained in the metadata.
D.Nothing. The backup set piece is lost forever.
E.Call Oracle support. Their assistance is required.
10.How long will this backup be allowed to run?
Backup as compressed backupset duration 2:00 minimize load database ;
A.2 minutes
B.2 hours
C.2 days
D.The command will generate an error.
E.This backup is not constrained by any time limitation.
11.What is the impact of the following backup if it exceeds the duration allowance? (Choose all that apply.)
Backup as compressed backupset duration 2:00 partial minimize load database ;
A.The entire backup will fail. It will not be usable for recovery.
B.The entire backup will fail, but any datafile successfully backed up will be usable for recovery.
C.If this backup fails, subsequent backups will prioritize datafiles not backed up.
D.If this backup fails, an error will be raised and any other commands will not be executed.
E.If this backup fails, no error will be raised and any other commands will be executed.
12.In what view are you likely to see the following output?
SID |
SERIAL# |
EVENT |
SECONDS_IN_WAIT |
---------- ---------- |
------------------------------ --------------- |
||
121 |
269 |
RMAN backup & recovery I/O |
2 |
129 |
415 |
SQL*Net message from client |
63 |
130 |
270 |
SQL*Net message from client |
8 |
A.V$SESSION_EVENT
B.V$SESSION
C.V$WAITS
D.V$WAITSTAT
E.V$SYSSTAT
Review Questions |
309 |
13.What view might you use to try to determine how long a particular backup will take?
A.V$SESSION_EVENT
B.V$SESSION
C.V$WAITS
D.V$WAITSTAT
E.V$SESSION_LONGOPS
14.What is the impact of the results of the output of the following command?
RMAN> report |
unrecoverable database; |
|||
Report of |
files that need backup due to unrecoverable operations |
|||
File |
Type |
of |
Backup Required |
Name |
---- |
----------------------- |
----------------------------------- |
||
4 |
full |
or |
incremental |
C:\ORACLE\ORADATA\ORCL\USERS01.DBF |
A.There are no backup sets with any backups of the users01.dbf datafile.
B.The users01.dbf datafile has had unrecoverable operations occur in it. It will need to be backed up or some data loss is possible during a recovery.
C.The users01.dbf datafile is corrupted.
D.The users01.dbf datafile backup exceeds the retention criteria.
E.The last backup of the users01.dbf datafile failed and must be rerun.
15.What does the output on this report indicate?
RMAN> report need backup;
RMAN retention policy will be applied to the command RMAN retention policy is set to redundancy 1
Report of files with less than 1 redundant backups File #bkps Name
---- ----- ------------------------------------------
5 0 C:\ORACLE\ORADATA\ORCL\MY_DATA_01.DBF
A.The my_data_01.dbf datafile is corrupted and needs to be restored.
B.The my_data_01.dbf datafile has not yet been backed up. This report does not imply that the data in the datafile can not be recovered.
C.The my_data_01.dbf datafile has not yet been backed up. This report implies that the data in the datafile can not be recovered.
D.The my_data_01.dbf datafile no longer meets the retention criteria for backups.
E.Datafile 5 is missing.
310 Chapter 7 n Reporting, Monitoring, and Tuning with RMAN
16.What does the minimize load database parameter mean when backing up a database?
A.RMAN will attempt to make the backup run as fast as possible without any IO limitations.
B.RMAN will automatically restrict the number of channels in use to one.
C.RMAN will spread the backup IO over the total duration stated in the backup command.
D.RMAN will skip any datafile that currently is involved in an IO operation. RMAN will retry backing up the datafile later and an error will be raised at the end of the backup if the datafile cannot be backed up.
E.Datafiles will be backed up; those having the lowest current number of IO operations will be backed up first.
17.What is the result of this command?
RMAN> Report need backup days 3;
A.Lists all datafiles created in the last three days that are not backed up.
B.Lists all datafiles not recoverable based on the current retention criteria.
C.Lists all datafiles not backed up in the last three days. The datafile is not recoverable.
D.Lists all datafiles that need to be backed up due to unrecoverable operations.
E.Lists all datafiles not backed up in the last three days. It does not imply that the datafile is not recoverable.
18.Why would you execute the report obsolete command?
A.To list all backups that were no longer available for restore operations
B.To list all backups that had aged beyond the RMAN retention criteria
C.To list all backup set pieces listed in control-file or recovery-catalog metadata that are not on the backup media
D.To list all datafiles that are no longer part of the database and thus do not need to be backed up
E.To list all archived redo logs that are no longer needed for any database recovery
19.What information does the report schema command not provide? (Choose all that apply.)
A.Size of the datafiles
B.Size of the tempfiles
C.Date of last backup for datafiles and tempfiles
D.Filenames for each datafile
E.Checkpoint SCN associated with the last RMAN backup
20.If a backup is expired, which of the following is true?
A.It can never be used for a restore/recover operation.
B.Oracle will remove the backup set pieces from the flash recovery area.
C.The backup has been used at least once to restore and recover the database.
D.The backup is no longer valid because of a resetlogs operation.
E.The physical backup set pieces are missing from the media.