- •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
Answers to Review Questions |
311 |
Answers to Review Questions
1.C. The list backup of database command provides information on all database backups that are available for restore via RMAN.
2.A. The crosscheck command is used to validate all RMAN-related metadata with associated physical backups on backup media.
3.B. The resync catalog command is used to synchronize the recovery catalog with the database control file.
4.D. The duration command is used to limit the overall time of a database backup.
5.E. The catalog command is used to load backup set pieces that do not already exist into the recovery catalog or the control file.
6.B. Expired backup set pieces are those backup set pieces that do not exist. They are discovered via the crosscheck command and marked as expired. The list expired command reports backup set records that are marked as expired. The delete expired backup command marks the backup metadata in the control file and recovery catalog with a status of DELETED.
7.C, D. The delete obsolete command will mark the related metadata records for the backups as DELETED in the control file and the recovery catalog.
8.D. If a backup is expired, it means that a crosscheck command has detected that one or more backup set pieces associated with that backup are missing.
9.B. You would make the lost backup set available again by running the crosscheck command once the backup set piece becomes available on the backup media.
10.B. The backup will be allowed to run for 2 hours.
11.B, C, E. The backup will fail after the duration period expires, but the datafiles that were backed up successfully will be able to be used in any restore operation. RMAN will prioritize any datafiles not backed up in subsequent backups. Also, the backup will not return an error when the duration expires and other commands will be executed.
12.B. This output would be from the V$SESSION view. It contains the current wait event for each session as well as how long the wait has been occurring.
13.E. The V$SESSION_LONGOPS view is used to estimate how long a given running operation has until it is complete.
14.B. The users01.dbf database datafile has had an unrecoverable operation occur. Because an unrecoverable operation does not generate redo records, the data involved in that operation will be lost in the event of a recovery. The datafile should be backed up.
15.B. The #bkps columns shows zero, which indicates that the datafile has not been backed up. The datafile may yet still be recoverable as long as the archived redo logs are available.
312 Chapter 7 n Reporting, Monitoring, and Tuning with RMAN
16.C. RMAN will attempt to spread the overall IO over the total stated duration of the backup listed in the duration parameter. This will have the effect of limiting the overall load on the database and reducing the performance impacts of the backup.
17.E. This command lists all database datafiles that would require that more than three days of archived redo logs be applied in order to be restored.
18.B. The report obsolete command will list all RMAN backups that have aged beyond the RMAN retention criteria and are eligible for removal.
19.C, E. The report schema command does not contain the date of the last backup of the datafiles and tempfiles. Also, the report schema command does not report the checkpoint SCNs associated with each RMAN backup.
20.E. If a backup is expired, then the physical backup set pieces are missing from the backup media. This backup cannot be restored unless the physical backup set pieces are found, and either re-cataloged or re-crosschecked.
Chapter
8
Performing Oracle
Advanced Recovery
Oracle Database 11g: Administration II exam objectives covered in this chapter:
ÛÛUsing RMAN to Perform Recovery
NN Restore a database onto a new host
NN Perform disaster recovery
ÛÛUsing RMAN to Duplicate a Database
NN Creating a duplicate database
NN Using a duplicate database
ÛÛPerforming Tablespace Point-in-Time Recovery
NN Identify the situations that require TSPITR
NN Perform automated TSPITR
We have already discussed the basics of recovering your Oracle database. You now know how to use the restore and recover commands to recover your database to the point of failure.
In this chapter, we will cover more advanced recovery topics. First we will cover RMAN incarnations, and then we will introduce you to RMAN database duplication. After that we will discuss tablespace point-in-time recovery, and we will close the chapter with some discussion of disaster recovery of your Oracle database.
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.
Switching Between RMAN Incarnations
We introduced you to the idea of RMAN incarnations in Chapter 2 and have talked about incarnations in several other chapters. A database incarnation is the measure of the logical lifetime of an Oracle database. A database’s first incarnation begins when it is created and ends whenever the resetlogs option is used to open the database. The next incarnation starts at the point of the resetlogs operation and ends at the point of the next resetlogs operations and so on. When a new incarnation is started, the log sequence numbers are reset, the online redo logs are flushed, and the database literally has a new future.
Sometimes when performing RMAN operations it is necessary to reset to a previous database incarnation. This is pretty rare and is typically done in cases where you have restored your database using point-in-time recovery. After such cases, if you need to perform another restore and that restore needs to be to an SCN that is before the current resetlog SCN, then you will have to reset the database incarnation.
For example, look at this output of this list incarnation command:
RMAN> list incarnation;
using target database control file instead of recovery catalog
List of |
Database Incarnations |
|
|
|
||
DB Key |
Inc Key DB Name |
DB ID |
STATUS |
Reset SCN |
Reset Time |
|
------- |
------- |
-------- |
----------- |
------ |
---------- |
---------- |
1 |
1 |
ORCL |
1194923408 |
PARENT |
1 |
10/15/2007 10:08:59 |
2 |
2 |
ORCL |
1194923408 |
PARENT |
886308 |
10/03/2008 13:24:36 |
3 |
3 |
ORCL |
1194923408 |
CURRENT |
904361 |
10/03/2008 14:05:15 |
Switching Between RMAN Incarnations |
315 |
If you wanted to restore the database to a point in time before 10/03/2008 at 14:05:15 (or SCN 904361), you would need to reset the database to one of the previous incarnations. If, however, you wanted to restore the database to the resetlog time/SCN or after that time, then you would not need to reset the database incarnation.
To reset the database incarnation, you would need to mount the database first. Then use the reset database to incarnation command. You include the incarnation number that you want to switch to in the command. This number comes from the Inc Key column displayed in the list incarnation command output. Here is an example of switching the database to incarnation number 2:
RMAN> shutdown immediate database closed database dismounted
Oracle instance shut down RMAN> startup mount
connected to target database (not started)
Oracle instance started |
|
|
database mounted |
|
|
Total System Global Area |
364081152 |
bytes |
Fixed Size |
1333228 |
bytes |
Variable Size |
239077396 |
bytes |
Database Buffers |
117440512 |
bytes |
Redo Buffers |
6230016 |
bytes |
RMAN> Reset database to incarnation 2; database reset to incarnation 2
Figure 8.1 provides a graphic example of database incarnations. In this graphic,
the database crashes at SCN 40000 (shown in point A in the figure). We restore the database from a backup taken at SCN 10000 (shown in point B in the figure) and recover it to SCN 25000 (shown in point C). Perhaps we have lost the redo logs needed to restore the database beyond SCN 25000, and so we open the database at SCN 25000 with the alter database open resetlogs command. This creates a new incarnation of the database. Note that the SCNs are greater than 40000 (because the SCN does not change), but notice that there is a new timeline with which the changes are being recorded (the tangent line heading to the northeast in the figure). This is the new incarnation of the database (demonstrated in point D). It’s a completely new life for the database, and everything that happened in the database in the previous life after the previous SCN 25000 is as if it had never happened. There will now actually be two SCN 25000s in the redo stream.