- •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
Summary 337
6.Once the database parameter file or spfile is restored, you can mount the database with the alter database mount command. You would then use a backup control file or the create controlfile command to re-create the control file of the database.
7.Once the database control file is restored, you would move the backups of the database datafiles from the backup media.
8.If you are restoring the database datafiles to a different location, you would need to rename them in the database control file. Use the alter database rename file command for this operation.
9.You will need to restore the needed archived redo logs from the backup media.
10.Use the recover database command to complete the database recovery. You will need to perform an incomplete recovery, since the online redo logs are not available. See Chapter 3 for more on incomplete user-managed recoveries.
11.Once the recover database command has completed its work, open the database with the alter database open resetlogs command.
Summary
In this chapter, we talked about some advanced RMAN recovery concepts. First we talked about changing database incarnations. You will want to know how to change incarnations of your database, as this provides the ability to restore your database from previous incarnations in certain cases.
The ability of RMAN to duplicate databases is very powerful. The Oracle OCP exam will include questions about this functionality, and we strongly suggest you go through the exercise of actually performing database duplication. The first few times, it can be a frustrating exercise, but it’s well worth the experience.
Tablespace point-in-time recovery is an RMAN feature that makes recovering tablespaces to specific points in time easy to do. We covered the basics of TSPITR, which you will need to know for your OCP exam, but we encourage you to do further research into more customized methods of doing TSPITR that might meet your unique needs.
Finally, we concluded this chapter with a discussion of disaster recovery. This is the end game of backup and recovery (or as one person once told us, it should be called recovery and backup since recovery is the really important part). We gave you an outline of the process to follow to get your database back up to speed should you lose the whole database server.
338 Chapter 8 n Performing Oracle Advanced Recovery
Exam Essentials
Describe database incarnations. Understand how to use the set database incarnation command. Know what a database incarnation is and when a given incarnation changes.
Describe database duplication. There are two kinds of database duplication, active and backup-based. Understand that when you use backup-based duplication, the backup set pieces must be available on the host to which you are duplicating. Understand that active database duplication occurs over the network. Know how to set up for database duplication.
Describe tablespace point-in-time recovery. Be able to list the benefits of tablespace point- in-time recovery. Understand how to perform a tablespace point-in-time recovery and what the restrictions are.
Describe disaster-recovery basics. Understand how to restore a system from a complete disaster using both RMAN-based backup sets and user-managed recovery.
Review Questions |
339 |
Review Questions
1.True or false: tablespace point-in-time recovery is possible only with RMAN.
A.True
B.False
2.Which command is used to begin a tablespace point-in-time recovery?
A.Restore tablespace
B.Recover tablespace
C.Tablespace recover
D.Recover to time
E.recover datafile
3.When you’re performing active database duplication, a backup of what kind is required?
A.A current RMAN backup-set backup is required.
B.No backup is required.
C.An RMAN image backup is required.
D.A manual backup is required.
E.A “duplicate” preparatory backup is required.
4.Which of the following commands will perform an active database duplication of the ORCL database to the ORCL2 database?
Set oracle_sid=orcl
rman target=sys/robert auxname=sys/Robert@orcl2 create duplicate target database to neworcl from active database nofilenamecheck
spfile set control_files ‘c:\oracle\oradata\neworcl\control01.ctl’, ‘c:\oracle\oradata\neworcl\control02.ctl’
set db_file_name_convert ’c:\oracle\oradata\orcl’,’c:\oracle\oradata\neworcl’ set log_file_name_convert ’c:\oracle\oradata\orcl’,’c:\oracle\oradata\neworcl’;
Set oracle_sid=orcl
rman target=sys/robert auxname=sys/Robert@orcl2 duplicate target database nofilenamecheck
spfile set control_files ‘c:\oracle\oradata\neworcl\control01.ctl’, ‘c:\oracle\oradata\neworcl\control02.ctl’
340 Chapter 8 n Performing Oracle Advanced Recovery
set db_file_name_convert ’c:\oracle\oradata\orcl’,’c:\oracle\oradata\neworcl’ set log_file_name_convert ’c:\oracle\oradata\orcl’,’c:\oracle\oradata\neworcl’;
C.
Set oracle_sid=orcl
rman target=sys/robert auxname=sys/Robert@orcl2 duplicate target database to neworcl nofilenamecheck
spfile set control_files ‘c:\oracle\oradata\neworcl\control01.ctl’, ‘c:\oracle\oradata\neworcl\control02.ctl’
set db_file_name_convert ’c:\oracle\oradata\orcl’,’c:\oracle\oradata\neworcl’ set log_file_name_convert ’c:\oracle\oradata\orcl’,’c:\oracle\oradata\neworcl’;
D.
Set oracle_sid=orcl
rman target=sys/robert auxname=sys/Robert
duplicate target database to neworcl from active database nofilenamecheck spfile set control_files ‘c:\oracle\oradata\neworcl\control01.ctl’, ‘c:\oracle\oradata\neworcl\control02.ctl’
set db_file_name_convert ’c:\oracle\oradata\orcl’,’c:\oracle\oradata\neworcl’ set log_file_name_convert ’c:\oracle\oradata\orcl’,’c:\oracle\oradata\neworcl’;
E.
Set oracle_sid=orcl
rman target=sys/robert auxname=sys/Robert@orcl2
duplicate target database to neworcl from active database nofilenamecheck spfile set control_files ‘c:\oracle\oradata\neworcl\control01.ctl’, ‘c:\oracle\oradata\neworcl\control02.ctl’
set db_file_name_convert ’c:\oracle\oradata\orcl’,’c:\oracle\oradata\neworcl’ set log_file_name_convert ’c:\oracle\oradata\orcl’,’c:\oracle\oradata\neworcl’;
5.How many database instances are used during a database-duplication process?
A.One
B.Two
C.Three
D.Four
E.Five
Review Questions |
341 |
6.What command is used to reset a database to a previous incarnation?
A.reset incarnation
B.incarnation reset
C.reset database to incarnation
D.reset database incarnation
E.reset databse incarnation number
7.What view would you use to determine if a given tablespace is fully self-contained for the execution of a tablespace point-in-time recovery?
A.TS_CHECK
B.TPITR_CHECK
C.TS_PITR_CHECK
D.CHECK_TSPITR
E.PITR_TS_CHECK
8.When performing a full database disaster recovery with RMAN, in what order would you execute these steps?
a.Restore the control file from autobackups.
b.Run the RMAN restore and recover command.
c.Restore the database spfile from autobackups.
d.Make the RMAN backup set pieces available.
e.Open the database with the alter database open resetlogs command.
f.Open the database with the alter database open command.
A.a, b, c, d, e, f
B.c, d, a, b, f
C.d, c, a, b, f
D.d, b, d, c, e
E.d, c, a, b, e
9.When performing a database duplication, which duplicate database parameter would you set to ensure that the online redo logs are created in the correct location?
A.log_file_name_convert
B.convert_log_file_name
C.file_name_convert_log
D.redo_log_file_name_convert
E.logfile_convert_directory
342 Chapter 8 n Performing Oracle Advanced Recovery
10.Which command would correctly start a TSPITR of the USERS tablespace?
recover tablespace users
until time ‘10/06/2008:22:42:00’ auxiliary ‘c:\oracle\auxiliary’;
recover tablespace users
time ‘10/06/2008:22:42:00’ auxiliary destination ‘c:\oracle\auxiliary’;
recover tablespace users
to point-in-time ‘10/06/2008:22:42:00’ auxiliary destination ‘c:\oracle\auxiliary’;
recover tablespace users
except time ‘10/06/2008:22:42:00’
auxiliary destination ‘c:\oracle\auxiliary’;
recover tablespace users
until time ‘10/06/2008:22:42:00’
auxiliary destination ‘c:\oracle\auxiliary’;
11.True or false: you can perform an active database duplication when the database is in NOARCHIVELOG mode.
A.True
B.False
12.When running the tablespace point-in-time command recover tablespace users
until time ‘10/06/2008:22:42:00’
auxiliary destination ‘c:\oracle\auxiliary’;
you receive the following error:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 10/08/2008 16:00:30 RMAN-20202: Tablespace not found in the recovery catalog RMAN-06019: could not translate tablespace name “USERS”
Review Questions |
343 |
What is the likely cause of the error?
A.The database is in ARCHIVELOG mode.
B.There is not a current backup of the database available.
C.The USERS tablespace has dependent objects in other tablespaces and can not be a part of a TSPITR alone.
D.The USERS tablespace is not eligible for TSPITR because it has invalid objects.
E.The recover tablespace command is incorrect and generates the error.
13.Which of the following restrictions are not true with respect to tablespace point-in-time recovery? (Choose all that apply.)
A.The target database must be in NOARCHIVELOG mode.
B.No backup is required of the database before you perform a TSPITR.
C.You must have all archived redo logs generated since the last backup up to the point to which you want to restore the transport set.
D.If you rename a tablespace, you can not perform a TSPITR to any point in time before that rename operation occurred.
E.If you have tables in tablespace_1 that have associated constraints in tablespace_2, then you must transport both tablespaces.
14.If you are going to run a TSPITR recovery, which view will help you to determine which objects will be lost during the TSPITR?
A.TS_OBJECTS_TO_BE_DROPPED
B.TS_PTTR_OBJECT_DROPPED
C.TS_PITR_OBJECTS_TO_BE_DROPPED
D.TS_OBJECTS_DROPPED
E.TS_DROPPED_OBJECTS
15.You’re performing tablespace point-in-time recovery on a tablespace called USERS. If an object in that tablespace has a foreign key constraint owned by another object in the INDEX_TBS, which statement is true?
A.You cannot perform the TSPITR with the constraints enabled.
B.You must perform the TSPITR recovery of both tablespaces for it to be successful.
C.You can perform TSPITR only on the USERS tablespace.
D.RMAN will determine if the INDEX_TBS tablespace must also be duplicated and will duplicate it automatically.
E.The TSPITR will only be successful if the constraint is enabled.
344 Chapter 8 n Performing Oracle Advanced Recovery
16.When issuing the duplicate database command, you use the parameter DB_FILE_NAME_ CONVERT. For what purpose do you use this parameter?
A.To indicate the location of the auxiliary-instance online redo logs.
B.To indicate the location of the target database datafiles.
C.To indicate the location of the auxiliary-instance control file and online redo logs.
D.To indicate the location of the auxiliary-instance database datafiles.
E.This is not a valid parameter when duplicating a database.
17.What is the end result of the following commands? recover tablespace users
until time ‘10/06/2008:22:42:00’
auxiliary destination ‘c:\oracle\auxiliary’; sql ’alter tablespace users online’; recover tablespace users
until time ‘10/06/2008:20:40:00’
auxiliary destination ‘c:\oracle\auxiliary’; sql ’alter tablespace users online’;
A.The commands will be successful. The USERS tablespace will be recovered until 10/06/2008 at 20:40.
B.The first recover tablespace command will fail because the syntax is incorrect.
C.The first alter tablespace users online command will fail because the tablespace will already be online after the recover command.
D.The second recover tablespace command will fail because it will be unable to complete the recovery.
E.The second alter tablespace users online command will fail because you cannot perform two TSPITRs in a row without backing up the database between the first and the last recovery.
18.Why should you back up a duplicated tablespace after a TSPITR is complete?
A.The tablespace cannot be duplicated or restored to any point in time after the duplication.
B.The tablespace cannot be duplicated or restored to the point in time before the duplication.
C.The entire database cannot be restored after a TSPITR, so a backup is required.
D.You cannot bring the tablespace online until it’s been backed up.
E.There is no requirement to do so, as RMAN will back up the tablespace after the TSPITR.
Review Questions |
345 |
19.In what state are the datafiles of a tablespace after a TSPITR has been successfully completed?
A.The datafiles have an ONLINE status.
B.The datafiles have an OFFLINE status.
C.The datafiles have an ONLINE status and are in hot backup mode prepared for an online backup.
D.The datafiles have an OFFLINE status and are in hot backup mode for an online backup.
E.The datafiles are in STANDBY mode.
20.Which command do you use to generate a report of database incarnations?
A.list incarnation of database
B.report incarnation of database
C.list database incarnation
D.database incarnation list
E.report database incarnation