- •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
Lab 7.1: Monitoring RMAN Backups |
723 |
searching for all files in the recovery area cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\AUTOBACKUP\2008_10_03 \O1_MF_S_667144857_4GDYJ29H_.BKP
using channel ORA_DISK_1 starting media recovery
archived log for thread 1 with sequence 4 is already on disk as file C:\ORACLE\ORADATA\ORCL\REDO01.LOG
archived log file
name=C:\ORACLE\ORADATA\ORCL\REDO01.LOG thread=1 sequence=4 media recovery complete, elapsed time: 00:00:00
Finished recover at 10/03/2008 14:03:59
10. Open the database with the alter database open resetlogs command.
RMAN> alter database open resetlogs; database opened
The database is open. This concludes the exercise.
Lab 7.1: Monitoring RMAN Backups
In this exercise, we will monitor the progress of RMAN backups. We will also experiment with the duration command.
1.Log into RMAN, connecting to your recovery catalog.
C:\Documents and Settings\Robert>set oracle_sid=orcl C:\Documents and Settings\Robert>rman target=/ catalog=rcat_user/rcat_user@rcat
Recovery Manager: Release 11.1.0.6.0 - Production on Sun Oct 19 14:51:06 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved. connected to target database: ORCL (DBID=1195614221) connected to recovery catalog database
2.From another command-line window, log into SQL*Plus.
C:\Documents and Settings\Robert>set oracle_sid=orcl C:\Documents and Settings\Robert>sqlplus / as sysdba
724 Appendix A n Lab Exercises
SQL*Plus: Release 11.1.0.6.0 - Production on Sun Oct 19 22:07:29 2008 Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, OLAP, Data Mining
and Real Application Testing options SQL>
3.From the RMAN session, start an RMAN backup. We assume you have configured RMAN for backups as discussed in Chapter 2.
RMAN> Backup as compressed backupset database plus archivelog delete input;
4.While the RMAN backup is running, change to the SQL*Plus session and query the
V$SESSION_LONGOPS view, as shown here.
SQL> Select sid, serial#, opname, time_remaining
2From v$session_longops
3Where sid in (select sid from v$session
4 |
|
|
Where program like ‘%rman%‘) |
|
5 |
And time_remaining > 0; |
|
||
|
SID |
SERIAL# |
OPNAME |
TIME_REMAINING |
---------- ---------- |
------------------------------ -------------- |
|||
|
133 |
14 |
RMAN: aggregate input |
87 |
|
126 |
33 |
RMAN: full datafile backup |
179 |
5.Rerun the query listed in step 4, monitoring the TIME_REMAINING column. This will give you an idea of how long the backup will take.
6.When the backup completes, note how long it took to run. Ours took 4 minutes and 55 seconds, as shown here.
channel ORA_DISK_1: backup set complete, elapsed time: 00:04:55 Finished backup at 19-OCT-08
7.Once the RMAN backup is complete, run a second RMAN backup using the duration command with the minimize load database option as shown here.
RMAN> Backup as compressed backupset duration 1:00 minimize load database;
8.Monitor the backup with the V$SESSION_LONGOPS view again. How has the TIME_ REMAINING column changed since you used the duration command? Here is what we saw when we queried the view. Note that TIME_REMAINING is now much higher.
SQL> Select sid, serial#, opname, time_remaining 2 From v$session_longops
Lab 7.2: One of My Backups Is Missing! |
725 |
3Where sid in (select sid from v$session
4 |
|
|
Where |
program like ‘%rman%‘) |
|
5 |
And time_remaining > 0; |
|
|
||
|
SID |
SERIAL# |
OPNAME |
|
TIME_REMAINING |
---------- ---------- |
------------------------------ -------------- |
||||
|
126 |
33 |
RMAN: full |
datafile backup |
3130 |
9.When the backup ends, note how the runtime has changed.
Lab 7.2: One of My Backups Is Missing!
Sometimes it happens—the unexpected. This lab is about one of those cases.
1.Log into RMAN, connecting to your recovery catalog.
C:\Documents and Settings\Robert>set oracle_sid=orcl C:\Documents and Settings\Robert>rman target=/ catalog=rcat_user/rcat_user@rcat
Recovery Manager: Release 11.1.0.6.0 - Production on Sun Oct 19 14:51:06 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved. connected to target database: ORCL (DBID=1195614221) connected to recovery catalog database
2.List all of the archived redo logs currently in the control file. Note that these are not backups of the archived redo logs, but the actual archived redo logs themselves.
RMAN> list archivelog all;
List of |
Archived Log |
Copies for database with db_unique_name ORCL |
|
===================================================================== |
|||
Key |
Thrd |
Seq |
S Low Time |
------- |
---- |
------- |
- --------- |
1773 |
1 |
23 |
A 18-OCT-08 |
|
Name: C:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00023_0667833490.001 |
||
1779 |
1 |
24 |
A 19-OCT-08 |
|
Name: C:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00024_0667833490.001 |
||
1787 |
1 |
25 |
A 19-OCT-08 |
|
Name: C:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00025_0667833490.001 |
726 Appendix A n Lab Exercises
3.Next, remove the last archived redo log listed.
RMAN> Host ‘del C:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ ARC00025_0667833490.001’;
host command complete
4.Now try to execute a backup.
RMAN> Backup as compressed backupset database plus archivelog delete input; Starting backup at 20-OCT-08
current log archived using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup plus archivelog command at 10/20/2008 00:34:26
RMAN-06059: expected archived log not found, lost of archived log compromises
recoverability
ORA-19625: error identifying file C:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00025_0667833490.001 ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) The system cannot find the file specified.
5.Notice that the backup failed because of the missing archived redo log. Run the command crosscheck archivelog all to mark the archived redo log as expired. This will allow you to rerun the backup.
RMAN> Crosscheck archivelog all; released channel: ORA_DISK_1 allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=126 device type=DISK validation succeeded for archived log
archived log file name=C:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ ARC00023_0667833490.001 RECID=43 STAMP=668556384 validation succeeded for archived log
archived log file name=C:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ ARC00024_0667833490.001 RECID=45 STAMP=668556995 validation failed for archived log
archived log file name=C:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ ARC00025_0667833490.001 RECID=47 STAMP=668557334