You are on page 1of 706

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g:


Backup and Recovery

Volume I • Student Guide

D22057GC10
Production 1.0
June 2006
D46524
Authors Copyright © 2006, Oracle. All rights reserved.

Donna Keesling Disclaimer


Maria Billings This document contains proprietary information and is protected by copyright and
other intellectual property laws. You may copy and print this document solely for your
Technical Contributors own use in an Oracle training course. The document may not be modified or altered in
any way. Except where your use constitutes "fair use" under copyright law, you may
and Reviewers not use, share, download, upload, copy, print, display, perform, reproduce, publish,
Christopher Andrews license, post, transmit, or distribute this document in whole or in part without the
express authorization of Oracle.
Tammy Bednar
Tom Best The information contained in this document is subject to change without notice. If you
Harald van Breederode find any problems in the document, please report them in writing to: Oracle University,
Mary Jane Bryksa 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
warranted to be error-free.
Marielle Canning
Tim Chien Restricted Rights Notice
Donna Cooksey
Judy Ferstenberg If this documentation is delivered to the United States Government or anyone using

Oracle Internal & Oracle Academy Use Only


the documentation on behalf of the United States Government, the following notice is
Gerlinde Frenzen applicable:
Joel Goodman
Pete Jones U.S. GOVERNMENT RIGHTS
Isabelle Marchand The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or
disclose these training materials are restricted by the terms of the applicable Oracle
Sabiha Miri license agreement and/or the applicable U.S. Government contract.
Manish Pawar
Jim Spiller Trademark Notice
George Stabler
Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle
Anthony Woodell Corporation and/or its affiliates. Other names may be trademarks of their respective
owners.
Editor
Daniel Milne

Graphic Designer
Satish Bettegowda

Publisher
Jobi Varghese
Contents

1 Introduction
Objectives 1-2
Course Objectives 1-3
What Is Backup and Recovery? 1-4
Performing Backup and Recovery Operations for an Oracle Database 1-5
Using Oracle Recovery Manager 1-6

Oracle Internal & Oracle Academy Use Only


Recovery Manager Components 1-7
Using Oracle Secure Backup 1-9
Overview of Oracle Backup Methods 1-10
When Do You Need to Use a Backup for Recovery? 1-12
Responding to User Error 1-13
Overview of Data Recovery 1-14
Oracle Database Architecture: Crash Recovery 1-15
Oracle Database Architecture: Recovery After Media Failure 1-16
Developing a Backup and Recovery Strategy for Your Oracle Database 1-17
Oracle Solutions for High Availability 1-18
Oracle High Availability Solutions for Unplanned Downtime 1-19
Summary 1-21

2 Configuring for Recoverability


Objectives 2-2
Configuring Your Database for Backup and Recovery Operations 2-3
Configuring ARCHIVELOG Mode 2-4
Specifying a Backup Destination 2-5
Specifying a Retention Policy 2-6
Using a Flash Recovery Area 2-8
Defining a Flash Recovery Area 2-9
Defining Flash Recovery Area Using Enterprise Manager 2-10
Flash Recovery Area Space Management 2-11
Flash Recovery Area Space Usage 2-13
Monitoring the Flash Recovery Area 2-14
Benefits of Using a Flash Recovery Area 2-15
Summary 2-16
Practice Overview 2-17

iii
3 Using RMAN to Create Backups
Objectives 3-2
Using RMAN to Create Backups 3-3
Backup Destinations 3-4
Configuring Persistent Settings for RMAN 3-5
Using Enterprise Manager to Configure RMAN Settings 3-6
Managing Persistent Settings 3-7
Configuring and Allocating Channels for Use in Backups 3-8
Configuring Backup Optimization 3-9
Creating Backup Sets 3-11
Creating Image Copies 3-12

Oracle Internal & Oracle Academy Use Only


BACKUP Command Options 3-14
Creating a Whole Database Backup 3-16
RMAN Backup Types 3-17
Fast Incremental Backup 3-19
Enabling Fast Incremental Backup 3-20
Monitoring Block Change Tracking 3-21
Creating an Oracle-Suggested Backup 3-22
Creating Duplexed Backup Sets 3-23
Creating Duplexed Backup Sets Using CONFIGURE BACKUP COPIES 3-24
Creating Duplexed Backup Sets Using BACKUP COPIES 3-25
Creating Backups of Backup Sets 3-26
Configuring Control File Autobackups 3-27
Using a Media Manager 3-29
Creating Proxy Copies 3-31
Managing Backups: Reporting 3-32
Using Enterprise Manager to View Backup Reports 3-34
Managing Backups: Crosschecking and Deleting 3-35
Using Enterprise Manager to Manage Backups 3-36
Summary 3-37
Practice Overview 3-38

4 Using RMAN to Perform Recovery


Objectives 4-2
Using RMAN RESTORE and RECOVER Commands 4-3
Performing Recovery Using Enterprise Manager 4-4
Comparing Complete and Incomplete Recovery 4-5
Complete Recovery Following the Loss of Datafiles 4-6
Performing Complete Recovery: Loss of a Non-Critical datafile in ARCHIVELOG
Mode 4-7

iv
Performing Complete Recovery: Loss of a System-Critical Datafile in ARCHIVELOG
Mode 4-8
Recovery Using Incrementally Updated Backups 4-9
Using the Flash Recovery Area for Fast Recovery 4-10
Performing Restore and Recovery of a Database in NOARCHIVELOG Mode 4-11
Using Incremental Backups to Recover a Database in NOARCHIVELOG Mode 4-12
Restoring and Recovering the Database on a New Host 4-13
Preparing to Restore the Database to a New Host 4-14
Restoring the Database to a New Host 4-15
Performing Recovery with a Backup Control File 4-19
Restoring the Server Parameter File from the Control File Autobackup 4-20
Restoring the Control File from Autobackup 4-21

Oracle Internal & Oracle Academy Use Only


Performing Disaster Recovery 4-23
Summary 4-25
Practice Overview 4-26

5 Using Oracle Flashback Technologies


Objectives 5-2
Using Oracle Flashback Technology 5-3
Flashback Drop and the Recycle Bin 5-4
Understanding the Recycle Bin 5-5
Restoring Tables from the Recycle Bin 5-6
Automatic Space Reclamation in the Recycle Bin 5-7
Manual Space Reclamation in the Recycle Bin 5-8
Bypassing the Recycle Bin 5-9
Querying the Recycle Bin 5-10
Querying Data in Dropped Tables 5-11
Using Flashback Technology to Query Data 5-12
Configuring Undo for Flashback 5-13
Flashback Query: Overview 5-14
Flashback Query: Example 5-15
Flashback Versions Query: Overview 5-16
Using Enterprise Manager to Perform Flashback Versions Query 5-17
Flashback Versions Query: Considerations 5-18
Flashback Transaction Query: Overview 5-19
Using Enterprise Manager to Perform Flashback Transaction Query 5-20
Flashback Transaction Query: Considerations 5-21
Flashback Table: Overview 5-22
Flashback Table 5-23
Enabling Row Movement on a Table 5-24
Performing Flashback Table 5-25

v
Flashback Table: Considerations 5-26
Flashback Database: Overview 5-27
Flashback Database Architecture 5-28
Configuring Flashback Database 5-29
Using Enterprise Manager to Configure Flashback Database 5-30
Flashback Database: Examples 5-31
Using Enterprise Manager to Perform Flashback Database 5-32
Flashback Database Considerations 5-35
Monitoring Flashback Database 5-36
Tuning Considerations for Flashback Database 5-39
Using Guaranteed Restore Points 5-41

Oracle Internal & Oracle Academy Use Only


Summary 5-42
Practice Overview 5-43

6 Using RMAN to Create a Duplicate Database


Objectives 6-2
Using RMAN to Create a Duplicate Database 6-3
Using a Duplicate Database 6-4
Creating a Duplicate Database 6-5
Creating an Initialization Parameter File for the Auxiliary Instance 6-6
Specifying Parameters to Control File Naming 6-7
Starting the Instance in NOMOUNT Mode 6-9
Ensuring That Backups and Archived Redo Log Files Are Available 6-10
Allocating Auxiliary Channels 6-11
Using the RMAN DUPLICATE Command 6-12
Understanding the RMAN Duplication Operation 6-13
Specifying Options for the DUPLICATE Command 6-14
Using Enterprise Manager to Create a Duplicate Database 6-15
Using Enterprise Manager: Source Working Directory 6-16
Using Enterprise Manager: Select Destination 6-17
Using Enterprise Manager: Destination Options 6-18
Using Enterprise Manager: Review Page 6-19
Summary 6-20
Practice Overview 6-21

7 Performing Tablespace Point-in-Time Recovery


Objectives 7-2
Tablespace Point-in-Time Recovery (TSPITR) Concepts 7-3
Tablespace Point-in-Time Recovery (TSPITR): Terminology 7-4
Tablespace Point-in-Time Recovery: Architecture 7-5
Understanding When to Use TSPITR 7-7

vi
Preparing for TSPITR 7-8
Determining the Correct Target Time 7-9
Determining the Tablespaces for the Recovery Set 7-10
Identifying Objects That Will Be Lost 7-11
Performing Basic RMAN TSPITR 7-12
Performing Fully Automated TSPITR 7-13
Using Enterprise Manager to Perform TSPITR 7-14
Understanding TSPITR Processing 7-15
Performing Customized RMAN TSPITR with an RMAN-Managed Auxiliary Instance 7-17
Performing RMAN TSPITR Using Your Own Auxiliary Instance 7-18
Troubleshooting RMAN TSPITR 7-19
Summary 7-21

Oracle Internal & Oracle Academy Use Only


Practice Overview 7-22

8 Using the RMAN Recovery Catalog


Objectives 8-2
RMAN Repository Data Storage: Comparison of Options 8-3
Storing Information in the Recovery Catalog 8-4
Reasons to Use a Recovery Catalog 8-5
Creating the Recovery Catalog: Three Steps 8-6
Configuring the Recovery Catalog Database 8-7
Creating the Recovery Catalog Owner 8-8
Creating the Recovery Catalog 8-9
Managing Target Database Records in the Recovery Catalog 8-10
Registering a Database in the Recovery Catalog 8-11
Using Enterprise Manager to Register a Database 8-12
Unregistering a Target Database from the Recovery Catalog 8-14
Cataloging Additional Backup Files 8-15
Manually Resynchronizing the Recovery Catalog 8-16
Using RMAN Stored Scripts 8-17
Creating RMAN Stored Scripts 8-18
Executing RMAN Stored Scripts 8-19
Displaying RMAN Stored Script Information 8-20
Updating and Deleting RMAN Stored Scripts 8-21
Backing Up and Recovering the Recovery Catalog 8-22
Re-creating an Unrecoverable Recovery Catalog 8-23
Exporting and Importing the Recovery Catalog 8-24
Upgrading the Recovery Catalog 8-25
Dropping the Recovery Catalog 8-26
Summary 8-27
Practice Overview 8-28

vii
9 Monitoring and Tuning RMAN
Objectives 9-2
Monitoring RMAN Sessions 9-3
Monitoring RMAN Job Progress 9-5
Monitoring RMAN Job Performance 9-7
Interpreting RMAN Message Output 9-8
Using the DEBUG Option 9-9
Understanding RMAN Code Layer Error Numbers 9-10
Interpreting RMAN Error Stacks 9-11
Tuning RMAN 9-12
RMAN Multiplexing 9-13

Oracle Internal & Oracle Academy Use Only


Allocating Disk Buffer: Example 9-14
Allocating Tape Buffers 9-15
Comparing Synchronous and Asynchronous I/O 9-16
Monitoring RMAN Job Performance 9-18
Asynchronous I/O Bottlenecks 9-19
Synchronous I/O Bottlenecks 9-20
Tape Backup Speed 9-21
Tape Subsystem Performance Rules 9-22
Controlling Tape Buffer Size with BLKSIZE 9-23
Channel Tuning 9-24
Tuning the BACKUP Command 9-25
Tuning RMAN Backup Performance 9-26
Setting LARGE_POOL_SIZE 9-27
Tuning RMAN Tape Streaming Performance Bottlenecks 9-28
Summary 9-30
Practice Overview 9-31

10 Oracle Secure Backup Overview


Objectives 10-2
Oracle Secure Backup Tape Backup Management 10-3
What Is Oracle Secure Backup? 10-4
Oracle Secure Backup: Tape Management and Integration with Oracle Products 10-5
Client/Server Architecture Host Roles 10-6
Oracle Secure Backup for Centralized Tape Backup Management 10-7
Typical SAN Environment 10-8
Oracle Secure Backup Interface Options 10-9
Media Concepts: Overview 10-10
Backup Pieces and Backup Images 10-11
Media Management Expiration Policies 10-12
Oracle Secure Backup Media Family 10-14

viii
Tape Drives and Libraries 10-15
Virtual Tape Libraries (VTL) 10-17
Managing Data to Be Protected 10-18
Oracle Secure Backup Jobs 10-19
Securing Data and Access to the Backup Domain 10-20
Oracle Secure Backup: The Integration Advantage 10-22
Why Use Oracle Secure Backup? 10-23
Summary 10-24

11 Installing Oracle Secure Backup


Objectives 11-2

Oracle Internal & Oracle Academy Use Only


Performing Preinstallation Tasks 11-3
Installation and Configuration of the Administrative Domain 11-4
Performing Installation Tasks 11-5
Administrative Server Installation: Example 11-6
Wizard-Based Installation on Windows 11-13
Oracle Secure Backup Interfaces 11-14
Integration with Enterprise Manager 11-15
Oracle Secure Backup Administrative Server Page 11-16
Configuring the Administrative Server in EM 11-17
Oracle Secure Backup Web Tool Home Page 11-18
Common obtool Commands 11-19
Configuring Oracle Secure Backup Users 11-20
Adding Oracle Secure Backup Users 11-21
Preauthorizing Access 11-23
Summary 11-24
Practice Overview 11-25

12 Using RMAN and Oracle Secure Backup


Objectives 12-2
RMAN and Oracle Secure Backup Basic Process Flow 12-3
RMAN Database Backup to Tape 12-4
Database Backup Storage Selector 12-5
Defining Database Storage Selectors 12-7
Media Families and RMAN 12-8
Oracle Database Disk and Tape Backup Solution 12-9
Backing Up the Flash Recovery Area to Tape 12-10
Defining Retention for RMAN Backups 12-11
Backup Settings 12-12
Scheduling Backups with EM 12-13
Oracle-Suggested Backup to Tape 12-14

ix
RMAN and Oracle Secure Backup Job Execution 12-15
Managing Database Tape Backups 12-16
Performing Database Recovery 12-18
RMAN Automatic Failover to Previous Backup 12-19
Summary 12-20
Practice Overview 12-21

13 Backing Up File-System Files with Oracle Secure Backup


Objectives 13-2
Backing Up File-System Files with Oracle Secure Backup 13-3
File-System Backups 13-4

Oracle Internal & Oracle Academy Use Only


Managing Media Families 13-5
Dataset Script: Examples 13-6
Creating Datasets 13-9
Creating Backup Windows 13-11
Creating Backup Schedules 13-13
Creating Backup Triggers 13-14
Previewing a Backup Trigger 13-16
Creating On-Demand Backup Requests 13-17
Submitting Backup Requests 13-19
Reviewing Jobs 13-20
Summary 13-21
Practice Overview 13-22

14 Restoring File-System Backups with Oracle Secure Backup


Objectives 14-2
Browsing the Catalog for File-System Backup Data 14-3
Restoring File-System Data 14-4
Restoring File-System Files with Oracle Secure Backup 14-5
The Restore Page 14-6
Listing All File-System Backups of a Client 14-7
Creating a Catalog-Based Restore Request 14-8
Submitting Restore Requests 14-12
Summary 14-13
Practice Overview 14-14

x
15 Managing Oracle Secure Backup Security
Objectives 15-2
Guarding Access and Data 15-3
Managing User Access Control 15-4
Predefined Classes and User Rights 15-5
Defining an Oracle Secure Backup User 15-8
Oracle Secure Backup User: OS Permissions 15-9
Preauthorization 15-11
Assigning Windows Account Information 15-12
Authentication 15-13
Leveraging Oracle Security Technology 15-14

Oracle Internal & Oracle Academy Use Only


Administrative Server Certificate Authority (CA) 15-16
Oracle Wallets 15-18
Encrypted Backups to Tape 15-20
Creating RMAN Encrypted Backups 15-21
Using Transparent Mode Encryption 15-22
Using Password Mode Encryption 15-24
Using Dual Mode Encryption 15-25
Restoring Encrypted Backups 15-26
Performing Encrypted Recovery 15-27
Summary 15-28
Practice Overview 15-29

16 Managing the Administrative Domain


Objectives 16-2
Oracle Secure Backup Processes: Daemons 16-3
Managing Common Daemon Operations 16-5
Managing Policies and Defaults 16-6
Configuring Oracle Secure Backup Policies 16-7
Oracle Secure Backup: Backup Metadata Catalogs 16-8
Oracle Secure Backup: Directory Structure 16-10
Backing Up the Catalog 16-11
Adding Clients 16-12
Adding Media Servers 16-13
NAS Devices 16-15
Adding NDMP Media Servers 16-16
Adding Devices 16-17
Discovering Devices on NDMP Hosts 16-19
Managing Devices 16-20
Tape Library Properties 16-21
Tape Drive Properties 16-22

xi
Managing Volumes 16-23
Oracle Secure Backup Jobs 16-25
Managing Jobs 16-27
Viewing Job Properties and Transcripts 16-29
Suspending and Resuming Job Dispatching 16-31
Job Summaries 16-33
Displaying Log Files and Transcripts 16-34
Summary 16-35
Practice Overview 16-36

Appendix A: Practices

Oracle Internal & Oracle Academy Use Only


Appendix B: Practice Solutions

Appendix C: Oracle Secure Backup Additional Installation Topics


Topics C-2
Windows Installation: Overview C-3
Stopping Tape Device Drivers C-4
Oracle Secure Backup Setup C-6
Service Startup Dialogs C-8
Service Login Dialog Box C-9
Oracle Secure Backup Installed Files C-10
Installed Files for Host Role: Administrative Server C-14
Installed Files for Host Role: Media Server C-16
Installed Files for Host Role: Client C-17
Specifying Installation Parameters C-18
Client Installation: Example C-20
Media Server Installation: Example C-21
Verifying Your Installation C-22
Uninstalling Oracle Secure Backup C-23
Summary C-25

Appendix D: Glossary

xii
Introduction

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.
Objectives

After completing this lesson, you should be able to:


• Describe course objectives
• Describe backup methods
• Describe the forms of data recovery
• Describe Oracle Recovery Manager architecture

Oracle Internal & Oracle Academy Use Only


• Plan a recovery strategy
• Plan a backup strategy based on your recovery
strategy

Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 1 - 2


Course Objectives

After completing this course, you should be able to:


• Use Oracle Recovery Manager (RMAN) to perform
backup and recovery operations
• Create a duplicate database
• Perform tablespace point-in-time recovery

Oracle Internal & Oracle Academy Use Only


• Create and manage an RMAN recovery catalog
• Use Oracle Secure Backup to back up and restore
Oracle databases and file-system data to and from tape

Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 1 - 3


What Is Backup and Recovery?

Backup and recovery constitutes the strategies and


procedures you employ to:
• Protect your database against data loss
• Reconstruct your database following data loss

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

What Is Backup and Recovery?


The phrase backup and recovery refers to the strategies and techniques that are employed by
database administrators to protect the database from loss and to reconstruct the database
should loss occur.

Oracle Database 10g: Backup and Recovery 1 - 4


Performing Backup and Recovery Operations for
an Oracle Database

For performing backup and recovery based on physical


backups, the following solutions are available:
• Recovery Manager: A utility with a command-line client
and an Enterprise Manager GUI interface
• User-managed backup and recovery: A technique that
involves using operating system commands to create

Oracle Internal & Oracle Academy Use Only


backups and using SQL*Plus commands for additional
backup and recovery operations

Copyright © 2006, Oracle. All rights reserved.

Performing Backup and Recovery Operations for an Oracle Database


Physical backups are backups of the physical files that comprise your Oracle database,
including datafiles, control files, and archived redo log files. You can make backups of your
database by using Recovery Manager (RMAN), a utility that creates and manages backups and
enables you to perform recovery operations. Alternatively, you can create backups of your
database files and perform recovery through a combination of SQL commands and operating
system commands. RMAN is the preferred solution for backup and recovery operations for an
Oracle database.

Oracle Database 10g: Backup and Recovery 1 - 5


Using Oracle Recovery Manager

• RMAN:
– Is a command-line client for advanced functions
– Has powerful control and scripting language
– Has a published API that enables interface with most
popular backup software
– Backs up data, control, archived log, and server

Oracle Internal & Oracle Academy Use Only


parameter files
– Backs up files to disk or tape
• Enterprise Manager uses Recovery Manager (RMAN) to
perform backup and recovery operations.

Copyright © 2006, Oracle. All rights reserved.

Using Oracle Recovery Manager


RMAN is the component of Oracle Database that is used to perform backup and recovery
operations. It can make consistent and inconsistent backups, perform incremental or full
backups, and back up either the whole database or a portion of it.
RMAN uses its own powerful job control and scripting language, as well as a published API
that interfaces RMAN with many popular backup software solutions.
RMAN can store backups on disk for quick recovery or place them on tape for long-term
storage. In order for RMAN to store backups on tape, an interface to the tape device known as
a Media Management Library (MML) must be configured.
Enterprise Manager supplies a graphical interface to the most commonly used RMAN
functionality. Advanced backup and recovery operations are accessible through the RMAN
command-line client.

Oracle Database 10g: Backup and Recovery 1 - 6


Recovery Manager Components

Server Recovery
Target database session Manager Enterprise
(control file (RMAN) Manager
repository)
Options
Server
session

Oracle Internal & Oracle Academy Use Only


Channel Channel Channel
Auxiliary
MML
database

Recovery
catalog
Disk Flash Recovery database
Area

Copyright © 2006, Oracle. All rights reserved.

Recovery Manager Components


Recovery Manager executable: The Recovery Manager command-line interface is invoked
through the RMAN client application. RMAN interprets user commands and appropriately
invokes server sessions to perform the desired tasks.
Enterprise Manager: Enterprise Manager Database Control supplies a graphical interface to
the most commonly used RMAN functionality.
Server sessions: The server processes (UNIX) or threads (Windows) invoked by RMAN
connect to the target database to perform the backup, restore, and recovery functions through a
PL/SQL interface. These sessions read or write files from or to disk, tape, or the Flash
Recovery Area, which is a storage location specified as the default storage area for files related
to database recovery.
Target database: The database for which backup and recovery operations are being
performed using RMAN is called the target database. The control file of the target database
contains information about its physical structure, such as the size and location of datafiles,
online and archived redo log files, and control files. This information is used by the server
sessions invoked by RMAN in backup and recovery operations.

Oracle Database 10g: Backup and Recovery 1 - 7


Recovery Manager Components (continued)
Auxiliary database: An auxiliary database is used when creating a duplicate database or
performing tablespace point-in-time recovery (TSPITR). For the tasks, the auxiliary database
serves as the destination of the new copy of the database or the recovered tablespaces. An
auxiliary database can reside on the same host as its parent or on a different host.
Channel: A channel represents one stream of data to a device type. To perform and record
backup and recovery operations, RMAN requires a link to the target database. A channel
establishes this link by creating a session in the target database that is able to interface with the
host file system (to interface with disks) and the Media Management Library (to interface with
tapes). You can allocate channels manually or preconfigure channels by using automatic
channel allocation.
Flash Recovery Area: The Flash Recovery Area is a location in which Oracle Database can
store and manage files related to backup and recovery. Additional information is provided later

Oracle Internal & Oracle Academy Use Only


in the lesson.
RMAN repository: RMAN maintains metadata about the target database and its backup and
recovery operations in the RMAN repository. Among other things, RMAN stores information
about its own configuration settings, the target database schema, archived redo logs, and all
backup files that are on disk or tape. RMAN repository data is always stored in the control file
of the target database.
Recovery catalog: The RMAN repository data can optionally be kept in a recovery catalog,
which is a separate Oracle database.
Media Management Library: The Media Management Library (MML) is used by RMAN
when writing to or reading from tapes. The additional media management software required
for using the tape medium is provided by media and storage system vendors. Also, the Oracle
Secure Backup product allows RMAN to back up to tape without requiring third-party tools.

Oracle Database 10g: Backup and Recovery 1 - 8


Using Oracle Secure Backup

• One tool to backup and restore Oracle databases and


file-system data to and from tape
• Integrated with RMAN and Enterprise Manager
• Supports Oracle9i and Oracle Database 10g

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using Oracle Secure Backup


The Oracle Secure Backup tape management system has been introduced to lower software
costs and complexity. Oracle Secure Backup can back up all types of file-system files.
Although Oracle Secure Backup has no specialized knowledge of database backup and
recovery algorithms, it can serve as a media management layer for Recovery Manager
(RMAN) through the system backup to tape (SBT) interface. In this capacity, Oracle Secure
Backup provides the same services for RMAN as other supported third-party SBT libraries.
Oracle Secure Backup delivers reliable database and file system backup to tape, with support
for the major tape drives and libraries accessible through various protocols, including Small
Computer System Interface (SCSI), Small Computer System Interface protocol (iSCSI),
Network Data Management Protocol (NDMP), and Fibre Channel.
Note: Oracle continues to support third-party media management vendors (MMV) through its
Backup Solutions Program (BSP). Oracle Secure Backup uses the same RMAN API as third-
party media management software, so you have a choice of products to use for writing your
database backups to tape.

Oracle Database 10g: Backup and Recovery 1 - 9


Overview of Oracle Backup Methods

• Backup strategies:
– Whole: A backup of the control file and all datafiles that
belong to a database
– Partial: A portion of the database
• Backup types:
– Full: A non-incremental RMAN backup

Oracle Internal & Oracle Academy Use Only


– Incremental: Only information that has changed since
some previous backup
• Backups modes:
– Offline: Consistent, also referred to as cold backup
– Online: Inconsistent, also referred to as hot backup

Copyright © 2006, Oracle. All rights reserved.

Overview of Oracle Backup Methods


A whole database backup includes all datafiles and at least one control file.
Partial database backups may include zero or more tablespaces, zero or more datafiles, and
may or may not include a control file.
Full backups are non-incremental RMAN backups. You can make a full backup of only one
datafile. “Full” does not refer to how much of the database is backed up, but to the fact that the
backup is not incremental.
Incremental backups make a copy of all data blocks that have changed since some previous
backup. Oracle Database 10g supports two levels of incremental backup (0 and 1). A level 0 or
baseline backup is equivalent to a full backup and contains all data blocks. A level 1
cumulative incremental backs up all database blocks changed since the level 0 backup. A level
1 differential incremental backs up all database blocks changed since a level 0 or level 1
backup. To restore using incremental backups, the baseline backup must first be restored, and
then the incremental backup. You can make incremental backups with Recovery Manager
(RMAN).
Offline backups (also known as cold or consistent backups) are taken while the database is not
open. They are consistent because at the time of the backup, the system change number (SCN)
in the datafile headers matches the SCN in the control files.
Oracle Database 10g: Backup and Recovery 1 - 10
Overview of Oracle Backup Methods (continued)
Online backups (also known as hot or inconsistent backups) are taken while the database is
open. The backups are inconsistent because, with the database open, there is no guarantee that
the datafiles are synchronized with the control files.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery 1 - 11


When Do You Need to Use a Backup for
Recovery?

The use of a backup to perform recovery is often required


for the following types of errors:
• Media failure: The failure of a read or write of a
database file due to a physical problem with the file
• User errors: Data in your database is changed or
deleted incorrectly

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

When Do You Need to Use a Backup for Recovery?


When you experience media failure, such as the loss of a disk drive, you may need to recover
your database. This type of recovery typically requires the use of a backup of the affected files.
In the case of user errors, when data in the database has been incorrectly updated or deleted, a
backup may be required to enable you to recover the database to a point before the unwanted
change.

Oracle Database 10g: Backup and Recovery 1 - 12


Responding to User Error

Possible responses to user error include:


• Reentering the lost data manually, if a record of the
changes exists
• Importing the dropped object, if a suitable export file
exists or the object is still available on a standby
database

Oracle Internal & Oracle Academy Use Only


• Performing tablespace point-in-time recovery (TSPITR)
of one or more tablespaces
• Returning the database to a past state using database
point-in-time recovery
• Using one of the Oracle Flashback features to recover
from logical corruption by returning affected objects to
a past state

Copyright © 2006, Oracle. All rights reserved.

Responding to User Error


When a user error occurs, your recovery options are based on the techniques and features you
implemented in anticipation of the error.
In later lessons, you investigate tablespace point-in-time recovery, database point-in-time
recovery, and Oracle Flashback features.

Oracle Database 10g: Backup and Recovery 1 - 13


Overview of Data Recovery

• Crash recovery: Automatic recovery after instance


failure
• Media recovery: Recovery of current datafiles, control
files
– Complete recovery: Recovery of the database to the
most recent point in time

Oracle Internal & Oracle Academy Use Only


– Incomplete recovery (point-in-time recovery): Recovery
of the database to its state at a specific time or system
change number (SCN)

Copyright © 2006, Oracle. All rights reserved.

Overview of Data Recovery


Crash (instance) recovery and media recovery are performed to restore data integrity.
Crash recovery happens the first time an Oracle database instance is started after a crash (or
SHUTDOWN ABORT). The goal of crash recovery is to bring the datafiles to a transaction-
consistent state, preserving all committed changes up to the point when the instance failed.
Media recovery is initiated when you have experienced a loss of datafiles or all control files.
You can perform a complete recovery to bring the database back to the point of failure by
restoring datafiles from a backup and performing a recovery operation. In addition, you can
perform an incomplete recovery operation by recovering the database to a named time or
system change number (SCN).

Oracle Database 10g: Backup and Recovery 1 - 14


Oracle Database Architecture: Crash Recovery

• The online redo log files are used to roll the database
forward.
• Uncommitted changes are rolled back.

Online redo

Oracle Internal & Oracle Academy Use Only


log files Undo blocks

Database at Database with Database with


time of instance committed and committed
failure uncommitted transactions only
transactions

Copyright © 2006, Oracle. All rights reserved.

Oracle Database Architecture: Crash Recovery


Crash recovery employs two distinct operations:
• Rolling forward the current, online datafiles by applying both committed and
uncommitted transactions contained in online redo records
• Rolling back changes made in uncommitted transactions to their original state

Oracle Database 10g: Backup and Recovery 1 - 15


Oracle Database Architecture: Recovery After
Media Failure

• Datafiles are restored from a backup.


• Archived and online redo log files are used to roll the
database forward.

Online and

Oracle Internal & Oracle Academy Use Only


archived redo
log files Undo blocks

Recovered
Database with Database with database
restored committed and
datafiles uncommitted
transactions

Copyright © 2006, Oracle. All rights reserved.

Oracle Database Architecture: Recovery After Media Failure


Media recovery is used to recover from a lost or damaged current datafile, server parameter
file (SPFILE), or control file. It can also recover changes that were recorded in the redo log
files but not in the datafiles for a tablespace that went offline without the OFFLINE NORMAL
option.
Media recovery has the following characteristics:
• Must be explicitly invoked by the DBA
• Applies needed changes to datafiles that have been restored from backup, not to online
datafiles
• Requires the use of archived redo log files as well as the online redo log file

Oracle Database 10g: Backup and Recovery 1 - 16


Developing a Backup and Recovery Strategy for
Your Oracle Database

• Assess service-level criteria, including:


– Data availability requirements
– Data criticality
– Recovery point and time objectives
• Anticipate the errors that will arise in your environment
and put in place the backup procedures needed to

Oracle Internal & Oracle Academy Use Only


recover from those errors.

Copyright © 2006, Oracle. All rights reserved.

Developing a Backup and Recovery Strategy for Your Oracle Database


Developing best practices for backup and recovery of your Oracle database begins with an
assessment of all service level criteria for your environment, including recovery point and time
objectives, data availability requirements, and data criticality.

Oracle Database 10g: Backup and Recovery 1 - 17


Oracle Solutions for High Availability

In addition to backup and recovery strategies and


procedures, consider the following Oracle solutions:
• Oracle Data Guard: Provides a comprehensive set of
services that create, maintain, manage, and monitor
one or more standby databases
• Oracle Real Application Clusters (RAC): Enables

Oracle Internal & Oracle Academy Use Only


access to a single database from multiples instances
• Oracle Streams: Enables the propagation and
management of data, transactions, and events in a data
stream
• LogMiner: Enables you to query redo log files through
a SQL interface to provide data recovery

Copyright © 2006, Oracle. All rights reserved.

Additional Oracle Solutions for High Availability


High availability systems are computing environments configured to provide nearly full-time
availability. These systems typically have redundant hardware and software that make them
available despite failures.
Well-designed high availability systems avoid having single points of failure. When failures
occur, the failover processes implemented as part of the system move processing performed by
the failed component to backup components.
Oracle has a number of products and features that provide high availability in cases of
unplanned downtime or planned downtime. In this course, you focus on various backup and
recovery techniques that help you to meet high availability needs. Additional Oracle solutions
for high availability include Oracle Data Guard, Oracle Real Application Clusters (RAC),
Oracle Streams, and LogMiner.

Oracle Database 10g: Backup and Recovery 1 - 18


Oracle High Availability Solutions for
Unplanned Downtime

• Computer failure: Fast-start fault recovery, Real


Application Clusters (RAC), Data Guard, Oracle
Streams
• Storage failure: Automatic Storage Management (ASM),
RMAN with Flash Recovery Area, Data Guard, Oracle
Streams

Oracle Internal & Oracle Academy Use Only


• Human errors: Oracle security features, Oracle
Flashback technology, LogMiner
• Data corruption: Hardware Assisted Resilient Data
(HARD) initiative, RMAN with Flash Recovery Area,
Data Guard, Oracle Streams
• Site failure: RMAN, Data Guard, Oracle Streams

Copyright © 2006, Oracle. All rights reserved.

Oracle High Availability Solutions for Unplanned Downtime


Oracle provides high availability solutions for the following types of unplanned downtime:
• Computer failure: The system on which the database operates is unavailable
• Storage failure: The storage holding some or all of the database is unavailable
• Human errors: Unintentional or malicious actions cause data within the database to
become logically corrupt or unusable
• Data corruption: A hardware or software component causes corrupt data to be read or
written to the database
• Site failure: An event causes all or a significant portion of an application to stop
processing or slow to an unusable level
The table on the following page describes the appropriate Oracle solution for the various types
of unplanned downtimes. Additionally, an estimate of recovery time is provided for each. Use
this table to help plan the appropriate implementation of Oracle solutions to enable you to
meet your recovery goals.

Oracle Database 10g: Backup and Recovery 1 - 19


Oracle High Availability Solutions for Unplanned Downtime (continued)
Source: Oracle Database High Availability Overview
Outage Type Oracle Solution Benefits Recovery Time
Computer Fast-start Fault Tunable and predictable cache Minutes to hours
failures Recovery recovery
RAC Automatic recovery of failed No downtime
nodes and instances, fast
connection failover, and service
failover
Data Guard Fast start failover and fast < 1 minute
connection failover
Oracle Streams Online replica database No downtime

Oracle Internal & Oracle Academy Use Only


Storage ASM Mirroring; online auto rebalance No downtime
failure
RMAN with flash Fully managed database recovery Minutes to hours
recovery area and managed disk-based backups
Data Guard Fast start failover and fast < 1 minute
connection failover
Oracle Streams Online replica database No downtime
Human errors Oracle security Restrict user access No downtime
features
Oracle Flashback Fine-grained and database-wide < 30 minutes
technology rewind capability
LogMiner Log analysis Minutes to hours
Data HARD Corruption prevention within a No downtime
corruption storage array
RMAN with flash Online block media recovery and Minutes to hours
recovery area managed disk-based backups
Data Guard Automatic validation of redo < 1 minute
blocks; fast failover to an
uncorrupted standby database
Oracle Streams Online replica database No downtime
Site failure RMAN Fully managed database recovery Hours to days
Data Guard Fast start failover and fast Seconds to 5
connection failover minutes
Oracle Streams Online replica database Seconds to 5
minutes

Oracle Database 10g: Backup and Recovery 1 - 20


Summary

In this lesson, you should have learned how to:


• Describe backup methods
• Describe the forms of data recovery
• Describe Oracle Recovery Manager architecture
• Plan a recovery strategy

Oracle Internal & Oracle Academy Use Only


• Plan a backup strategy based on your recovery
strategy

Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 1 - 21


Oracle Internal & Oracle Academy Use Only
Configuring for Recoverability

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.
Objectives

After completing this lesson, you should be able to:


• Configure your database in ARCHIVELOG mode
• Specify a retention policy
• Configure the Flash Recovery Area

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 2 - 2


Configuring Your Database for Backup and
Recovery Operations

• Operate the database in ARCHIVELOG mode.

Archiver
(ARCn)
Online redo Archived
log files redo log files

Oracle Internal & Oracle Academy Use Only


• Configure the Flash Recovery Area.

Archived Control file Datafile backups


redo log files backups

Copyright © 2006, Oracle. All rights reserved.

Configuring Your Database


When you operate your database in ARCHIVELOG mode, you have more recovery options
after a data loss, including point-in-time recovery of the database or some tablespaces.
It is recommended that you take advantage of the Flash Recovery Area to store as many
backup and recovery-related files as possible, including disk backups and archived redo logs.
Some features of Oracle Database backup and recovery, such as Oracle Flashback Database
and guaranteed restore points, require the use of a Flash Recovery Area.

Oracle Database 10g: Backup and Recovery 2 - 3


Configuring ARCHIVELOG Mode

Perform the following steps to place the database in


ARCHIVELOG mode:
• Using Enterprise Manager:
1. Select the “ARCHIVELOG Mode” check box.
2. Click Apply. The database can be set to ARCHIVELOG
mode only from the MOUNT state.

Oracle Internal & Oracle Academy Use Only


3. Click Yes when asked whether you want to restart the
database.
• Using SQL commands:
1. Place the database in MOUNT mode.
2. Issue the ALTER DATABASE ARCHIVELOG MODE command
3. Open the database.

Copyright © 2006, Oracle. All rights reserved.

Configuring ARCHIVELOG Mode


Placing the database in ARCHIVELOG mode prevents redo logs from being overwritten until
they have been archived.
The following SQL command is used to place the database in ARCHIVELOG mode:
SQL> ALTER DATABASE ARCHIVELOG;
This command can be issued only while the database is in the MOUNT state.
With the database in NOARCHIVELOG mode (the default), recovery is possible only until the
time of the last backup. All transactions made after that backup are lost.
In ARCHIVELOG mode, recovery is possible until the time of the last commit. Most
production databases are operated in ARCHIVELOG mode.
Note: Back up your database after switching to ARCHIVELOG mode because your database is
recoverable only from the last backup taken in that mode.

Oracle Database 10g: Backup and Recovery 2 - 4


Specifying a Backup Destination

Backups can be written to:


• Disk directory
• Tape using Oracle Secure Backup
• Media Management Library (tape device)
• Flash recovery area: Disk area set aside for backup and

Oracle Internal & Oracle Academy Use Only


recovery and flashback database purposes

Copyright © 2006, Oracle. All rights reserved.

Backup Destinations
Backups can be written to a designated disk directory, a Media Management Library, or the
Flash Recovery Area. Specifying a disk directory or the Flash Recovery Area means that
backups go to hard-disk media. Typically, backups are regularly moved offline to tape via the
media management interface in order to maintain disk space availability. Any disk directory
can be specified as the destination of a backup provided that it already exists.
If you set up a Flash Recovery Area, many backup and recovery tasks are simplified for you.
The Oracle database automatically names files for you, and deletes obsolete files when there is
space pressure. More information about configuring Flash Recovery is provided later in this
lesson.

Oracle Database 10g: Backup and Recovery 2 - 5


Specifying a Retention Policy

• Retention policy: Describes which backups will be kept


and for how long
• Two types of retention policies:
– Recovery window: Establishes a period of time within
which point-in-time recovery must be possible

Oracle Internal & Oracle Academy Use Only


File2 File1 Now
File2 needs
to be backed up:

Seven-day retention

– Redundancy: Establishes a fixed number of backups that


must be kept
• Retention policies are mutually exclusive.

Copyright © 2006, Oracle. All rights reserved.

Specifying a Retention Policy


A retention policy describes which backups will be kept and for how long. You can set the
value of the retention policy by using the RMAN CONFIGURE command or Enterprise
Manager. The best practice is to establish a period of time during which it will be possible to
discover logical errors and fix the affected objects by doing a point-in-time recovery to just
before the error occurred. This period of time is called the recovery window. This policy is
specified in number of days. For each datafile, there must always exist one backup that
satisfies the following condition:
SYSDATE - checkpoint_time <= recovery_window
For example, if the policy were to be set as follows:
RMAN> CONFIGURE RETENTION POLICY
2 TO RECOVERY WINDOW OF 7 DAYS;
Then, for each file there must be a backup that satisfies:
SYSDATE - (SELECT checkpoint_time
FROM V$DATAFILE WHERE file#= …) >= 7
In the example in the slide, File1 has a backup that is within the seven-day retention period.
File2 does not, so it needs to be backed up in order to satisfy the retention policy.

Oracle Database 10g: Backup and Recovery 2 - 6


Specifying a Retention Policy (continued)
You should keep the recovery window time period less than or equal to the value of the control
file parameter CONTROL_FILE_RECORD_KEEP_TIME to prevent the record of older
backups from being overwritten in the control file.
If you require a certain number of backups to be retained, then you can set the retention policy
on the basis of the redundancy option. This option requires that a specified number of backups
be cataloged before any backup is identified as obsolete. The default retention policy has a
redundancy of 1, which means that only one backup of a file must exist at any given time. A
backup is deemed obsolete when a more recent version of the same files has been backed up.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery 2 - 7


Using a Flash Recovery Area

• The Flash Recovery Area provides a centralized


location for control file backups, archived redo logs,
flashback logs, and database backups.
• The Flash Recovery Area can be defined as a directory,
file system, or ASM disk group.
• A single Flash Recovery Area can be shared by more

Oracle Internal & Oracle Academy Use Only


than one database.

Database area Flash Recovery Area

Copyright © 2006, Oracle. All rights reserved.

Using a Flash Recovery Area


The Flash Recovery Area is a unified storage location for all recovery-related files and
activities in an Oracle database. All files that are needed to completely recover a database
from a media failure are part of the Flash Recovery Area. The recovery-related files include:
• Control file: A copy is created in the Flash Recovery Area location at database creation.
• Archived redo log files: When the Flash Recovery Area is configured,
LOG_ARCHIVE_DEST_10 is automatically set to the Flash Recovery Area location. The
Archiver background process creates archived redo log files in the Flash Recovery Area
and in other configured LOG_ARCHIVE_DEST_n locations. If no
LOG_ARCHIVE_DEST_n locations are defined, the default location for archived redo
log files is in the Flash Recovery Area.
• Flashback logs: Flashback logs are generated when Flashback Database is enabled.
• Control file autobackups: The default location for control file autobackups created by
RMAN and autobackups generated by the Oracle database server is the Flash Recovery
Area.
• Datafile copies: The BACKUP AS COPY command creates image datafile copies in the
Flash Recovery Area.
• RMAN files: This is the default location that is used by RMAN for backups and
restoration of the archive log content from tape for a recovery operation.
Oracle Database 10g: Backup and Recovery 2 - 8
Defining a Flash Recovery Area

• The Flash Recovery Area is defined by setting the


following initialization parameters:
– DB_RECOVERY_FILE_DEST_SIZE: Sets the disk limit,
expressed in bytes
– DB_RECOVERY_FILE_DEST: Sets the location for the Flash
Recovery Area

Oracle Internal & Oracle Academy Use Only


• These parameters are dynamic and can be altered or
disabled.

Copyright © 2006, Oracle. All rights reserved.

Defining a Flash Recovery Area


Use the following mandatory parameters to define the Flash Recovery Area:
• DB_RECOVERY_FILE_DEST_SIZE: You must define a disk limit, which is the
amount of space that the Flash Recovery Area is permitted to use. Setting a disk limit
allows the remaining disk space not dedicated to the Flash Recovery Area to be used for
other purposes. The recommended size of the disk limit is the sum of the database size,
size of incremental backups, and size of all archive log files that have not been copied to
tape. In addition, when configuring the value of this parameter, it is recommended to set
the value approximately 10 percent lower than what the operating system reports as free
space because this disk limit does not include any overhead size that is not known to the
Oracle database. For example, the DB_RECOVERY_FILE_DEST_SIZE parameter
should account for any file system overhead due to file system metadata, compression, or
mirroring. Therefore, if 10 GB is allocated for the Flash Recovery Area and the operating
system reports free space as 10 GB (neglecting any file system overhead), then set the
value of this parameter 10 percent lower than 10 GB. The minimum size of the Flash
Recovery Area should be at least large enough to contain archived redo log files that have
not been copied to tape.
• DB_RECOVERY_FILE_DEST: A Flash Recovery Area specification contains a location,
which is a valid destination to create files.
Oracle Database 10g: Backup and Recovery 2 - 9
Defining Flash Recovery Area
Using Enterprise Manager

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Defining Flash Recovery Area Using Enterprise Manager


You can use Enterprise Manager Grid Control and Database Control to easily define the Flash
Recovery Area. On the Database Control home page, navigate to the Maintenance page and
click the Recovery Settings link in the Backup/Recovery Settings region. You can define the
Flash Recovery Area location and its size on the Recovery Settings page.
You must set the size of the Flash Recovery Area when specifying its location. Specifying a
size allows any remaining disk space that is not dedicated to the Flash Recovery Area to be
used for other purposes.

Oracle Database 10g: Backup and Recovery 2 - 10


Flash Recovery Area Space Management

Disk limit is
reached and a
Flash new file needs Files that are
Database file Recovery to be written no longer
backup Area into the Flash required on disk
1 Recovery Area are deleted
2
3 Space pressure
4 occurs

Oracle Internal & Oracle Academy Use Only


Warning issued
to user
RMAN updates 1
list of files that 2
may be deleted Backup files
to be deleted

Copyright © 2006, Oracle. All rights reserved.

Flash Recovery Area Space Management


Each time RMAN creates a file in the Flash Recovery Area, the list of files that are no longer
required on disk is updated. When the Flash Recovery Area experiences space pressure or is
low on free space because there are no files that can be deleted from the Flash Recovery Area,
you are warned of the danger of running out of disk space. The Oracle Database server and
RMAN continue to create files in the Flash Recovery Area until 100% of the disk limit is
reached. When setting DB_RECOVERY_FILE_DEST_SIZE, you must consider whether you
have allocated enough disk space before running out of space or necessitating a backup to
tape. Files that are obsolete or have been backed up to tape are likely candidates for deletion to
provide free space.
When a file is written into the Flash Recovery Area and space is needed for that file, the
Oracle Database server deletes a file that is on the obsolete files list. When a file is written and
deleted from the Flash Recovery Area, notification is written into the alert log.
Note: When Flash Recovery Area used space is at 85%, a warning is issued, and when used
space is at 97%, a critical warning is issued. These are internal settings and cannot be changed.
A sample alert log output follows:
WARNING: db_recovery_file_dest_size of 52428800 bytes is
100.00% used, and has 0 remaining bytes available.

Oracle Database 10g: Backup and Recovery 2 - 11


Flash Recovery Area Space Management (continued)
You can issue the following query to determine the action to take:
SQL> SELECT object_type, message_type, message_level,
2> reason, suggested_action
3> FROM dba_outstanding_alerts;
Your choice is to add further disk space, back up files to a tertiary device, delete files from the
Flash Recovery Area using RMAN, or consider changing the RMAN retention policy.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery 2 - 12


Flash Recovery Area Space Usage

• Configure the retention policy to the minimum value


appropriate for your database.
• Back up the archive log files regularly and delete the
files upon completion of the backup.
• Use the RMAN REPORT OBSOLETE and DELETE
OBSOLETE commands to remove backups and file

Oracle Internal & Oracle Academy Use Only


copies that are not required.

Copyright © 2006, Oracle. All rights reserved.

Flash Recovery Area Space Usage


To avoid running out of space in the Flash Recovery Area, you should never store user-
managed files in this area. You should also perform the following steps as needed or
appropriate:
• Use RMAN to delete unnecessary files from the Flash Recovery Area.
• Use RMAN to take frequent backups of the Flash Recovery Area.
• Change the RMAN retention policy to retain backups for a smaller period of time.
• Change the RMAN archived log deletion policy.
• Add disk space and increase the value of the DB_RECOVERY_FILE_DEST_SIZE
database initialization parameter if you are frequently running out of space.
For example, to back up the archived log files in the Flash Recovery Area and then delete the
files after they have been successfully backed up, you would use the RMAN command:
BACKUP ARCHIVELOG ALL DELETE ALL INPUT;
If you use a backup solution other than RMAN, you still have to use RMAN to remove the
files from the Flash Recovery Area. After the archived redo log files have been backed up and
removed from disk, use the RMAN CROSSCHECK and DELETE commands to reclaim the
archived log space from the Flash Recovery Area. You should do this on a regular basis, or
after every backup.

Oracle Database 10g: Backup and Recovery 2 - 13


Monitoring the Flash Recovery Area

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Monitoring the Flash Recovery Area


Real-time Flash Recovery Area metrics can be viewed through Enterprise Manager Database
Control. On the Maintenance page, scroll down to the Related Links section and select All
Metrics. Scan the list and click Recovery Area.
The displayed page shows the Recovery Area Free Space (%) metric, which indicates the
percentage of the recovery that is free space. Click the percentage number to see the graph of
recovery area usage.

Oracle Database 10g: Backup and Recovery 2 - 14


Benefits of Using a Flash Recovery Area

Using the Flash Recovery Area for recovery-related files:


• Simplifies the location of database backups
• Automatically manages the disk space allocated for
recovery files

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Benefits of Using a Flash Recovery Area


Using a Flash Recovery Area for all recovery-related files simplifies the ongoing
administration of your database.
Oracle Corporation recommends the use of the Flash Recovery Area for all recovery-related
files.

Oracle Database 10g: Backup and Recovery 2 - 15


Summary

In this lesson, you should have learned how to:


• Configure your database in ARCHIVELOG mode
• Specify a retention policy
• Configure the Flash Recovery Area

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 2 - 16


Practice Overview

This practice covers the following topics:


• Placing the database in ARCHIVELOG mode
• Verifying that the Flash Recovery Area is configured
• Using RMAN to connect to the target database

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 2 - 17


Oracle Internal & Oracle Academy Use Only
Using RMAN to Create Backups

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.
Objectives

After completing this lesson, you should be able to:


• Configure persistent settings
• Configure backup destinations
• Configure backup optimization
• Create duplexed backup sets

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 3 - 2


Using RMAN to Create Backups

When creating a backup using RMAN, you can specify:


• Type: Full or incremental
• Files to back up: Entire database, datafiles, control file,
server parameter file, archived redo log files
• Backup type: Image copy or backup set

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using RMAN to Create Backups


A backup is a copy of data from your database that can be used to reconstruct that data. The
results of a backup created through RMAN can be either image copies or backup sets.
When performing a backup using RMAN, you can specify:
• The type of backup to be performed. You can perform backups of the entire database to
include every used data block in the files (a FULL backup) or incremental backups
(INCREMENTAL). If CONFIGURE CONTROLFILE AUTOBACKUP is enabled, RMAN
automatically backs up the control file and the current server parameter file after a
BACKUP command is executed.
• What to backup. Valid values are DATABASE, DATAFILE, TABLESPACE,
ARCHIVELOG, CURRENT CONTROLFILE, or SPFILE.
• Whether an image copy (AS COPY) or backup set (AS BACKUPSET) is created
• The file name format and location for backup pieces (FORMAT)
• Which datafiles or archived redo logs should be excluded from the backup set (SKIP)
• That the input files should be deleted upon the successful creation of the backup set
(DELETE INPUT)

Oracle Database 10g: Backup and Recovery 3 - 3


Backup Destinations

Backups can be written to:


• Disk directory
• Media Management Library (tape device)
– Typically used for disaster recovery, when disk backups
are lost.
• Flash Recovery Area

Oracle Internal & Oracle Academy Use Only


– This is the disk area set aside for backup and recovery
and flashback database purposes.
– Define the location and the size.
– Files are automatically named by using Oracle Managed
Files.
– Files are automatically retained and deleted as necessary.

Copyright © 2006, Oracle. All rights reserved.

Backup Destinations
Backups can be written to a designated disk directory, a Media Management Library, or the
Flash Recovery Area. Specifying a disk directory or the Flash Recovery Area means that
backups go to hard-disk media. Typically, they are regularly moved offline to tape via the
media management interface in order to maintain disk space availability. Any disk directory
can be specified as the destination of a backup provided that it already exists.
If you configure a Flash Recovery Area, many backup and recovery tasks are simplified for
you. The Oracle Database server automatically names files for you, and deletes obsolete files
when there is space pressure.

Oracle Database 10g: Backup and Recovery 3 - 4


Configuring Persistent Settings for RMAN

• RMAN is preset with default configuration settings.


• Use the CONFIGURE command to:
– Configure automatic channels
– Specify the backup retention policy
– Specify the number of backup copies to be created
– Set the default backup type to BACKUPSET or COPY

Oracle Internal & Oracle Academy Use Only


– Limit the size of backup pieces
– Exempt a tablespace from backup
– Enable and disable backup optimization
– Configure automatic backups of control files

Copyright © 2006, Oracle. All rights reserved.

Configuring Persistent Settings for RMAN


To simplify ongoing use of RMAN for backup and recovery, RMAN enables you to set a
number of persistent configuration settings for each target database. These settings control
many aspects of RMAN’s behavior. You can save persistent configuration information such as
channel parameters, parallelism, and the default device type in the RMAN repository (which is
stored in either the control file or a recovery catalog database).
These settings have default values, which allow you to use RMAN immediately. However, as
you develop a more advanced backup and recovery strategy, you may have to change these
settings to implement that strategy. You can use the CONFIGURE command to configure
persistent settings for RMAN backup, restore, duplication, and maintenance jobs. These
settings are in effect for any RMAN session until the configuration is cleared or changed.

Oracle Database 10g: Backup and Recovery 3 - 5


Using Enterprise Manager to Configure
RMAN Settings

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using Enterprise Manager to Configure RMAN Settings


You can use Oracle Enterprise Manager to specify the backup settings for an instance. To
specify backup settings, on the Maintenance page, select Backup Settings in the
Backup/Recovery Settings section.
The Backup Settings property page consists of three tabs:
• Device: Used to set the disk and tape configuration settings, including the Media
Management Library (MML) settings
• Backup Set (shown in the slide): Used to specify parameters for backup sets and to enter
host credentials
• Policy: Used to set various backup and retention policies before you initiate a backup,
such as automatically backing up the control file and SPFILE. The Policy page also
allows you to configure block change tracking support, a feature that provides faster
incremental backups.
Note: Backup settings change the databasewide settings and apply to any backups that do not
override settings at the backup level.

Oracle Database 10g: Backup and Recovery 3 - 6


Managing Persistent Settings

• Use the SHOW command to list current settings:


RMAN> SHOW CONTROLFILE AUTOBACKUP FORMAT;
RMAN> SHOW EXCLUDE;
RMAN> SHOW ALL;

• Use the CLEAR command to reset any persistent setting

Oracle Internal & Oracle Academy Use Only


to its default value:
RMAN> CONFIGURE BACKUP OPTIMIZATION CLEAR;
RMAN> CONFIGURE MAXSETSIZE CLEAR;
RMAN> CONFIGURE DEFAULT DEVICE TYPE CLEAR;

Copyright © 2006, Oracle. All rights reserved.

Managing Persistent Settings


Using the RMAN SHOW command, you can view the RMAN configuration settings. If SHOW
ALL is executed when connected to a target database, only node-specific configurations and
database configurations are displayed.
You can return to the default value for any CONFIGURE command by executing the same
command with the CLEAR option.

Oracle Database 10g: Backup and Recovery 3 - 7


Configuring and Allocating Channels for
Use in Backups

• Configure automatic channels with the CONFIGURE


command:
RMAN> CONFIGURE DEVICE TYPE sbt PARALLELISM 1;
RMAN> CONFIGURE DEFAULT DEVICE TYPE TO sbt;
RMAN> CONFIGURE CHANNEL DEVICE TYPE sbt …
RMAN> BACKUP DATABASE;

Oracle Internal & Oracle Academy Use Only


• Allocate channels manually with the ALLOCATE
CHANNEL command within a RUN block:
RMAN> RUN
{
ALLOCATE CHANNEL ch1 DEVICE TYPE DISK; …
BACKUP DATABASE PLUS ARCHIVELOG;
}

Copyright © 2006, Oracle. All rights reserved.

Configuring and Allocating Channels for Use in Backups


Choose from the following options for configuring channels and executing backups:
• Configure automatic channels with the CONFIGURE command, and then issue the
BACKUP command at the RMAN prompt or within a RUN block.
• Manually allocate channels with the ALLOCATE CHANNEL command within a RUN
block, and then issue BACKUP commands.

Oracle Database 10g: Backup and Recovery 3 - 8


Configuring Backup Optimization

• The BACKUP command skips backing up files when the


identical files have already been backed up.
• It is used when the following conditions are true:
– Backup optimization is enabled.
– BACKUP DATABASE, BACKUP ARCHIVELOG with ALL or LIKE
options, or BACKUP BACKUPSET ALL commands are

Oracle Internal & Oracle Academy Use Only


executed.
– Only one type of channel is allocated.
• It can be overriden with the FORCE option.
• It is always used for RECOVERY AREA,
DB_RECOVERY_FILE_DEST, and RECOVERY FILES
BACKUP options.

Copyright © 2006, Oracle. All rights reserved.

Configuring Backup Optimization


If you enable backup optimization, the BACKUP command skips backing up files when the
identical files have already been backed up to the specified device type.
If RMAN determines that a file is identical and it has already been backed up, then it is a
candidate to be skipped. However, RMAN performs further checking to determine whether to
skip the file, because both the retention policy and the backup duplexing feature are factors in
the algorithm that RMAN uses to determine whether there are sufficient backups on the
specified device type.
Refer to the Oracle Database Backup and Recovery Advanced User’s Guide for detailed
information about the criteria that RMAN uses to determine whether a file is identical and the
backup optimization algorithm.
You can enable backup optimization on the Backup Settings page in Enterprise Manager or by
issuing the CONFIGURE BACKUP OPTIMIZATION ON command. By default, backup
optimization is disabled.
Backup optimization is automatically enabled for the BACKUP RECOVERY AREA |
DB_RECOVERY_FILE_DEST and BACKUP RECOVERY FILES commands.

Oracle Database 10g: Backup and Recovery 3 - 9


Configuring Backup Optimization (continued)
To override backup optimization and back up all files whether or not they have changed,
specify the FORCE option on the BACKUP command as in the following example:
BACKUP DEVICE TYPE sbt BACKUPSET ALL FORCE;
Note that the FORCE option does not apply to files in the recovery area.
You can disable backup optimization on a persistent basis using Enterprise Manager or by
issuing the following command:
CONFIGURE BACKUP OPTIMIZATION OFF;

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery 3 - 10


Creating Backup Sets

RMAN> BACKUP AS BACKUPSET


2> FORMAT '/BACKUP/df_%d_%s_%p.bus'
3> TABLESPACE hr_data;

Oracle Internal & Oracle Academy Use Only


Datafile Datafile
1 1

Datafile Datafile
2 2

Datafile Datafile
3 3
Tablespace Backup
HR_DATA set

Copyright © 2006, Oracle. All rights reserved.

Creating Backup Sets


RMAN can store its backups in an RMAN-exclusive format called a backup set. A backup set
is a collection of files called backup pieces, each of which may contain one or more database
file backups.
Note: The FORMAT parameter specifies a pattern to use in creating a file name for the backup
pieces created by this command. The FORMAT specification can also be provided through the
ALLOCATE CHANNEL and CONFIGURE commands.

Oracle Database 10g: Backup and Recovery 3 - 11


Creating Image Copies

RMAN> BACKUP AS COPY


2> DATAFILE '/ORADATA/users_01_db01.dbf'
3> FORMAT '/BACKUP/users01.dbf';
RMAN> BACKUP AS COPY
4> ARCHIVELOG LIKE '/arch%'
5> FORMAT 'arch_%U.bak';

Oracle Internal & Oracle Academy Use Only


Copy of datafile 3
Datafile 3 Datafile 3

Copy of archived log


Archived Archived
log file log file

Copyright © 2006, Oracle. All rights reserved.

Creating Image Copies


An image copy is a clone of a single datafile, archived redo log, or control file. An image copy
can be created with the BACKUP AS COPY command or with an operating system command.
When you create the image copy with the RMAN BACKUP AS COPY command, the server
session validates the blocks in the file and records the copy information in the control file.
An image copy has the following characteristics:
• An image copy can be written only to disk. When large files are being considered,
copying may take a long time, but restoration time is reduced considerably because the
copy is available on the disk.
• If files are stored on disk, they can be used immediately by using the SWITCH command
in RMAN, which is equivalent to the ALTER DATABASE RENAME FILE SQL statement.
• In an image copy, all blocks are copied, whether they contain data or not, because an
Oracle database process copies the file and performs additional actions such as checking
for corrupt blocks and registering the copy in the control file. To speed up the process of
copying, you can use the NOCHECKSUM parameter.
• Image copy can be part of a full or incremental level 0 backup because a file copy always
includes all blocks. You must use the level 0 option if the copy will be used in
conjunction with an incremental backup set.

Oracle Database 10g: Backup and Recovery 3 - 12


Creating Image Copies (continued)
The example in the slide creates two image copies:
• A copy of the users01_db01.dbf datafile, renamed as users01.dbf, and stored in
the BACKUP directory
• A copy of the archived redo log files
The example assumes that you are using automatic channel allocation. If you manually
allocate channels, you must include the COPY command within the RUN statement as follows:
RMAN> RUN {
2> ALLOCATE CHANNEL c1 type disk;
3> COPY
4> DATAFILE '/ORADATA/users_01_db01.dbf' to
5> '/BACKUP/users01.dbf',
6> ARCHIVELOG 'arch%' to

Oracle Internal & Oracle Academy Use Only


7> 'arch_%U.bak';
8> }

Oracle Database 10g: Backup and Recovery 3 - 13


BACKUP Command Options

• Scan for logical corruptions and physical corruptions.


• Set a threshold on the number of detected corruptions
allowed before aborting.
• Validate the target input files before performing a
backup operation.
• Duplex the backup set.

Oracle Internal & Oracle Academy Use Only


• Overwrite an existing backup set or image copy.
• Pass control of the data transfer between storage
devices and the datafiles on disk to the media
management layer.
• Encrypt the backup files.

Copyright © 2006, Oracle. All rights reserved.

BACKUP Command Options


During the backup operation, an Oracle database process computes a checksum for each block
to detect corruption. RMAN verifies the checksum when restoring the copy. This is referred to
as physical corruption detection. You can use the NOCHECKSUM option to suppress the
checksum operation and speed up the backup process. If the database is already maintaining
block checksums, then this option has no effect.
You can use the CHECK LOGICAL option to test data and index blocks that pass physical
corruption checks for logical corruption—for example, corruption of a row piece or index
entry. If logical corruption is detected, the block is logged in the alert log and trace file of the
server process. You can set a threshold for the allowed number of logical and physical
corruptions with the MAXCORRUPT parameter. As long as the sum of physical and logical
corruptions that is detected for a file remains below this value, the RMAN backup operation
completes and the Oracle database populates the V$DATABASE_BLOCK_CORRUPTION
view with the corrupt block ranges. If MAXCORRUPT is exceeded, then the operation
terminates without populating the view.
You can use the VALIDATE option to check for physical and logical errors in database files.
When using the BACKUP command with the VALIDATE option, RMAN scans the specified
files and verifies their contents, testing whether this file can be backed up. This command does
not actually back up the specified files.
Oracle Database 10g: Backup and Recovery 3 - 14
BACKUP Command Options (continued)
You can create up to four identical copies of each backup piece by duplexing the backup set.
Use any of the following commands to produce a duplexed backup set:
• BACKUP COPIES
• SET BACKUP COPIES
• CONFIGURE ... BACKUP COPIES

RMAN does not produce multiple backup sets, but produces identical copies of each backup
piece in the set. You cannot use this option with the BACKUP AS COPY command to create
multiple image copies.
If you specify REUSE, you enable RMAN to overwrite an already existing backup set or
image copy with the same file name as the file that BACKUP is currently creating.
The PROXY copy functionality backs up the specified files by giving the media management

Oracle Internal & Oracle Academy Use Only


software control over the data transfer between storage devices and the datafiles on disk. The
media manager—not RMAN—decides how and when to move data. When you run BACKUP
with the PROXY option, RMAN performs these steps:
1. It searches for a channel of the specified device type that is proxy capable. If no such
channel is found, then RMAN issues a warning and attempts a conventional (that is,
nonproxy) backup of the specified files.
2. If RMAN locates a proxy-capable channel, it calls the media manager to check whether it
can proxy copy the files. If the media manager cannot proxy copy, then RMAN uses
conventional backup sets to back up the files.
If you do not want RMAN to try a conventional copy when a proxy copy fails, use the ONLY
option.
Because image copies are written only to disk, you cannot use the PROXY option with the
BACKUP AS COPY command.
Note: If you specify PROXY, then the %p variable must be included in the FORMAT string
either explicitly or implicitly within %U.
Encryption of backups is discussed later in this lesson.

Oracle Database 10g: Backup and Recovery 3 - 15


Creating a Whole Database Backup

RMAN> BACKUP DATABASE


PLUS ARCHIVELOG;

Oracle Internal & Oracle Academy Use Only


Control
Archived log Datafile file SPFILE
file copies copies

Copyright © 2006, Oracle. All rights reserved.

Creating a Whole Database Backup


A whole database backup is a copy of all datafiles and the control file. You can optionally
include the server parameter file (SPFILE) and archived redo log files. Using Recovery
Manager to make an image copy of all the database files simply requires mounting the
database, starting RMAN, and entering the BACKUP command shown in the slide.
Note: You must have issued the following CONFIGURE commands to make the backup as
described previously:
• CONFIGURE DEFAULT DEVICE TYPE TO disk;
• CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COPY;
• CONFIGURE CONTROLFILE AUTOBACKUP ON;

You can also create a backup (either a backup set or image copies) of previous image copies of
all datafiles and control files in the database by using the following command:
RMAN> BACKUP COPY OF DATABASE;
By default, RMAN executes each BACKUP command serially. However, you can parallelize
the copy operation by:
• Using the CONFIGURE DEVICE TYPE DISK PARALLELISM n command, where n is
the desired degree of parallelism
• Allocating multiple channels
• Specifying one BACKUP AS COPY command and listing multiple files
Oracle Database 10g: Backup and Recovery 3 - 16
RMAN Backup Types

• A full backup contains all used Full, or "level 0


incremental backup"
datafile blocks.
• A level 0 incremental backup is
equivalent to a full backup that
has been marked as level 0.
• A cumulative level 1 Cumulative
incremental backup
incremental backup contains

Oracle Internal & Oracle Academy Use Only


only blocks modified since the
last level 0 incremental
backup.
Differential
• A differential level 1 incremental backup
incremental backup contains
only blocks modified since the
last incremental backup.
Copyright © 2006, Oracle. All rights reserved.

RMAN Backup Types


Full Backups
A full backup is different from a whole database backup. A full datafile backup is a backup
that includes every used data block in the file. RMAN copies all blocks into the backup set or
image copy, skipping only datafile blocks that have never been used. For a full image copy,
the entire file contents are reproduced exactly. A full backup cannot be part of an incremental
backup strategy; it cannot be the parent for a subsequent incremental backup.
Incremental Backups
An incremental backup is either a level 0 backup, which includes every block in the datafiles
except blocks that have never been used, or a level 1 backup, which includes only those blocks
that have been changed since a previous backup was taken. A level 0 incremental backup is
physically identical to a full backup. The only difference is that the level 0 backup can be used
as the base for a level 1 backup, but a full backup can never be used as the base for a level 1
backup.
Incremental backups are specified through the INCREMENTAL keyword of the BACKUP
command. You specify INCREMENTAL LEVEL = [0 | 1].

Oracle Database 10g: Backup and Recovery 3 - 17


RMAN Backup Types (continued)
Incremental Backups (continued)
RMAN can create multilevel incremental backups as follows:
• Differential: Is the default type of incremental backup that backs up all blocks changed
after the most recent incremental backup at either level 1 or level 0
• Cumulative: Backs up all blocks changed after the most recent backup at level 0
Examples
• To perform an incremental backup at level 0, use the following command:
RMAN> BACKUP INCREMENTAL LEVEL 0 DATABASE;
• To perform a differential incremental backup, use the following command:
RMAN> BACKUP INCREMENTAL LEVEL 1 DATABASE;
• To perform a cumulative incremental backup, use the following command:

Oracle Internal & Oracle Academy Use Only


RMAN> BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE;
RMAN makes full backups by default if neither FULL nor INCREMENTAL is specified.
Unused block compression causes never-written blocks to be skipped when backing up
datafiles to backup sets, even for full backups.
A full backup has no effect on subsequent incremental backups, and is not considered part of
any incremental backup strategy, although a full image copy backup can be incrementally
updated by applying incremental backups with the RECOVER command. This is covered later
in this lesson.

Oracle Database 10g: Backup and Recovery 3 - 18


Fast Incremental Backup

• Optimizes incremental backups


– Tracks which blocks have changed since the last backup
• Oracle Database 10g has integrated change tracking:
– A change tracking file is introduced.
– Changed blocks are tracked as redo is generated.
– Database backup automatically uses the changed block

Oracle Internal & Oracle Academy Use Only


list.

List of changed
1011001010110 Change
blocks
CTWR 0001110100101 tracking
Redo 1010101110011 file
generation
SGA Redo log

Copyright © 2006, Oracle. All rights reserved.

Fast Incremental Backup


The goal of an incremental backup is to back up only those data blocks that have changed
since a previous backup. You can use RMAN to create incremental backups of datafiles,
tablespaces, or the whole database. During media recovery, RMAN examines the restored files
to determine whether it can recover them from an incremental backup. RMAN always chooses
incremental backups over archived redo logs because applying changes at a block level is
faster than reapplying individual changes.
If you enable the block change tracking feature, Oracle Database tracks the physical location
of all database changes in a file called the change tracking file. RMAN uses this change
tracking data to determine which blocks to read during an incremental backup, creating much
faster incremental backups by eliminating the need to read the entire datafile. The maintenance
of this file is fully automatic and does not require your intervention. The size of the block
change tracking file is proportional to the:
• Database size in bytes
• Number of enabled threads in a RAC environment
• Number of old backups maintained by the block change tracking file
The minimum size for the block change tracking file is 10 MB, and any new space is allocated
in 10 MB increments. The Oracle database does not record block change information by
default.
Oracle Database 10g: Backup and Recovery 3 - 19
Enabling Fast Incremental Backup

Oracle Internal & Oracle Academy Use Only


ALTER DATABASE
{ENABLE|DISABLE} BLOCK CHANGE TRACKING
[USING FILE '...']

Copyright © 2006, Oracle. All rights reserved.

Enabling Fast Incremental Backup


You enable block change tracking from the Database Control home page. Click the Policy tab
from the Backup Settings on the Maintenance tabbed page. You do not need to set the block
change tracking file destination if the DB_CREATE_FILE_DEST initialization parameter is
set because the file is created as an Oracle Managed File (OMF) file in the
DB_CREATE_FILE_DEST location. You can, however, specify the name of the block
change tracking file, placing it in any location you choose.
You can also enable or disable this feature by using an ALTER DATABASE command. If the
change tracking file is stored in the database area with your database files, then it is deleted
when you disable change tracking. You can rename the block change tracking file by using the
ALTER DATABASE RENAME command. Your database must be in the MOUNT state to rename
the tracking file. The ALTER DATABASE RENAME FILE command updates the control file to
refer to the new location. You can use the following syntax to move the block change tracking
file name:
ALTER DATABASE RENAME FILE '...' TO '...';

Oracle Database 10g: Backup and Recovery 3 - 20


Monitoring Block Change Tracking

SQL> SELECT filename, status, bytes


2 FROM v$block_change_tracking;
SQL> SELECT file#, avg(datafile_blocks),
2 avg(blocks_read),

Oracle Internal & Oracle Academy Use Only


3 avg(blocks_read/datafile_blocks)
4 * 100 AS PCT_READ_FOR_BACKUP,
5 avg(blocks)
5 FROM v$backup_datafile
6 WHERE used_change_tracking = 'YES'
7 AND incremental_level > 0
8 GROUP BY file#;

Copyright © 2006, Oracle. All rights reserved.

Monitoring Block Change Tracking


The output of the V$BLOCK_CHANGE_TRACKING view shows where the block change
tracking file is located, the status of block change tracking (ENABLED/DISABLED), and the
size (in bytes) of the file.
The query on the V$BACKUP_DATAFILE view shows how effective the block change
tracking is in minimizing the incremental backup I/O (the PCT_READ_FOR_BACKUP
column). A high value indicates that RMAN reads most blocks in the datafile during an
incremental backup. You can reduce this ratio by decreasing the time between the incremental
backups.
A sample formatted output from the V$BACKUP_DATAFILE query is shown below:
FILE# BLOCKS_IN_FILE BLOCKS_READ PCT_READ_FOR_BACKUP BLOCKS_BACKED_UP
----- -------------- ----------- ------------------- ----------------
1 56320 4480 7 462
2 3840 2688 70 2408
3 49920 16768 33 4457
4 640 64 10 1
5 19200 256 1 91

Oracle Database 10g: Backup and Recovery 3 - 21


Creating an Oracle-Suggested Backup

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Creating an Oracle-Suggested Backup


Enterprise Manager makes it easy for you to set up an Oracle-suggested backup strategy that
protects your data and provides efficient recoverability to any point in the preceding 24 hours.
The Oracle-suggested strategy uses the incremental backup and incrementally updated backup
features, providing faster recoverability than is possible when applying database changes from
the archived log files.
To establish an Oracle-suggested strategy, navigate to the Maintenance page. In the
Backup/Recovery region, select Schedule Backup. The Backup Strategy enables you to select
from the Oracle-Suggested Backup and Customized Backup strategies. The Oracle-suggested
strategy takes a full database copy as the first backup. Because it is a whole database backup,
you might want to consider taking this at a period of least activity. After that, an incremental
backup to disk is taken every day. Because these backups on disk are retained, you can always
perform a full database recovery or a point-in-time recovery to any time within the past day.
After you complete and accept your required options, your database is backed up once daily,
using incremental backups and incrementally applied backups, allowing quick recovery to any
time in the preceding 24 hours.

Oracle Database 10g: Backup and Recovery 3 - 22


Creating Duplexed Backup Sets

To create a duplexed backup set use:


• CONFIGURE ... BACKUP COPIES
• BACKUP...COPIES

Datafile

Oracle Internal & Oracle Academy Use Only


Datafile
1 1 Datafile
1
Datafile
Datafile 2 Datafile
2 2
Datafile
Datafile 3 Datafile
3 3
Backup
Tablespace set 1 Backup
HR_DATA set 2

Copyright © 2006, Oracle. All rights reserved.

Creating Duplexed Backup Sets


RMAN can make up to four copies of a backup set simultaneously, each an exact duplicate of
the others. A copy of a backup set is a copy of each backup piece in the backup set, with each
copy getting a unique copy number (for example, 0tcm8u2s_1_1 and 0tcm8u2s_1_2).
In most cases, the easiest method of duplexing backup sets is to use BACKUP...COPIES or
CONFIGURE ... BACKUP COPIES to duplex backup sets. For DISK channels, specify
multiple values in the FORMAT option to direct the multiple copies to different physical disks.
For sbt channels, if you use a media manager that supports Version 2 of the SBT API, then
the media manager will automatically put each copy onto a separate medium (for example, a
separate tape).
Note that it is not possible to duplex backup sets to the Flash Recovery Area, and that
duplexing only applies to backup sets, not image copies. You receive an error if you specify
the BACKUP... COPIES option when creating image copy backups. The
CONFIGURE...BACKUP COPIES setting is ignored for image copy backups.
Note: Duplexed backup sets are typically used for tape backups.

Oracle Database 10g: Backup and Recovery 3 - 23


Creating Duplexed Backup Sets Using
CONFIGURE BACKUP COPIES

RMAN> CONFIGURE ARCHIVELOG BACKUP COPIES


> FOR DEVICE TYPE sbt TO 2;
RMAN> CONFIGURE DATAFILE BACKUP COPIES
> FOR DEVICE TYPE sbt TO 2;
RMAN> BACKUP DATABASE PLUS ARCHIVELOG;

Oracle Internal & Oracle Academy Use Only


RMAN> BACKUP DEVICE TYPE DISK AS COPY DATABASE;

Copyright © 2006, Oracle. All rights reserved.

Creating Duplexed Backup Sets Using CONFIGURE BACKUP COPIES


Use the CONFIGURE ... BACKUP COPIES command to specify the number of identical
backup sets that you want to create on the specified device type. This setting applies to all
backups except control file autobackups (because the autobackup of a control file always
produces one copy) and backup sets when backed up with the BACKUP BACKUPSET
command.
Note: You must have automatic channels configured.
To create a duplexed backup set with CONFIGURE BACKUP COPIES perform the following
steps:
1. Configure the number of copies on the desired device type for datafiles and archived redo
log files.
2. Execute the BACKUP command.
3. Issue a LIST BACKUP command to verify your backup.

Oracle Database 10g: Backup and Recovery 3 - 24


Creating Duplexed Backup Sets Using
BACKUP COPIES

RMAN> BACKUP AS BACKUPSET DEVICE TYPE sbt


2> COPIES 2
3> INCREMENTAL LEVEL 0
4> DATABASE;

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Creating Duplexed Backup Sets Using BACKUP COPIES


You can use the BACKUP command with the COPIES option to override other COPIES or
DUPLEX settings to create duplexed backup sets.
To duplex a backup with BACKUP COPIES, perform the following steps:
1. Specify the number of identical copies with the COPIES option of the BACKUP
command.
2. Issue a LIST BACKUP command to verify your backup.

Oracle Database 10g: Backup and Recovery 3 - 25


Creating Backups of Backup Sets

RMAN> BACKUP DEVICE TYPE DISK AS BACKUPSET


2> DATABASE PLUS ARCHIVELOG;
RMAN> BACKUP DEVICE TYPE sbt BACKUPSET ALL;

Datafile Datafile

Oracle Internal & Oracle Academy Use Only


1 1
Datafile
Datafile 2
2 Datafile
3
Datafile
3 Archived
redo logs
Archived
redo logs
Backup sets

Copyright © 2006, Oracle. All rights reserved.

Creating Backups of Backup Sets


Use the RMAN BACKUP BACKUPSET command to back up previously created backup sets.
Only backup sets that were created on device type DISK can be backed up using RMAN. The
backup sets can be backed up to any available device type.
The BACKUP BACKUPSET command uses the default disk channel to copy backup sets from
disk to disk. To back up from disk to tape, you must either configure or manually allocate a
nondisk channel.

Oracle Database 10g: Backup and Recovery 3 - 26


Configuring Control File Autobackups

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Configuring Control File Autobackups


To avoid losing a copy of the current control file, you should configure RMAN to take
automatic backups of the control file. The automatic backup of the control file occurs
independently of any backup of the current control file explicitly requested as part of your
backup command. If you are operating RMAN in NOCATALOG mode, it is highly
recommended that you activate control file autobackup. Otherwise, if you lose your control
file, your database may be unrecoverable.
To configure control file autobackup, modify the backup policy for your database by using
Enterprise Manager or use the following RMAN command:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
By default, control file autobackups are disabled. If you enable control file autobackups, then
RMAN automatically backs up the control file and the current server parameter file (if used to
start up the database) in one of two circumstances:
• A successful backup is recorded in the RMAN repository.
• A structural change to the database affects the contents of the control file, which,
therefore, must be backed up. Control file autobackups that take place as the result of
structural changes are always written to disk.

Oracle Database 10g: Backup and Recovery 3 - 27


Configuring Control File Autobackups (continued)
For non-Oracle Managed Files (non-OMF) files, the control file autobackup file name has a
default format of %F for all device types, so that RMAN can guess the file location and restore
it without a repository. This variable format translates into c-IIIIIIIIII-YYYYMMDD-
QQ, where:
• IIIIIIIIII stands for the DBID
• YYYYMMDD is a time stamp of the day the backup is generated
• QQ is the hex sequence that starts with 00 and has a maximum of FF

You can change the default format by using the CONFIGURE CONTROLFILE AUTOBACKUP
FORMAT FOR DEVICE TYPE type TO 'string' command. The value of string must
contain the substitution variable %F and cannot contain other substitution variables. For
example:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT

Oracle Internal & Oracle Academy Use Only


FOR DEVICE TYPE DISK TO '/u01/oradata/cf_ORCL_auto_%F';
Note: Control file autobackups are stored in the Flash Recovery Area, unless otherwise
specified. Files created in the Flash Recovery Area are OMF files and do not adhere to the
naming convention described above.
With a control file autobackup, RMAN can recover the database even if the current control
file, recovery catalog, and server parameter file are inaccessible. Because the path used to
store the autobackup follows a well-known format, RMAN can search for and restore the
server parameter file or control file from that autobackup.

Oracle Database 10g: Backup and Recovery 3 - 28


Using a Media Manager

Server
Recovery session
Manager (channel)

Media
management
library
Oracle Secure Or

Oracle Internal & Oracle Academy Use Only


Backup with
built-in MML Media
management
server software

Copyright © 2006, Oracle. All rights reserved.

Using a Media Manager


To use tape storage for your database backups, RMAN requires Oracle Secure Backup or a
media manager. Oracle Secure Backup is covered in detail later in this course.
A media manager is a utility that loads, labels, and unloads sequential media, such as tape
drives for the purpose of backing up, restoring, and recovering data. The Oracle Database
server calls MML software routines to back up and restore datafiles to and from media that is
controlled by the media manager.
Some media management products can completely manage all data movement between Oracle
datafiles and the backup devices. Some products that use high-speed connections between
storage and media subsystems can reduce much of the backup load from the primary database
server.
Note that the Oracle Database server does not need to connect to the Media Management
Library (MML) software when it backs up to disk.

Oracle Database 10g: Backup and Recovery 3 - 29


Using a Media Manager (continued)
The Oracle Backup Solutions Program (BSP) provides a range of media management products
that are compliant with Oracle’s MML specification. Software that is compliant with the MML
interface enables an Oracle Database session to back up data to a media manager and request
the media manager to restore backups. Check with your media vendor to determine whether it
is a member of the Oracle BSP.
Before you can begin using RMAN with a media manager, you must install the media
manager software and make sure that RMAN can communicate with it. Instructions for this
procedure should be available in the media manager vendor’s software documentation.
Depending on the product that you are installing, perform the following basic steps:
1. Install and configure the media management software on the target host or production
network. No RMAN integration is required at this stage.
2. Ensure that you can make non-RMAN backups of operating system files on the target

Oracle Internal & Oracle Academy Use Only


database host. This step makes it easier to troubleshoot problems at a later time. Refer to
your media management documentation to learn how to back up files to the media
manager.
3. Obtain and install the third-party media management module for integration with the
Oracle database. This module must contain the library loaded by the Oracle Database
server when accessing the media manager.
Backup and Restore Operations Using a Media Manager
The following Recovery Manager script performs a datafile backup to a tape drive controlled
by a media manager:
run {
# Allocating a channel of type 'sbt' for serial device
ALLOCATE CHANNEL ch1 DEVICE TYPE sbt;
BACKUP DATAFILE 3;
}
When Recovery Manager executes this command, it sends the backup request to the Oracle
Database session performing the backup. The Oracle Database session identifies the output
channel as a media management device and requests the media manager to load a tape and
write the output.
The media manager labels and keeps track of the tape and the names of the files on each tape.
The media manager also handles restore operations. When you restore a file, the following
steps occur:
1. The Oracle Database server requests the restoration of a particular file.
2. The media manager identifies the tape containing the file and reads the tape.
3. The media manager passes the information back to the Oracle Database session.
4. The Oracle Database server writes the file to disk.

Oracle Database 10g: Backup and Recovery 3 - 30


Creating Proxy Copies

• A proxy copy is a backup to a third-party media


storage device in which the entire data transfer is
conducted by a media manager.
• Media manager must support proxy copy functionality.
• It is created with BACKUP PROXY command.
• RMAN creates conventional backup if proxy copy is

Oracle Internal & Oracle Academy Use Only


not supported.
• Use PROXY ONLY to force failure if proxy copy is not
possible.

Copyright © 2006, Oracle. All rights reserved.

Creating Proxy Copies


A proxy copy is a backup to a third-party media storage device in which the entire data transfer
is conducted by a media manager. You can use the PROXY option of the BACKUP command to
create a proxy copy. This option can be used only with media managers that support it. During
a proxy copy, RMAN turns over control of the data transfer to the media manager.
When you execute the BACKUP PROXY command, RMAN queries the media manager to
determine whether it can perform a proxy copy for the specified file. If the media manager
cannot proxy copy the file, then RMAN attempts a conventional backup of the file. You can
use the PROXY ONLY option to force RMAN to fail if a proxy copy cannot be performed.
Proxy copy can be used with datafiles or archived redo log files, as shown in these examples:
BACKUP DEVICE TYPE sbt PROXY DATAFILE 3;
BACKUP DEVICE TYPE sbt PROXY ONLY DATABASE;
BACKUP DEVICE TYPE sbt PROXY ONLY ARCHIVELOG ALL;
Note: SBT channels must be configured with the appropriate parameters.
Control files are never backed up with proxy copy. If the PROXY option is specified on an
operation that includes backup of a control file, it is ignored for the control file backup.

Oracle Database 10g: Backup and Recovery 3 - 31


Managing Backups: Reporting

Use the following RMAN commands to obtain information


about your backups:
• LIST: Displays information about backup sets, proxy
copies, and image copies recorded in the repository
• REPORT: Produces a detailed analysis of the repository
• REPORT NEED BACKUP: Lists all datafiles that require a

Oracle Internal & Oracle Academy Use Only


backup
• REPORT OBSOLETE: Identifies files that are no longer
needed to satisfy backup retention policies

Copyright © 2006, Oracle. All rights reserved.

Managing Backups: Reporting


Use the RMAN LIST command to display information about backup sets, proxy copies, and
image copies recorded in the repository. Use this command to list:
• Backups and copies that do not have the AVAILABLE status in the RMAN repository
• Backups and copies of datafiles that are available and can possibly be used in a restore
operation
• Backup sets and copies that contain a backup of a specified list of datafiles or specified
tablespaces
• Backup sets and copies that contain a backup of any archived logs with a specified name
or range
• Backup sets and copies restricted by tag, completion time, recoverability, or device
• Incarnations of a specified database or of all databases known to the repository
• Stored scripts in the recovery catalog
Use the RMAN REPORT command to analyze information in the RMAN repository in more
detail.
The REPORT NEED BACKUP command is used to identify all datafiles that need a backup.
The report assumes that the most recent backup would be used in the event of a restore.

Oracle Database 10g: Backup and Recovery 3 - 32


Managing Backups: Reporting (continued)
Using the REPORT OBSOLETE command, you can identify files that are no longer needed to
satisfy backup retention policies. By default, the REPORT OBSOLETE command reports
which files are obsolete under the currently configured retention policy. You can generate
reports of files that are obsolete according to different retention policies by using
REDUNDANCY or RECOVERY WINDOW retention policy options with the REPORT
OBSOLETE command.
Refer to the Oracle Database Backup and Recovery Reference for detailed syntax information.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery 3 - 33


Using Enterprise Manager to View Backup
Reports

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using Enterprise Manager to View Backup Reports


You can use the Backup Report page to display lists of backup jobs that are known to the
database through the information recorded about them in the database control file.
You can filter the jobs that appear in the Result table by using the Filter By fields at the top of
the page. The Result table lists basic information about each backup job, such as the Start
Time, the Time Taken, and the Status of the backup job. You can also use the Result table to
drill down to individual, detailed backup job reports by using the link in the Backup Name
column.
You can drill down to a “Summary of job” page of the backup job by clicking the Status of the
job in the Result table, where you can view the contents of the output log.
You can use the View Backup Report Job page to display detailed information about the
current backup job selected on the Backup Report page. The information displayed on this
page is derived from the information recorded in the database control file.
The View Backup Report Job page displays result information in the Result section in various
categories, such as Input Summary, containing rollup information about the files that were
backed up; Output Summary, containing rollup information about the Backup Sets and Image
Copies; and then Inputs and Outputs sections that display tables containing detailed job
information about the datafiles, control files, backup sets, backup pieces, and image copies.
Oracle Database 10g: Backup and Recovery 3 - 34
Managing Backups: Crosschecking and Deleting

Use the following RMAN commands to manage your


backups:
• CROSSCHECK: Verifies the status of backups and copies
recorded in the RMAN repository against media such
as disk or tape
• DELETE EXPIRED: Removes only files whose status in

Oracle Internal & Oracle Academy Use Only


the repository is EXPIRED
• DELETE OBSOLETE: Deletes backups that are no longer
needed

Copyright © 2006, Oracle. All rights reserved.

Managing Backups: Crosschecking and Deleting


Use the CROSSCHECK command to ensure that data about backups in the recovery catalog or
control file is synchronized with actual files on disk or in the media management catalog. The
CROSSCHECK command operates only on files that are recorded in the RMAN repository.
The CROSSCHECK command checks only objects marked AVAILABLE or EXPIRED by
examining the files on disk for DISK channels or by querying the media manager for sbt
channels. The CROSSCHECK command updates the repository records for any files that it is
unable to find to EXPIRED. It does not delete any files that it is unable to find.
The DELETE command can remove any file that the LIST and CROSSCHECK commands can
operate on. For example, you can delete backup sets, archived redo logs, and datafile copies.
The DELETE command removes both the physical file and the catalog record for the file. The
DELETE OBSOLETE command deletes backups that are no longer needed. It uses the same
REDUNDANCY and RECOVERY WINDOW options as REPORT OBSOLETE.
If you delete backups without using RMAN, you can use the CROSSCHECK or UNCATALOG
commands to remove the files from the recovery catalog.
Refer to the Oracle Database Backup and Recovery Reference for detailed syntax information.

Oracle Database 10g: Backup and Recovery 3 - 35


Using Enterprise Manager to Manage Backups

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using Enterprise Manager to Manage Backups


You can manage your backup records through Enterprise Manager. Backup maintenance
functions provided in Enterprise Manager include the following:
• Viewing lists of backups (backup sets and image copies) recorded in the RMAN
repository
• Crosschecking your repository:
- Verifying that the backups listed in the repository exist and are accessible
- Marking as expired any backups not accessible at the time of the crosscheck
• Deleting the record of expired backups from your RMAN repository
• Deleting obsolete backups from the repository and from disk
You can access the Manage Current Backups page in Enterprise Manager by clicking Manage
Current Backups in the Backup/Recovery region of the Maintenance page. The Manage
Current Backups page has two property pages: Backup Set (the initial view) and Image Copy.
Each serves a similar purpose, listing the backups as recorded in the Recovery Manager
repository.
Note: If you use a Flash Recovery Area for your backup storage, many maintenance activities
are reduced or eliminated because of the Flash Recovery Area’s automatic management of
disk space and file retention based on the retention policy.

Oracle Database 10g: Backup and Recovery 3 - 36


Summary

In this lesson, you should have learned how to:


• Configure persistent settings
• Configure backup destinations
• Configure backup optimization
• Create duplexed backup sets

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 3 - 37


Practice Overview

This practice covers the following topics:


• Configuring control file autobackup
• Configuring backup optimization
• Creating a whole database backup using the Oracle-
suggested strategy

Oracle Internal & Oracle Academy Use Only


• Creating duplexed backup sets
• Managing backups

Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 3 - 38


Using RMAN to Perform Recovery

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.
Objectives

After completing this lesson, you should be able to:


• Perform complete recovery
• Perform recovery on a new host
• Perform recovery using a backup control file

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 4 - 2


Using RMAN RESTORE and RECOVER Commands

• RESTORE command: Restores database files from


backup
• RECOVER command: Recovers restored files by
applying changes recorded in the redo log files

RMAN> SQL 'ALTER TABLESPACE inv_tbs OFFLINE IMMEDIATE';

Oracle Internal & Oracle Academy Use Only


RMAN> RESTORE TABLESPACE inv_tbs;
RMAN> RECOVER TABLESPACE inv_tbs;
RMAN> SQL 'ALTER TABLESPACE inv_tbs ONLINE';

Copyright © 2006, Oracle. All rights reserved.

Using RMAN RESTORE and RECOVER Commands


Reconstructing the contents of all or part of a database from a backup typically involves two
phases: retrieving a copy of the datafile from a backup, and reapplying changes to the file since
the backup from the archived and online redo logs, to bring the database to the desired SCN
(usually the most recent one).
The RESTORE command retrieves the datafile onto disk from a backup location on tape, disk, or
other media, and makes it available to the database server. RMAN restores from backup any
archived redo logs required during the recovery operation. If backups are stored on a media
manager, channels must be configured or allocated for use in accessing backups stored there.
The RECOVER command takes the restored copy of the datafile and applies to it the changes
recorded in the database’s redo logs.
Refer to the Oracle Database Backup and Recovery Reference for additional information and
examples using the RESTORE and RECOVER commands.

Oracle Database 10g: Backup and Recovery 4 - 3


Performing Recovery Using Enterprise Manager

The Enterprise Manager Recovery Wizard creates and runs


an RMAN script to perform the recovery.

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Performing Recovery Using Enterprise Manager


You can also perform complete or incomplete recovery by using the Recovery Wizard available
through Enterprise Manager. On the Maintenance page, click Perform Recovery in the
Backup/Recovery section.

Oracle Database 10g: Backup and Recovery 4 - 4


Comparing Complete and Incomplete Recovery

There are two types of recovery:


• Complete recovery: Brings the database up to the
present, including all committed data changes made to
the point in time when the recovery was requested
• Incomplete recovery: Brings the database up to a
specified point in time in the past, before the recovery

Oracle Internal & Oracle Academy Use Only


operation was requested
Complete
recovery
Incomplete
recovery Recovery
Restore from Missing transactions task started
this backup after incomplete recovery at this time

Copyright © 2006, Oracle. All rights reserved.

Comparing Complete and Incomplete Recovery


When you perform complete recovery, you bring the database to the state where it is fully up-to-
date, including all committed data modifications to the present time. Incomplete recovery,
however, brings the database to some point in the past. This means there are missing
transactions; any data modifications done between the recovery destination time and the present
are lost. In many cases, this is the desirable goal because there may have been some changes
made to the database that need to be undone. Recovering to a point in the past is a way to
remove the unwanted changes.

Oracle Database 10g: Backup and Recovery 4 - 5


Complete Recovery Following the Loss of
Datafiles
Archived
log Archived
log Online
Redo log

Changes applied
Database
2 opened Undo applied

Oracle Internal & Oracle Academy Use Only


4 5

1 3 6
Restored Datafiles containing
datafiles committed and Recovered
uncommitted datafiles
transactions

Copyright © 2006, Oracle. All rights reserved.

Complete Recovery Following the Loss of Datafiles


The following steps describe what takes place during complete recovery following the loss of
datafiles:
1. Damaged or missing files are restored from a backup.
2. Changes from incremental backups, archived redo log files, and online redo log files are
applied as necessary. The redo log changes are applied to the datafiles until the current
online log is reached and the most recent transactions have been reentered. Undo blocks are
generated during this entire process. This is referred to as rolling forward or cache recovery.
3. The restored datafiles may now contain committed and uncommitted changes.
4. The database is opened before undo is applied. This is to provide higher availability.
5. The undo blocks are used to roll back any uncommitted changes. This is sometimes referred
to as transaction recovery.
6. The datafiles are now in a recovered state and are consistent with the other datafiles in the
database.

Oracle Database 10g: Backup and Recovery 4 - 6


Performing Complete Recovery: Loss of a
Non-Critical datafile in ARCHIVELOG Mode

If a datafile is lost or corrupted, and that file does not


belong to the SYSTEM or UNDO tablespace, then restore and
recover the missing datafile.

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Performing Complete Recovery: Loss of a Non-Critical datafile in ARCHIVELOG


Mode
With the database in ARCHIVELOG mode, the loss of any datafile not belonging to the SYSTEM
or UNDO tablespaces only affects objects that are in the missing file.
To restore and recover the missing datafile using Enterprise Manager, perform the following
steps:
1. Click Perform Recovery on the Maintenance properties page.
2. Select “Datafiles” as the recovery type, and select “Restore to current time.”
3. Add all datafiles that need recovery.
4. Determine whether you want to restore the files to the default location or (if a disk or
controller is missing) to a new location.
5. Submit the RMAN job to restore and recover the missing files.
Because the database is in ARCHIVELOG mode, recovery up to the time of the last commit is
possible and users are not required to reenter any data.

Oracle Database 10g: Backup and Recovery 4 - 7


Performing Complete Recovery: Loss of a
System-Critical Datafile in ARCHIVELOG Mode

If a datafile is lost or corrupted, and that file belongs to the


SYSTEM or UNDO tablespace, then perform the following
steps:
1. The instance may or may not shut down automatically.
If it does not, use SHUTDOWN ABORT to bring the
instance down.

Oracle Internal & Oracle Academy Use Only


2. Mount the database.
3. Restore and recover the missing datafile.
4. Open the database.

Copyright © 2006, Oracle. All rights reserved.

Performing Complete Recovery: Loss of a System-Critical Datafile


Datafiles belonging to the SYSTEM tablespace or containing UNDO data are considered system
critical. A loss of one of these files requires the database to be restored from the MOUNT state
(unlike other datafiles that may be restored with the database open).
Perform the following steps for complete recovery:
1. If the instance is not already shut down, shut it down.
2. Mount the database.
3. Click Perform Recovery on the Maintenance properties page.
4. Select “Datafiles” as the recovery type, and select “Restore to current time.”
5. Add all datafiles that need recovery.
6. Determine whether you want to restore the files to the default location or (if a disk or
controller is missing) to a new location.
7. Submit the RMAN job to restore and recover the missing files.
8. Open the database. Users are not required to reenter data because the recovery is up to the
time of the last commit.

Oracle Database 10g: Backup and Recovery 4 - 8


Recovery Using Incrementally Updated Backups

RMAN can recover image copies by using incremental


backup files:
• Image copies are updated with all changes up to the
incremental backup SCN.
• Incremental backup reduces the time required for
media recovery.

Oracle Internal & Oracle Academy Use Only


• There is no need to perform an image copy after the
incremental restoration.
RMAN> RECOVER COPY OF
Incremental 2> DATAFILE {n|'file_name'}
backup files

Image copy
of datafile Incrementally updated
backup

Copyright © 2006, Oracle. All rights reserved.

Recovery Using Incrementally Updated Backups


You can use RMAN to apply incremental backups to datafile image copies. With this recovery
method, you use RMAN to recover a copy of a datafile—that is, you roll forward (recover) the
image copy to the specified point in time by applying the incremental backups to the image
copy. The image copy is updated with all changes up through the SCN at which the incremental
backup was taken. RMAN uses the resulting updated datafile in media recovery just as it would
use a full image copy taken at that SCN, without the overhead of performing a full image copy
of the database every day. The benefits of applying incremental backups to datafile image copies
are that you reduce the time required for media recovery (using archive logs) because you need
to apply archive logs only since the last incremental backup. Also, you do not need to perform a
full image copy after the incremental restoration.
If the recovery process fails during the application of the incremental backup file, you simply
restart the recovery process. RMAN automatically determines the required incremental backup
files to apply, from before the image datafile copy until the time at which you want to stop the
recovery process. If there is more than one version of an image copy recorded in the RMAN
catalog, RMAN automatically uses the latest version of the image copy. RMAN reports an error
if it cannot merge an incremental backup file with an image copy.

Oracle Database 10g: Backup and Recovery 4 - 9


Using the Flash Recovery Area for Fast Recovery

Use the Flash Recovery Area to perform fast recovery by


performing the following steps:
1. Use the SWITCH TO COPY command to switch to a file in
the Flash Recovery Area.
2. Recover the datafile in the Flash Recovery Area.
3. Create an image copy of the datafile in the original

Oracle Internal & Oracle Academy Use Only


datafile location.
4. Switch to the new image copy.
5. Recover the new image copy.

Copyright © 2006, Oracle. All rights reserved.

Using the Flash Recovery Area for Fast Recovery


You can use datafiles from the Flash Recovery area for fast recovery by performing the
following steps:
1. Take the datafile offline.
2. Use the SWITCH TO COPY command to restore the datafile from the flash recovery area.
3. Recover the datafile.
4. Bring the datafile online.
5. Create an image copy of the datafile in the original location using the BACKUP AS COPY
command.
6. Take the datafile offline.
7. Switch to the copy you made in step 5 using the SWITCH TO COPY command.
8. Recover the datafile.
9. Bring the datafile online.

Oracle Database 10g: Backup and Recovery 4 - 10


Performing Restore and Recovery of a Database
in NOARCHIVELOG Mode

• If the database is in NOARCHIVELOG mode, and any


datafile is lost, perform the following tasks:
1. Shut down the instance if it is not already down.
2. Restore the entire database, including all data and
control files, from the backup.
3. Open the database.

Oracle Internal & Oracle Academy Use Only


• Users must reenter all changes made since the last
backup.

Copyright © 2006, Oracle. All rights reserved.

Performing Restore and Recovery of a Database in NOARCHIVELOG Mode


The loss of any datafile from a database in NOARCHIVELOG mode requires complete
restoration of the database, including control files and all datafiles.
With the database in NOARCHIVELOG mode, recovery is possible only up to the time of the last
backup. So users must reenter all changes made since that backup. For this type of recovery,
perform the following tasks:
1. Shut down the instance if it is not already down.
2. Click Perform Recovery on the Maintenance properties page.
3. Select Whole Database as the type of recovery.

Oracle Database 10g: Backup and Recovery 4 - 11


Using Incremental Backups to Recover a
Database in NOARCHIVELOG Mode

Use incremental backups to perform limited recovery of a


database in NOARCHIVELOG mode.

STARTUP FORCE MOUNT;


RESTORE CONTROLFILE;
ALTER DATABASE MOUNT;

Oracle Internal & Oracle Academy Use Only


RESTORE DATABASE;
RECOVER DATABASE NOREDO;
ALTER DATABASE OPEN RESETLOGS;

Copyright © 2006, Oracle. All rights reserved.

Using Incremental Backups to Recover a Database in NOARCHIVELOG Mode


You can perform limited recovery of a NOARCHIVELOG mode database by using incremental
backups. The incremental backups must be consistent backups.
If you have taken incremental backups, RMAN will use your level 0 and level 1 backups to
restore and recover the database.
You must specify the NOREDO option on the RECOVER DATABASE command if the online redo
log files are lost or if the redo cannot be applied to the incremental backups. If you do not
specify the NOREDO option, RMAN searches for the online redo log files after applying the
incremental backups. If the online redo log files are not available, RMAN issues an error
message.
Note: If the current online redo log files contain all changes since the last incremental backup,
you can issue the RECOVER DATABASE command without the NOREDO option and the changes
will be applied.

Oracle Database 10g: Backup and Recovery 4 - 12


Restoring and Recovering the Database
on a New Host

Use the procedure to:


• Perform test restores
• Move a production database to a new host

Oracle Internal & Oracle Academy Use Only


Backups RMAN>

Server Server
parameter file parameter file

Copyright © 2006, Oracle. All rights reserved.

Restoring and Recovering the Database on a New Host


Use the procedure described on the following pages to perform test restores. You can also use it
to move a production database to a new host.
The database identifier (DBID) for the restored test database is the same as the DBID of the
original database. If you are using a recovery catalog and connect to the test database and the
recovery catalog database, the recovery catalog is updated with information about the test
database. This can impact RMAN’s ability to restore and recover the source database.
You should create a duplicate database using the RMAN DUPLICATE command if your goal is
to create a new copy of your target database for ongoing use on a new host. The duplicate
database is assigned a new DBID which allows it to be registered in the same recovery catalog
as the original target database. Refer to the lesson titled “Using RMAN to Create a Duplicate
Database” for detailed information about the DUPLICATE command.

Oracle Database 10g: Backup and Recovery 4 - 13


Preparing to Restore the Database to a New Host

Perform the following steps to prepare:


1. Record the database identifier (DBID) of your source
database.
2. Copy the source database initialization parameter file to
the new host.
3. Ensure that source backups, including the control file

Oracle Internal & Oracle Academy Use Only


autobackup, are accessible on the restore host.

Copyright © 2006, Oracle. All rights reserved.

Preparing to Restore the Database to a New Host


Perform the steps listed in the slide to prepare for the restore of the database to a new host.
Note: If you are performing a test restore, do not connect to the recovery catalog when restoring
the datafiles. If you connect to the recovery catalog, RMAN records information about the
restored datafiles in the recovery catalog and considers the restored database as the current target
database. If your control file is not large enough to contain all of the RMAN repository data on
the backups you need to restore and you must use a recovery catalog, export the catalog and
import it into a different schema or database. Use the copied recovery catalog for the test restore.

Oracle Database 10g: Backup and Recovery 4 - 14


Restoring the Database to a New Host

Perform the following steps on the restore host to restore


the database:
1. Configure the ORACLE_SID environment variable.
2. Start RMAN and connect to the target instance in
NOCATALOG mode.
3. Set the database identifier (DBID).

Oracle Internal & Oracle Academy Use Only


4. Start the instance in NOMOUNT mode.
5. Create a RUN block to:
– Restore the server parameter file from the backup sets
– Shut down the instance (SHUTDOWN ABORT)
6. Edit the restored initialization parameter file.
7. Start the instance in NOMOUNT mode.

Copyright © 2006, Oracle. All rights reserved.

Restoring the Database to a New Host


Perform the steps listed on this page and the next on the restore host to restore the database.
1. Configure the ORACLE_SID environment variable as shown in the following example:
$ setenv ORACLE_SID orcl
2. Start RMAN and connect to the target instance. Do not connect to the recovery catalog as
shown in the following example:
$ rman TARGET /
3. Set the database identifier (DBID). You can find the DBID of your source database by
querying the DBID column in V$DATABASE.
RMAN> SET DBID 1090770270;
4. Start the instance in NOMOUNT mode:
RMAN> STARTUP NOMOUNT
You will receive an error similar to the following because the server parameter file has not
been restored. RMAN uses a “dummy” parameter file to start the instance.
startup failed: ORA-01078: failure in processing system
parameters

Oracle Database 10g: Backup and Recovery 4 - 15


Restoring the Database to a New Host (continued)
5. Create a RUN block to restore the server parameter file from the backup sets and shut down
the instance (SHUTDOWN ABORT) as shown in the example:
RUN
{
RESTORE SPFILE TO PFILE '?/oradata/test/initorcl.ora' FROM
AUTOBACKUP;
SHUTDOWN ABORT;
}
6. Edit the restored initialization parameter file to change any location-specific parameters,
such as those ending in _DEST, to reflect the new directory structure.
7. Start the instance in NOMOUNT mode using your edited text initialization parameter file.
RMAN> STARTUP NOMOUNT
> PFILE='?/oradata/test/initorcl.ora';

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery 4 - 16


Restoring the Database to a New Host

8. Create a RUN block to:


– Restore the control file
– Mount the database
9. Create the RMAN recovery script to restore and recover
the database.
10.Execute the RMAN script.

Oracle Internal & Oracle Academy Use Only


11.Open the database with the RESETLOGS option.

Copyright © 2006, Oracle. All rights reserved.

Restoring the Database to a New Host (continued)


8. Create a RUN block to restore the control file from an autobackup and mount the database
as shown in the example:
RUN
{
RESTORE CONTROLFILE FROM AUTOBACKUP;
ALTER DATABASE MOUNT;
}
9. Query V$DATAFILE to determine the file names of the database on your new host. Create
the RMAN recovery script to restore and recover the database. Use the SET NEWNAME
command to specify the path on your new host for each of the datafiles. Use the SQL
ALTER DATABASE RENAME FILE command to specify the path for the online redo log
files. Include the SET UNTIL command to limit recovery to the end of the archived redo
log files. Include the SWITCH command so that the control file recognizes the new path
names as the correct names for the datafiles. An example of a recovery script follows:

Oracle Database 10g: Backup and Recovery 4 - 17


Restoring the Database to a New Host (continued)
RUN
{
SET NEWNAME FOR DATAFILE 1 TO '?/oradata/test/system01.dbf';
SET NEWNAME FOR DATAFILE 2 TO '?/oradata/test/undotbs01.dbf';
SET NEWNAME FOR DATAFILE 3 TO '?/oradata/test/sysaux.dbf';
SET NEWNAME FOR DATAFILE 4 TO '?/oradata/test/users01.dbf';
SET NEWNAME FOR DATAFILE 5 TO '?/oradata/test/example01.dbf';
SQL "ALTER DATABASE RENAME FILE
''/u01/app/oracle/oradata/orcl/redo01.log''
TO ''?/oradata/test/redo01.log'' ";
SQL "ALTER DATABASE RENAME FILE
''/u01/app/oracle/oradata/orcl/redo02.log''
TO ''?/oradata/test/redo02.log'' ";
SQL "ALTER DATABASE RENAME FILE
''/u01/app/oracle/oradata/orcl/redo03.log''

Oracle Internal & Oracle Academy Use Only


TO ''?/oradata/test/redo03.log'' ";
SET UNTIL SCN 4545727;
RESTORE DATABASE;
SWITCH DATAFILE ALL;
RECOVER DATABASE;
}
10. Execute the recovery script.
11. Open the database with the RESETLOGS option:
RMAN> ALTER DATABASE OPEN RESETLOGS;
After you have completed your test, you can shut down the test database instance and delete the
test database with all of its files.

Oracle Database 10g: Backup and Recovery 4 - 18


Performing Recovery with a Backup Control File

• Restore and mount a backup control file when all


copies of the current control file are lost or damaged.
• Execute the RECOVER command after restoring the
backup control file.
• Open the database with the RESETLOGS option after
performing complete or point-in-time recovery.

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Performing Recovery with a Backup Control File


If you have lost all copies of the current control file, you must restore and mount a backup
control file before performing recovery. Your recovery operation may be to recover lost datafiles
or it may be to simply recover the control file. If you are using a recovery catalog, the process is
identical to recovery with a current control file because RMAN can use the recovery catalog to
obtain RMAN metadata.

Oracle Database 10g: Backup and Recovery 4 - 19


Restoring the Server Parameter File from the
Control File Autobackup
RMAN> STARTUP FORCE NOMOUNT;
RMAN> RESTORE SPFILE FROM AUTOBACKUP;
RMAN> STARTUP FORCE;

Recovery
Manager
(RMAN) Flash Recovery

Oracle Internal & Oracle Academy Use Only


Area

Server
parameter
file Database

Copyright © 2006, Oracle. All rights reserved.

Restoring the Server Parameter File from the Control File Autobackup
If you have lost the server parameter file, you can restore it from the autobackup. The procedure
is similar to restoring the control file from autobackup. Set the DBID for your database and then
issue the RESTORE SPFILE FROM AUTOBACKUP command.
If you are restoring the SPFILE to a nondefault location, specify the command as follows:
RESTORE SPFILE TO <file_name> FROM AUTOBACKUP
If you are restoring the server parameter file from the flash recovery area, specify the command
as follows:
RMAN> run {
2> restore spfile from autobackup
3> recovery area = '<flash recovery area destination>'
4> db_name = '<db_name>';
5> }

Oracle Database 10g: Backup and Recovery 4 - 20


Restoring the Control File from Autobackup

Recovery
Manager
(RMAN) Flash Recovery
Area

Oracle Internal & Oracle Academy Use Only


Control
file
Database

RMAN> RESTORE CONTROLFILE TO


2> '/oradata/ctlfile.bak' FROM AUTOBACKUP;
RMAN> RECOVER DATABASE;
RMAN> ALTER DATABASE OPEN RESETLOGS;

Copyright © 2006, Oracle. All rights reserved.

Restoring the Control File from Autobackup


If you are not using a recovery catalog, you should have autobackup of the control file
configured, so that you are able to quickly restore the control file if needed. The commands used
for restoring your control file are the same, whether or not you are using a Flash Recovery Area.
However, if you are using a Flash Recovery Area, RMAN implicitly cross-checks backups and
image copies listed in the control file, and catalogs any files in the Flash Recovery Area not
recorded in the restored control file, improving the usefulness of the restored control file in the
restoration of the rest of your database.
Note: Tape backups are not automatically cross-checked after the restoration of a control file. If
you are using tape backups, then after restoring the control file and mounting the database, you
must cross-check the backups on tape.

Oracle Database 10g: Backup and Recovery 4 - 21


Restoring the Control File from Autobackup (continued)
To restore the control file from an autobackup, the database must be in a NOMOUNT state. You
must set the database identifier (DBID) before issuing the RESTORE CONTROLFILE FROM
AUTOBACKUP command as shown in the following example:
RMAN> SHUTDOWN IMMEDIATE;
RMAN> STARTUP NOMOUNT;
RMAN> SET DBID 1090770270;
RMAN> RESTORE CONTROLFILE FROM AUTOBACKUP;
RMAN searches for a control file autobackup. If one is found, RMAN restores the control file
from that backup to all the control file locations listed in the CONTROL_FILES initialization
parameter.
If you have a recovery catalog, you do not have to set the DBID or use the control file
autobackup to restore the control file. You can use the RESTORE CONTROLFILE command

Oracle Internal & Oracle Academy Use Only


with no arguments:
RMAN> RESTORE CONTROLFILE;
The instance must be in the NOMOUNT state when you perform this operation, and RMAN must
be connected to the recovery catalog. The restored control file is written to all locations listed in
the CONTROL_FILES initialization parameter.
Use the RESTORE CONTROLFILE... TO <destination> command to restore the control
file to a nondefault location.
If you have also lost the SPFILE for the database and need to restore it from the autobackup, the
procedure is similar to restoring the control file from autobackup. You must first set the DBID
for your database, and then use the RESTORE SPFILE FROM AUTOBACKUP command.
After you have started the instance with the restored server parameter file, RMAN can restore
the control file from the autobackup. After you restore and mount the control file, you have the
backup information necessary to restore and recover the database.
After restoring the control files of your database from backup, you must perform complete
media recovery and then open your database with the RESETLOGS option.

Oracle Database 10g: Backup and Recovery 4 - 22


Performing Disaster Recovery

• Disaster implies the loss of the entire target database,


the recovery catalog database, all current control files,
all online redo log files, and all parameter files.
• Disaster recovery includes the restoration and
recovery of the target database.
• Minimum required set of backups:

Oracle Internal & Oracle Academy Use Only


– Backups of some datafiles
– Corresponding archived redo logs files
– At least one control file autobackup

Copyright © 2006, Oracle. All rights reserved.

Performing Disaster Recovery


Disaster recovery includes the restoration of and recovery of the target database after the loss of
the entire target database, all current control files, all online redo log files, all parameter files,
and the recovery catalog database (if applicable).
To perform disaster recovery, the following backups are required as a minimum:
• Backups of some datafiles
• Corresponding archived redo logs generated after the time of the backup
• At least one autobackup of the control file
Note: Refer to the Oracle Database 10g: Data Guard Administration course and the Oracle
Data Guard Concepts and Administration manual for information about how Oracle Data Guard
can provide complete disaster protection.

Oracle Database 10g: Backup and Recovery 4 - 23


Performing Disaster Recovery

Basic procedure:
• Restore an autobackup of the server parameter file.
• Start the target database instance.
• Restore the control file from autobackup.
• Mount the database.

Oracle Internal & Oracle Academy Use Only


• Restore the datafiles.
• Recover the datafiles.
• Open the database with the RESETLOGS option.

Copyright © 2006, Oracle. All rights reserved.

Performing Disaster Recovery (continued)


The basic procedure for performing disaster recovery is outlined in the slide. After you have
mounted the database, follow the steps for performing recovery with a backup control file.
Refer to the Oracle Database Backup and Recovery Advanced User’s Guide for a detailed
example.

Oracle Database 10g: Backup and Recovery 4 - 24


Summary

In this lesson, you should have learned how to:


• Perform complete recovery
• Perform recovery on a new host
• Perform recovery using a backup control file

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 4 - 25


Practice Overview

This practice covers the following topics:


• Performing datafile recovery using different methods
• Performing control file recovery

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 4 - 26


Using Oracle Flashback Technologies

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.
Objectives

After completing this lesson, you should be able to:


• Use Flashback Drop to recover a dropped table
• Use Flashback Query to view the contents of the
database as of any single point in time
• Use Flashback Versions Query to view versions of a
row over time

Oracle Internal & Oracle Academy Use Only


• Use Flashback Transaction Query to view transaction
history of a row
• Use Flashback Table to restore the contents of a table
to a specific point in the past
• Configure Flashback Database
• Perform Flashback Database to a point in time

Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 5 - 2


Using Oracle Flashback Technology

Object Scenario Examples Flashback Uses Affects


Level Technology Data
Database Truncate table; Database Flashback TRUE
Undesired multitable logs
changes made
Table Drop table Drop Recycle TRUE
bin

Oracle Internal & Oracle Academy Use Only


Update with the wrong Table Undo data TRUE
WHERE clause
Compare current data Query Undo data FALSE
with data from the past
Compare versions of a Version Undo data FALSE
row
Tx Investigate several Transaction Undo data FALSE
historical states of data

Copyright © 2006, Oracle. All rights reserved.

Using Oracle Flashback Technology


Flashback technology can be used when a logical corruption occurs in an Oracle database and
you need to recover data quickly and easily. It is often difficult to identify the objects and rows
that are affected by an erroneous transaction. With flashback technology, you can diagnose
errors introduced into the database and repair the damage. You can view the transactions that
have contributed to specific row modifications, view the entire set of versions of a given row
during some time period, or just view data as it appeared at a specific time in the past.
The table in the slide shows typical uses of flashback technology.
Flashback Database uses the flashback logs to perform flashback. Flashback Drop uses the
Recycle Bin. All other techniques use undo data.
Not all flashback features modify the database. Some are simply methods to query other
versions of data. The results of flashback queries can help you to:
• Determine which type of database-modifying flashback operation to perform to correct
the problem
• Use the result set of the flashback queries in an INSERT, UPDATE, or DELETE statement
that enables you to easily repair the erroneous data

Oracle Database 10g: Backup and Recovery 5 - 3


Flashback Drop and the Recycle Bin

RECYCLEBIN = ON

Drop a table Realize a mistake

Oracle Internal & Oracle Academy Use Only


was made
DROP TABLE
FLASHBACK TABLE
employees;
employees
TO BEFORE DROP;

Copyright © 2006, Oracle. All rights reserved.

Flashback Drop and the Recycle Bin


In previous releases of the Oracle database, if you dropped a table by mistake, you had to
recover the database to a prior time to recover the dropped table. This procedure was often
time consuming and resulted in loss of work of other transactions.
Oracle Database includes the Flashback Drop feature, which you can use to undo the effects of
a DROP TABLE statement without having to use point-in-time recovery.
Note: The RECYCLEBIN initialization parameter is used to control whether the Flashback
Drop capability is enabled. If the parameter is set to OFF, then dropped tables do not go into
the Recycle Bin. If this parameter is set to ON, the dropped tables go into the Recycle Bin and
can be recovered. By default, RECYCLEBIN is set to ON.

Oracle Database 10g: Backup and Recovery 5 - 4


Understanding the Recycle Bin

BIN$zbjrBdpw==$0 EMPLOYEES
BIN$zbjra9wy==$0 EMPLOYEES_PK
Recycle
bin
USER_OBJECTS
Objects are:
– Renamed
EMPLOYEES – Not moved BIN$zbjrBdpw==$0

Oracle Internal & Oracle Academy Use Only


EMPLOYEES_PK DBA_FREE_SPACE BIN$zbjra9wy==$0

DROP TABLE employees;

Copyright © 2006, Oracle. All rights reserved.

Understanding the Recycle Bin


Without the Recycle Bin enabled, when you drop a table, the space associated with the table
and its dependent objects is immediately reclaimable (that is, it can be used for other objects).
If the Recycle Bin is enabled, when you drop a table, the space associated with the table and
its dependent objects is not immediately reclaimable, even though it appears in
DBA_FREE_SPACE. Instead, the dropped objects are temporarily placed in the Recycle Bin
and still belong to their owner. The space used by Recycle Bin objects is never automatically
reclaimed unless there is space pressure. This enables you to recover Recycle Bin objects for
the maximum possible duration.
When a dropped table is moved to the Recycle Bin, the table and its associated objects and
constraints are renamed using system-generated names. This is necessary to avoid name
conflicts that may arise if you later create a new object with the same name.
The Recycle Bin itself is a data dictionary table that maintains the relationships between the
original names of dropped objects and their system-generated names. You can query the
contents of the Recycle Bin by using the DBA_RECYCLEBIN view.

Oracle Database 10g: Backup and Recovery 5 - 5


Restoring Tables from the Recycle Bin

• Restore dropped tables and dependent objects.


• If multiple Recycle Bin entries have the same original
name:
– Use unique, system-generated names to restore a
particular version
– The restored table is last in, first out (LIFO)

Oracle Internal & Oracle Academy Use Only


• Rename the original name if that name is currently
used.

FLASHBACK TABLE table_name


TO BEFORE DROP [RENAME TO new_name];

Copyright © 2006, Oracle. All rights reserved.

Restoring Tables from the Recycle Bin


Use the FLASHBACK TABLE ... TO BEFORE DROP command to recover a table and all of
its possible dependent objects from the Recycle Bin. You can specify either the original name
of the table or the system-generated name assigned to the object when it was dropped.
If you specify the original name, and if the Recycle Bin contains more than one object of that
name, then the object that was moved to the Recycle Bin most recently is recovered first
(LIFO: last in, first out). If you want to retrieve an older version of the table, you can specify
the system-generated name of the table that you want to retrieve, or issue additional
FLASHBACK TABLE ... TO BEFORE DROP statements until you retrieve the table you
want.
If a new table of the same name has been created in the same schema since the original table
was dropped, then an error is returned unless you also specify the RENAME TO clause.
Note: When you flash back a dropped table, the recovered indexes, triggers, and constraints
keep their Recycle Bin names. Therefore, it is advisable to query the Recycle Bin and
DBA_CONSTRAINTS before flashing back a dropped table. In this way, you can rename the
recovered indexes, triggers, and constraints to more usable names.

Oracle Database 10g: Backup and Recovery 5 - 6


Automatic Space Reclamation in the Recycle Bin

Recycle bin

BIN$zbjrBdpw==$0
BIN$zbjra9wy==$0 BIN$zbjrBdpw==$0

Oracle Internal & Oracle Academy Use Only


BIN$zbjra9wy==$0

DBA_FREE_SPACE - RECYCLEBIN 1

Autoextend 3

Copyright © 2006, Oracle. All rights reserved.

Automatic Space Reclamation in the Recycle Bin


As long as the space used by Recycle Bin objects is not reclaimed, you can recover those
objects by using Flashback Drop. Recycle Bin object reclamation policies are as follows:
• Manual cleanup when you explicitly issue a PURGE command
• Automatic cleanup under space pressure: While objects are in the Recycle Bin, their
corresponding space is also reported in DBA_FREE_SPACE because their space is
automatically reclaimable. The free space in a particular tablespace is then consumed in
the following order:
1. Free space not corresponding to Recycle Bin objects
2. Free space corresponding to Recycle Bin objects. In this case, Recycle Bin objects
are automatically purged from the Recycle Bin using a first in, first out (FIFO)
algorithm.
3. Free space automatically allocated if the tablespace is autoextensible
Suppose you create a new table in the TBS1 tablespace. If there is free space allocated to this
tablespace that does not correspond to a Recycle Bin object, this free space is used first. If this
is not enough, free space is used that corresponds to Recycle Bin objects that reside in TBS1.
If the free space of some Recycle Bin objects is used, these objects get purged automatically
from the Recycle Bin. You can no longer recover those objects by using the Flashback Drop
feature. As a last resort, the TBS1 tablespace is extended if possible.
Oracle Database 10g: Backup and Recovery 5 - 7
Manual Space Reclamation in the Recycle Bin

PURGE {TABLE table_name|INDEX index_name}

PURGE TABLESPACE ts_name [USER user_name]

PURGE [USER_|DBA_]RECYCLEBIN

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Manual Space Reclamation in the Recycle Bin


Use the PURGE command to permanently remove objects from the Recycle Bin. When an
object is purged from the Recycle Bin, the object and its dependent objects are permanently
removed from the database. Objects purged from the Recycle Bin are no longer recoverable by
using the Flashback Drop feature. PURGE can be used as follows:
• PURGE TABLE purges the specified table.
• PURGE INDEX purges the specified index.
• PURGE TABLESPACE purges all the objects residing in the specified tablespace. In
addition, objects residing in other tablespaces may get purged if they are dependent.
Optionally, you can also specify the USER clause to purge only those objects that belong
to the specified user running low on disk quota for the specified tablespace.
• PURGE RECYCLEBIN purges all the objects that belong to the current user.
RECYCLEBIN and USER_RECYCLEBIN are synonymous.
• PURGE DBA_RECYCLEBIN purges all the objects. You must have the appropriate
system privileges or the SYSDBA system privilege to issue this command.
Note: For PURGE TABLE and PURGE INDEX commands, if you specify an original name and
if the Recycle Bin contains more than one object of that name, then the object that has been in
the Recycle Bin the longest is purged first (FIFO).

Oracle Database 10g: Backup and Recovery 5 - 8


Bypassing the Recycle Bin

DROP TABLE table_name [PURGE] ;

DROP TABLESPACE ts_name


[INCLUDING CONTENTS] ;

Oracle Internal & Oracle Academy Use Only


DROP USER user_name [CASCADE] ;

Copyright © 2006, Oracle. All rights reserved.

Bypassing the Recycle Bin


You can use the DROP TABLE PURGE command to permanently drop a table and its
dependent objects from the database. When you use this command, the corresponding objects
are not moved to the Recycle Bin. This command provides the same functionality that the
DROP TABLE command provided in previous releases.
When you issue the DROP TABLESPACE ... INCLUDING CONTENTS command, the
objects in the tablespace are not placed in the Recycle Bin. Moreover, objects in the Recycle
Bin belonging to the tablespace are purged. When you issue the same command without the
INCLUDING CONTENTS clause, the tablespace must be empty for the command to succeed.
However, there can be objects belonging to the tablespace in the Recycle Bin. In this case,
these objects are purged.
When you issue the DROP USER ... CASCADE command, the user and all the objects owned
by the user are permanently dropped from the database. Any objects in the Recycle Bin
belonging to the dropped user are purged.

Oracle Database 10g: Backup and Recovery 5 - 9


Querying the Recycle Bin

SELECT owner, original_name, object_name,


type, ts_name, droptime, related, space
FROM dba_recyclebin
WHERE can_undrop = 'YES';

SELECT original_name, object_name,

Oracle Internal & Oracle Academy Use Only


type, ts_name, droptime, related, space
FROM user_recyclebin
WHERE can_undrop = 'YES';

SQL> SHOW RECYCLEBIN

Copyright © 2006, Oracle. All rights reserved.

Querying the Recycle Bin


You can view all the objects that you have dropped by querying USER_RECYCLEBIN or
RECYCLEBIN. DBA_RECYCLEBIN shows you all the objects that have been dropped by all
users and that are still in the Recycle Bin.
You can also use the SQL*Plus SHOW RECYCLEBIN command. This command shows you
only those objects that can be “undropped.”
The examples show how to extract important information from the Recycle Bin:
• ORIGINAL_NAME is the name of the object before it is dropped.
• OBJECT_NAME is the system-generated name of the object after it is dropped.
• TYPE is the object’s type.
• TS_NAME is the name of the tablespace to which the object belongs.
• DROPTIME is the date at which the object was dropped.
• RELATED is the object identifier of the dropped object.
• SPACE is the number of blocks currently used by the object.
You can also see the contents of the Recycle Bin by using Enterprise Manager.
Note: For detailed information about the DBA_RECYCLEBIN view, refer to the Oracle
Database Reference manual.

Oracle Database 10g: Backup and Recovery 5 - 10


Querying Data in Dropped Tables

USER_TABLES
DROPPED TABLE_NAME

NO SALES
Recycle
YES BIN$zbjrBdpw==$0 EMPLOYEES bin
YES BIN$zbjra9wy==$0 EMPLOYEES_PK

Oracle Internal & Oracle Academy Use Only


NO SALES_PK
DROPPED INDEX_NAME
USER_INDEXES

SELECT ...
FROM "BIN$zbjrBdpw==$0"
WHERE ...

Copyright © 2006, Oracle. All rights reserved.

Querying Data in Dropped Tables


When you drop a table, the table is moved to the Recycle Bin, and its original name is changed
to a unique, system-generated name. Because you still own the dropped table, you can see its
characteristics from various dictionary views such as DBA_TABLES, DBA_OBJECTS, and
DBA_SEGMENTS. To make a distinction between tables that are in the Recycle Bin and tables
that are not, the DBA_TABLES view has a column named DROPPED that is set to YES for
tables that are still in the Recycle Bin.
As long as a system-generated table name is in the Recycle Bin, you can use it in a SELECT
statement and also in flashback queries. However, you cannot issue any sort of DML or DDL
statements on objects that reside in the Recycle Bin.

Oracle Database 10g: Backup and Recovery 5 - 11


Using Flashback Technology to Query Data

• Flashback Query
– Query all data at a specified point in time.
• Flashback Versions Query
– See all versions of a row between two times.
– See the transactions that changed the row.
• Flashback Transaction Query

Oracle Internal & Oracle Academy Use Only


– See all changes made Time
by a transaction.

Tx3
Tx2
Flashback
Tx1

Copyright © 2006, Oracle. All rights reserved.

Using Flashback Technology to Query Data


Flashback technology provides the capability to query past versions of schema objects, query
historical data, and perform change analysis. Every transaction logically generates a new
version of the database. With Flashback technology, you can navigate through these versions
to find an error and its cause:
• Flashback Query: Query all data as it existed at a specific point in time.
• Flashback Versions Query: See all versions of rows between two times and the
transactions that changed the row.
• Flashback Transaction Query: See all changes made by a transaction.

Oracle Database 10g: Backup and Recovery 5 - 12


Configuring Undo for Flashback

SYSTEM tablespace UNDOTBS1 tablespace

Oracle Internal & Oracle Academy Use Only


UNDO_RETENTION initialization parameter

Copyright © 2006, Oracle. All rights reserved.

Configuring Undo for Flashback


Flashback Query, Flashback Versions Query, and Flashback Transaction Query use data from
the undo tablespace.
Use the UNDO_RETENTION initialization parameter to specify, in seconds, the amount of
committed undo information to be retained in the database.
Note: If an active transaction needs undo space and the undo tablespace does not have any free
space, then the system starts reusing undo space that would have been retained unless you had
specified RETENTION GUARANTEE for the tablespace.

Oracle Database 10g: Backup and Recovery 5 - 13


Flashback Query: Overview

Use to query all data at a specified point in time.

Employees Unwanted Employees


updates

Oracle Internal & Oracle Academy Use Only


t1 t2

SELECT employee_id, salary FROM employees


AS OF TIMESTAMP <t1>
WHERE employee_id = 200

Copyright © 2006, Oracle. All rights reserved.

Flashback Query: Overview


With the Flashback Query feature, you can perform queries as of a certain time. By using the
AS OF clause of the SELECT statement, you can specify the time stamp for which to view the
data. This is useful for analyzing a data discrepancy.
Note: TIMESTAMP and SCN are valid options for the AS OF clause.

Oracle Database 10g: Backup and Recovery 5 - 14


Flashback Query: Example

Employees Employees Employees

salary = 4,400 salary = 4,840 salary = 4,400

Oracle Internal & Oracle Academy Use Only


11:00 11:10
UPDATE employees
SET salary =
(SELECT salary FROM employees
AS OF TIMESTAMP TO_TIMESTAMP
('2005-05-04 11:00:00', 'yyyy-mm-dd hh24:mi:ss')
WHERE employee_id = 200)
WHERE employee_id = 200

Copyright © 2006, Oracle. All rights reserved.

Flashback Query: Example


If a raise has been erroneously given to a particular employee recently, you can update the
salary again, assigning the salary provided by a subquery that returns the flashed back value.

Oracle Database 10g: Backup and Recovery 5 - 15


Flashback Versions Query: Overview

Tx0 Tx1 Tx2

Employees Employees Employees

200

Oracle Internal & Oracle Academy Use Only


t1 t2
SELECT versions_xid, salary FROM employees
VERSIONS BETWEEN TIMESTAMP <t1> and <t2>
WHERE employee_id = 200;

Tx0 Tx1 Tx2

Copyright © 2006, Oracle. All rights reserved.

Flashback Versions Query: Overview


With the Flashback Query feature, you can perform queries on the database as of a certain
time span or range of user-specified system change numbers (SCNs). The Flashback Versions
Query feature enables you to use the VERSIONS clause to retrieve all the versions of the rows
that exist between two points in time or two SCNs.
The rows returned by Flashback Versions Query represent a history of changes for the rows
across transactions. Flashback Versions Query retrieves only committed occurrences of the
rows. Uncommitted row versions within a transaction are not shown. The rows returned also
include deleted and subsequently reinserted versions of the rows.
You can use Flashback Versions Query to retrieve row history. It provides you with a way to
audit the rows of a table and retrieve information about the transactions that affected the rows.
You can then use the returned transaction identifier to perform transaction mining by using
LogMiner or to perform a Flashback Transaction Query, as described later in this lesson.
Note: VERSIONS_XID is a pseudocolumn that returns the transaction identifier of the
corresponding version of a row.

Oracle Database 10g: Backup and Recovery 5 - 16


Using Enterprise Manager to Perform
Flashback Versions Query

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Flashback Versions Query Through Enterprise Manager


Flashback Versions Query can also be performed by using Enterprise Manager.
On the Maintenance page, select Perform Recovery.
On the Perform Recovery page, select Tables for the Object Type and select Flashback
Existing Tables for the Operation Type. Click Perform Object Level Recovery. On the
“Perform Object Level Recovery: Point-in-Time” page, select “Evaluate row changes and
transactions to decide on a point in time,” and specify the name of the target table.
Select the columns that you want to view in the Available Columns box, and then enter a
search clause in the Bind The Row Value box. Select “Show all row history,” and then click
Next.

Oracle Database 10g: Backup and Recovery 5 - 17


Flashback Versions Query: Considerations

• The VERSIONS clause cannot be used to query:


– External tables
– Temporary tables
– Fixed tables
– Views
• The VERSIONS clause cannot span DDL commands.

Oracle Internal & Oracle Academy Use Only


• Segment shrink operations are filtered out.

Copyright © 2006, Oracle. All rights reserved.

Flashback Versions Query: Considerations


The VERSIONS clause cannot be used to query the following types of tables:
• External tables
• Temporary tables
• Fixed tables
You cannot use the VERSIONS clause to query a view. However, a view definition can use the
VERSIONS clause.
The VERSIONS clause in a SELECT statement cannot produce versions of rows across the
DDL statements that change the structure of the corresponding tables. This means that the
query stops producing rows after it reaches a time in the past when the table structure was
changed.
Certain maintenance operations, such as a segment shrink, may move table rows across blocks.
In this case, the version query filters out such phantom versions because the row data remains
the same.

Oracle Database 10g: Backup and Recovery 5 - 18


Flashback Transaction Query: Overview

FLASHBACK_TRANSACTION_QUERY

DBA

Oracle Internal & Oracle Academy Use Only


Erroneous
DML Undo
SQL

User

Copyright © 2006, Oracle. All rights reserved.

Flashback Transaction Query: Overview


Flashback Transaction Query is a diagnostic tool that you can use to view changes made to the
database at the transaction level. This enables you to diagnose problems in your database and
perform analysis and audits of transactions.
You can use the FLASHBACK_TRANSACTION_QUERY view to determine all the necessary
SQL statements that can be used to undo the changes made either by a specific transaction or
during a specific period of time.

Oracle Database 10g: Backup and Recovery 5 - 19


Using Enterprise Manager to Perform
Flashback Transaction Query

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using Enterprise Manager to Perform Flashback Transaction Query


This feature is used in conjunction with the Flashback Versions Query feature with the help of
the Perform Recovery Wizard. On the “Perform Object Level Recovery: Choose SCN” page,
click the corresponding Transaction ID link in the Flashback Versions Query Result region.
In the example in the slide, a Flashback Versions Query is performed on the JOBS table to
retrieve the three versions of the JOBS row for JOB_ID = 'AD_PRES'. Then, one of the
transaction IDs is clicked, showing all the changes that were part of that transaction. Notice
that in addition to the JOBS table update, there was also an update to the EMPLOYEES table in
that transaction.

Oracle Database 10g: Backup and Recovery 5 - 20


Flashback Transaction Query: Considerations

• DDL commands are seen as dictionary updates.


• Dropped objects appear as object numbers.
• Dropped users appear as user identifiers.

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Flashback Transaction Query: Considerations


Within the database, DDL operations are nothing but a series of space management operations
and changes to the data dictionary. Flashback Transaction Query on a transaction underlying a
DDL command displays the changes made to the data dictionary.
When Flashback Transaction Query involves tables that have been dropped from the database,
the table names are not reflected. Instead, object numbers are used.
If the user who executed a transaction is dropped, Flashback Transaction Query of that
transaction displays the corresponding user ID only, and not the username.
Note: When there is not enough undo data for a specific transaction, a row with a value of
UNKNOWN in the OPERATION column of FLASHBACK_TRANSACTION_QUERY is returned.

Oracle Database 10g: Backup and Recovery 5 - 21


Flashback Table: Overview

• Flashback Table recovers tables to a specific point in


time.
• Flashback Table is an in-place operation.
• The database stays online.

Oracle Internal & Oracle Academy Use Only


Erroneous Flashed back
DMLs User tables

Copyright © 2006, Oracle. All rights reserved.

Flashback Table: Overview


Using Flashback Table, you can recover a set of tables to a specific point in time without
having to perform traditional point-in-time recovery operations.
A Flashback Table operation is done in-place, while the database is online, by rolling back
only the changes that are made to the given tables and their dependent objects.
A Flashback Table statement is executed as a single transaction. All tables must be flashed
back successfully, or the entire transaction is rolled back.
Note: You can use Flashback Versions Query and Flashback Transaction Query to determine
the appropriate flashback time.

Oracle Database 10g: Backup and Recovery 5 - 22


Flashback Table

• Using Flashback Table, you can recover a table or


tables to a specific point in time without restoring a
backup.
• Data is retrieved from the undo tablespace to perform a
Flashback Table operation.
• The FLASHBACK TABLE privilege is required to flash

Oracle Internal & Oracle Academy Use Only


back a table.
• Row movement must be enabled on the table that you
are performing the flashback operation on.

Copyright © 2006, Oracle. All rights reserved.

Flashback Table
With Flashback Table, you can recover a table or tables to a specific point in time without
restoring a backup. When you use this feature, the data in tables and their associated objects
(indexes, constraints, triggers, and so on) is restored. The data used to satisfy a Flashback
Table request is retrieved from the undo tablespace.
You can use Flashback Versions Query and Flashback Transaction Query to determine the
appropriate flashback time.
Flashback Table provides a way for users to easily and quickly recover from accidental
modifications without a database administrator’s involvement. You must grant the
FLASHBACK TABLE or FLASHBACK ANY TABLE system privilege to any user that uses the
Flashback Table feature. In addition, you must grant the SELECT, INSERT, DELETE, and
ALTER object privileges to the user.
You can use Enterprise Manager to flash back a table. The wizard guides you through the
process.
Note: Enabling row movement is described on the next page.

Oracle Database 10g: Backup and Recovery 5 - 23


Enabling Row Movement on a Table

Oracle Internal & Oracle Academy Use Only


ALTER TABLE employees ENABLE ROW MOVEMENT;

Copyright © 2006, Oracle. All rights reserved.

Enabling Row Movement on a Table


You must enable row movement on a table to be able to flash back the table. When you enable
row movement, the Oracle server can move a row in the table. You can use Enterprise
Manager to enable row movement.
Using Enterprise Manager, you can enable row movement on a table by performing the
following steps:
1. Select Tables in the Schema region on the Administration property page. Enter the
schema name to search for the table, and click Go.
2. Click the table name of the table for which you want to enable row movement. You are
now on the View Table page.
3. Click Edit, which takes you to the Edit Table page.
4. Click the Options tab, where you can change the Enable Row Movement setting for the
table.
5. Set Enable Row Movement to Yes, and click Apply. The update confirmation message is
displayed.

Oracle Database 10g: Backup and Recovery 5 - 24


Performing Flashback Table

Oracle Internal & Oracle Academy Use Only


FLASHBACK TABLE hr.employees TO TIMESTAMP
TO_TIMESTAMP('2005-05-05 05:32:00',
'YYYY-MM-DD HH24:MI:SS');

Copyright © 2006, Oracle. All rights reserved.

Performing Flashback Table


You can use Enterprise Manager to flash back a table by performing the following steps:
1. Select Perform Recovery in the Backup/Recovery region on the Maintenance property
page. The Perform Recovery page appears.
2. In the Object Level Recovery region, select Tables from the Object Type drop-down list.
3. Select Flashback Existing Tables as the Operation Type. Click Perform Object Level
Recovery. The “Perform Object Level Recovery: Point-in-time” page is displayed.
4. Select “Flashback to a timestamp” or “Flashback to a known SCN” and then specify a
time stamp or SCN to flash back to, and click Next.
5. Click Add Tables to add tables to the list for the flashback operation. Click Next.
6. The Dependency Options page appears if there are dependent tables. Select the desired
option for dealing with dependent tables. Typically, you would select “Cascade” to ensure
a consistent flashback. Click Next.
7. The “Perform Object Level Recovery: Review” page appears. Review the information
and click Submit. The Confirmation page appears.
Note: You can also flash back tables from the Tables link in the Schema region of the
Administration page.

Oracle Database 10g: Backup and Recovery 5 - 25


Flashback Table: Considerations

• The FLASHBACK TABLE command executes as a single


transaction, acquiring exclusive DML locks.
• Statistics are not flashed back.
• Current indexes and dependent objects are maintained.
• Flashback Table operations:

Oracle Internal & Oracle Academy Use Only


– Cannot be performed on system tables
– Cannot span DDL operations
– Generate undo and redo data

Copyright © 2006, Oracle. All rights reserved.

Flashback Table: Considerations


• The entire FLASHBACK TABLE statement is executed within a single transaction. All or
none of the specified tables are flashed back.
• Flashback Table acquires exclusive data manipulation language (DML) locks on all the
tables that are specified in the statement over the period of time when the operation is in
progress.
• Statistics of impacted objects are not flashed back.
• All existing indexes are maintained. Dropped indexes are not re-created. Dependent on-
commit materialized views are also maintained automatically.
• Tables specified in the FLASHBACK TABLE statement are flashed back, provided that
none of the table constraints are violated. If any constraints are violated during flashback
execution, the operation is aborted and the tables are left in the same state as they were
just before the FLASHBACK TABLE statement invocation.
• You cannot perform Flashback Table to a particular time that is older than the time of the
execution of a data definition language (DDL) operation that altered the structure of or
shrunk a table that would be involved in the flashback operation. This restriction does not
apply to DDL statements that only change storage attributes of the tables.
• Flashback Table cannot be performed on system tables, remote tables, and fixed tables.

Oracle Database 10g: Backup and Recovery 5 - 26


Flashback Database: Overview

The Flashback Database operation:


• Works like a rewind button for the database
• Can be used in cases of logical data corruptions made
by users

Oracle Internal & Oracle Academy Use Only


Users The Flashback Database: The
generate database is You “press the database is
errors. corrupted. rewind button.” “rewound.”

Copyright © 2006, Oracle. All rights reserved.

Flashback Database: Review


With Flashback Database, you can quickly bring your database to an earlier point in time by
undoing all the changes that have taken place since that time. With this operation, you do not
need to restore backups. You can use this feature to undo changes that have resulted in logical
data corruption.
If you have experienced a loss of media or physical corruption in your database, then you must
use traditional recovery methods.

Oracle Database 10g: Backup and Recovery 5 - 27


Flashback Database Architecture

SGA
Redo log
Flashback buffer
buffer
Buffer cache
LGWR
Every
change

Log block

Oracle Internal & Oracle Academy Use Only


before
images
periodically.
Flashback Redo
RVWR logs
logs

Back out changes Do forward


1 to database using media recovery. 2
before images.
… …

Copyright © 2006, Oracle. All rights reserved.

Flashback Database Architecture


When you enable Flashback Database, the RVWR background process is started. This
background process sequentially writes Flashback Database data from the flashback buffer to
the Flashback Database logs, which are circularly reused. Subsequently, when a FLASHBACK
DATABASE command is issued, the flashback logs are used to restore to the blocks’ before
images, and then redo data is used to roll forward to the desired flashback time.
The overhead of enabling Flashback Database depends on the read-write mix of the database
workload. Because queries do not need to log any flashback data, the more write-intensive the
workload, the higher the overhead of enabling Flashback Database.
Note: Flashback Database logs are not archived.

Oracle Database 10g: Backup and Recovery 5 - 28


Configuring Flashback Database

1. Configure the Flash 2. Set the retention 3. Enable Flashback

Oracle Internal & Oracle Academy Use Only


Recovery Area. target. Database.

SQL> SHUTDOWN IMMEDIATE;


SQL> STARTUP MOUNT EXCLUSIVE;
SQL> ALTER SYSTEM SET
2 DB_FLASHBACK_RETENTION_TARGET=2880 SCOPE=BOTH;
SQL> ALTER DATABASE FLASHBACK ON;
SQL> ALTER DATABASE OPEN;

Copyright © 2006, Oracle. All rights reserved.

Configuring Flashback Database


You can configure Flashback Database as follows:
1. Configure the Flash Recovery Area.
2. Set the retention target with the DB_FLASHBACK_RETENTION_TARGET initialization
parameter. You can specify an upper limit, in minutes, on how far back you want to be
able to flash back the database. This parameter is only a target and does not provide any
guarantee. Your flashback time interval depends on how much flashback data has been
kept in the Flash Recovery Area.
3. Enable Flashback Database with the following command:
ALTER DATABASE FLASHBACK ON;
Before you can issue the command to enable Flashback Database, the database must be
configured for archiving and started in MOUNT EXCLUSIVE mode.
You can determine whether Flashback Database is enabled with the following query:
SELECT flashback_on FROM v$database;
You can disable Flashback Database with the ALTER DATABASE FLASHBACK OFF
command. As a result, all existing Flashback Database logs are deleted automatically.
Note: You can enable Flashback Database only when the database is mounted in exclusive
mode, not open.

Oracle Database 10g: Backup and Recovery 5 - 29


Using Enterprise Manager to Configure
Flashback Database

Enable flashback logging and specify the Flash Recovery


Area.

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using Enterprise Manager to Configure Flashback Database


When you are certain that the database is in ARCHIVELOG mode, return to the Recovery
Settings page and scroll down to the Media Recovery and Flash Recovery Area regions to
observe the new settings. When the Flash Recovery Area and archiving are configured,
USE_DB_RECOVERY_FILE_DEST is configured for archive log destination 10. Enable
flashback logging by selecting Enable Flashback Logging. You also have the ability to set the
flashback retention time, and you can view important information regarding your flashback
database window.
Review the Flash Recovery Area location. The Flash Recovery Area is a unified storage
location for all recovery-related files and activities in an Oracle database. All files that are
needed to completely recover a database from a media failure are part of the Flash Recovery
Area. The recovery-related files that can be created in the Flash Recovery Area include:
archived redo log files, control files, backups created by Recovery Manager (RMAN),
flashback logs, and the change tracking file. By allocating a storage location and unifying
recovery-related files within a specific area, the Oracle database server relieves the database
administrator of having to manage the disk files created by these components. The default
location for the Flash Recovery Area is $ORACLE_BASE. If you want it in a different
location, change it now. Scroll down to the bottom of the Recovery Settings page and click
Apply.
Oracle Database 10g: Backup and Recovery 5 - 30
Flashback Database: Examples

RMAN> FLASHBACK DATABASE TO TIME =


2> "TO_DATE('2004-05-27 16:00:00',
3> 'YYYY-MM-DD HH24:MI:SS')";

RMAN> FLASHBACK DATABASE TO SCN=23565;

RMAN> FLASHBACK DATABASE


2> TO SEQUENCE=223 THREAD=1;

Oracle Internal & Oracle Academy Use Only


SQL> FLASHBACK DATABASE
2 TO TIMESTAMP(SYSDATE-1/24);

SQL> FLASHBACK DATABASE TO SCN 53943;

SQL> FLASHBACK DATABASE TO RESTORE POINT b4_load;

Copyright © 2006, Oracle. All rights reserved.

Flashback Database: Examples


You can use the RMAN FLASHBACK DATABASE command to execute the Flashback
Database operation. You can use SEQUENCE and THREAD to specify a redo log sequence
number and thread as a lower limit. RMAN selects only files that can be used to flash back to,
but not including, the specified sequence number.
Alternatively, you can use the FLASHBACK DATABASE SQL command to return the database
to a past time or SCN. If you use the TO SCN clause, you must provide a number. If you
specify TO TIMESTAMP, you must provide a time-stamp value. You can also specify a restore
point name.
Note: The database must be mounted in EXCLUSIVE mode to issue the FLASHBACK
DATABASE command and must be opened with the RESETLOGS option when finished.

Oracle Database 10g: Backup and Recovery 5 - 31


Using Enterprise Manager to Perform
Flashback Database

Select the object and


operation type.

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using Enterprise Manager to Perform Flashback Database


On the Maintenance page, select Perform Recovery. From the Object Type drop-down list,
select Whole Database. Next, select “Recover to the current time or a previous point-in-time”
as Operation Type. Finally, provide the operating system credentials for a database user (that
is, one who belongs to the DBA group). When these steps are completed, click Continue to
proceed to the next step in the Flashback Database operation.

Oracle Database 10g: Backup and Recovery 5 - 32


Using Enterprise Manager to Perform
Flashback Database

Starting the Recovery Wizard:

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using Enterprise Manager to Perform Flashback Database (continued)


After the recovery operation type has been chosen, the Recovery Wizard is started. You are
informed that the database will be shut down and restarted in MOUNT mode. This operation
takes several minutes and you will be informed of the delay. After waiting an appropriate
amount of time, you must click Refresh to continue with the operation.

Oracle Database 10g: Backup and Recovery 5 - 33


Using Enterprise Manager to Perform
Flashback Database

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using Enterprise Manager to Perform Flashback Database (continued)


The Recovery Wizard is now started. At this stage, the database is shut down and started in
MOUNT mode. Click Refresh.
This displays the Perform Recovery: Point-in-time page. On this page, select the “Recover to a
prior point-in-time” option, and then specify either a date or an SCN. Then, click Next.
The Perform Recovery: Flashback page appears next, and you can choose to perform either
recovery using flashback or regular recovery. Select the corresponding option, and then click
Next.
This brings you directly to the Perform Recovery: Review page that is shown in the slide.
Click Submit to flash back the database.

Oracle Database 10g: Backup and Recovery 5 - 34


Flashback Database Considerations

• When the Flashback Database operation completes,


open the database:
– In read-only mode to verify that the correct target time or
SCN was used
– With a RESETLOGS operation to allow for DML
• You cannot use Flashback Database in the following

Oracle Internal & Oracle Academy Use Only


situations:
– The control file has been restored or re-created.
– A tablespace has been dropped.
– A datafile has been shrunk.
• Use the TO BEFORE RESETLOGS to flash back to before
the last RESETLOGS operation.

Copyright © 2006, Oracle. All rights reserved.

Flashback Database Considerations


After the Flashback Database operation is complete, you can open the database in read-only
mode to verify that the correct target time or SCN was used. If not, you can flash back the
database again, or perform a recovery to roll forward the database. To undo a Flashback
Database operation, you should recover the database forward.
You cannot use Flashback Database to recover a data file that was dropped during the span of
time you are flashing back. The dropped data file is added to the control file and marked
offline, but it is not flashed back. Flashback Database cannot flash back a data file to a time
after its creation and before the resize operation. If a file was resized during the span of time to
which you are going to flash back the database, then you should take the file offline before
beginning the Flashback Database operation. This is applicable for files that are shrunk rather
than expanded. You can use Flashback Database with datafiles that you have configured for
automatic extension.
You can flash back to just before the last RESETLOGS operation by supplying the TO
BEFORE RESETLOGS clause in the FLASHBACK DATABASE command.
Note: The flashback retention target is not an absolute guarantee that flashback will be
available. If space is needed for required files in the Flash Recovery Area, flashback logs may
be deleted automatically.

Oracle Database 10g: Backup and Recovery 5 - 35


Monitoring Flashback Database

To monitor the ability to meet your retention target:


• View the Flash Recovery Area disk quota:
SQL> SELECT estimated_flashback_size,
2 flashback_size
3 FROM v$flashback_database_log;

Oracle Internal & Oracle Academy Use Only


• Determine the current flashback window:
SQL> SELECT oldest_flashback_scn,
2 oldest_flashback_time
3 FROM v$flashback_database_log;

• Monitor logging in the Flashback Database logs:


SQL> SELECT *
2 FROM v$flashback_database_stat;

Copyright © 2006, Oracle. All rights reserved.

Monitoring Flashback Database


It is important for you to monitor space usage of the Flash Recovery Area so that you know
how well you are meeting your retention target. Use the V$FLASHBACK_DATABASE_LOG
view to monitor the Flashback Database retention target:
• ESTIMATED_FLASHBACK_SIZE uses previously logged flashback data to provide an
estimate of how much disk space is needed in the Flash Recovery Area for flashback logs
to meet the current flashback retention target. The estimate is based on the workload since
the instance was started, or during the most recent time interval equal to the flashback
retention target, whichever is shorter.
• FLASHBACK_SIZE gives you the current size in bytes of the flashback data.
• OLDEST_FLASHBACK_SCN and OLDEST_FLASHBACK_TIME display the
approximate lowest SCN and time to which you can flash back your database.
CURRENT_SCN in V$DATABASE gives you the current database SCN.
Use the V$FLASHBACK_DATABASE_STAT view to monitor the overhead of logging
flashback data in the Flashback Database logs. This view contains 24 hours of information,
with each row representing a one-hour time interval. You can use this view to determine rate
changes in the flashback data generation.

Oracle Database 10g: Backup and Recovery 5 - 36


Monitoring Flashback Database (continued)
SQL> SELECT begin_time, end_time, flashback_data, db_data,
2 redo_data, estimated_flashback_size AS EST_FB_SZE
3 FROM v$flashback_database_stat;

BEGIN_TIM END_TIME FLASHBACK_DATA DB_DATA REDO_DATA EST_FB_SZE


--------- --------- -------------- ---------- ---------- ----------
12-FEB-04 12-FEB-04 16384 0 24576 0
12-FEB-04 12-FEB-04 6594560 7471104 1533440 815923200
12-FEB-04 12-FEB-04 17235968 12361728 5150720 839467008
12-FEB-04 12-FEB-04 311648256 37249024 10272768 855195648
On the basis of this information, you may need to adjust the retention time or the Flash
Recovery Area size.

Oracle Internal & Oracle Academy Use Only


FLASHBACK_DATA and REDO_DATA represent the number of bytes of flashback data and
redo data written, respectively, during the time interval, and DB_DATA gives the number of
bytes of data blocks read and written. This view also contains the estimated flashback space
needed for the interval.
You can query V$RECOVERY_FILE_DEST to view information regarding the Flash
Recovery Area. The column descriptions are:
• NAME: Flash recovery area name, indicating location string
• SPACE_LIMIT: Disk limit specified in the DB_RECOVERY_FILE_DEST_SIZE
parameter
• SPACE_USED: Space used by Flash Recovery Area files (in bytes)
• SPACE_RECLAIMABLE: Amount of space that can be reclaimed by deleting obsolete,
redundant, and other low-priority files through the space management algorithm
• NUMBER_OF_FILES: Number of files

SQL> SELECT name, space_limit AS quota,


2 space_used AS used,
3 space_reclaimable AS reclaimable,
4 number_of_files AS files
5 FROM v$recovery_file_dest ;

NAME QUOTA USED RECLAIMABLE FILES


------------------------ ---------- ---------- ----------- -----
/u01/flash_recovery_area 5368709120 2509807104 203386880 226

Oracle Database 10g: Backup and Recovery 5 - 37


Monitoring Flashback Database

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Monitoring Flashback Database (continued)


Most of the Flashback Database statistics mentioned on the preceding pages can be viewed
from the Recovery Settings page. These metrics include the current space used by all
flashback logs, the lowest SCN, and the time of the lowest SCN in the flashback data.

Oracle Database 10g: Backup and Recovery 5 - 38


Tuning Considerations for Flashback Database

• Performance overhead is approximately 2%.


– Sequential and often, bulk writes are used for writing
flashback data.
– In well-configured systems, no process needs to wait for
writing of flashback logs.
• Best practices:
– Use a fast file system for the Flash Recovery Area,

Oracle Internal & Oracle Academy Use Only


preferably without operating system file caching.
– Configure enough disk spindles for the file system that
holds the Flash Recovery Area.
– Configure the file system on top of striped storage
volumes, with a relatively small stripe size such as 128
KB.
– For large, production databases, set the LOG_BUFFER
initialization parameter to at least 8 MB.

Copyright © 2006, Oracle. All rights reserved.

Tuning Considerations for Flashback Database


Maintaining flashback logs imposes comparatively limited overhead on an Oracle database
instance. Changed blocks are written from memory to the flashback logs at relatively
infrequent, regular intervals, to limit processing and I/O overhead.
To achieve good performance for large production databases with Flashback Database
enabled, Oracle recommends the following:
• Use a fast file system for your Flash Recovery Area, preferably without operating system
file caching. Files created in the Flash Recovery Area, including flashback logs, are
typically large. Operating system file caching is typically not effective for these files, and
may actually add CPU overhead for reading from and writing to these files. The
recommendation is to use a file system that avoids operating system file caching, such as
ASM.
• Configure enough disk spindles for the file system that will hold the Flash Recovery Area.
For large production databases, multiple disk spindles may be needed to support the
required disk throughput for the Oracle Database server to write the flashback logs
effectively.

Oracle Database 10g: Backup and Recovery 5 - 39


Tuning Considerations for Flashback Database (continued)
• If the storage system used to hold the Flash Recovery Area does not have non-volatile
RAM, try to configure the file system on top of striped storage volumes, with a relatively
small stripe size such as 128 KB. This will allow each write to the flashback logs to be
spread across multiple spindles, improving performance.
• For large, production databases, set the LOG_BUFFER initialization parameter to at least
8 MB. This ensures that the Oracle Database server allocates maximum memory
(typically16 MB) for writing flashback database logs.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery 5 - 40


Using Guaranteed Restore Points

A guaranteed restore point ensures that you can perform a


FLASHBACK DATABASE command to that SCN at any time.

Oracle Internal & Oracle Academy Use Only


SQL> CREATE RESTORE POINT before_load
2 GUARANTEE FLASHBACK DATABASE;

Copyright © 2006, Oracle. All rights reserved.

Guaranteed Restore Points


Like normal restore points, guaranteed restore points can be used as aliases for SCNs in
recovery operations. However, they also provide specific functionality related to the use of the
Flashback Database feature.
Creating a guaranteed restore point at a particular SCN enforces the requirement that you can
perform a Flashback Database operation to return your database to its state at that SCN, even if
flashback logging is not enabled for your database. If flashback logging is enabled, creating a
guaranteed restore point enforces the retention of flashback logs required for Flashback
Database back to any point in time after the creation of the earliest guaranteed restore point.
A guaranteed restore point can be used to revert a whole database to a known good state days
or weeks ago, as long as there is enough disk space in Flash Recovery Area to store the needed
logs.
Note: As with normal restore points, guaranteed restore points can be used to specify a point
in time for RECOVER DATABASE operations.

Oracle Database 10g: Backup and Recovery 5 - 41


Summary

In this lesson, you should have learned how to:


• Use Flashback Drop to recover a dropped table
• Use Flashback Query to view the contents of the
database as of any single point in time
• Use Flashback Versions Query to view versions of a
row over time

Oracle Internal & Oracle Academy Use Only


• Use Flashback Transaction Query to view transaction
history or a row
• Use Flashback Table to restore the contents of a table
to a specific point in the past
• Configure Flashback Database
• Perform Flashback Database to a point in time

Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 5 - 42


Practice Overview

This practice covers the following topics:


• Enabling Flashback Database
• Setting Restore Points
• Performing Flashback Table
• Using Flashback Query and Flashback Versions Query

Oracle Internal & Oracle Academy Use Only


• Performing Flashback Database to undo unwanted
transactions

Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 5 - 43


Oracle Internal & Oracle Academy Use Only
Using RMAN to Create a Duplicate Database

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.
Objectives

After completing this lesson, you should be able to:


• Describe the ways a duplicate database can be used
• Configure auxiliary database file names
• Create a duplicate database

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 6 - 2


Using RMAN to Create a Duplicate Database

Use the RMAN DUPLICATE command to create a duplicate


database using target database backups.

Oracle Internal & Oracle Academy Use Only


Datafile backups

Archived
redo log files
Auxiliary instance
Target database

Copyright © 2006, Oracle. All rights reserved.

Using RMAN to Create a Duplicate Database


A duplicate database is a copy of the target database (or a subset of the target database) with a
new, unique database identifier (DBID). The target database site and duplicate database site can
be on the same or separate hosts. The duplicate database is created using backups and archived
redo log files from the target database.

Oracle Database 10g: Backup and Recovery 6 - 3


Using a Duplicate Database

You can use a duplicate database to:


• Test backup and recovery procedures
• Recover objects by creating an export and importing
the objects into the production database

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using a Duplicate Database


A duplicate database is a copy of your target database. You can operate it independently of the
target database to:
• Test backup and recovery procedures
• Recover objects that were inadvertently dropped from the target database by creating an
export containing the objects in the duplicate database and importing them into the
production database.

Oracle Database 10g: Backup and Recovery 6 - 4


Creating a Duplicate Database

1. Create an Oracle password file for the auxiliary


instance.
2. Establish Oracle Net connectivity to the auxiliary
instance.
3. Create an initialization parameter file for the auxiliary
instance.

Oracle Internal & Oracle Academy Use Only


4. Start the auxiliary instance in NOMOUNT mode.
5. Mount or open the target database.
6. Ensure that backups and archived redo log files are
available.
7. Allocate auxiliary channels if needed.
8. Execute the DUPLICATE command.

Copyright © 2006, Oracle. All rights reserved.

Creating a Duplicate Database


The basic steps to creating a duplicate database are outlined in the slide. More detail is provided
in the lesson for some of the steps.

Oracle Database 10g: Backup and Recovery 6 - 5


Creating an Initialization Parameter File for the
Auxiliary Instance

Specify parameters as follows:


• DB_NAME
– If the duplicate database is in the same Oracle Home as
the target database, names must be different.
– Use the same value in the DUPLICATE command.
• DB_BLOCK_SIZE

Oracle Internal & Oracle Academy Use Only


– Specify the same value as set for the target database.

Copyright © 2006, Oracle. All rights reserved.

Creating an Initialization Parameter File for the Auxiliary Instance


You must create a text initialization parameter file for the auxiliary instance. The text
initialization parameter file must reside on the same host as the RMAN client that you use to
execute the DUPLICATE command.
Take note of the requirements for each of the following parameters:
• DB_NAME: If the target database and the duplicate database are in the same Oracle Home,
you must set DB_NAME to a different name. If they are in different Oracle Homes, you must
ensure that the duplicate database name differs from the other names in its Oracle Home. Be
sure to use the same database name that you set for this parameter when you execute the
DUPLICATE command.
• DB_BLOCK_SIZE: The block size of the auxiliary database must match the block size of
the target database. Specify the same value in the initialization parameter file for the
auxiliary database as set in the initialization parameter file for the target database. If the
parameter is not set in the initialization parameter file for the target database, do not set it in
the auxiliary instance initialization parameter file.
In addition, be sure to verify the settings of all initialization parameters that specify path names.
Verify that all specified paths are accessible on the duplicate database host.

Oracle Database 10g: Backup and Recovery 6 - 6


Specifying Parameters to Control File Naming

Specify the following parameters to control the naming of


the files of your auxiliary database:
• CONTROL_FILES
• DB_FILE_NAME_CONVERT
• LOG_FILE_NAME_CONVERT

Oracle Internal & Oracle Academy Use Only


CONTROL_FILES='/u01/app/oracle/oradata/aux/control01.ctl',
'/u01/app/oracle/oradata/aux/control02.ctl',
'/u01/app/oracle/oradata/aux/control03.ctl'
DB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/orcl',
'/u01/app/oracle/oradata/aux'
LOG_FILE_NAME_CONVERT='/u01/app/oracle/oradata/orcl',
'/u01/app/oracle/oradata/aux'

Copyright © 2006, Oracle. All rights reserved.

Specifying Parameters to Control File Naming


RMAN generates names for the required database files when you execute the DUPLICATE
command. You can control the naming of the files by specifying the following initialization
parameters in the auxiliary instance initialization parameter file:
• CONTROL_FILES: Specify the names of the control files in this parameter. If you do not
set the names via this parameter, the Oracle server creates an Oracle-managed control file in
a default control destination. Refer to the SQL CREATE CONTROLFILE command in the
SQL Reference manual for specific information.
• DB_FILE_NAME_CONVERT: This parameter is used to specify the names of datafiles for
the auxiliary database. It has the format DB_FILE_NAME_CONVERT = 'string1' ,
'string2' where string1 is the pattern of the target database file name and string2
is the pattern of the auxiliary database file name. You can also specify the
DB_FILE_NAME_CONVERT parameter as an option to the DUPLICATE DATABASE
command.
• LOG_FILE_NAME_CONVERT: This parameter is used to specify the names of the redo log
files for the auxiliary database. It has the format LOG_FILE_NAME_CONVERT =
'string1' , 'string2' where string1 is the pattern of the target database file name
and string2 is the pattern of the auxiliary database file name. You can also use the
LOGFILE clause of the DUPLICATE DATABASE command to specify redo log file names.

Oracle Database 10g: Backup and Recovery 6 - 7


Specifying Parameters to Control File Naming (continued)
As an alternative to using the initialization parameters to control the naming of the files, you can
use the following techniques to rename the redo log files:
• Use the LOGFILE clause of the DUPLICATE command.
• Set the Oracle Managed Files initialization parameters: DB_CREATE_FILE_DEST,
DB_CREATE_ONLINE_DEST_n, or DB_RECOVERY_FILE_DEST.
You can use the following techniques to specify new names for datafiles:
• Include the SET NEWNAME FOR DATAFILE command within a RUN block to specify new
names for the datafiles.
• Use the CONFIGURE AUXNAME command.
• Specify the DB_FILE_NAME_CONVERT parameter with the DUPLICATE command.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery 6 - 8


Starting the Instance in NOMOUNT Mode

• Create a server parameter file (SPFILE) from the text


initialization parameter file you used to start the
instance.
• Start the auxiliary instance in NOMOUNT mode.
SQL> create spfile
2 from pfile='$HOME/auxinstance/initAUX.ora';

Oracle Internal & Oracle Academy Use Only


File created.
SQL> startup nomount pfile='$HOME/auxinstance/initAUX.ora'
ORACLE instance started.

Total System Global Area 285212672 bytes


Fixed Size 1218992 bytes
Variable Size 92276304 bytes
Database Buffers 188743680 bytes
Redo Buffers 2973696 bytes

Copyright © 2006, Oracle. All rights reserved.

Starting the Instance in NOMOUNT Mode


After you have created the text initialization parameter file, invoke SQL*Plus to start the
auxiliary instance in NOMOUNT mode.
After you invoke SQL*Plus, create a server parameter file (SPFILE) from your text initialization
parameter file. You can execute the CREATE SPFILE before or after you have started the
instance. You should create the SPFILE in the default location so that you do not need to specify
the PFILE option with the DUPLICATE command. RMAN shuts down the auxiliary instance
and restarts it as part of the duplication process, so you must specify the PFILE option if you do
not use an SPFILE.

Oracle Database 10g: Backup and Recovery 6 - 9


Ensuring That Backups and Archived Redo Log
Files Are Available

• Backups of all target database datafiles must be


accessible on the duplicate host.
• Backups can be a combination of full and incremental
backups.
• Archived redo log files needed to recover the duplicate
database must be accessible on the duplicate host.

Oracle Internal & Oracle Academy Use Only


• Archived redo log files can be:
– Backups on a media manager
– Image copies
– Actual archived redo log files

Copyright © 2006, Oracle. All rights reserved.

Ensuring That Backups and Archived Redo Log Files Are Available
The backups needed to restore the datafiles must be accessible on the duplicate host. You do not
need a whole database backup. RMAN can use a combination of full and incremental backups of
individual datafiles during the duplication process.
Archived redo logs required to recover the duplicate database to the desired point in time must
also be accessible. The archived redo log files can be backups, image copies, or the actual
archived redo logs. The backups or copies can be transferred to the local disk of the duplicate
database node or mounted across a network by some means such as NFS.

Oracle Database 10g: Backup and Recovery 6 - 10


Allocating Auxiliary Channels

• Auxiliary channels specify a connection between


RMAN and an auxiliary database instance.
• If automatic channels are not configured, allocate
auxiliary channels:
– Start RMAN with a connection to the target database, the
auxiliary instance, and recovery catalog if applicable.

Oracle Internal & Oracle Academy Use Only


– Allocate at least one auxiliary channel within the RUN
block.
$ rman target sys/oracle@trgt auxiliary sys/oracle@aux
RMAN> RUN
{ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL aux2 DEVICE TYPE DISK;

Copyright © 2006, Oracle. All rights reserved.

Allocating Auxiliary Channels


If you do not have automatic channels configured, manually allocate at least one auxiliary
channel before issuing the DUPLICATE command. The ALLOCATE AUXILIARY CHANNEL
command must be within the same RUN block as the DUPLICATE command. The channel type
specified on the ALLOCATE AUXILIARY CHANNEL command must match the media where
the backups of the target database are located. If the backups reside on disk, you can allocate
more than one channel to reduce the time it takes for the duplication process. For tape backups,
you can specify the number of channels that correspond to the number of devices available.

Oracle Database 10g: Backup and Recovery 6 - 11


Using the RMAN DUPLICATE Command

• Connect to the target database and the auxiliary


instance.
• Specify the same database name that you used in the
DB_NAME initialization parameter.
RMAN> RUN
{ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK;

Oracle Internal & Oracle Academy Use Only


ALLOCATE AUXILIARY CHANNEL aux2 DEVICE TYPE DISK;

DUPLICATE TARGET DATABASE to auxdb;
}

Copyright © 2006, Oracle. All rights reserved.

Using the RMAN DUPLICATE command


Invoke RMAN and connect to the target database and auxiliary instance before issuing the
DUPLICATE command. The auxiliary instance must be started with the NOMOUNT option and
the target database must be mounted or open.

Oracle Database 10g: Backup and Recovery 6 - 12


Understanding the RMAN Duplication Operation

When you execute the DUPLICATE command, RMAN


performs the following operations:
• Creates a control file for the duplicate database
• Restores the target datafiles to the duplicate database
• Performs incomplete recovery using all available
incremental backups and archived redo log files

Oracle Internal & Oracle Academy Use Only


• Shuts down and restarts the auxiliary instance
• Opens the duplicate database with the RESETLOGS
option
• Creates the online redo log files
• Generates a new, unique database identifier (DBID) for
the duplicate database

Copyright © 2006, Oracle. All rights reserved.

Understanding the RMAN Duplication Operation


When you execute the DUPLICATE command, RMAN performs the following operations:
• Creates a control file for the duplicate database
• Restores the target datafiles to the duplicate database
• Performs incomplete recovery using all available incremental backups and archived redo
log files
• Shuts down and restarts the auxiliary instance
• Opens the duplicate database with the RESETLOGS option
• Creates the online redo log files
• Generates a new, unique DBID for the duplicate database

Oracle Database 10g: Backup and Recovery 6 - 13


Specifying Options for the DUPLICATE Command

You can specify the following options with the DUPLICATE


command:

Option Purpose

SKIP READONLY Exclude read-only tablespaces

Oracle Internal & Oracle Academy Use Only


SKIP TABLESPACE Exclude named tablespaces

NOFILENAMECHECK Prevent checking of file names

OPEN RESTRICTED Enable RESTRICTED SESSION automatically

Copyright © 2006, Oracle. All rights reserved.

Specifying Options for the DUPLICATE Command


Specify additional options when executing the DUPLICATE command as appropriate.
SKIP READONLY: Use to exclude read-only tablespace datafiles.
SKIP TABLESPACE: Use to exclude tablespaces from the target database. You cannot exclude
the SYSTEM tablespace or tablespaces containing undo or rollback segments.
NOFILENAMECHECK: Use to prevent RMAN from checking whether target database datafiles
with the same name as duplicate database datafiles are in use. You must specify this option
when the target database and duplicate database datafiles and redo log files use the same names.
You would typically use this when you create a duplicate database on a host that has the same
disk configuration, directory structure, and file names as the target database host. If you do not
specify NOFILENAMECHECK in this situation, RMAN returns an error.
OPEN RESTRICTED: Use to enable RESTRICTED SESSION automatically after the database
is opened.

Oracle Database 10g: Backup and Recovery 6 - 14


Using Enterprise Manager to Create a Duplicate
Database

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using Enterprise Manager to Create a Duplicate Database


You can also use Enterprise Manager to create a duplicate (clone) database. Select Clone
Database in the “Move Database Files” section of the Maintenance page. The Clone Database
Wizard steps you through the process of creating a duplicate database.
On the Source Type page, designate the source for the cloning operation. You can select a
current database instance or a saved working directory from a previous clone operation.

Oracle Database 10g: Backup and Recovery 6 - 15


Using Enterprise Manager: Source Working
Directory

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using Enterprise Manager: Source Working Directory


On the Source Working Directory page, specify the directory on the source host in which the
backup files are to be stored during the clone operation.
You can choose to delete or retain the backup set after the cloning procedure. The Clone
Database wizard automatically calculates the amount of temporary disk space required for
creating the new backup set and for retaining the backup set for future use.
On this page, you must also enter the operating host credentials.

Oracle Database 10g: Backup and Recovery 6 - 16


Using Enterprise Manager: Select Destination

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using Enterprise Manager: Select Destination


On the Select Destination page, specify the Global Database Name and Instance Name for the
duplicate database. Provide the host credentials for the destination and select the destination
Oracle Home.

Oracle Database 10g: Backup and Recovery 6 - 17


Using Enterprise Manager: Destination Options

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using Enterprise Manager: Destination Options


On the Destination Options page, specify the location for the database files. Confirm the location
for the Oracle Net configuration files. Specify login information for Enterprise Manager.
After completing this page and clicking Next, the Schedule page is displayed. Confirm the
schedule information and click Next.

Oracle Database 10g: Backup and Recovery 6 - 18


Using Enterprise Manager: Review Page

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using Enterprise Manager: Review Page


A complete description of the duplicate database is displayed on the Review page. Confirm that
all information is correct. Click Submit Job to create the duplicate database.

Oracle Database 10g: Backup and Recovery 6 - 19


Summary

In this lesson, you should have learned how to:


• Describe the ways a duplicate database can be used
• Configure auxiliary database file names
• Create a duplicate database

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 6 - 20


Practice Overview

This practice covers the following topics:


• Configuring an auxiliary instance
• Creating a duplicate database using the DUPLICATE
command

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 6 - 21


Oracle Internal & Oracle Academy Use Only
Performing Tablespace Point-in-Time
Recovery

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.
Objectives

After completing this lesson, you should be able to:


• Determine when to use tablespace point-in-time
recovery (TSPITR)
• Choose the correct TSPITR target time
• Perform basic RMAN tablespace point-in-time recovery

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 7 - 2


Tablespace Point-in-Time Recovery (TSPITR)
Concepts

• TSPITR enables you to quickly recover one or more


tablespaces to an earlier time.
• TSPITR does not affect the state of other tablespaces
or objects in the database.

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Tablespace Point-in-Time Recovery (TSPITR) Concepts


RMAN automatic tablespace point-in-time recovery (TSPITR) enables you to quickly recover
one or more tablespaces in an Oracle database to an earlier time, without affecting the state of
the other tablespaces and objects in the database.

Oracle Database 10g: Backup and Recovery 7 - 3


Tablespace Point-in-Time Recovery (TSPITR):
Terminology

• Target time: The point in time or SCN that the


tablespace will be recovered to
• Recovery set: Datafiles that compose the tablespaces
to be recovered
• Auxiliary set: Datafiles required for the TSPITR of the
recovery set that are not part of the recovery set. It

Oracle Internal & Oracle Academy Use Only


typically includes:
– SYSTEM tablespace
– Rollback or undo segment tablespaces
– Temporary tablespace
• Auxiliary destination: Disk location to store files

Copyright © 2006, Oracle. All rights reserved.

Tablespace Point-in-Time Recovery (TSPITR): Terminology


The following terminology is used when discussing TSPITR:
• Target time: The point in time or system change number (SCN) that the tablespace will be
recovered to during TSPITR
• Recovery set: Datafiles composing the tablespaces to be recovered
• Auxiliary set: Datafiles required for TSPITR of the recovery set that are not themselves
part of the recovery set. The auxiliary set typically includes:
- A copy of the SYSTEM tablespace
- Datafiles containing rollback or undo segments from the target instance
- In some cases, a temporary tablespace, used during the export of database objects from
the auxiliary instance
• Auxiliary destination: A location on disk that can be used to store any of the auxiliary set
datafiles, control files, and online logs of the auxiliary instance during TSPITR. Files stored
in the auxiliary destination can be deleted after TSPITR is complete.

Oracle Database 10g: Backup and Recovery 7 - 4


Tablespace Point-in-Time Recovery: Architecture

RMAN

Auxiliary instance

Oracle Internal & Oracle Academy Use Only


Control file

Restore
Datafile
Restore backups

Recover
1 Archived
redo log files Recovered tablespace
Target database
2

Copyright © 2006, Oracle. All rights reserved.

Tablespace Point-in-Time Recovery: Architecture


In the diagram, the following tablespace point-in-time recovery (TSPITR) entities are shown:
• Target database: Contains the tablespace to be recovered
• Control file: Provides the RMAN backup information
• Backup sets: Come from the target database and are the source of the reconstructed
tablespace
• Archived redo logs: Come from the target database and are the source of the reconstructed
tablespace
• Auxiliary instance: Is the Oracle database instance used during the recovery process to
perform the recovery
RMAN performs the following steps during tablespace point-in-time recovery (TSPITR):
1. Restores a backup control file from a point in time before the target time to the auxiliary
instance. It restores the datafiles for the recovery set to the target database and the datafiles
for the auxiliary set to the auxiliary instance.
2. Recovers the restored datafiles to the specified point in time

Oracle Database 10g: Backup and Recovery 7 - 5


Tablespace Point-in-Time Recovery: Architecture

RMAN
5
Import metadata

Oracle Internal & Oracle Academy Use Only


Export
file
Recovered
tablespace
Control file

Auxiliary instance
Target database
4 3
Export
Point to recovered tablespace metadata

Copyright © 2006, Oracle. All rights reserved.

Tablespace Point-in-Time Recovery Architecture (continued)


3. Exports the dictionary metadata about objects in the recovered tablespace to the target
database
4. Issues SWITCH commands on the target database so that the target database control file
points to the datafiles in the recovery set that were recovered on the auxiliary instance
5. Imports the dictionary metadata from the auxiliary instance to the target instance, allowing
the recovered objects to be accessed

Oracle Database 10g: Backup and Recovery 7 - 6


Understanding When to Use TSPITR

• TSPITR can be used in the following situations:


– To recover data lost after an erroneous TRUNCATE TABLE
statement
– To recover from logical corruption of a table
– To undo the effects of a batch job or DML statements
that have affected only a part of the database

Oracle Internal & Oracle Academy Use Only


– To recover a logical schema to a different point from the
rest of the physical database
• TSPITR cannot be used to:
– Recover a dropped tablespace
– Recover a renamed tablespace to a point before it was
renamed

Copyright © 2006, Oracle. All rights reserved.

Understanding When to Use TSPITR


RMAN TSPITR can be used to:
• Recover data lost after an erroneous TRUNCATE TABLE statement
• Recover from logical corruption of a table
• Undo the effects of an incorrect batch job or another DML statement that has affected only
a subset of the database
• Recover a logical schema to a different point in time than other parts of the physical
database

Oracle Database 10g: Backup and Recovery 7 - 7


Preparing for TSPITR

Perform the following steps to prepare for TSPITR:


• Determine the correct target time.
• Determine what is needed in the recovery set.
• Identify and preserve objects that will be lost after
TSPITR.

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Preparing for TSPITR


Before performing TSPITR, you need to determine the correct target time for your recovery.
You need to determine whether you need additional tablespaces in your recovery set. You
should evaluate what objects will be lost as a result of the TSPITR operation and determine how
you want to preserve those objects.
Each of these steps is discussed in more detail in this lesson.

Oracle Database 10g: Backup and Recovery 7 - 8


Determining the Correct Target Time

• You cannot perform TSPITR a second time unless you


are using a recovery catalog.
• After you perform TSPITR and bring the tablespace
online, you cannot use a backup from an earlier time.
• Use the following methods to determine the correct
target time:

Oracle Internal & Oracle Academy Use Only


– Flashback Query
– Flashback Transaction Query
– Flashback Version Query

Copyright © 2006, Oracle. All rights reserved.

Determining the Correct Target Time


It is extremely important that you choose the right target time or SCN for TSPITR. After you
bring a tablespace online after TSPITR, you cannot use any backup from a time earlier than the
moment you brought the tablespace online. In practice, this means that you cannot make a
second attempt at TSPITR if you choose the wrong target time the first time, unless you are
using a recovery catalog. If you have a recovery catalog, however, you can perform repeated
TSPITR operations to different target times.
The current control file does not contain a record of an older incarnation of the recovered
tablespace if you do not use a recovery catalog. Recovery with a current control file that
involves the tablespace cannot use a backup taken prior to the time when you brought the
tablespace online. However, you can perform incomplete recovery of the whole database to any
time prior to or equal to the time when you brought the tablespace online if you can restore a
backup control file from before that time.
You can use Oracle Flashback Query, Oracle Flashback Transaction Query, and Oracle
Flashback Version Query to investigate changes to your database and to help determine the
correct target time for TSPITR.

Oracle Database 10g: Backup and Recovery 7 - 9


Determining the Tablespaces for the Recovery
Set

• Use the TS_PITR_CHECK view to identify relationships


that span recovery set boundaries.
• If objects in the tablespace that you are recovering
have relationships with objects in other tablespaces,
you can:
– Add the tablespace that contains the related objects to

Oracle Internal & Oracle Academy Use Only


the recovery set
– Suspend the relationship for the duration of TSPITR
– Remove the relationship

Copyright © 2006, Oracle. All rights reserved.

Determining the Recovery Set


If you are unsure whether you have accounted for all objects that have relationships with the
objects in the tablespaces you are performing the TSPITR operation for, you can use the
TS_PITR_CHECK view to identify any additional objects. When you query this view,
information about any objects that will prevent you from proceeding with TSPITR is displayed.
The reason why tablespace point-in-time recovery cannot proceed is displayed in the REASON
column of the TS_PITR_CHECK view.
As an example, if you are planning to perform TSPITR for the USERS and EXAMPLE
tablespaces, execute the following query to determine whether there are any relationships with
objects in other tablespaces that are not accounted for:
SELECT * FROM SYS.TS_PITR_CHECK
WHERE (TS1_NAME IN ('USERS','EXAMPLE')
AND TS2_NAME NOT IN ('USERS','EXAMPLE'))
OR (TS1_NAME NOT IN ('USERS','EXAMPLE')
AND TS2_NAME IN ('USERS','EXAMPLE'));
Refer to the Oracle Database Backup and Recovery Advanced User’s Guide for additional
examples using the TS_PITR_CHECK view.

Oracle Database 10g: Backup and Recovery 7 - 10


Identifying Objects That Will Be Lost

• Objects created in the tablespace after the target


recovery time are lost.
• Query TS_PITR_OBJECTS_TO_BE_DROPPED to
determine which objects will be lost following TSPITR.
• Use Export prior to TSPITR and Import following
TSPTIR to preserve and re-create the lost objects.

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Identifying Objects That Will be Lost


Query the TS_PITR_OBJECTS_TO_BE_DROPPED view to determine whether there are any
objects that will be lost as a result of performing tablespace point-in-time recovery.
As an example, you are performing TSPITR for the USERS and EXAMPLE tablespaces to the
target time of April 3, 2006 at 8:30:00 a.m. Issue the following query to determine whether there
are any objects that will be lost following your TSPITR:
SELECT OWNER, NAME, TABLESPACE_NAME,
TO_CHAR(CREATION_TIME, 'YYYY-MM-DD:HH24:MI:SS')
FROM TS_PITR_OBJECTS_TO_BE_DROPPED
WHERE TABLESPACE_NAME IN ('USERS','EXAMPLE')
AND CREATION_TIME >
TO_DATE('2006-APR-03:08:30:00','YY-MON-DD:HH24:MI:SS')
ORDER BY TABLESPACE_NAME, CREATION_TIME;

Oracle Database 10g: Backup and Recovery 7 - 11


Performing Basic RMAN TSPITR

• Fully automated TSPITR:


– Specify an auxiliary destination.
– RMAN manages all aspects of TSPITR.
– This is the recommended method.
• Customized TSPITR with an automatic auxiliary
instance:

Oracle Internal & Oracle Academy Use Only


– This is based on fully automated TSPITR.
– Customize location of files.
– Specify initialization parameters.
– Specify channel configurations.
• TSPITR using your own auxiliary instance:
– Configure and manage the auxiliary instance.

Copyright © 2006, Oracle. All rights reserved.

Performing Basic RMAN TSPITR


You have the following options when performing TSPITR:
• Fully automated TSPITR: Specify an auxiliary destination and RMAN manages all
aspects of the TSPITR operation. This is the simplest way to perform TSPITR, and is
recommended unless you specifically need more control over the location of recovery set
files after TSPITR or auxiliary set files during TSPITR, or control over the channel
configurations or some other aspect of your auxiliary instance.
• Customized TSPITR with an automatic auxiliary instance: TSPITR is based on the
behavior of fully automated TSPITR, possibly still using an auxiliary destination. You can
customize one or more aspects of the behavior, such as the location of auxiliary set or
recovery set files. You can specify initialization parameters or channel configurations for
the auxiliary instance created and managed by RMAN.
• TSPITR with your own auxiliary instance: Set up, start, stop, and clean up the auxiliary
instance used in TSPITR. In addition, you can manage the TSPITR process using some of
the methods available in customized TSPITR with an automatic auxiliary instance.

Oracle Database 10g: Backup and Recovery 7 - 12


Performing Fully Automated TSPITR

• Configure channels required for TSPITR on the target


instance.
• Specify the auxiliary destination using the AUXILIARY
DESTINATION option .
RMAN> CONNECT TARGET
RMAN> RECOVER TABLESPACE users, example

Oracle Internal & Oracle Academy Use Only


> UNTIL TIME '2006-03-31:08:00:00'
> AUXILIARY DESTINATION
> '/u01/app/oracle/oradata/aux';

• Back up the recovered tablespaces and bring them


online.

Copyright © 2006, Oracle. All rights reserved.

Performing Fully Automated TSPITR


In addition to the preparation requirements discussed earlier in the lesson, when you perform
fully automated TSPITR, you must:
• Configure any channels required for TSPITR on the target instance
• Specify a destination for RMAN to use for the auxiliary set of datafiles and other auxiliary
instance files
After TSPITR has completed, back up the recovered tablespaces and bring them online. You
cannot use backups of any tablespaces that participate in TSPITR taken prior to TSPITR after
you perform TSPITR.

Oracle Database 10g: Backup and Recovery 7 - 13


Using Enterprise Manager to Perform TSPITR

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using Enterprise Manager to Perform TSPITR


You can also use Enterprise Manager to perform TSPITR. Select Perform Recovery in the High
Availability section on the Maintenance page. In the Object Level Recovery section, select
Tablespaces in the Object Type menu and click Perform Object Level Recovery. You are
stepped through the TSPITR process.

Oracle Database 10g: Backup and Recovery 7 - 14


Understanding TSPITR Processing

RMAN performs the following steps:


1. Creates the auxiliary instance, starts it, and connects
to it
2. Takes the tablespaces that will be recovered offline
3. Restores a backup control file from a point in time
before the target time to the auxiliary instance

Oracle Internal & Oracle Academy Use Only


4. Restores the datafiles from the recovery set to the
target database and the auxiliary set to the auxiliary
instance
5. Recovers the restored datafiles to the specified time
6. Opens the auxiliary database with the RESETLOGS
option

Copyright © 2006, Oracle. All rights reserved.

Understanding TSPITR Processing


The steps that RMAN carries out to perform TSPITR are listed on this page and the next.

Oracle Database 10g: Backup and Recovery 7 - 15


Understanding TSPITR Processing

7. Exports the dictionary metadata about objects in the


recovered tablespaces to the target database
8. Shuts down the auxiliary instance
9. Imports the dictionary metadata from the auxiliary
instance to the target instance
10. Deletes all auxiliary set files

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Understanding TSPITR Processing (continued)


After RMAN completes the last step, the TSPITR process is complete. The recovery set datafiles
are returned to the state they were in at the specified target time.

Oracle Database 10g: Backup and Recovery 7 - 16


Performing Customized RMAN TSPITR with an
RMAN-Managed Auxiliary Instance

• Rename or relocate your recovery set datafiles.


• Specify a location other than the auxiliary destination
for some or all of the auxiliary set datafiles.
• Create image copy backups of your datafiles in
advance of TSPITR.
• Use a different channel configuration for the auxiliary

Oracle Internal & Oracle Academy Use Only


instance.
• Specify different initialization parameters for your
RMAN-managed auxiliary instance.

Copyright © 2006, Oracle. All rights reserved.

Performing Customized RMAN TSPITR with an RMAN-Managed Auxiliary Instance


If you want to customize RMAN TSPITR, you can use an RMAN-managed auxiliary instance
and make the following changes:
• Rename the recovery set datafiles using SET NEWNAME so that they are not restored and
recovered in their original locations.
• Control the location of your auxiliary set datafiles by specifying new names for individual
files with SET NEWNAME and using DB_FILE_NAME_CONVERT to provide rules for
converting datafile names in the target database to datafile names for the auxiliary database.
• Use existing image copies of the recovery set and auxiliary set datafiles on disk rather than
restoring them from backup for faster RMAN TSPITR performance.
Refer to the Oracle Database Backup and Recovery Advanced User’s Guide for additional
information.

Oracle Database 10g: Backup and Recovery 7 - 17


Performing RMAN TSPITR Using Your Own
Auxiliary Instance

• Not recommended, but supported


• Perform the following steps:
1. Create an Oracle password file for the auxiliary instance.
2. Create an initialization parameter file for the auxiliary
instance.
3. Verify Oracle Net connectivity to the auxiliary instance.

Oracle Internal & Oracle Academy Use Only


4. Start the auxiliary instance in NOMOUNT mode.
5. Connect the RMAN client to the target and auxiliary
instances.
6. Execute the RECOVER TABLESPACE command.

Copyright © 2006, Oracle. All rights reserved.

Performing RMAN TSPITR Using Your Own Auxiliary Instance


Oracle recommends that you allow RMAN to manage the creation and destruction of the
auxiliary instance used during RMAN TSPITR. However, creating and using your own auxiliary
instance is supported.
Perform the following steps to create an Oracle instance suitable for use as an auxiliary instance:
1. Create an Oracle password file for the auxiliary instance using the orapwd utility.
2. Create a text initialization parameter file for the auxiliary instance.
3. Verify Oracle Net connectivity to the auxiliary instance using a valid net service name.
To perform TSPITR, complete the following steps:
1. Start the auxiliary instance in NOMOUNT mode.
2. Connect the RMAN client to target and auxiliary instances.
3. Execute the RECOVER TABLESPACE command.
Refer to the Oracle Database Backup and Recovery Advanced User’s Guide for a detailed
example.

Oracle Database 10g: Backup and Recovery 7 - 18


Troubleshooting RMAN TSPITR

• Filename conflicts: Ensure that there are no name


conflicts when using SET NEWNAME, CONFIGURE
AUXNAME, and DB_FILE_NAME_CONVERT.
• Insufficient sort space during Export: Increase the sort
space.
• RMAN cannot identify tablespaces with undo

Oracle Internal & Oracle Academy Use Only


segments: Use the UNDO TABLESPACE clause.
• Restarting a manual auxiliary instance after TSPITR
failure: Shut down and restart in NOMOUNT mode.

Copyright © 2006, Oracle. All rights reserved.

Troubleshooting RMAN TSPITR


File name conflicts: If your use of SET NEWNAME, CONFIGURE AUXNAME, and
DB_FILE_NAME_CONVERT cause multiple files in the auxiliary or recovery sets to have the
same name, you receive an error during TSPITR. To correct the problem, specify different
values for these parameters to eliminate the duplicate name.
Insufficient sort space during Export: When RMAN exports the metadata about recovered
objects from the auxiliary instance, it uses space in the temporary tablespace for sorting. If there
is insufficient space in the temporary tablespace for the sorting operation, you need to increase
the amount of sort space available. Edit the recover.bsq file, found in
$ORACLE_HOME/rdbms/admin, to remove the comment characters from the following lines
in the file:
sql clone "create tablespace aux_tspitr_tmp
datafile ''/tmp/aux_tspitr_tmp.dbf'' size 500K";

Oracle Database 10g: Backup and Recovery 7 - 19


Troubleshooting RMAN TSPITR (continued)
RMAN cannot identify tablespaces with undo segments: During TSPITR, RMAN needs
information about which tablespaces had undo segments at the TSPITR target time. This
information is usually available in the recovery catalog, if one is used. If there is no recovery
catalog, or if the information is not found in the recovery catalog, RMAN proceeds assuming
that the set of tablespaces with undo segments at the target time is the same as the set of
tablespaces with undo segments at the present time. If this assumption is not correct, the TSPITR
operation fails and an error is reported. To prevent this from happening, provide a list of
tablespaces with undo segments at the target time in the UNDO TABLESPACE clause.
Restarting manual auxiliary instance after TSPITR failure: If you are managing your own
auxiliary instance and there is a failure in TSPITR, then before you can retry TSPITR, you must
shut down the auxiliary instance, correct the problem, and put the auxiliary instance back in
NOMOUNT mode.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery 7 - 20


Summary

In this lesson, you should have learned how to:


• Determine when to use tablespace point-in-time
recovery
• Choose the correct target
• Perform basic RMAN tablespace point-in-time recovery

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 7 - 21


Practice Overview

This practice covers using RMAN to perform TSPITR.

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 7 - 22


Using the RMAN Recovery Catalog

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.
Objectives

After completing this lesson, you should be able to:


• Create the recovery catalog
• Manage the recovery catalog
• Resynchronize the recovery catalog
• Use stored scripts

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 8 - 2


RMAN Repository Data Storage:
Comparison of Options

Control file: Recovery catalog:


• Simpler administration • Replicates control file data
• Default • Has room for more data
• Can service many targets
• Can store RMAN scripts

Oracle Internal & Oracle Academy Use Only


Metadata
Backup set list
Image copy list
.
.
.

Copyright © 2006, Oracle. All rights reserved.

RMAN Repository Data Storage: Comparison of Options


The RMAN repository data is always stored in the control file of the target database. But it can
also be stored in a separate database, called a recovery catalog.
A recovery catalog preserves backup information in a separate database, which is useful in the
event of a lost control file. This allows you to store a longer history of backups than what is
possible with a control file–based repository. A single recovery catalog is able to store
information for multiple target databases. The recovery catalog can also hold RMAN stored
scripts, which are sequences of RMAN commands for common backup tasks. Centralized
storage of scripts in the recovery catalog can be more convenient than working with command
files.
Using a separate recovery catalog database is not recommended for small installations where
administration of a separate recovery catalog database would be burdensome.

Oracle Database 10g: Backup and Recovery 8 - 3


Storing Information in the Recovery Catalog

Recovery
Manager
(RMAN)

Oracle Internal & Oracle Academy Use Only


Database structure
Archived redo logs
Target database Backup sets Recovery catalog
control file Datafile copies database

Copyright © 2006, Oracle. All rights reserved.

Storing Information in the Recovery Catalog


RMAN propagates information about the database structure, archived redo logs, backup sets,
and datafile copies into the recovery catalog from the target database’s control file after any
operation that updates the repository, and also before certain operations.

Oracle Database 10g: Backup and Recovery 8 - 4


Reasons to Use a Recovery Catalog

• Stores more historical information than the control file


• Provides backup history needed for a recovery that
goes further back in time than the history in the control
file
• Enables you to use RMAN stored scripts
• Enables you to create customized reports for all

Oracle Internal & Oracle Academy Use Only


registered targets
• Enables you to use the KEEP FOREVER clause of the
BACKUP command

Copyright © 2006, Oracle. All rights reserved.

Reasons to Use a Recovery Catalog


Although you can use the control file as the sole repository for RMAN, it has finite space for
records of backup activities. When you use a recovery catalog, you can store a much longer
history of backups. This enables you to perform a recovery that goes back further in time than
the history in the control file.
If you want to use RMAN stored scripts, you must use a recovery catalog.
When you use a recovery catalog, the backup and recovery information for all registered
targets is contained in one place allowing you to create customized reports by connecting as
the recovery catalog owner and querying the various RC_ views. If you do not use a recovery
catalog, you must connect to each target database instance separately and query the V$ views
for the RMAN information in the target control file.
You can use the BACKUP ... KEEP command to create a backup that is retained for a
different period of time from that specified by the configured retention policy. The KEEP
FOREVER clause specifies that the backup or copy never expires and requires the use of a
recovery catalog so that the backup records can be maintained indefinitely.

Oracle Database 10g: Backup and Recovery 8 - 5


Creating the Recovery Catalog: Three Steps

Oracle Internal & Oracle Academy Use Only


Configure the Create the
Create the
recovery catalog recovery catalog
recovery catalog.
database. owner.

Copyright © 2006, Oracle. All rights reserved.

Creating the Recovery Catalog: Three Steps


Perform the following three steps to create a recovery catalog:
1. Configure the database in which you will store the recovery catalog.
2. Create the recovery catalog owner.
3. Create the recovery catalog.

Oracle Database 10g: Backup and Recovery 8 - 6


Configuring the Recovery Catalog Database

• Allocate space for the recovery catalog. Consider:


– The number of databases supported by the recovery
catalog
– Number of archived redo log files and backups recorded
– Use of RMAN stored scripts
• Space is needed for default tablespace for recovery

Oracle Internal & Oracle Academy Use Only


catalog owner schema.
• Create a tablespace for the recovery catalog.

Copyright © 2006, Oracle. All rights reserved.

Configuring the Recovery Catalog Database


Determine in which database you will install the recovery catalog schema. Be sure to consider
your backup and recovery procedures for this database.
The amount of space required by the recovery catalog schema depends upon the number of
databases monitored by the catalog. The space increases as the number of archived redo log
files and backups for each database increases. If you use RMAN stored scripts, space must be
allocated for those scripts. The typical space requirement is 15 MB for each database
registered in the recovery catalog.

Oracle Database 10g: Backup and Recovery 8 - 7


Creating the Recovery Catalog Owner

1. Create the recovery catalog


owner.
2. Grant the
RECOVERY_CATALOG_OWNER
role.

Oracle Internal & Oracle Academy Use Only


SQL> CREATE USER rcowner IDENTIFIED BY rcpass
2 TEMPORARY TABLESPACE temp
3 DEFAULT TABLESPACE tools
4 QUOTA UNLIMITED ON tools;
SQL> GRANT recovery_catalog_owner TO rcowner;

Copyright © 2006, Oracle. All rights reserved.

Creating the Recovery Catalog Owner


Create a user to serve as the recovery catalog owner. Set the default tablespace for this user to
the tablespace you created for the recovery catalog. Be sure to provide UNLIMITED quota on
this tablespace for the user. After you have created the user, grant the
RECOVERY_CATALOG_OWNER role to the user. The RECOVERY_CATALOG_OWNER role
provides privileges for the owner of the recovery catalog. The role includes the following
system privileges: ALTER SESSION, CREATE CLUSTER, CREATE DATABASE LINK,
CREATE PROCEDURE, CREATE SEQUENCE, CREATE SESSION, CREATE SYNONYM,
CREATE TABLE, CREATE TRIGGER, CREATE TYPE, and CREATE VIEW.
You can use SQL commands or Enterprise Manager to create the user and grant the role.

Oracle Database 10g: Backup and Recovery 8 - 8


Creating the Recovery Catalog

1. Connect to the recovery catalog database as the


catalog owner:
$ rman
RMAN> CONNECT CATALOG username/password@net_service_name

2. Execute the CREATE CATALOG command:

Oracle Internal & Oracle Academy Use Only


RMAN> CREATE CATALOG;

Copyright © 2006, Oracle. All rights reserved.

Creating the Recovery Catalog


After creating the catalog owner, use the RMAN CREATE CATALOG command to create the
catalog tables in the default tablespace of the catalog owner.

Oracle Database 10g: Backup and Recovery 8 - 9


Managing Target Database Records in the
Recovery Catalog

• Registering a database in the recovery catalog


• Cataloging additional backup files
• Unregistering a target database from the recovery
catalog

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Managing Target Database Records in the Recovery Catalog


Although most information is automatically propagated from the control file to the recovery
catalog, there are a few operations you may need to perform to maintain target database
records in the recovery catalog.

Oracle Database 10g: Backup and Recovery 8 - 10


Registering a Database in the Recovery Catalog

RMAN performs the following actions:


• Creates rows in the recovery catalog tables for the
target database
• Copies data from the target database control file to the
recovery catalog tables
• Synchronizes the recovery catalog with the control file

Oracle Internal & Oracle Academy Use Only


$ rman TARGET / CATALOG
username/password@net_service_name
RMAN> REGISTER DATABASE;

Copyright © 2006, Oracle. All rights reserved.

Registering a Database in the Recovery Catalog


After creating the recovery catalog, you must register the target databases in the recovery
catalog. Perform the following steps to register your target database:
1. Invoke RMAN and connect to the recovery catalog database and to the target database as
shown in the following example:
% rman TARGET / CATALOG rman/rman@reccatdb
2. Ensure that the target database is mounted or open.
3. Register the target database in the recovery catalog by issuing the REGISTER command:
RMAN> REGISTER DATABASE;

Oracle Database 10g: Backup and Recovery 8 - 11


Using Enterprise Manager to Register a Database

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using Enterprise Manager to Register a Database


Select Recovery Catalog Settings in the Backup/Recovery Settings section of the Maintenance
page. Click Add Recovery Catalog to specify the host, port, and SID of a database with an
existing recovery catalog.

Oracle Database 10g: Backup and Recovery 8 - 12


Using Enterprise Manager to Register a Database

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using Enterprise Manager to Register a Database


After you have defined the recovery catalog database, select “Use Recovery Catalog” on the
Recovery Catalog Setting page to register the database in the recovery catalog database.

Oracle Database 10g: Backup and Recovery 8 - 13


Unregistering a Target Database from the
Recovery Catalog

• This removes information about the target database


from the recovery catalog.
• Use this when you no longer want the target database
to be defined in the recovery catalog.

$ rman TARGET / CATALOG

Oracle Internal & Oracle Academy Use Only


username/password@net_service_name
RMAN> UNREGISTER DATABASE;

Copyright © 2006, Oracle. All rights reserved.

Unregistering a Target Database from the Recovery Catalog


When you unregister a database from the recovery catalog, all RMAN repository records in the
recovery catalog are lost. You can reregister the database. The recovery catalog records for
that database are then based on the contents of the control file at the time of reregistration.
Typically, you would unregister a target database only if you no longer want to use the
recovery catalog for that database or the database no longer exists.
Note: If you have used Enterprise Manager Database Control to register your database, you
must use it again to unregister your database.

Oracle Database 10g: Backup and Recovery 8 - 14


Cataloging Additional Backup Files

• CATALOG can be used to catalog existing backup files


that are no longer listed in the control file.
• This enables RMAN to use the files during a restore
operation.
• Use the CATALOG command to add the following types
of backup files to the recovery catalog:

Oracle Internal & Oracle Academy Use Only


– Control file copies
– Datafile copies
– Backup pieces
– Archived redo log files

RMAN> CATALOG BACKUPPIECE 'file_name';

Copyright © 2006, Oracle. All rights reserved.

Cataloging Additional Backup Files


If you have additional control file copies, datafile copies, backup pieces, or archived redo log
files on disk, you can catalog them in the recovery catalog by using the CATALOG command.
If backups have aged out of the control file, you can catalog them so that RMAN can use them
during a restore operation.
Examples of cataloging a control file, datafile, archived redo log file, and backup piece follow:
RMAN> CATALOG CONTROLFILECOPY
'/disk1/controlfile_bkup/2006_01_01/control01.ctl';
RMAN> CATALOG DATAFILECOPY
'/disk1/datafile_bkup/2006_01_01/users01.dbf';
RMAN> CATALOG ARCHIVELOG
'/disk1/arch_logs/archive1_731.log',
'/disk1/arch_logs/archive1_732.log';
RMAN> CATALOG BACKUPPIECE '/disk1/backups/backup_820.bkp';
You can catalog all files in the currently enabled Flash Recovery Area as follows:
RMAN> CATALOG RECOVERY AREA NOPROMPT;
Use the following command to catalog all valid backups in the specified location:
RMAN> CATALOG START WITH '/tmp/arch_logs';

Oracle Database 10g: Backup and Recovery 8 - 15


Manually Resynchronizing the Recovery Catalog

Manually resynchronize the recovery catalog in the


following situations:
• After the recovery catalog was unavailable for RMAN to
automatically resynchronize it
• When you perform infrequent backups of your target
database

Oracle Internal & Oracle Academy Use Only


• After making changes to the physical structure of the
target database

RMAN> RESYNC CATALOG;

Copyright © 2006, Oracle. All rights reserved.

Manually Resynchronizing the Recovery Catalog


When RMAN performs a resynchronization, it compares the recovery catalog to either the
current control file of the target database or a backup control file and updates the recovery
catalog with information that is missing or changed. When resynchronizing, RMAN does the
following:
1. Creates a snapshot control file
2. Compares the recovery catalog to the snapshot control file
3. Updates the recovery catalog with missing or changed information
Note: Refer to the Backup and Recovery Advanced User’s Guide for detailed information
about records that are updated during resynchronization.
RMAN automatically performs full or partial resynchronizations in most situations in which
they are needed.
Perform a manual resynchronization of the recovery catalog in the following situations:
• If the recovery catalog was unavailable when you issued RMAN commands that cause a
partial resynchronization
• If you perform infrequent backups of your target database because the recovery catalog is
not updated automatically when a redo log switch occurs or when a redo log is archived
• After making any change to the physical structure of the target database

Oracle Database 10g: Backup and Recovery 8 - 16


Using RMAN Stored Scripts

• Stored scripts are an alternative to command files


stored on a specific system.
• Stored scripts are available to any RMAN client that
can connect to the target database and recovery
catalog.
• Two types of RMAN stored scripts:

Oracle Internal & Oracle Academy Use Only


– Local: Associated with the target database to which
RMAN is connected when the script is created
– Global: Can be executed against any database registered
in the recovery catalog

Copyright © 2006, Oracle. All rights reserved.

Using Stored Scripts


You can use RMAN stored scripts as an alternative to command files for managing frequently
used sequences of RMAN commands. Unlike command files that are available only on the
system on which they are stored, a stored script is always available to any RMAN client that
can connect to the target database and recovery catalog.
Stored scripts can be defined as global or local. A local stored script is associated with the
target database to which RMAN is connected when the script is created, and can be executed
only when you are connected to that target database. A global stored script can be executed
against any database registered in the recovery catalog, if the RMAN client is connected to the
recovery catalog and a target database.

Oracle Database 10g: Backup and Recovery 8 - 17


Creating RMAN Stored Scripts

• Creating a local script:


CREATE SCRIPT script_name
{
<RMAN commands>
}
• Creating a global script:

Oracle Internal & Oracle Academy Use Only


CREATE GLOBAL SCRIPT script_name
{
<RMAN commands>
}
• Creating a script from a text file:

CREATE SCRIPT script_name FROM FILE 'file_name';

Copyright © 2006, Oracle. All rights reserved.

Creating Stored Scripts


Connect to the desired target database and the recovery catalog and execute the CREATE
SCRIPT command to create a stored script.

Oracle Database 10g: Backup and Recovery 8 - 18


Executing RMAN Stored Scripts

• Executing a script:
RUN { EXECUTE SCRIPT
script_name
; }

• Executing a global script:

Oracle Internal & Oracle Academy Use Only


RUN { EXECUTE GLOBAL SCRIPT
script_name
; }

Copyright © 2006, Oracle. All rights reserved.

Executing Stored Scripts


Connect to the target database and recovery catalog, and use the EXECUTE SCRIPT
command to execute a stored script. Note that the EXECUTE SCRIPT command requires a
RUN block. If an RMAN command in the script fails, subsequent RMAN commands in the
script will not execute.
When you execute the script, it will use the automatic channels configured at the time. Use
ALLOCATE CHANNEL commands in the script if you need to override the configured channels
as shown in the following example:
RMAN> RUN
{
ALLOCATE CHANNEL ch1 DEVICE TYPE DISK;
ALLOCATE CHANNEL ch2 DEVICE TYPE DISK;
ALLOCATE CHANNEL ch3 DEVICE TYPE DISK;
EXECUTE SCRIPT full_backup;
}

Oracle Database 10g: Backup and Recovery 8 - 19


Displaying RMAN Stored Script Information

• Displaying a script:

PRINT [GLOBAL] SCRIPT script_name;

• Sending the contents of a script to a file:


PRINT [GLOBAL] SCRIPT script_name

Oracle Internal & Oracle Academy Use Only


TO FILE 'file_name';

• Displaying the names of defined scripts:

LIST [GLOBAL] SCRIPT NAMES;

Copyright © 2006, Oracle. All rights reserved.

Displaying Stored Script Information


Connect to the target database and recovery catalog and use the PRINT SCRIPT command to
display a stored script or write it out to a file.
Use the LIST SCRIPT NAMES command to display the names of scripts defined in the
recovery catalog. This command displays the names of all stored scripts, both global and local,
that can be executed for the target database to which you are currently connected.

Oracle Database 10g: Backup and Recovery 8 - 20


Updating and Deleting RMAN Stored Scripts

• Updating a script:

REPLACE [GLOBAL] SCRIPT script_name


{
<RMAN commands> ;
}

Oracle Internal & Oracle Academy Use Only


• Updating a script from a file:
REPLACE [GLOBAL] SCRIPT script_name
FROM FILE 'file_name';

• Deleting a script:

DELETE SCRIPT script_name;

Copyright © 2006, Oracle. All rights reserved.

Updating and Deleting Stored Scripts


Connect to the target database and recovery catalog and use the REPLACE SCRIPT command
to update stored scripts. RMAN creates the script if it does not exist.
To delete a stored script from the recovery catalog, connect to the catalog and a target
database, and use the DELETE SCRIPT command.

Oracle Database 10g: Backup and Recovery 8 - 21


Backing Up and Recovering the Recovery Catalog

• Include the recovery catalog in your overall backup


and recovery strategy.
• Backup guidelines:
– Set the retention policy to a REDUNDANCY value greater
than 1.
– Configure the control file autobackup feature to ON.

Oracle Internal & Oracle Academy Use Only


– Back up the database onto two separate media.
– Execute BACKUP DATABASE PLUS ARCHIVELOG at regular
intervals.
– Do not use another recovery catalog as the repository for
the backups.

Copyright © 2006, Oracle. All rights reserved.

Backing Up and Recovering the Recovery Catalog


Because the recovery catalog resides in a database, your backup and recovery strategy for the
recovery catalog should be included in your overall backup and recovery strategy.
Never store a recovery catalog containing the RMAN repository for a database in the same
database as the target database or on the same disks as the target database. A recovery catalog
is only effective if it is separated from the data that it is designed to protect.
Logical backups of the RMAN recovery catalog created with one of Oracle’s export utilities
can be a useful supplement for physical backups. You can import the exported recovery
catalog data into another database and rebuild the catalog.

Oracle Database 10g: Backup and Recovery 8 - 22


Re-creating an Unrecoverable Recovery Catalog

To partially re-create the contents of a lost recovery


catalog, use the following commands:
• RESYNC CATALOG command: Updates the recovery
catalog with any RMAN repository information from the
control file of the target database or a control file copy
• CATALOG START WITH command: Recatalogs any

Oracle Internal & Oracle Academy Use Only


available backups

Copyright © 2006, Oracle. All rights reserved.

Re-creating an Unrecoverable Recovery Catalog


If the recovery catalog database is lost or damaged, and recovery of the recovery catalog
database through the normal Oracle recovery procedures is not possible, then you must
re-create the catalog.
You can use the following commands to partially repopulate the contents of the recovery
catalog:
• RESYNC CATALOG: Use this command to update the recovery catalog with any RMAN
repository information from the control file of the target database or a control file copy.
Note that any metadata from control file records that aged out of the control file is lost.
• CATALOG START WITH... : Use this command to recatalog any available backups.

Oracle Database 10g: Backup and Recovery 8 - 23


Exporting and Importing the Recovery Catalog

Use the Export and Import utilities or the Data Pump


utilities to:
• Move the recovery catalog from one database to
another
• Create a logical backup of the RMAN recovery catalog

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Exporting and Importing the Recovery Catalog


You can use Export and Import to move the recovery catalog from one database to another.
You can also create an export of the recovery catalog to serve as a logical backup.
Perform the following steps to export a recovery catalog from one database and import the
catalog into a second database:
1. Use one of the Oracle Export utilities to export the catalog data from the database.
2. Create a recovery catalog user on the database you are exporting to and grant the user
necessary privileges.
3. Use the corresponding import utility to import the catalog data into the schema created in
step 2.
You should not execute the CREATE CATALOG command before or after importing the
catalog into the database. The import operation creates the catalog in the second database.
Note: The recovery catalog can be backed up and moved to another database by using Export
and Import or Data Pump as a transportable tablespace, as well as using logical methods.

Oracle Database 10g: Backup and Recovery 8 - 24


Upgrading the Recovery Catalog

To upgrade the recovery catalog to the version required


by the RMAN client, use the UPGRADE CATALOG command:

UPGRADE CATALOG;

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Upgrading the Recovery Catalog


If you use a version of the recovery catalog that is older than that required by the RMAN
client, then you must upgrade it by executing the UPGRADE CATALOG command.
Note: To install the new recovery catalog schema, the recovery catalog user must have TYPE
privilege.
You must be connected to the catalog database, and the catalog database must be open. You do
not have to be connected to the target database.
You must enter the UPGRADE command a second time to confirm the upgrade.
You will receive an error if the recovery catalog is already at a version greater than needed by
the RMAN executable. RMAN permits the command to be run if the recovery catalog is
current however, so that the packages can be re-created if necessary.
RMAN displays all error messages generated during the upgrade in the message log.

Oracle Database 10g: Backup and Recovery 8 - 25


Dropping the Recovery Catalog

To drop the recovery catalog schema, use the DROP


CATALOG command:

DROP CATALOG;

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Dropping the Recovery Catalog


If you no longer want to maintain a recovery catalog, you can drop the recovery catalog
schema from the tablespace with the DROP CATALOG command. Dropping the catalog deletes
the recovery catalog record of backups for all target databases registered in the catalog.
Note: Execute this command only at the RMAN prompt.
You must be connected to the recovery catalog database through the CATALOG command-line
option or the CONNECT CATALOG command. The catalog database must be open. You do not
have to be connected to the target database.
Enter the command twice to confirm that you want to drop the schema.

Oracle Database 10g: Backup and Recovery 8 - 26


Summary

In this lesson, you should have learned how to:


• Create the recovery catalog
• Manage the recovery catalog
• Resynchronize the recovery catalog
• Use stored scripts

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 8 - 27


Practice Overview

This practice covers the following topics:


• Creating the recovery catalog
• Resynchronizing the recovery catalog
• Creating and executing a stored script

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 8 - 28


Monitoring and Tuning RMAN

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.
Objectives

After completing this lesson, you should be able to:


• Monitor RMAN jobs
• Troubleshoot RMAN operations
• Tune RMAN backup performance

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 9 - 2


Monitoring RMAN Sessions

• Query V$SESSION and V$PROCESS to identify the


relationship between server sessions and RMAN
channels.
• If you are monitoring multiple sessions, use the SET
COMMAND ID command to correlate a process with a
channel during a backup.

Oracle Internal & Oracle Academy Use Only


SQL> COLUMN CLIENT_INFO FORMAT a30
SQL> COLUMN SID FORMAT 999
SQL> COLUMN SPID FORMAT 9999
SQL> SELECT s.sid, p.spid, s.client_info
2 FROM v$process p, v$session s
3 WHERE p.addr = s.paddr
4 AND CLIENT_INFO LIKE 'rman%';

Copyright © 2006, Oracle. All rights reserved.

Monitoring RMAN Sessions


To identify which server sessions correspond to which RMAN channels, you can query
V$SESSION and V$PROCESS. The SPID column of V$PROCESS identifies the operating
system ID number for the process or the thread. On UNIX, the SPID column shows the
process ID. On Windows, the SPID column shows the thread ID. There are two basic methods
for obtaining this information, depending on whether you have multiple RMAN sessions
active concurrently. When only one RMAN session is active, execute the following query on
the target database while the RMAN job is running:
SQL> COLUMN CLIENT_INFO FORMAT a30
SQL> COLUMN SID FORMAT 999
SQL> COLUMN SPID FORMAT 9999
SQL> SELECT s.sid, p.spid, s.client_info
2 FROM v$process p, v$session s
3 WHERE p.addr = s.paddr
4 AND CLIENT_INFO LIKE 'rman%';
SID SPID CLIENT_INFO
---- ------------ ------------------------------
15 2714 rman channel=ORA_SBT_TAPE_1
13 2715 rman channel=ORA_SBT_TAPE_2

Oracle Database 10g: Backup and Recovery 9 - 3


Monitoring RMAN Sessions (continued)
When multiple RMAN sessions are running, it will help to correlate a process with a channel
during a backup by using the SET COMMAND ID command as shown below:
1. In each session, set the COMMAND ID to a different value after allocating the channels and
then back up the desired object. For example, enter the following in session 1:
RUN
{
ALLOCATE CHANNEL c1 TYPE sbt;
SET COMMAND ID TO 'sess1';
BACKUP DATABASE;
}

Set the command ID to a string such as sess2 in the job running in session 2:

Oracle Internal & Oracle Academy Use Only


RUN
{
ALLOCATE CHANNEL c1 TYPE sbt;
SET COMMAND ID TO 'sess2';
BACKUP DATABASE;
}
2. Start a SQL*Plus session and then query the joined V$SESSION and V$PROCESS views
while the RMAN job is being executed. For example, enter:

SELECT SID, SPID, CLIENT_INFO


FROM V$PROCESS p, V$SESSION s
WHERE p.ADDR = s.PADDR
AND CLIENT_INFO LIKE '%id=sess%';

If you run the SET COMMAND ID command in the RMAN job, then the CLIENT_INFO
column displays in the following format:
id=command_id,rman channel=channel_id
For example, the following shows a sample output:

SID SPID CLIENT_INFO


---- ------------ ------------------------------
11 8358 id=sess1
15 8638 id=sess2
14 8374 id=sess1,rman channel=c1
9 8642 id=sess2,rman channel=c1

Oracle Database 10g: Backup and Recovery 9 - 4


Monitoring RMAN Job Progress

Monitor the progress of backup and restore operations by


querying V$SESSION_LONGOPS.
SQL> SELECT SID, SERIAL#, CONTEXT, SOFAR, TOTALWORK,
2 ROUND(SOFAR/TOTALWORK*100,2) "%_COMPLETE"
3 FROM V$SESSION_LONGOPS
4 WHERE OPNAME LIKE 'RMAN%'

Oracle Internal & Oracle Academy Use Only


5 AND OPNAME NOT LIKE '%aggregate%'
6 AND TOTALWORK != 0
7 AND SOFAR <> TOTALWORK;

SID SERIAL# CONTEXT SOFAR TOTALWORK %_COMPLETE


--- ------- ------- ------- --------- ----------
13 75 1 9470 15360 61.65
12 81 1 15871 28160 56.36

Copyright © 2006, Oracle. All rights reserved.

Monitoring RMAN Job Progress


Monitor the progress of backups, copies, and restores by querying the
V$SESSION_LONGOPS view. RMAN uses detail and aggregate rows in
V$SESSION_LONGOPS. Detail rows describe the files that are being processed by one job
step. Aggregate rows describe the files that are processed by all job steps in an RMAN
command. A job step is the creation or restore of one backup set or datafile copy. The detail
rows are updated with every buffer that is read or written during the backup step, so their
granularity of update is small. The aggregate rows are updated when each job step is
completed, so their granularity of update is large.
Note: Set the STATISTICS_LEVEL parameter to TYPICAL (the default value) or ALL to
populate the V$SESSION_LONGOPS view.
The relevant columns in V$SESSION_LONGOPS for RMAN include:
• SID: The server session ID corresponding to an RMAN channel
• SERIAL#: The server session serial number. This value changes each time a server
session is reused.
• OPNAME: A text description of the row. Detail rows include RMAN:datafile copy,
RMAN:full datafile backup, and RMAN:full datafile restore.
• CONTEXT: For backup output rows, the value of this column is 2. For all the other rows
except proxy copy (which does not update this column), the value is 1.
Oracle Database 10g: Backup and Recovery 9 - 5
Monitoring RMAN Job Progress (continued)
• SOFAR: For image copies, the number of blocks that have been read; for backup input
rows, the number of blocks that have been read from the files that are being backed up;
for backup output rows, the number of blocks that have been written to the backup piece;
for restores, the number of blocks that have been processed to the files that are being
restored in this one job step; and for proxy copies, the number of files that have been
copied
• TOTALWORK: For image copies, the total number of blocks in the file; for backup input
rows, the total number of blocks to be read from all files that are processed in this job
step; for backup output rows, the value is 0 because RMAN does not know how many
blocks that it will write into any backup piece; for restores, the total number of blocks in
all files restored in this job step; and for proxy copies, the total number of files to be
copied in this job step

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery 9 - 6


Monitoring RMAN Job Performance

• The following views can be used to monitor backup


and restore performance:
– V$BACKUP_SYNC_IO
– V$BACKUP_ASYNC_IO
• The following rows will exist for a backup or restore:
– One row for each datafile

Oracle Internal & Oracle Academy Use Only


– One aggregate datafile row
– One row for each backup piece
• Whether or not I/O is synchronous depends on how
the controlling process views it.

Copyright © 2006, Oracle. All rights reserved.

Monitoring RMAN Job Performance


The maximum backup speed is limited by the available hardware. It is not possible to back up
any faster than the aggregate tape bandwidth. One exception to this is if there are many empty
blocks in the datafiles that need not be backed up.
One of the components of the backup system will be a bottleneck; which one depends on the
relative speeds of the disk, tape drive, and any other transport components such as the
network. For example, if the bottleneck is the tape drive, and the tape is streaming, then the
backup cannot possibly proceed any faster.
Note: If you have synchronous I/O and have set the BACKUP_DISK_IO_SLAVES
initialization parameter to TRUE, I/O will be displayed in V$BACKUP_ASYNC_IO.

Oracle Database 10g: Backup and Recovery 9 - 7


Interpreting RMAN Message Output

RMAN troubleshooting information can be found in the:


• RMAN command output
• RMAN trace file
• Alert log
• Oracle server trace file

Oracle Internal & Oracle Academy Use Only


• sbtio.log file

Copyright © 2006, Oracle. All rights reserved.

Interpreting RMAN Message Output


The RMAN command output contains actions that are relevant to the RMAN job as well as
error messages that are generated by RMAN, the server, and the media vendor. RMAN error
messages have an RMAN-nnnn prefix. The output is displayed to the terminal (standard
output) but can be written to a file by defining the LOG option or by shell redirection.
The RMAN trace file contains the DEBUG output and is used only when the TRACE command
option is used.
The alert log contains a chronological log of errors, nondefault initialization parameter
settings, and administration operations. Because it records values for overwritten control file
records, it can be useful for RMAN maintenance when operating without a recovery catalog.
The Oracle trace file contains detailed output that is generated by Oracle server processes.
This file is created when an ORA-600 or ORA-3113 (following an ORA-7445) error
message occurs, whenever RMAN cannot allocate a channel, and when the media
management library fails to load. It can be found in USER_DUMP_DEST.
The sbtio.log file contains vendor-specific information that is written by the media
management software and can be found in USER_DUMP_DEST. Note that this log does not
contain Oracle server or RMAN errors.

Oracle Database 10g: Backup and Recovery 9 - 8


Using the DEBUG Option

• The DEBUG option is used to:


– View the PL/SQL that is generated
– Determine precisely where an RMAN command is
hanging or faulting
• The DEBUG option is specified at the RMAN prompt or
within a run block.

Oracle Internal & Oracle Academy Use Only


• The DEBUG option creates an enormous amount of
output, so redirect the output to a trace file:
$ rman target / catalog rman/rman debug trace trace.log

Copyright © 2006, Oracle. All rights reserved.

Using the DEBUG Option


The DEBUG option displays all SQL statements that are executed during RMAN compilations
and the results of these executions. Any information that is generated by the recovery catalog
PL/SQL packages is also displayed. In the following example, the DEBUG output is written
during the backup of datafile 3, but not datafile 4:
RMAN> run {
debug on;
allocate channel c1 type disk;
backup datafile 3;
debug off;
backup datafile 4; }
Remember that the DEBUG output can be voluminous, so make sure that you have adequate
disk space for the trace file. This simple backup session that does not generate any errors
creates a trace file that is almost a half megabyte in size:
$ rman target / catalog rman/rman debug trace sample.log
RMAN> backup database;
RMAN> host "ls –l sample.log";
-rw-r--r-- 1 user02 dba 576270 Apr 6 10:38
sample.log
host command complete
Oracle Database 10g: Backup and Recovery 9 - 9
Understanding RMAN Code Layer Error Numbers

Error Range Cause

5000-5499 RESTORE or RECOVER compilation errors

5500-5999 DUPLICATE compilation errors

6000-6999 General compilation errors

7000-7999 General execution manager

Oracle Internal & Oracle Academy Use Only


8000-8999 Generated PL/SQL errors and messages

9000-9999 Low-level keyword analyzer

10000-10999 Execution manager server-side errors

11000-11999 Interphase errors between PL/SQL and RMAN

12000-12999 Catalog package diagnostics

Copyright © 2006, Oracle. All rights reserved.

Understanding RMAN Code Layer Error Numbers


In the RMAN message stack, you will find errors that are prefixed with RMAN-nnnn,
ORA-nnn, and finally errors that are preceded by the line, Additional information.

Oracle Database 10g: Backup and Recovery 9 - 10


Interpreting RMAN Error Stacks

• Read the stack from bottom to top.


• Look for Additional information.
• RMAN-03009 identifies the failed command.
RMAN-00571: ===========================================
RMAN-00569: ======= ERROR MESSAGE STACK FOLLOWS =======

Oracle Internal & Oracle Academy Use Only


RMAN-00571: ===========================================
RMAN-03009: failure of backup command on c1 channel at
09/04/2001 13:18:19
ORA-19506: failed to create sequential file,
name="07d36ecp_1_1", parms=""
ORA-27007: failed to open file
SVR4 Error: 2: No such file or directory
Additional information: 7005
Additional information: 1
ORA-19511: Error from media manager layer,error text:

Copyright © 2006, Oracle. All rights reserved.

Interpreting RMAN Error Stacks


Because of the amount of data that RMAN logs, you may find it difficult to identify the useful
messages in the RMAN error stack. Note the following tips and suggestions:
• Because many of the messages in the error stack are not meaningful for troubleshooting,
try to identify the one or two errors that are most important.
• Check for a line that says Additional information followed by an integer. This
line indicates a media management error. The integer that follows refers to a code that is
explained in the text of the error message.
• Read the messages from bottom to top because this is the order in which RMAN issues
the messages. The last one or two errors that are displayed in the stack are often
informative.
• Look for the RMAN-03002 or RMAN-03009 message immediately following the
banner. The RMAN-03009 is the same as RMAN-03002 but includes the channel ID. If
the failure is related to an RMAN command, then these messages indicate which
command failed. The syntax errors generate an RMAN-00558 error.
• Identify the basic type of error according to the error range chart provided earlier in the
lesson. If the error is still unclear, refer to the Oracle Database Error Messages manual
for more information.

Oracle Database 10g: Backup and Recovery 9 - 11


Tuning RMAN

• RMAN BACKUP and RESTORE operations perform the


following tasks:
– Read or write data.
– Process data by copying and validating blocks.
• The slowest of these tasks is referred to as a
bottleneck.

Oracle Internal & Oracle Academy Use Only


• Tuning RMAN requires that the bottlenecks be
identified and addressed.

Copyright © 2006, Oracle. All rights reserved.

Tuning RMAN
RMAN backup and restore operations perform the following distinct tasks:
• Reading or writing input data
• Processing data by validating and copying blocks from the input to the output buffers
The slowest of these tasks is called a bottleneck. RMAN tuning involves identifying the
bottleneck (or bottlenecks) and attempting to make it more efficient by using RMAN
commands, initialization parameter settings, or adjustments to the physical media. The key to
tuning RMAN is understanding I/O. The backup and restore jobs of RMAN use two types of
I/O buffers: disk and tertiary storage (usually tape). When performing a backup, RMAN reads
input files by using disk buffers and writes the output backup file by using either the disk or
the tape buffer. When performing restores, RMAN reverses these roles. I/O can be
synchronous and asynchronous. Synchronous devices perform only one I/O task at a time.
Therefore, you can easily determine how much time the backup jobs require. In contrast to
synchronous I/O (SIO), asynchronous I/O (AIO) can perform more than one task at a time. To
tune RMAN effectively, you must thoroughly understand the concepts of synchronous and
asynchronous I/O, disk and tape buffers, and channel architecture. With an understanding of
these concepts, you can use fixed views to monitor bottlenecks.

Oracle Database 10g: Backup and Recovery 9 - 12


RMAN Multiplexing

Multiplexing Level Allocation Rule

Less than or equal to 4 1 MB buffers are allocated so that the total buffer
size for all the input files is 16 MB.

Greater than 4 but less 512 KB are allocated so that the total buffer size for

Oracle Internal & Oracle Academy Use Only


than or equal to 8 all the files is less than 16 MB.

Greater than 8 RMAN allocates four 128 KB disk buffers for each
file, so that the total size is 512 KB for each file.

Copyright © 2006, Oracle. All rights reserved.

RMAN Multiplexing
RMAN uses two different types of buffers for I/O: disk and tape. RMAN multiplexing
determines how RMAN allocates disk buffers. RMAN multiplexing is the number of files in a
backup read simultaneously and then written to the same backup piece. The degree of
multiplexing depends on the FILESPERSET parameter of the BACKUP command as well as
the MAXOPENFILES parameter of the CONFIGURE CHANNEL or ALLOCATE CHANNEL
commands.
For example, assume that you back up two data files with one channel. You set
FILESPERSET to 3 and set MAXOPENFILES to 8. In this case, the number of files in each
backup set is 2 (the lesser of FILESPERSET and the files read by each channel) and the level
of multiplexing is 2 (the lesser of MAXOPENFILES and the number of files in each backup
set). When RMAN backs up from disk, it uses the algorithm that is described in the table
shown in the slide.
Note: For best recovery performance, do not set FILESPERSET to a value greater than 8.

Oracle Database 10g: Backup and Recovery 9 - 13


Allocating Disk Buffer: Example

Data files Input disk buffers

1 MB 1 MB
1 MB 1 MB

1 MB 1 MB
1 MB 1 MB

Oracle Internal & Oracle Academy Use Only


Channel
FILESPERSET = 4
MAXOPENFILES = 4
1 MB 1 MB
1 MB 1 MB

1 MB 1 MB
1 MB 1 MB

Copyright © 2006, Oracle. All rights reserved.

Allocating Disk Buffer: Example


In the example shown in the slide, one channel is backing up four data files. MAXOPENFILES
is set to 4 and FILESPERSET is set to 4. The level of multiplexing is 4 in this example. The
total size of the buffers for each data file is 4 MB. To calculate the total size of the buffers that
are allocated in a backup set, multiply the total bytes for each data file by the number of
datafiles that are being concurrently accessed by the channel, and then multiply this number by
the number of channels.
Assume that you use one channel to back up four data files, and use the settings that are shown
in the slide. In this case, multiply as follows to obtain the total size of the buffers that are
allocated for the backup:
4 MB per datafile x 1 channel x 4 datafiles per channel = 16 MB
Set the MAXOPENFILES parameter so that the number of files that are read simultaneously is
just enough to use the output device fully. This consideration is important when the output
device is a tape.

Oracle Database 10g: Backup and Recovery 9 - 14


Allocating Tape Buffers

• If BACKUP_TAPE_IO_SLAVES is TRUE, tape buffers are


allocated from the SGA.

Channel Tape buffers


256 KB 256 KB

Oracle Internal & Oracle Academy Use Only


256 KB 256 KB

• If BACKUP_TAPE_IO_SLAVES is FALSE, tape buffers are


allocated from the PGA.

Copyright © 2006, Oracle. All rights reserved.

Allocating Tape Buffers


If you make a backup to a tape device, the Oracle server allocates four buffers per channel for
the tape writers (or reads if doing a restore). The Oracle server allocates these buffers only if
the channel is an SBT channel. Typically, each tape buffer is 256 KB. To calculate the total
size of buffers that are used during a backup or restore, multiply the buffer size by four, and
then multiply this product by the number of channels.
As illustrated in the example shown in the slide, assume that you use one tape channel and
each buffer is 256 KB. In this case, the total size of buffers that are used during a backup is as
follows:
256 KB per buffer x 4 buffers per channel x 1 channel = 1024 KB
RMAN allocates the tape buffers in the System Global Area (SGA) or the Program Global
Area (PGA), depending on whether I/O slaves are used. If the BACKUP_TAPE_IO_SLAVES
initialization parameter is set to TRUE, RMAN allocates tape buffers from the shared pool or
the large pool if the LARGE_POOL_SIZE initialization parameter is set. If you set the
parameter to FALSE, RMAN allocates the buffers from the PGA. If you use I/O slaves, set the
LARGE_POOL_SIZE initialization parameter to set aside SGA memory that is dedicated to
holding these large memory allocations. By doing this, the RMAN I/O buffers do not compete
with the library cache for shared pool memory.

Oracle Database 10g: Backup and Recovery 9 - 15


Comparing Synchronous and Asynchronous I/O

Synchronous I/O

1 Server process 2 Server process waits;


writes data to buffer. tape process writes data.

Server 0100100

Oracle Internal & Oracle Academy Use Only


process 0100100
Tape
Server process buffers
4 writes data to
new buffer. 3 Tape process
signals finish.

Copyright © 2006, Oracle. All rights reserved.

Comparing Synchronous and Asynchronous I/O


When RMAN reads or writes data, the I/O is either synchronous or asynchronous. When the
I/O is synchronous, a server process can perform only one task at a time. When it is
asynchronous, a server process can begin an I/O and then perform other tasks while waiting for
the I/O to complete. It can also begin multiple I/O operations before waiting for the first to
complete.
You can set initialization parameters that determine the type of I/O. If you set
BACKUP_TAPE_IO_SLAVES to TRUE, the tape I/O is asynchronous. Otherwise, the I/O is
synchronous.
The example in the slide shows synchronous I/O in a backup to tape. The following steps
occur in a synchronous transfer:
1. A server process writes blocks to a tape buffer.
2. The tape process writes data to tape. The server process is idle while the media manager
copies data from the Oracle buffers to the media manager’s internal buffers.
3. The tape process relays to the server process that it has completed writing.
4. The server process can initiate a new task.

Oracle Database 10g: Backup and Recovery 9 - 16


Comparing Synchronous and Asynchronous I/O

Asynchronous I/O

1 Server process 2 Tape process writes data.


writes data to buffer.

Server 0100100

Oracle Internal & Oracle Academy Use Only


process 0100100 0100100
Tape
buffers

3 Server process writes to new


buffer while step 2 completes.

Copyright © 2006, Oracle. All rights reserved.

Comparing Synchronous and Asynchronous I/O (continued)


Many operating systems support native asynchronous I/O and Oracle can take advantage of
this feature whenever it is available. It is recommended that you always set
BACKUP_TAPE_IO_SLAVES to TRUE when the platform supports it. On operating systems
that do not support native asynchronous I/O, Oracle can simulate it by using special I/O slave
processes that are dedicated to performing I/O on behalf of another process. You can control
disk I/O slaves by setting the DBWR_IO_SLAVES parameter to a nonzero value. Oracle
allocates four backup disk I/O slaves for any nonzero value of DBWR_IO_SLAVES.
The example in the slide illustrates asynchronous I/O in a backup to tape. The steps that occur
in an asynchronous exchange are detailed below:
1. A server process writes blocks to a tape buffer.
2. The tape process writes data to the tape. While the tape process is writing, other server
processes are free to process more input blocks and fill more output buffers.
3. The spawned server process writes to the tape buffers while the initial tape process writes
to the tape.

Oracle Database 10g: Backup and Recovery 9 - 17


Monitoring RMAN Job Performance

• The following views can be used to monitor backup


and restore performance:
– V$BACKUP_SYNC_IO
– V$BACKUP_ASYNC_IO
• The following rows will exist for a backup or restore:
– One row for each datafile

Oracle Internal & Oracle Academy Use Only


– One aggregate datafile row
– One row for each backup piece
• Whether or not I/O is synchronous depends on how
the controlling process views it.

Copyright © 2006, Oracle. All rights reserved.

Monitoring RMAN Job Performance


The maximum backup speed is limited by the available hardware. It is not possible to back up
any faster than the aggregate tape bandwidth. One exception to this is if there are many empty
blocks in the datafiles that need not be backed up.
One of the components of the backup system will be a bottleneck—which one depends on the
relative speeds of the disk, tape drive, and any other transport components such as the
network. As an example if the bottleneck is the tape drive, and the tape is streaming, then the
backup cannot possibly proceed any faster.
Note: If you have synchronous I/O and have set the BACKUP_DISK_IO_SLAVES
initialization parameter to TRUE, I/O will be displayed in V$BACKUP_ASYNC_IO.

Oracle Database 10g: Backup and Recovery 9 - 18


Asynchronous I/O Bottlenecks

• Use V$BACKUP_ASYNC_IO to monitor asynchronous


I/O.
• If LONG_WAITS + SHORT_WAITS is a large part of
IO_COUNT, then the file is probably a bottleneck.
– LONG_WAITS: Number of times the backup/restore
process told the OS to wait until I/O was complete

Oracle Internal & Oracle Academy Use Only


– SHORT_WAITS: Calls the backup/restore process made
polling for I/O completion in nonblocking mode.
• WAITS times should be zero to avoid bottlenecks.

Copyright © 2006, Oracle. All rights reserved.

Asynchronous I/O Bottlenecks


You can use V$BACKUP_ASYNC_IO to monitor asynchronous I/O. The LONG_WAITS
column shows the number of times the backup or restore process directed the operating system
to wait until an I/O was complete. The SHORT_WAITS column shows the number of times the
backup/restore process made an operating system call to poll for I/O completion in a
nonblocking mode. On some platforms, the asynchronous I/O implementation may cause the
calling process to wait for the I/O to complete while performing a nonblocking poll for I/O.
The simplest way to identify the bottleneck is to query V$BACKUP_ASYNC_IO for the
datafile that has the largest ratio for LONG_WAITS divided by IO_COUNT.

Oracle Database 10g: Backup and Recovery 9 - 19


Synchronous I/O Bottlenecks

• Synchronous I/O is considered to be a bottleneck.


• Query the DISCRETE_BYTES_PER_SECOND column from
V$BACKUP_SYNC_IO to view the I/O rate.
– Compare this rate with the device’s maximum rate.
– If the rate is lower than what the device specifies, this is
a tuning opportunity.

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Synchronous I/O Bottlenecks


When using synchronous I/O, it can easily be determined how much time the backup jobs
require because devices perform only one I/O task at a time. Oracle I/O uses a polling
mechanism rather than an interrupt mechanism to determine when each I/O request completes.
Because the backup or restore process is not immediately notified of I/O completion by the
operating system, you cannot determine the duration of each I/O.
Use V$BACKUP_SYNC_IO to determine the source of backup or restore bottlenecks and to
determine the progress of backup jobs. V$BACKUP_SYNC_IO contains rows when the I/O is
synchronous to the process (or thread, on some platforms) that is performing the backup.

Oracle Database 10g: Backup and Recovery 9 - 20


Tape Backup Speed

The following factors affect the speed of the backup to


tape:
• Native transfer rate
• Tape compression
• Tape streaming

Oracle Internal & Oracle Academy Use Only


• Physical tape block size

Copyright © 2006, Oracle. All rights reserved.

Tape Backup Speed


The tape native transfer rate is the write speed without compression. This speed represents the
upper limit of the backup rate. The upper limit of your backup performance should be the
aggregate transfer rate of all the tape drives. If the backup is performing at that rate, and an
excessive amount of CPU is not being used, then tuning RMAN will not help.
Tape compression greatly affects backup performance. If the tape has good compression, then
the sustained backup rate is faster. For example, if the compression ratio is 2:1 and the native
transfer rate of the tape drive is 6 MB per second, then the resulting backup speed is 12 MB
per second.
Almost all tape drives currently in the market are fixed-speed, streaming tape drives—that is,
these drives can write data only at one speed. As a result, when they run out of data to write to
tape, they must slow down and stop. For example, when the drive’s buffer empties, the tape is
moving so quickly that it actually overshoots and must rewind past the point where it stopped
writing.
The physical tape block size can affect the backup performance. The block size is the amount
of data that is written by the media management software to a tape in one write operation. The
common rule is that a larger tape block size leads to a faster backup. The physical tape block
size is controlled by the media management software.

Oracle Database 10g: Backup and Recovery 9 - 21


Tape Subsystem Performance Rules

• Increasing the number of tape drives or the speed of


tape drives provides for faster backup and restore.
• Allocate one channel per physical device:
– If more channels than physical drives are used, then the
backup sets will be intermingled.
– This is similar to multiplexing data files.

Oracle Internal & Oracle Academy Use Only


• If tape drive is not streaming, then increase the
number of files that are multiplexed.
• Back up the files that are likely to be restored together
in the same backup set.

Copyright © 2006, Oracle. All rights reserved.

Tape Subsystem Performance Rules


You can speed up the backup and restore processes by buying more tape drives, faster tape
drives, or ideally a combination of the two. It is a waste of system resources to allocate more
than one channel per tape drive. If more channels than physical drives are used, then the
backup sets will be intermingled. This can adversely affect the time it takes to restore selected
files.
If a tape drive is not streaming, increasing the number of files multiplexed together may help.
Remember that if a small subset of files in a backup set must be restored, the restore will take
longer if many files are multiplexed into the backup set. Put just enough files into each backup
set to keep the tape drives streaming. It is better to store files that are likely to be restored
together in the same backup set.

Oracle Database 10g: Backup and Recovery 9 - 22


Controlling Tape Buffer Size with BLKSIZE

• Adjust the size of the tape buffer to keep the tape


streaming.
• Use the BLKSIZE option of PARMS to set the desired
buffer size:
RMAN> CONFIGURE CHANNEL DEVICE TYPE SBT_TAPE
2> PARMS="BLKSIZE=1048576 ";

Oracle Internal & Oracle Academy Use Only


• Set BLKSIZE to 1 MB to correspond to the buffer size.

Copyright © 2006, Oracle. All rights reserved.

Controlling Tape Buffer Size with BLKSIZE


If the tape is not streaming, but the problem is not due to an incremental backup or by backing
up empty files, then try adjusting the block size of the tape buffer. You can change the size of
each tape buffer by using the PARMS parameter of the ALLOCATE CHANNEL or CONFIGURE
CHANNEL command. If the BLKSIZE parameter for PARMS is supported on your platform,
then you can set it to the desired size of each buffer. For example, configure an SBT channel
as follows:
RMAN> CONFIGURE CHANNEL DEVICE TYPE SBT
> PARMS="BLKSIZE=1048576";

Oracle Database 10g: Backup and Recovery 9 - 23


Channel Tuning

Use the CONFIGURE CHANNEL and ALLOCATE CHANNEL


commands to:
• Limit the size of backup pieces
• Prevent RMAN from consuming too much disk
bandwidth
• Determine the level of multiplexing for each channel

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Channel Tuning
You can set various channel limit parameters that apply to operations that are performed by
the allocated server session in the CONFIGURE CHANNEL and ALLOCATE CHANNEL
commands.
The MAXPIECESIZE parameter specifies the maximum size of a backup piece. Use this
parameter to make RMAN create multiple backup pieces in a backup set. RMAN creates each
backup piece with a size that is no larger than the value that has been specified in the
parameter.
The RATE parameter specifies the bytes per second that RMAN reads on the channel. This
parameter is useful in preventing RMAN from consuming excessive disk bandwidth and
degrading OLTP performance. For example, if each disk drive delivers 3 MB per second and
you set RATE=1500K, some disk bandwidth will still be available to the online system.
The MAXOPENFILES parameter determines the maximum number of input files that a backup
or copy can have open at a given time. If not set manually, then the value defaults to 8. The
level of RMAN multiplexing is partially determined by MAXOPENFILES. The level of
multiplexing in turn determines how RMAN allocates disk buffers. Multiplexing is the number
of input files that are simultaneously read and then written into the same backup piece.

Oracle Database 10g: Backup and Recovery 9 - 24


Tuning the BACKUP Command

• MAXPIECESIZE limits the size of each backup piece.


• FILESPERSET prevents RMAN from reading from too
many disks at once.

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Tuning the BACKUP Command


The MAXPIECESIZE parameter specifies the maximum size of each backup piece created on
the channel.
The FILESPERSET parameter specifies the maximum number of files to place in a backup
set. If you allocate only one channel, then you can use this parameter to make RMAN create
multiple backup sets. For example, if you have 50 input datafiles and two channels, you can
set FILESPERSET=5 to create 10 backup sets. This strategy can prevent you from splitting a
backup set among multiple tapes.

Oracle Database 10g: Backup and Recovery 9 - 25


Tuning RMAN Backup Performance

Follow these steps to tune RMAN backup performance:


1. Remove RATE settings from configured and allocated
channels.
2. Set DBWR_IO_SLAVES if you use synchronous disk I/O.
3. Set LARGE_POOL_SIZE.

Oracle Internal & Oracle Academy Use Only


4. Tune RMAN tape streaming performance bottlenecks.
5. Query V$ views to identify bottlenecks.

Copyright © 2006, Oracle. All rights reserved.

Tuning RMAN Backup Performance


Follow this set of steps to obtain the best backup performance:
1. Remove RATE settings from configured and allocated channels. The RATE parameter is
used to set the maximum number of bytes (default), kilobytes (K), megabytes (M), or
gigabytes (G) that RMAN reads each second on the channel. It sets an upper limit for
bytes read so that RMAN does not consume too much disk bandwidth and degrade
performance. If your backup is not streaming to tape, ensure that the RATE parameter is
not set on the ALLOCATE CHANNEL or CONFIGURE CHANNEL commands.
2. Set DBWR_IO_SLAVES if you use synchronous disk I/O. If your disk does not support
asynchronous I/O, then try setting the DBWR_IO_SLAVES initialization parameter to a
nonzero value. Any nonzero value for DBWR_IO_SLAVES causes a fixed number (four)
of disk I/O slaves to be used for backup and restore, simulating asynchronous I/O. If I/O
slaves are used, I/O buffers are obtained from the SGA. The large pool is used if
configured. Otherwise, the shared pool is used.
Note: By setting DBWR_IO_SLAVES, the database writer processes will use slaves as
well. You may need to increase the value of the PROCESSES initialization parameter.
3. Set LARGE_POOL_SIZE as described on the next page.
4. Tune RMAN tape streaming performance bottlenecks as described later in the lesson.
5. Use V$ views as described earlier in the lesson.

Oracle Database 10g: Backup and Recovery 9 - 26


Setting LARGE_POOL_SIZE

• If LARGE_POOL_SIZE is not set, the Oracle server tries


to get memory from the shared pool.
• If LARGE_POOL_SIZE is not big enough, the server
does not allocate buffers from the shared pool.
• If the server cannot get enough memory, it allocates
buffers from the local process memory.

Oracle Internal & Oracle Academy Use Only


• The Oracle server writes a message to the alert log
indicating that synchronous I/O is used for this
backup.
ksfqxcre: failure to allocate shared memory means sync
I/O will be used whenever async I/O to file not
supported natively

Copyright © 2006, Oracle. All rights reserved.

Setting LARGE_POOL_SIZE
The requests for contiguous memory allocations from the shared pool are small, usually under
5 KB in size. It is possible that a request for a large contiguous memory allocation can fail or
require significant memory housekeeping to release the required amount of contiguous
memory. The large pool may be able to satisfy the memory request. The large pool does not
have a least recently used list, so Oracle does not attempt to age memory out of the large pool.
Use the LARGE_POOL_SIZE initialization parameter to configure the large pool. Query
V$SGASTAT.POOL to see in which pool (shared pool or large pool) the memory for an object
resides. The suggested value for LARGE_POOL_SIZE is calculated as:
#_of_allocated_channels * (16 MB + (4*size_of_tape_buffer ))
For backups to disk, the tape buffer is obviously 0, so set LARGE_POOL_SIZE to 16 MB. For
tape backups, the size of a single tape buffer is defined by the RMAN channel parameter
BLKSIZE, which defaults to 256 KB. Assume a case in which you are backing up to two tape
drives. If the tape buffer size is 256 KB, then set LARGE_POOL_SIZE to 18 MB. If you
increase BLKSIZE to 512 KB, then increase LARGE_POOL_SIZE to 20 MB.
Note: The large pool is used only for disk buffers when DBWR_IO_SLAVES > 0 and for tape
buffers when BACKUP_TAPE_IO_SLAVES = TRUE. If you are using Automatic Shared
Memory Management, the large pool is sized automatically in response to system workload.

Oracle Database 10g: Backup and Recovery 9 - 27


Tuning RMAN Tape Streaming Performance
Bottlenecks

• Use BACKUP... VALIDATE to determine whether tape


streaming or disk I/O is the bottleneck.
• Use multiplexing to improve tape streaming with disk
bottlenecks.
• Use incremental backups to improve backup
performance with tape bottlenecks.

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Tuning RMAN Tape Streaming Performance Bottlenecks


Perform the following actions to identify and remedy bottlenecks that affect RMAN’s
performance on tape backups:
• Use BACKUP... VALIDATE to determine whether tape streaming or disk I/O is the
bottleneck in a given backup job. Compare the time required to run backup tasks with the
time required to run BACKUP VALIDATE of the same tasks. BACKUP VALIDATE of a
backup to tape performs the same disk reads as a real backup but performs no tape I/O. If
the time required for the BACKUP VALIDATE to tape is significantly less than the time
required for a real backup to tape, then writing to tape is the likely bottleneck.
• Use multiplexing to improve tape streaming with disk bottlenecks. In some situations
when RMAN is performing a backup to tape, it may not be able to send data blocks to the
tape drive fast enough to support streaming. For example, during an incremental backup,
RMAN backs up only blocks changed since a previous datafile backup as part of the same
strategy. If you do not enable change tracking, RMAN must scan entire datafiles for
changed blocks, and fill output buffers as it finds such blocks. If there are not many
changed blocks, RMAN may not fill output buffers fast enough to keep the tape drive
streaming. You can improve performance by increasing the degree of multiplexing used
for backups. This increases the rate at which RMAN fills tape buffers, which makes it
more likely that buffers are sent to the media manager fast enough to maintain streaming.
Oracle Database 10g: Backup and Recovery 9 - 28
Tuning RMAN Tape Streaming Performance Bottlenecks (continued)
• Use incremental backups to improve backup performance with tape bottlenecks. If writing
to tape is the source of a bottleneck for your backups, consider using incremental backups
as part of your backup strategy. Incremental level 1 backups write only the changed
blocks from datafiles to tape, so that any bottleneck on writing to tape has less impact on
your overall backup strategy. In particular, if tape drives are not locally attached to the
node running the database being backed up, then incremental backups can be faster.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery 9 - 29


Summary

In this lesson, you should have learned how to:


• Monitor RMAN jobs
• Troubleshoot RMAN operations
• Tune RMAN backup performance

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 9 - 30


Practice Overview

This practice covers monitoring RMAN jobs.

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 9 - 31


Oracle Internal & Oracle Academy Use Only
Oracle Secure Backup Overview

Oracle Internal & Oracle Academy Use Only


Copyright © 2006 Oracle. All rights reserved.
Objectives

After completing this lesson, you should be able to:


• Describe how Oracle Secure Backup complements the
Oracle backup and recovery options
• Define Oracle Secure Backup terminology
• Describe Oracle Secure Backup interface options

Oracle Internal & Oracle Academy Use Only


• Describe backup management features of Oracle
Secure Backup

Copyright © 2006, Oracle. All rights reserved.

For More Information


• http://www.oracle.com/technology/deploy/availability
• http://www.oracle.com/technology/products/secure-backup
• Oracle Secure Backup Administrator’s Guide
• Oracle Secure Backup Reference

Oracle Database 10g: Backup and Recovery 10 - 2


Oracle Secure Backup
Tape Backup Management

• Highest levels of tape


Oracle Databases File System Data data protection at the
lowest cost
UNIX Linux
Integration with • Fastest, most efficient
Windows NAS
RMAN Oracle database tape
backup

Oracle Internal & Oracle Academy Use Only


• Protection of entire
Oracle environment
Oracle Secure Backup including Oracle
Centralized Tape Backup System application files
• Oracle integrated
product

Tape

Copyright © 2006, Oracle. All rights reserved.

Oracle Secure Backup Tape Backup Management


Business background: The increased demands on the enterprise backup infrastructure require more
rigorous service level agreements for backup windows and restoration time, while obtaining reliable
data protection within budget. The tape technology meets this challenge by offering high-speed
devices and high capacity media with a throughput similar to that of a disk (generally, at a high cost).
Oracle Secure Backup 10.1 addresses this issue by providing centralized tape backup management
for the Oracle Database and file systems in mixed, diverse environments, thus reducing the cost and
complexity of tape backup and restoration.

Oracle Database 10g: Backup and Recovery 10 - 3


What Is Oracle Secure Backup?

• Centralized tape backup management software:


– Managing data protection for diverse, distributed servers
and tape devices
– Client/server architecture for backing up and restoring
data locally or over the LAN, WAN, or SAN
• Oracle Secure Backup features:

Oracle Internal & Oracle Academy Use Only


– Tape backup management for entire Oracle environment
including file systems and the Oracle database
– Policy-based backup management
– Secure data protection and interdomain communication
– Effective media and device management
– Broad tape device and platform support

Copyright © 2006, Oracle. All rights reserved.

What Is Oracle Secure Backup?


Oracle Secure Backup is centralized tape management software. It enables reliable data protection to
tape, and supports the major tape drives and libraries in SAN, Gigabit Ethernet, and SCSI
environments.
Oracle Secure Backup enables you to do the following:
• Back up and restore data using a variety of machine architectures.
• Access local and remote file systems and devices from any location in a network without using
Network File System (NFS) or Common Internet File System (CIFS) protocols.
• Back up to and restore from Oracle Cluster File System (OCFS) on Linux and Windows
• Use wildcards and exclusion lists to specify what you want to back up.
• Control secondary storage–based data recording format and compression.
• Duplex database backups (back up the same files to multiple devices). Each data stream
automatically goes to a separate device.
• Perform full, incremental, or differential backups.
• Maintain security and limit the users who are authorized to perform data management
operations.
• Support most popular tape drives and libraries.

Oracle Database 10g: Backup and Recovery 10 - 4


Oracle Secure Backup: Tape Management and
Integration with Oracle Products

Oracle Collaboration Suite


configuration files

Oracle Application Server

Backup and restore


configuration files
Oracle Secure
Oracle Database: Backup

Oracle Internal & Oracle Academy Use Only


• Versions Oracle9i and later Centralized
• Real Application Clusters Tape Backup
Management
File System Data: Tape
Library
• Oracle Home installations
• Other nondatabase data

Copyright © 2006, Oracle. All rights reserved.

Oracle Secure Backup: Tape Management and Integration with Oracle Products
Some of the many options available for protecting your Oracle data are backing up solely to disk,
backing up to disk as a staging area for tape backups, or backing up directly to tape. Disk backup and
restore operations are generally faster than the equivalent tape operations. However, tape backups
provide some advantages for long-term backup requirements, such as offsite storage and portability,
which allow you to move backups from one data center to another.
Oracle Secure Backup provides tape backup management for all your files relating to Oracle
products, including:
• Oracle database backups stored on tape through integration with Recovery Manager
• Seamless support of Oracle Real Application Clusters (RAC)
• Support for Oracle Cluster File System (OCFS) and Automatic Storage Management (ASM)
• Central administration of distributed clients and media servers including:
- Oracle Application Servers
- Oracle Collaboration Suite
- Oracle Home and binaries

Oracle Database 10g: Backup and Recovery 10 - 5


Client/Server Architecture
Host Roles

• Administrative server
Administrative – Maintains
server configuration
Oracle Secure settings and backup
Backup catalog history catalog
N
E • Media server
T

Oracle Internal & Oracle Academy Use Only


Media
W
server
– Transfers data to or
O
R from attached
K devices
• Client
Client – Contains data to be
backed up
Data to
backup

Copyright © 2006, Oracle. All rights reserved.

Client/Server Architecture Host Roles


To configure Oracle Secure Backup, you need to define an administrative domain. An administrative
domain is a group of machines on your network that you manage as a common unit to perform
backup and restore operations. An administrative domain has one administrative server, one or more
clients, and one or more media servers.
• The administrative server is a machine in your administrative domain that contains a full
installation of the Oracle Secure Backup software. This host maintains the backup catalog files
and others files for configuration settings and administrative data. The administrative server runs
the scheduler, which starts and monitors jobs within the administrative domain. You need one
administrative server for each administrative domain at your site. To configure an administrative
server, you choose an administrative server installation when installing Oracle Secure Backup
on the host.
• A media server is a machine that has one or more secondary storage devices, such as a tape
library, connected to it. A media server transfers data to and from its attached storage devices.
During installation, you can configure multiple secondary storage devices on media servers.
• A client is a machine whose locally accessed data is backed up by Oracle Secure Backup. Most
of the machines defined within the administrative domain are clients.

Oracle Database 10g: Backup and Recovery 10 - 6


Oracle Secure Backup for
Centralized Tape Backup Management

UNIX or
NAS Windows
Linux

Heterogeneous
clients backed up
Oracle Secure Backup over the network
administrative server LAN

Media

Oracle Internal & Oracle Academy Use Only


servers
locally
backed up
Oracle
Database
Oracle Secure Backup Tape
Administrative Domain Library

Copyright © 2006, Oracle. All rights reserved.

Oracle Secure Backup for Centralized Tape Backup Management


The Oracle Secure Backup software offers centralized backup management of heterogeneous clients
and servers by storing the backup and configuration data in a central repository called the Oracle
Secure Backup administrative server. The administrative server contains a consolidated backup
catalog, providing a single location for managing backup policies, scheduling backups for multiple
platforms, and managing local and remote tape devices. The configured machines and devices
managed by an administrative server make up the Oracle Secure Backup administrative domain, as
shown in the slide.
The Oracle Secure Backup tape management system minimizes the complexity of managing diverse
architectures:
• Flexible tape device configuration with options for single and multi-hosted tape libraries
• Support for major tape libraries and tape drives in GbE and SCSI environments
• Client/server architecture providing centralized administration of distributed media servers over
a local area network (LAN) or wide area network (WAN)

Oracle Database 10g: Backup and Recovery 10 - 7


Typical SAN Environment

LAN

Administrative
server

Oracle Internal & Oracle Academy Use Only


SAN

Fibre
Oracle Secure Backup: Oracle
connectivity
• Dynamically shares tape Database
drives attached to the
Storage Area Network (SAN)
• Manages any resource Tape devices
contention

Copyright © 2006, Oracle. All rights reserved.

Typical SAN Environment


Oracle Secure Backup supports Storage Area Network (SAN) environments. The graphic in the slide
depicts a typical SAN environment where one or more servers are attached to the SAN along with
one or more tape devices. Each of the tape devices attached to the SAN appears local to the servers
using SAN. Clients within the administrative domain are backed up over the network to the tape
devices on the configured media servers.
Oracle Secure Backup automatically manages resource contention for tape drives within the SAN.
During a backup or restore operation, a server engages a tape drive, thereby making it temporarily
unavailable to other servers. When the operation completes, the tape drive is again available for use
by any of the servers using SAN, as permitted by your configuration.
When configuring tape devices, you are asked to configure attachments, where each attachment
describes a data path between the host and the device itself. A device must have at least one
attachment. In a SAN environment, a tape device may have multiple attachments, one for each host
that can access the device.
The Fibre fabric and switches within the SAN are transparent to Oracle Secure Backup. Therefore,
SAN interoperability becomes important at the hardware level. When configuring a SAN, it is
recommended to confirm that the hardware components have been tested and certified to work
together.

Oracle Database 10g: Backup and Recovery 10 - 8


Oracle Secure Backup Interface Options

EM Web tool

Oracle
RMAN Secure obtool

Oracle Internal & Oracle Academy Use Only


SBT
Backup

Database File system


operations operations

Copyright © 2006, Oracle. All rights reserved.

Oracle Secure Backup Interface Options


As shown in the slide, you can access Oracle Secure Backup in four different ways depending on
what you want to do:
• EM provides a graphical interface to Oracle Secure Backup for users who elect to perform
database backup and restore operations through integration with RMAN. You can also perform
administrative tasks such as managing media and devices within the Oracle Secure Backup
administrative domain. The Enterprise Manager console includes a link to the Oracle Secure
Backup Web tool for performing file-system backup and restore operations.
• You use RMAN to back up your databases directly to tape. RMAN can be accessed either
through the RMAN executable or through EM. (This was covered in the previous lessons, so it is
not duplicated here.) RMAN communicates with Oracle Secure Backup through the SBT
interface.
• The Web tool is a GUI application that enables you to configure administrative domains,
manage operations, browse the backup catalog, and back up and restore data. It provides a
graphical and interactive interface to access the obtool utility. You should use this interface
when making backups of file system data.
• The obtool utility provides a command-line interface to Oracle Secure Backup. This interface
gives you the same functionalities as the GUI interface.

Oracle Database 10g: Backup and Recovery 10 - 9


Media Concepts: Overview

Media family

Volume set

Volume Volume

Backup image

Oracle Internal & Oracle Academy Use Only


Product of a backup operation

Physical tape Physical tape

Set of tapes containing backup images

Set of volumes with common characteristics

Copyright © 2006, Oracle. All rights reserved.

Media Concepts: Overview


Oracle Secure Backup organizes the backups it creates in a simple hierarchy, which comprises the
following logical concepts:
• A “backup image” is the product of a backup operation. A backup image is a file that consists of
one or more backup sections. A backup image can be contained within a single volume or it can
span multiple volumes. The part of a backup image that fits on a single volume is called a
“backup section.”
• A “volume” is a single unit of media such as an LTO-3 tape.
• A “volume set” is a group of one or more volumes that contain a complete backup image.
• A “media family” is a named classification of volumes that share some common attributes, such
as the volume naming method, the policies used for writing data to volumes, and the length of
time volumes are retained in the media family.
When you back up files using Oracle Secure Backup, you generate a volume set that has some
common characteristics defined by the media family that you have associated with your backup
operation.

Oracle Database 10g: Backup and Recovery 10 - 10


Backup Pieces and Backup Images

RMAN backup set

Oracle RMAN RMAN


database backup … backup
files piece piece

Oracle Internal & Oracle Academy Use Only


Backup Backup
image image

Oracle Secure Backup images

Copyright © 2006, Oracle. All rights reserved.

Backup Pieces and Backup Images


The backup of an Oracle database, created by RMAN, results in a backup set (an RMAN-specific
logical structure), which contains at least one backup piece (an RMAN-specific physical file
containing the backed up data).
Oracle Secure Backup backs up and maintains backup metadata for each RMAN backup piece
written to tape within its own catalog. You can browse backup pieces by using obtool or Oracle
Secure Backup Web tool.
Note: Use RMAN for the management of RMAN backup pieces.
If you manage the backup pieces stored on tape by using Oracle Secure Backup utilities instead of
RMAN, the Oracle Secure Backup catalog and the RMAN repository can become unsynchronized.
The best practice is for backup pieces to be updated through RMAN, not manually by the use of
Oracle Secure Backup.

Oracle Database 10g: Backup and Recovery 10 - 11


Media Management Expiration Policies

Recycling time-managed volumes


Write window Retention duration

Updates allowed Updates forbidden Time

Volume set Volume set Volume set


creation closed expiration

Oracle Internal & Oracle Academy Use Only


Recycling content-managed volumes

Marked DELETED Or Marked DELETED by


by RMAN Oracle Secure Backup

Expired Expired Expired Expired


Backup Backup Backup Backup Volume
piece piece piece piece set

Copyright © 2006, Oracle. All rights reserved.

Media Management Expiration Policies


Oracle Secure Backup automates tape recycling, reusing tapes after the backups or volumes have
expired, depending on their user-defined recycling method:
• Time-managed expiration policies: The expiration time is associated at the volume level for
time-managed media families. When the volume expiration date is reached, the volume becomes
eligible to be overwritten. Each volume in a volume set will have an expiration date, which is
determined as follows:
- The user-defined write-window determines how long the tape may be appended to after the
first tape write event (optional).
- The user-defined retention time determines how long the volume must be retained after the
write-window has closed or after the first tape write event, if a write-window is not defined.
If a write-window is not defined, the volume will be appended to, until it is full.
- The expiration time is the “write-window” time plus the retention time.

Oracle Database 10g: Backup and Recovery 10 - 12


Media Management Expiration Policies (continued)
• Content-managed expiration policies: The expiration time is associated with the content on
the tape, not with the actual volume. With content-managed volumes, the retention period is
configured within RMAN by using the recovery window or redundancy setting. Oracle Secure
Backup does not associate a specific date with the backup piece, but updates the piece attribute
from “content manages use” to “deleted” status as instructed by RMAN. By issuing the RMAN
DELETE OBSOLETE command, RMAN deletes any disk backups no longer needed to meet the
user-configured retention policies and notifies the media management software (Oracle Secure
Backup) about which pieces can be deleted. The expiration status is updated in the Oracle
Secure Backup catalog, but the actual pieces are not deleted from tape. Instead, the backup
pieces receive the “deleted” attribute. After all backup pieces on a specific tape have a
“deleted” attribute, Oracle Secure Backup considers the tape eligible for reuse, and overwrites
the tape, when a tape is needed.
Note: It is not recommended, but you can remove backup pieces (an RMAN backup piece

Oracle Internal & Oracle Academy Use Only


corresponds to an Oracle Secure Backup backup image) with the Oracle Secure Backup Web
tool or the rmpiece command in the obtool utility. These commands remove the backup
piece from the Oracle Secure Backup catalog. If you remove a backup piece outside of RMAN,
you must use the RMAN CROSSCHECK command to update the RMAN repository and have the
removed backup pieces marked as EXPIRED. Then you use the RMAN DELETE EXPIRED
command to remove these backup pieces from the RMAN repository.

Oracle Database 10g: Backup and Recovery 10 - 13


Oracle Secure Backup Media Family

• A named classification of volumes that share the same:


– Volume identification sequence
– Write-allowed period
– Expiration policy (either content- or time-managed)
• Used to classify and characterize backup types
• Commonly associated with backup levels, which

Oracle Internal & Oracle Academy Use Only


generally correspond to retention times, such as:
– Full
– Incremental
– Archive log

Copyright © 2006, Oracle. All rights reserved.

Oracle Secure Backup Media Family


Media families provide a way to establish write periods and retention policies for data backed up to
various kinds of tapes. You can, for example, establish a media family for all of your backups that
remain on site, a separate media family for your backups that are to be stored off site, and a third
media family for all your incremental backups.
Each media family identifies the length of time that data can be written to a tape and the length of
time before the data on a volume expires and is eligible to be overwritten. So, a media family is a
classification of backup media that share the same:
• Volume identification sequence: The volume ID consists of a fixed portion, followed by a
sequence number assigned and updated by Oracle Secure Backup. When you create a media
family, you specify how to generate volume IDs that become part of the volume label.
• Write window: The beginning of the write window is the time at which Oracle Secure Backup
first writes to a volume in the volume set. The write window is a user-specified time interval that
applies to all volumes in the set. Oracle Secure Backup continues to append backups to the
volume set until the end of this interval. When the write window closes, Oracle Secure Backup
does not allow further updates to the volume set until it expires or is relabeled, reused,
unlabeled, or overwritten.
• Expiration policy: When a volume set expires, Oracle Secure Backup automatically considers
each volume in the set eligible to be overwritten. A media family is either content managed
(default) or time managed. These two policies are mutually exclusive.
Oracle Database 10g: Backup and Recovery 10 - 14
Tape Drives and Libraries

mainlib
Tape library Tape library Barcode reader
robotics move scans labels on
Robotic control
tapes between ____________
cartridges.
drives and slots. ____________
____________ maintd1
____________
____________
____________
____________ Type of tape drive

Oracle Internal & Oracle Academy Use Only


____________
____________ maintd2 refers to its tape
____________
____________
____________
format such as
Storage elements
____________
____________
LTO-2 or
(slots) store
____________
____________
maintd3 SDLT600.
____________
tapes. ____________
____________

Device connectivity varies by device:


SCSI, Fibre, and iSCSI

Copyright © 2006, Oracle. All rights reserved.

Tape Drives and Libraries


Oracle Secure Backup maintains information about secondary storage devices, tape libraries, and
tape drives, so they can be used for local and network backup and restore operations. These devices
are easily configured during the installation process, or a new device can be easily added to an
existing Oracle Secure Backup environment.
Each tape drive and tape library is uniquely identified within an Oracle Secure Backup administrative
domain by a user-defined name (for example, mainlib and maintd1). Because Oracle Secure
Backup manages tape drive operations, it must explicitly be able to identify the tape drive as well as
understand if the tape drive is housed within a tape library. Oracle Secure Backup must further
determine which tape slots (storage elements) are available for storing tapes when they are not
loaded in a tape drive.
Before you can use tape drives or tape libraries with Oracle Secure Backup, you must add the device
to the administrative domain. Oracle Secure Backup maintains a distinction between a device and the
means by which the device is connected to a host. Each device you configure can have one or more
attachments, where each attachment describes a data path between a host and the device itself. Most
often, an attachment comprises the identity of a host plus a UNIX device special file name, a
Windows device name, or NAS device name. In rare cases, additional information is needed to
complete the attachment definition.

Oracle Database 10g: Backup and Recovery 10 - 15


Tape Drives and Libraries (continued)
A Fibre channel–attached tape drive or tape library often has multiple attachments, one for each host
that can directly access it.
When a device is attached to multiple hosts, Oracle Secure Backup automatically manages contention
for the device so that only one host is permitted access to it at any time. For example, SAN-attached
devices often have multiple attachments, one for each host that has local access to the device through
its Fibre channel interface.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery 10 - 16


Virtual Tape Libraries (VTL)

• Providing the performance advantages of disk backup


– Disk appliances, emulating tape libraries and drives
– Most popular virtual tape libraries supported by Oracle
Secure Backup
— (See “Tape Device” compatibility guide on Oracle
Technology Network)

Oracle Internal & Oracle Academy Use Only


• Increasingly adopted into IT environments
– Seamlessly deployed without changing backup
infrastructure
– Flexible configuration with user-defined options for
number and type of tape emulation
• Attached to the network or servers, depending on the
manufacturer

Copyright © 2006, Oracle. All rights reserved.

Virtual Tape Libraries (VTL)


A virtual tape library leverages traditional tape backup with disk technology to create an optimized
backup and recovery infrastructure. Tape emulation software on the disk appliance emulates popular
tape devices and formats. Because VTLs identify themselves as tape equipment, for the backup
software, they appear identical to the actual tape device that is emulated.
VTLs offer the performance advantages of disk backup and they may be seamlessly deployed in a
system environment, without changing the backup infrastructure.
Note: In this class (where physical tape devices are not available), you use virtual test devices to
practice Oracle Secure Backup operations. These virtual test devices are not supported in production
use and are different from the commercially sold VTLs.
For a list of supported VTLs, refer to Certify on MetaLink.

Oracle Database 10g: Backup and Recovery 10 - 17


Managing Data to Be Protected

Oracle Database File System Data

Defining what data to RMAN backup sets Datasets, user-defined,


back up group hosts, files, or
directories to back up

Backup options Use RMAN backup Multilevel backups: full,

Oracle Internal & Oracle Academy Use Only


levels: full and incremental, or off-site
incremental

Frequency of Recurring or Flexible date/time


backups immediate backups calendar–based
scheduled using scheduling
Enterprise Manager On-demand backups

Copyright © 2006, Oracle. All rights reserved.

Managing Data to Be Protected


Managing the backup infrastructure of file-system data and Oracle database data is easily
administered with Oracle Secure Backup and RMAN. Defining what data to back up is conceptually
similar for file-system and database data. Both require that you, the user, define what to include in
the backup. For the database, you use the RMAN backups sets created using RMAN or Enterprise
Manager. For file systems, Oracle Secure Backup uses “datasets.” Use the Oracle Secure Backup
Web tool to define file-system datasets.
After defining what data to back up, you must determine what type of backup is most appropriate to
meet your backup and restore requirements. Oracle Secure Backup offers multiple backup levels for
file-system backups including full backup levels, multiple incremental levels, and an off-site backup
level. The off-site level is actually a full backup performed without interfering with any incremental
backup strategies. Oracle Secure Backup also provides flexible scheduling options enabling you to
determine ongoing backup schedules based on the day and time granularity. For the Oracle database,
RMAN offers full and incremental backup levels that are backed up to tape by Oracle Secure
Backup.
After you have defined what, how, and how often to back up your data through scheduling, Oracle
Secure Backup can automatically implement your backup schedules requiring only manual
intervention for hardware errors or media needs.

Oracle Database 10g: Backup and Recovery 10 - 18


Oracle Secure Backup Jobs

Log
Job
Backup
ID
Restore
Type

Oracle Internal & Oracle Academy Use Only


Transcript

Job
summaries

Copyright © 2006, Oracle. All rights reserved.

Oracle Secure Backup Jobs


Each backup and restore operation creates a corresponding job. Each job has a unique ID, log, and
transcript.
• Job logs describe high-level events, such as:
- Job creation
- Job dispatch
- Completion times
• Job transcripts describe the job details:
- Created at the time of dispatch
- Updated as the job progresses
- Reports needs such as “operator assistance required”
There are two different job types:
• Data set jobs for file-system backup or restore
• Oracle backup jobs for database backup or restore
A job summary is a text file report produced by Oracle Secure Backup that describes the status of
selected file-system backup and restore jobs. Job summaries may be generated on a regular, repeating
basis and sent via e-mail to users.

Oracle Database 10g: Backup and Recovery 10 - 19


Securing Data and Access to the Backup Domain

• User-level access control


– Users assigned to a set of privileges, called classes
– Consistent user identity mapping OS privileges to Oracle
Secure Backup user, called preauthorized access
• Host authentication
– Two-way server authentication

Oracle Internal & Oracle Academy Use Only


• Encryption
– Oracle Database 10gR2 backup encryption to tape
– Data and backup messages encrypted in-transit as part of
SSL interdomain communication

Copyright © 2006, Oracle. All rights reserved.

Securing Data and Access to the Backup Domain


An Oracle Secure Backup administrative domain is a network of hosts. Any such network has a level
of vulnerability to malicious attacks. The task of the security administrator is to learn the types of
possible attacks and how to guard against them.
Access Control
To access the Oracle Secure Backup software, you must enter a username and password or use
preauthorization. Each Oracle Secure Backup user is assigned to a class, which defines the actions
that are permitted for that user.
Host Authentication
All hosts in the administrative domain use SSL and X.509 certificates for identity verification and
authentication. Sensitive data is encrypted before transmittal over the network. SSL protects the
administrative domain from eavesdropping, message tampering or forgery, and replay attacks.
The Web server requires a signed X.509 certificate and associated public and private keys to
establish an SSL connection with a client browser. The X.509 certificate for the Web server is self-
signed by the installation script when you install Oracle Secure Backup on the administrative server.

Oracle Database 10g: Backup and Recovery 10 - 20


Securing Data and Access to the Backup Domain (continued)
Network Backup Security
Note: Currently, the NDMP protocol does not include a mechanism to accommodate the negotiation
of an SSL connection to NDMP filers.
Encryption
File-system backups on tape are not encrypted by Oracle Secure Backup. When you use Oracle
Secure Backup to create a new file-system backup, Oracle Secure Backup applies encryption to the
data as it passes over the network. After Oracle Secure Backup writes the data to tape, the file system
data resides in unencrypted form.
When you use RMAN to make an encrypted backup of a database, RMAN encrypts the backup data
before it is provided to the SBT interface. If the data is transmitted over the network, Oracle Secure
Backup transfers the RMAN-encrypted data without applying additional encryption to the data as it
passes over the network. After Oracle Secure Backup writes the data to tape, the data resides on tape

Oracle Internal & Oracle Academy Use Only


in encrypted form. In this case, the encryption is provided by RMAN before the backup is provided
to the SBT layer. The Oracle Secure Backup SBT layer is the only supported interface for making
encrypted RMAN backups directly to tape.
By default, the data sent over the network within an administrative domain, both file system and
database, is encrypted through SSL. However, if the database backup data is first encrypted by
RMAN, then the data is not further encrypted in transit.
To improve performance of backups in a protected network, you can disable encryption for
transmitted data by means of the encryptdataintransit security policy.

Oracle Database 10g: Backup and Recovery 10 - 21


Oracle Secure Backup:
The Integration Advantage

• Key benefits of RMAN and Oracle Secure Backup


integration:
– Exclusive support of RMAN backup encryption to tape
– Faster, more reliable database backups to tape
– Single technical support resource, expediting problem
resolution

Oracle Internal & Oracle Academy Use Only


• EM integration exclusive to Oracle Secure Backup
– Familiar interface for Oracle customers, reducing any
learning curves associated with other products
– Management of the entire Oracle database backup and
recovery from disk (Flash Recovery Area) to tape
• Advanced security leveraging Oracle’s proven
technology

Copyright © 2006, Oracle. All rights reserved.

Oracle Secure Backup: The Integration Advantage


This slide summarizes key benefits of RMAN and Oracle Secure Backup integration over other third-
party media management libraries.
Details about the security technology are:
• Secure Socket Layer (SSL) implementation
• Embedded Oracle wallets

Oracle Database 10g: Backup and Recovery 10 - 22


Why Use Oracle Secure Backup?

• Intelligent integration with RMAN delivering the best


performance and security for database backups
– Backup encryption performed with Oracle database
– Faster, smaller backups protecting only used blocks
• Scalable, low-cost per-tape drive pricing
– Substantial cost savings over the competition

Oracle Internal & Oracle Academy Use Only


– Unlimited clients, servers, and NAS
• Single technical support resource for entire backup
solution expedites problem resolution
• Reliable, centralized backup management for entire
Oracle environment

Copyright © 2006, Oracle. All rights reserved.

Why Use Oracle Secure Backup?


• Since Oracle 8.0, RMAN is the recommended backup utility for the Oracle database. It is known
for reliable, automated, online protection of data to disk, and is integrated with numerous third-
party media management products for backups to tape. Oracle Secure Backup provides an
alternative to expensive, third-party tape backup utilities by providing the media management
layer for RMAN tape utilization.
• Oracle Secure Backup 10.1 increases customer return on investment by providing end-to-end
tape data protection for your Oracle environment at a fraction of the cost of other tape products.
• Oracle Secure Backup exclusively provides RMAN encrypted backup to tape.
• To deliver the fastest database tape backup, Oracle Secure Backup backs up only used blocks
(from Oracle Database 10.2.0.2 and higher). This process makes the backups faster and smaller,
which also saves space on tape.
• Oracle Secure Backup (as part of the Oracle technology stack) offers a single-vendor technical
resource for complete Oracle database protection. The Oracle Secure Backup installation
automatically links the SBT libraries for RMAN tape backups.

Oracle Database 10g: Backup and Recovery 10 - 23


Summary

In this lesson, you should have learned how to:


• Describe how Oracle Secure Backup complements the
Oracle backup and recovery options
• Define Oracle Secure Backup terminology
• Describe Oracle Secure Backup interface options

Oracle Internal & Oracle Academy Use Only


• Describe backup management features of Oracle
Secure Backup

Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 10 - 24


Installing Oracle Secure Backup

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.
Objectives

After completing this lesson, you should be able to:


• Install Oracle Secure Backup on Linux
• Choose an Oracle Secure Backup interface
• Register the Administrative Server in EM
• Add an Oracle Secure Backup user with preauthorized

Oracle Internal & Oracle Academy Use Only


access

Copyright © 2006, Oracle. All rights reserved.

For More Information


• Oracle Secure Backup Installation Guide
• For supported tape devices, see http://www.oracle.com/technology/products/secure-backup.
• For supported Web browser, platform and NAS devices, see Oracle’s certification matrix on
MetaLink.

Oracle Database 10g: Backup and Recovery 11 - 2


Performing Preinstallation Tasks

• Confirm that your planned environment is supported.


– Tape device support matrix on OTN
– Platform support on Certify on metalink.oracle.com
• Plan disk space for Oracle Secure Backup.
• Obtain Oracle Secure Backup software via OTN
download or CD.

Oracle Internal & Oracle Academy Use Only


• Plan your administrative domain—that is, determine
which host will be Administrative Server, which media
servers or clients.
• Obtain SCSI device information (UNIX and Linux).

Copyright © 2006, Oracle. All rights reserved.

Performing Preinstallation Tasks


There is no required sequence between the preinstallation tasks.
Check the supported device list on OTN to confirm that your environment is supported:
• Platform support by host role
• Tape library and tape drive support
• Connectivity support
Each host that participates in an Oracle Secure Backup administrative domain must have a network
connection and run TCP/IP. Oracle Secure Backup uses this protocol for all inter- and intra-machine
communication between its own and other system components.
Each appliance that employs a closed operating system, such as Network Attached Storage (NAS)
and tape servers, is backed up using NDMP. This protocol enables Oracle Secure Backup to access
primary and secondary storage controlled by the appliance.
Each host that participates in an Oracle Secure Backup administrative domain must also have some
preconfigured way to resolve a host name to an IP address. Most systems use one of the name
resolution mechanisms: (DNS, NIS, WINS, or a local hosts file) to do this. Oracle Secure Backup
does not require a specific mechanism. Oracle Secure Backup requires only that, upon presenting the
underlying system software with an IP address you have configured, it obtains an IP address
corresponding to that name.

Oracle Database 10g: Backup and Recovery 11 - 3


Installation and Configuration of
the Administrative Domain

OTN CD-ROM

1. Software 2. Configure additional hosts and


installation tape devices

Oracle Internal & Oracle Academy Use Only


Administrative Media Tape drives
server Client
server and libraries
Media
Client
server

Copyright © 2006, Oracle. All rights reserved.

Installation and Configuration of the Administrative Domain


The installation and configuration of your administrative domain includes the following:
• Install the Oracle Secure Backup software itself on each of your hosts except NDMP-enabled
hosts such as Network Attached Storage (NAS) filers.
• Define your administrative domain on the administrative server. This step involves defining all
media servers, clients, and NAS filers.
• When installing a media server, Oracle Secure Backup device attachments are created as part of
the device driver installation process. These attachments are used during the device definition.
Make the administrative server aware of the tape devices that exist in your administrative
domain. On each defined media servers, you need to configure the directly attached SCSI and
Fibre Channel devices (tape libraries and tape drives). If you use a NAS filer with attached tape
libraries and tape drives, you can use Oracle Secure Backup commands to discover these
devices; this allows Oracle Secure Backup to recognize and communicate with the NAS-
attached devices.

Oracle Database 10g: Backup and Recovery 11 - 4


Performing Installation Tasks

1. Log in as the root user.


2. Create an Oracle Secure Backup home directory.
3. Change your directory to the <OSB_Home> directory.
4. Run the setup program and respond to the prompts.

Oracle Internal & Oracle Academy Use Only


[stage] $ su
Password:
[stage]# mkdir -p /usr/local/oracle/backup
[stage]# cd /usr/local/oracle/backup
[backup]# /stage/osb_10_1cdrom/setup

Copyright © 2006, Oracle. All rights reserved.

Performing Installation Tasks


The recommended directory for installing the Oracle Secure Backup software is
/usr/local/oracle/backup. You can install the software in a different directory, if desired.
However, then the printed and online documentation for Oracle Secure Backup may not agree with
your actual commands, output, and GUI screens. For users new to Oracle Secure Backup, this can
add an unwanted layer of confusion.
In this course, you use the default directory: /usr/local/oracle/backup as <OSB_Home>.
Note: There is no default “OSB_Home” environment variable, which is used to refer to this
directory, unlike the ORACLE_HOME variable used with Oracle Database installations.
After your <OSB_Home> directory is created, change your current directory to the <OSB_Home>
directory, and execute the setup program from your staging area, which in this example is the
/stage/osb_10_1cdrom directory. If you use your CD-ROM drive as your staging area, use a
command similar to /cdrom/cdrom0/setup. In the above example, a stage directory is used
instead of a CD-ROM drive.

Oracle Database 10g: Backup and Recovery 11 - 5


Administrative Server Installation: Example

Welcome to Oracle's setup program for Oracle Secure Backup.


This program loads Oracle Secure Backup software from the CD-
ROM to a filesystem directory of your choosing.

This CD-ROM contains Oracle Secure Backup version 10.1.060420.


Please wait a moment while I learn about this host... done.

- - - - - - - - - - - - - - - - - - - -

Oracle Internal & Oracle Academy Use Only


You may load any of the following Oracle Secure Backup
packages:
1. linux32 (RH 2.1, RHEL 3, RHEL 4, SuSE 8, SuSE 9)
administrative server, media server, client
2. solaris64 (Solaris 2.8 and later, SPARC)
administrative server, media server, client

Enter a space-separated list of packages you'd like to load.


To load all
packages, enter 'all' [1]: 1

Copyright © 2006, Oracle. All rights reserved.

Administrative Server Installation: Example


As you can see, several numeric choices are displayed for various platforms, including Solaris, and
several flavors of Linux. Select the number that corresponds to the installation package for the UNIX
platform that you are running. The above example uses Linux.
You have the option of selecting multiple machines on which to install Oracle Secure Backup.
Simply list all package numbers, separated by spaces, on the same line. For example, to install Oracle
Secure Backup software for Solaris and Linux machines, you would respond as shown here:
To load all packages, enter 'all' [1]: 1 2
If you choose to install packages for other operating systems on the local host, you can use these files
to install Oracle Secure Backup on designated hosts in the administrative domain by using a network
connection.

Oracle Database 10g: Backup and Recovery 11 - 6


Administrative Server Installation: Example

Loading Oracle Secure Backup installation tools... done.


Loading linux32 administrative server, media server, client...
done.
- - - - - - - - - - - - - - - - - - - -
Loading of Oracle Secure Backup software from CD-ROM is
complete. You may unmount and remove the CD-ROM.

Would you like to continue Oracle Secure Backup installation

Oracle Internal & Oracle Academy Use Only


with 'installob' now? (The Oracle Secure Backup Media
Management Installation Guide contains complete information
about installob.)
Please answer 'yes' or 'no' [yes]: yes
- - - - - - - - - - - - - - - - - - - -

Copyright © 2006, Oracle. All rights reserved.

Administrative Server Installation: Example (continued)


installob is the primary installation script for Oracle Secure Backup. It can be called in a stand-
alone fashion by invoking the installob shell script.

Oracle Database 10g: Backup and Recovery 11 - 7


Administrative Server Installation: Example

- - - - - - - - - - - - - - - - - - - -
Welcome to installob, Oracle Secure Backup's UNIX installation
program.

It installs Oracle Secure Backup onto one or more UNIX, Linux,


or other supported open-source systems on your network.
(Install Oracle Secure Backup for Windows using the CD-ROM from
which you loaded this software.)

Oracle Internal & Oracle Academy Use Only


For most questions, a default answer appears enclosed in square
brackets. Press Enter to select this answer.

Please wait a few seconds while I learn about this machine...


done.

Have you already reviewed and customized install/obparameters


for your Oracle Secure Backup installation [yes]? yes

Copyright © 2006, Oracle. All rights reserved.

Administrative Server Installation: Example (continued)


A preconfigured obparameters file was created during the installation process.
If you respond yes, the installation continues.
If you respond no to the above prompt, you will be prompted to rerun installob after updating
the parameter file. You can use a text editor to edit the obparameters file in the
/usr/local/oracle/backup/install/ directory (referred to as the
<OSB_Home>/install directory). Various parameters are defined that you can configure to meet
the needs of your business. For example, you can modify parameters for:
• Oracle Secure Backup daemon observiced automatic startup at boot time
• Automatic creation of an Oracle Secure Backup user, called oracle, that is assigned the
oracle class, and preauthenticated to be used by RMAN
• Oracle Secure Backup directory names

Oracle Database 10g: Backup and Recovery 11 - 8


Administrative Server Installation: Example

- - - - - - - - - - - - - - - -

You can choose to install Oracle Secure Backup in one of


two ways:
(a) interactively, by answering questions asked
by this program, or
(b) in batch mode, by preparing a network

Oracle Internal & Oracle Academy Use Only


description file
Use interactive mode to install Oracle Secure Backup on
a small number of hosts. Use batch mode to install
Oracle Secure Backup on any number of hosts.

Which installation method would you like to use (a or b)


[a]? a

Copyright © 2006, Oracle. All rights reserved.

Administrative Server Installation: Example (continued)


You continue with the installation using one of the following two methods:
• If you quit the setup program to modify the obparameters file, then start the installob
script using the following commands (logged in as root):
# cd <Oracle Secure Backup software directory>
# install/installob
(The Oracle Secure Backup software is installed by default in the
/usr/local/oracle/backup directory)
• If you did not exit the setup program, indicate that the obparameters file is acceptable, and
the program continues by calling the installob installation script.
You then select one of the following installation modes:
• (a) interactive mode: The software is installed on one machine at a time. After each installation,
you are asked if you want to install the software on another machine.
• (b) batch mode: You can use this to create or modify a network description file, which is a text
file that describes your network configuration. The setup program uses the information in this
file to push the subset of the Oracle Secure Backup software that is required for Oracle Secure
Backup to run on the remote machine.

Oracle Database 10g: Backup and Recovery 11 - 9


Administrative Server Installation: Example

Oracle Secure Backup is not yet installed on this


machine.

Oracle Secure Backup's Web server has been loaded, but


is not yet configured. You can install this host one of
three ways:
(a) administrative server
(the host will also be able to act as a media

Oracle Internal & Oracle Academy Use Only


server or client)
(b) media server
(the host will also be able to act as a
client)
(c) client

If you are not sure which way to install, please refer


to the Oracle Secure Backup Installation Guide. (a,b or
c) [a]? a

Copyright © 2006, Oracle. All rights reserved.

Administrative Server Installation: Example (continued)


After specifying the method of installation, you specify the role for this machine. In this example,
this is the first time Oracle Secure Backup is being installed on the network, so you choose an
administrative server installation.

Oracle Database 10g: Backup and Recovery 11 - 10


Administrative Server Installation: Example

Beginning the installation. This will take just a minute and


will produce
several lines of informational output.

Installing Oracle Secure Backup on edrsr10p1 (Linux version


2.4.21-20.ELsmp)

You must now enter a password for the Oracle Secure Backup

Oracle Internal & Oracle Academy Use Only


'admin' user.
Oracle suggests you choose a password of at least 8 characters
in length,
containing a mixture of alphabetic and numeric characters.

Please enter the admin password:oracle << not echoed >>


Re-type password for verification:oracle << not echoed >>

Copyright © 2006, Oracle. All rights reserved.

Administrative Server Installation: Example (continued)


Choose a password for the admin user, which follows your security strategies.
During the software installation, the installob script displays output relating to the actions it
performs. This information varies among operating systems. The output may also be different if the
obparameters file was modified.
generating links for admin installation with Web server
checking Oracle Secure Backup's configuration file (/etc/obconfig)
setting Oracle Secure Backup directory to /usr/local/oracle/backup in
/etc/obconfig
setting local database directory to /usr/etc/ob in /etc/obconfig
setting temp directory to /usr/tmp in /etc/obconfig
setting administrative directory to /usr/local/oracle/backup/admin in
/etc/obconfig
protecting the Oracle Secure Backup directory
removing /etc/rc.d/init.d/qrserviced
creating /etc/rc.d/init.d/observiced
activating observiced via chkconfig
initializing the administrative domain
creating default oracle user

Oracle Database 10g: Backup and Recovery 11 - 11


Administrative Server Installation: Example

Is edrsr4p1 connected to any tape libraries that you'd


like to use with Oracle Secure Backup [no]? no

Is edrsr4p1 connected to any tape drives that you'd like


to use with Oracle Secure Backup [no]? no

Would you like to install Oracle Secure Backup on any

Oracle Internal & Oracle Academy Use Only


other machine [yes]? no
Installation summary:

Installation Host OS Driver OS Move Reboot


Mode Name Name Installed? Required? Req?
admin edrsr4p1 Linux no no no

Oracle Secure Backup is now ready for your use.

Copyright © 2006, Oracle. All rights reserved.

Administrative Server Installation: Example (continued)


After the Oracle Secure Backup software has been installed, you are asked if you want to configure
any tape libraries that might be attached to the current host.
If you do not have any devices to configure, or you do not want to configure the devices at this time,
you can press [Enter] to accept the default value of no. You can configure devices at a later time
using EM or the makedev interface.
Next, you are given the option of performing a remote installation of Oracle Secure Backup to
another machine using the software already installed on the administrative server. In this example,
you decide not to perform any further installations from this machine.
After the software installation completes, an installation summary appears.

Oracle Database 10g: Backup and Recovery 11 - 12


Wizard-Based Installation on Windows

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Wizard-Based Installation on Windows


Start your Windows installation by running the setup.exe program. This activates the
InstallShield wizard. Answer the questions of the InstallShield wizard, such as your customer
information, your server role definition, your predefined Oracle user, and other questions needed to
complete the installation on a Windows server.
Oracle Secure Backup supports configuring the administrative domain on a host running the
Windows operating system.
To support running an administrative server on Windows, the GNU SMTP implementation is
replaced with an Oracle-developed one.
During the installation process, the Oracle Secure Backup Setup wizard copies all Oracle Secure
Backup files to the local host and generates Windows Registry entries.
The default directory on Windows is C:\Program Files\Oracle\Backup\, which is
different from the recommended UNIX directory of usr/local/oracle/backup.

Oracle Database 10g: Backup and Recovery 11 - 13


Oracle Secure Backup Interfaces

Oracle Secure
Backup

Oracle Internal & Oracle Academy Use Only


Web
obtool
tool

Enterprise Manager
interface

Copyright © 2006, Oracle. All rights reserved.

Oracle Secure Backup Interfaces


You can use either the GUI interface or the obtool command-line interface (CLI) to access the
Oracle Secure Backup information. In all cases, you must use a valid username and password.
For example, if you want to view the Oracle Secure Backup users, you can choose any of these three
interfaces:
• You can start the Web tool by entering https://<host_name> into your Web browser.
Click the Configure tab, and then click Users.
• You can start Enterprise Manager by entering http://<host_name>:1158/em into your
Web browser, and then select the following: Maintenance > Oracle Secure Backup Device and
Media > Configure > Users.
• You can start the obtool command line by entering obtool in a terminal window, and then
the lsuser command.
Note: Enterprise Manager is the recommended interface.

Oracle Database 10g: Backup and Recovery 11 - 14


Integration with Enterprise Manager

Oracle Internal & Oracle Academy Use Only


• The Oracle Secure Backup Device and
Media link evokes the Oracle Secure
Backup Administrative Server page in EM.
• The File System Backup and Restore link
evokes the Oracle Secure Backup Web tool.

Copyright © 2006, Oracle. All rights reserved.

Integration with Enterprise Manager


Oracle Secure Backup has been integrated with Enterprise Manager (Database Control and Grid
Control). It can be accessed through the Maintenance page.
By using the EM interface, you can manage the Oracle Secure Backup administrative domain,
performing tasks such as adding or deleting media servers or tape devices, and scheduling RMAN
backups for the database.
The Web tool is the best interface to use file-system backups, adding and deleting clients, managing
defaults and polices, and managing Oracle Secure Backup users.

Oracle Database 10g: Backup and Recovery 11 - 15


Oracle Secure Backup
Administrative Server Page

em_admin_server_home.gif

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Secure Backup Administrative Server Page


Within the Enterprise Manager framework, Oracle Secure Backup has an intuitive Administrative
Server home page that provides an overview of your administrative domain.
From this management console, you can perform management tasks for the administration domain by
clicking the appropriate links:
• Administrative server (the Edit settings link)
• Media servers
• Media families
• Volumes (the Details link)
• Devices (the Manage link, or click the device name in the Devices table)
Note: For file-system backups, a link to invoke the Oracle Secure Backup Web tool is conveniently
located at the bottom of the page.

Oracle Database 10g: Backup and Recovery 11 - 16


Configuring the Administrative Server in EM

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Configuring the Administrative Server in EM


Before you can use Enterprise Manager to manage your administrative domain, you must first
configure the administrative server information within EM.
Connect to the EM Database Control on the administrative server. From the Maintenance page, click
the “Oracle Secure Backup Device and Media” link in the Oracle Secure Backup section. This takes
you to the Add Administrative Server page if this is the first time you are trying to access Oracle
Secure Backup from Database Control on that host.
On the Add Administrative Server page, you need to specify the Oracle Secure Backup home
directory, which is the directory specified during the software installation. EM assumes that the local
host is the Oracle Secure Backup administrative server and enters the local host name for the
administrative server name. After specifying the administrative server host, you need to enter the
Oracle Secure Backup administrative username and password (for example, admin). Then, click
OK.
You can also navigate to the Add Administrative Server page by clicking the Backup Settings link on
the Maintenance page. When the Backup Settings page is displayed, scroll down to the Oracle Secure
Backup section and click Configure. On the Administrative Server Login page, you can choose the
“Add a new administrative server” option, or change the current login information.

Oracle Database 10g: Backup and Recovery 11 - 17


Oracle Secure Backup
Web Tool Home Page

web_home_page.gif

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Secure Backup Web Tool Home Page


The Oracle Secure Backup Web tool Home page provides a snapshot of the current status of Oracle
Secure Backup jobs and devices, presenting important summary information to administrators and
users.
The Home page includes the schedule times and statuses of recent jobs as well as job IDs, job type,
and job level. Oracle Secure Backup provides a link for failed jobs, alerting users and administrators
to potential trouble spots.
The Devices link lists the devices associated with each job along with information concerning device
type, device name, and status. This page provides you with an overall sense of the various backup or
restore processes that are going on.
The Web tool provides a graphic interface for just about all of the Oracle Secure Backup features,
such as:
• Flexible scheduling options for backups of file-system data:
- Specify backups based on time of day, days of the week, month, quarter, or year
- Schedule backups to start immediately or at a future date
• Backup windows to minimize impact on day-to-day backup operations
• Ability to create off-site backups for remote storage without disturbing currently scheduled
incremental backups of the same data

Oracle Database 10g: Backup and Recovery 11 - 18


Common obtool Commands
Category obtool Command
Hosts lshost -l

Devices lsdev

Storage selectors lsssel

User info id, lsuser, lsclass

Jobs and schedules lsjob [-a | -c | -p]


lsbw (backup windows)

Oracle Internal & Oracle Academy Use Only


lssched

Backups lsds (for dataset information)


lspiece (for RMAN backup pieces)
lsbackup (for file system backups)
lssection (for backup image sections)

Media families lsmf --long

Volumes lsvol --all or lsvol --library <libname>

Copyright © 2006, Oracle. All rights reserved.

Common obtool Commands


The table in the slide lists some of the common obtool commands you can use to query the Oracle
Secure Backup administrative and catalog data. Depending upon the information you want to
retrieve, you may use additional options to specify the amount of information returned, such as
listing all the volumes for a particular media family or listing only completed jobs.

Oracle Database 10g: Backup and Recovery 11 - 19


Configuring Oracle Secure Backup Users

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Configuring Oracle Secure Backup Users


The Users page lists all the users authorized by Oracle Secure Backup along with their class names
and e-mail addresses.

Oracle Database 10g: Backup and Recovery 11 - 20


Adding Oracle Secure Backup Users

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Adding Oracle Secure Backup Users


To configure one or more users, perform the following steps:
1. From the Web tool Home page, click the Configure tab in the menu bar.
2. Click Users in the submenu under Basic. The Users page appears.
3. Click the Add button to add a new user. A dialog box appears for entering a username.
4. Enter a username in the User field. Formally, it is unrelated to any other name used in your
computing environment or the Oracle Secure Backup administrative domain. Practically, you
might find it convenient to choose Oracle Secure Backup usernames that are identical to users’
Windows or UNIX names.
5. Enter a password for the user in the Password field. This password is used to log in to Oracle
Secure Backup.
6. Select a class from the User class list.
7. Optionally, enter a given name in the Given name filed. This name is for information purposes
only.
8. Enter a UNIX name for this account in the UNIX name field. This name forms the identity of
any nonprivileged jobs run by the user on UNIX systems. If this Oracle Secure Backup user
will not, or is not permitted to, run Oracle Secure Backup jobs on UNIX systems, the user can
leave this field blank.

Oracle Database 10g: Backup and Recovery 11 - 21


Adding Oracle Secure Backup Users (continued)
9. Enter a UNIX group name for this account in the UNIX group field. This name forms the
identity of any nonprivileged jobs run by the user on UNIX systems.
10. In the NDMP server user list, select “yes” if you want Oracle Secure Backup’s NDMP server to
accept a login from this user using the username and password you have supplied. This is not
required for normal Oracle Secure Backup operation and is typically set to “no.”
11. Enter the e-mail address for the user in the Email address field. When Oracle Secure Backup
wants to communicate with this user, such as to deliver a summary report or notify the user of a
pending input request, it does so by sending an e-mail to this address.
12. Choose one of the following:
- Click Apply to add the user account and remain in this page.
- Click OK to add the user account and return to the Users page. The user account appears in
the User Name box on the Users page. A message appears in the Status box informing you
that the user was successfully added.

Oracle Internal & Oracle Academy Use Only


- Click Cancel to avoid the operation and move back one page.
13. If the user you configured needs to initiate backup and restore operations on Windows clients,
refer to the “Assigning Windows Account Information” section.
Note: Oracle Secure Backup creates the admin user when a new administrative domain is
initialized. You cannot remove the admin user.

Oracle Database 10g: Backup and Recovery 11 - 22


Preauthorizing Access

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Preauthorizing Access
To provide preauthorized access, you can modify parameters for an existing user account:
1. From the Users page, select the name of the user from the User Name box.
2. Click the Edit button. A page appears with details for the user you selected.
3. Make any required changes. To modify users, you need to be a member of a class that has this
right enabled.
4. Choose one of the following:
- Click Apply to remain in this page.
- Click OK to save the changes and return to the Users page.
- Click Cancel to avoid the operation and move back one page.
• If your Oracle Secure Backup user needs to initiate backup and restore operations on Windows
clients, then you need to add Windows Domains information.
• To configure RMAN and/or command-line preauthorization, click Preauthorized Access and
specify the appropriate attributes. The combination of Hosts, OS username, and Windows
domain name must be unique.
Note: For more information about the Oracle Secure Backup user, see the lesson titled “Managing
Oracle Secure Backup Security.”

Oracle Database 10g: Backup and Recovery 11 - 23


Summary

In this lesson, you should have learned how to:


• Install Oracle Secure Backup on Linux
• Choose an Oracle Secure Backup interface
• Register the administrative server in EM
• Add an Oracle Secure Backup user with preauthorized

Oracle Internal & Oracle Academy Use Only


access

Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 11 - 24


Practice Overview

This practice covers the following topics:


• Creating your Oracle Secure Backup home directory
• Installing the Oracle Secure Backup software
• Configuring virtual test devices
• Registering your administrative server with EM

Oracle Internal & Oracle Academy Use Only


• Inserting four volumes into the tape library
• Defining a new Oracle Secure Backup user
• Configuring preauthorization for this user
Note: Completing all practice steps is a prerequisite for all
the following practices.

Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 11 - 25


Oracle Internal & Oracle Academy Use Only
Using RMAN and Oracle Secure Backup

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.
Objectives

After completing this lesson, you should be able to:


• Create database backup storage selectors
• Describe integrated disk and tape backup
• Perform Oracle-suggested backup to tape
• Determine database recovery

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 12 - 2


RMAN and Oracle Secure Backup
Basic Process Flow

5
RMAN 1
4
2
Administrative

Oracle Internal & Oracle Academy Use Only


server

3
Oracle Secure Backup Data being Media server
Client: backed up
Database server

Copyright © 2006, Oracle. All rights reserved.

RMAN and Oracle Secure Backup Basic Process Flow


1. RMAN initiates backup.
2. Oracle Secure Backup creates the backup job.
3. Oracle Secure Backup executes the job (transfers data from client to media).
4. Oracle Secure Backup updates its own catalog.
5. RMAN updates its repository.

Oracle Database 10g: Backup and Recovery 12 - 3


RMAN Database Backup to Tape

1. Configure 2. Perform Backup and Restore


Oracle Secure Interface Options
Backup
Oracle
SBT
Database server
library
backup session
RMAN

Oracle Internal & Oracle Academy Use Only


storage
selector
Oracle Secure
Backup
Preauthorized Enterprise
RMAN user Manager

Copyright © 2006, Oracle. All rights reserved.

RMAN Database Backup to Tape


The RMAN database backup to tape consists of two steps:
1. Configure preauthorization and a database storage selector in Oracle Secure Backup.
2. Use RMAN to perform your backup and restore operation.
When you install Oracle Secure Backup, the installer automatically performs the following
tasks:
• Copies the SBT library to the /lib subdirectory of the <OSB_Home> directory
• Creates a symbolic link to the library in the /lib or /usr/lib directory
So, by default, you are automatically using Oracle Secure Backup each time you allocate an
SBT_TAPE channel with RMAN.
On a host that has Oracle Secure Backup installed, RMAN searches for and loads the SBT
library, when an SBT channel is allocated. RMAN looks in a platform-specific default location
for the SBT library. On UNIX or Linux, the default library file name is
$ORACLE_HOME/lib/libobk.so, with the extension name varying according to platform:
.so, .sl, .a, and so on. On Windows, the default library location is
%ORACLE_HOME%\bin\orasbt.dll.
When you access Oracle Secure Backup from RMAN, all you do is allocate a channel of type
SBT_TAPE, and then run RMAN commands to back up or restore your database.

Oracle Database 10g: Backup and Recovery 12 - 4


Database Backup Storage Selector

Database
name
Wait time Database ID

Database
backup
Copy number

Oracle Internal & Oracle Academy Use Only


Host
storage
selector

Restricted
devices Media family

Content

Copyright © 2006, Oracle. All rights reserved.

Database Backup Storage Selector


Database backup storage selectors are for backups of Oracle databases. Oracle Secure Backup
uses information encapsulated in storage selectors to interact with RMAN when performing
backup operations. Oracle Secure Backup maintains storage selectors as an object type on the
administrative server.
When RMAN performs an Oracle database backup to devices and media managed by Oracle
Secure Backup, RMAN passes the database name, content type, and copy number to Oracle
Secure Backup. With this information Oracle Secure Backup determines the corresponding
database backup storage selector. This selector informs Oracle Secure Backup which devices, if
any, to restrict this backup to and which media family (if any) to use.
Database backup storage selectors enable you to specify which resources should be used by SBT
backups. A database backup storage selector object contains the following information:
• The database name or ID. An asterisk character (*) indicates that the storage selector
applies to all databases.
• The name of the hosts to which this selector applies. An asterisk character (*) indicates that
the storage selector applies to databases residing on all available hosts.

Oracle Database 10g: Backup and Recovery 12 - 5


Database Backup Storage Selector (continued)
• The name of the media family to use for backups under the control of this storage
selector object
• The backup content to which this selector applies. The content may be one or more of the
following:
- archivelog: Backs up or restores database archived redo logs
- full: Backs up or restores the database files, regardless of when they were last
backed up. This option is the same as a level 0 backup.
- incremental: Backs up or restores only data that has been modified since the last
backup, regardless of the backup level
- autobackup: Backs up or restores control files
- * : Represents all content types
• The names of devices to which backups controlled by this storage selector are restricted.

Oracle Internal & Oracle Academy Use Only


You specify the restriction in one of the following forms:
- <devicename>: Uses the specified device
- @<hostname>: Uses any device of the specified host
- <devicename>@<hostname>: Uses the specified device attached to the
specified host
When more than one device restriction is specified in a list, Oracle Secure Backup selects
only one of them from the list.
• The RMAN copy number to which this selector applies. This is configured for use with
the RMAN commands BACKUP … COPIES or CONFIGURE BACKUP COPIES to
duplex backup sets to protect against disaster, media damage, or human error. The copy
number must be an integer in the range of 1 through 4. The default value is an asterisk (*),
which indicates that the storage selector applies to any copy number.
• How long to wait for the availability of resources required by backups under the control
of this storage selector. The resource wait time is specified as a duration, which has the
following format:
duration::= forever | disabled |
number {[seconds] | [minutes] | [hours] |
[days] | [weeks] | [months] | [years]}
If the resources do not become available during the specified wait time, RMAN fails the
job.
Note: For more information about creating and managing database backup storage selectors,
refer to the obtool topic, “Database Backup Storage Selector Commands,” in the Oracle
Secure Backup Reference manual.

Oracle Database 10g: Backup and Recovery 12 - 6


Defining Database Storage Selectors

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Defining Database Storage Selectors


Storage selectors are created, named, and modified by a user belonging to a class with the
modify administrative domain's configuration right.
To create a database backup storage selector, perform the following steps:
1. In EM Database Control, click the Maintenance tab.
2. On the Maintenance page, click the Configure Backup Settings link.
3. On the Configure Backup Settings page, click Configure in the Oracle Secure Backup
section. This takes you to the Backup Storage Selectors page. From there, you can manage
your backup storage selectors. Then, click Return.
You can also use the following example command to create a database storage selector:
mkssel -c * -d * -i * -h EDRSR14P1 -r vt1 ssel1
This example creates a database backup storage selector that is valid for any Oracle database
located on the EDRSR14P1 host. The storage selector object is called ssel1, and it restricts
backups to the vt1 tape drive.
The lsssel command enables you to list the defined database backup storage selectors in your
administrative domain.

Oracle Database 10g: Backup and Recovery 12 - 7


Media Families and RMAN

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Media Families and RMAN


The default content-managed media family is RMAN-DEFAULT. Thus, creating media families
for use in RMAN backups is optional. You may find it useful to create different media families
for the different types of backup sets that you create with RMAN. For example, you may want to
create a media family for archived redo log backups and a separate media family for datafile
backups.
You can create media families in Enterprise Manager. On the Administrative Server page, you
can click the link corresponding to the Media Families number. This takes you to the Media
Families page, where you can create new media families and manage the existing media families
used by Oracle Secure Backup.
Alternatively, you can use the Oracle Secure Backup Web tool to create these media families or
use the mkmf command in obtool.
Note: For more information about how to manage media families within Oracle Secure Backup,
refer to the Oracle Secure Backup Administrator’s Guide.

Oracle Database 10g: Backup and Recovery 12 - 8


Oracle Database
Disk and Tape Backup Solution

Oracle Databases Flash • Flash Recovery


Recovery Area space
Area managed by
RMAN
RMAN RMAN
• Automatic
restores from disk
Backup directly --- OR --- Backup from or tape without

Oracle Internal & Oracle Academy Use Only


to tape disk to tape user-specified
destination
• Optimized backup
Oracle Secure Backup to tape
Media Management Layer

Enterprise
Manager

Copyright © 2006, Oracle. All rights reserved.

Oracle Database Disk and Tape Backup Solution


The Oracle Database 10g (and later) has a Flash Recovery Area, which is a unified disk storage
location for all database recovery–related files. RMAN manages the disk space in the Flash
Recovery Area. With the Flash Recovery Area and Oracle Secure Backup, you can easily deploy
a comprehensive disk and tape backup and recovery strategy for your Oracle databases.
By putting RMAN in control of your backup and restore operation, you simplify your
availability-related processes. You have the most effective restore process because RMAN
automatically restores from the best backup source (which can be disk or tape). If the most
recent backup is not available, RMAN continues with a previous backup. This failover can be
from disk to tape. It does not require any user intervention.

Oracle Database 10g: Backup and Recovery 12 - 9


Backing Up the Flash Recovery Area to Tape

• One simple RMAN command: BACKUP RECOVERY AREA


• Advantages of using the Flash Recovery Area to tape:
– Performing optimized backups to tape
– First restoring from Flash Recovery Area for maximum
performance, then using tape (if needed)
– Reducing I/O on databases (separate disk group)

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Backing Up the Flash Recovery Area to Tape


To back up the Flash Recovery Area to tape with Oracle Secure Backup, you issue one RMAN
command: BACKUP RECOVERY AREA. Using this disk to tape backup method (instead of
performing a separate backup of the production database to tape) provides a few distinct
advantages:
• Saves tape resource with optimized backups of the Flash Recovery Area. It eliminates
unnecessary backup of files, which are already on tape.
• Enables RMAN to utilize better restore intelligence: first from disk, then tape as needed.
Otherwise, RMAN use the most recent backup regardless of the storage media.
• Reduces I/O (important for production databases) because the Flash Recovery Area uses a
separate disk group

Oracle Database 10g: Backup and Recovery 12 - 10


Defining Retention for RMAN Backups

• Achieving retention policy with both disk and tape


backups
• Defining an RMAN RECOVERY WINDOW retention policy
• Using the RMAN DELETE OBSOLETE command:
– Deleting obsolete files on disk
– Notifying Oracle Secure Backup of backup pieces that are

Oracle Internal & Oracle Academy Use Only


no longer needed
• Defining content-managed media families for RMAN
and Oracle Secure Backup (recommendation)
File2 File1 Now

RMAN recovery window


Seven-day retention

Copyright © 2006, Oracle. All rights reserved.

Defining Retention for RMAN Backups


By defining retention periods within RMAN, a combination of disk and tape backups are utilized
to meet your recovery requirements. When using the Flash Recovery Area and Oracle Secure
Backup, the recommended RMAN retention policy is the user-defined RECOVERY WINDOW
option. This means, you define a period of time within which point-in-time recovery must be
possible. When defining this recovery window, consider also the following:
• Base retention on recovery needs
• Size Flash Recovery Area based on desired disk recovery capability
• Schedule disk and tape backups through RMAN or EM
If your recovery plan allows for restoration from disk for a certain number of hours each day, the
Flash Recovery Area should be sized to hold the recovery-related files for this time period. The
amount of time backups remain within the Flash Recovery Area is determined by the amount of
available disk space, not by a specific time setting.

Oracle Database 10g: Backup and Recovery 12 - 11


Backup Settings

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Backup Settings
In Enterprise Manager, you must configure “Tape Drives” (in this screenshot set to 1) and you
must configure a database backup storage selector. Optional, but recommended: You should test
your tape drive.

Oracle Database 10g: Backup and Recovery 12 - 12


Scheduling Backups with EM

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Scheduling Backups with EM


With the EM Database Control Console, you can schedule backups to disk, tape, or both:
1. To schedule a backup, click the Schedule Backup link from the Maintenance page.
2. On the Schedule Backup page, you can choose either the Oracle-suggested backup strategy,
or configure a customized backup.
In the screenshot shown in the slide, the Oracle-suggested strategy is chosen by clicking the
Schedule Oracle-Suggested Backup button. Regardless of whether you accept the suggested
backup method or devise your own, you can choose the type of storage media to use for your
backups.
The Oracle-suggested backup strategy makes a one-time, whole-database backup, which is
performed online. This is a baseline incremental level 0 backup. The automated backup strategy
then schedules incremental level 1 backups for each following day.
By selecting Customized, you gain access to a wider range of configuration options. Select the
objects that you want to back up—the whole database (the default) or individual tablespaces,
datafiles, archived logs, or any Oracle backups currently residing on the disk (to move them to
the tape).

Oracle Database 10g: Backup and Recovery 12 - 13


Oracle-Suggested Backup to Tape

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle-Suggested Backup to Tape


This is the example for you to explore during your practice session.

Oracle Database 10g: Backup and Recovery 12 - 14


RMAN and Oracle Secure Backup Job Execution

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

RMAN and Oracle Secure Backup Job Execution


To verify that your RMAN and Oracle Secure Backup job executed successfully, review:
• Output Log (you can see how RMAN first uses the disk, then the tape)
• EM Backup Reports (accessible from the EM Maintenance page)

Oracle Database 10g: Backup and Recovery 12 - 15


Managing Database Tape Backups

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Managing Tape Backups


Use the Manage Current Backups page to search for and display a list of backup sets or backup
copies. You can then perform management operations on selected copies, sets, or files. You can
access this page from the Maintenance page.
The Manage Current Backups page displays both disk and tape backups, as shown in the slide.
Use the Search section to find backup sets or copies using Status filters to isolate specific
objects. You can use the Contents options to further filter the results list. You can then use the
available functions on the Manage Current Backups page to manage the files or sets displayed in
the Results table.
You can use Catalog Additional Files to catalog backup pieces on disk or to add metadata to the
RMAN repository when adding a new database to an RMAN recovery catalog.
You can ensure that data about backups in the recovery catalog or control file is synchronized
with the corresponding data on disk or in the media management catalog by performing the
Crosscheck All function and scheduling the operation as a job.

Oracle Database 10g: Backup and Recovery 12 - 16


Managing Tape Backups (continued)
You can use the Delete All Obsolete function to remove backups that are obsolete, or eligible for
deletion. You can use the function to create a job that removes the physical files, deletes the
recovery catalog records (if you use a catalog), and updates the records in the target control file
to the DELETED status. If the backup is stored on tape and managed by Oracle Secure Backup,
the Oracle Secure Backup catalog is also updated to indicate that the backup pieces are deleted.
You can create a job using the Delete All Expired function to remove expired records. First, use
the Crosscheck All function to determine whether backups recorded in the repository still exist
on disk or tape. If Enterprise Manager cannot locate the backups, then it updates their records to
the EXPIRED status. Then, you can use the Delete All Expired function to remove the records.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery 12 - 17


Performing Database Recovery

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Performing Database Recovery


In Enterprise Manager, you can access the Perform Recovery page from the Maintenance page.
The Perform Recovery page enables you to perform various kinds of database recovery. You can
recover the whole database, a particular datafile, or a tablespace. RMAN automatically retrieves
all the files from backup that are needed for the specified recovery operation, regardless of
whether the files were backed up to disk or tape.
If RMAN requests files from a previous backup that is stored on tape, Oracle Secure Backup
automatically determines which tape to use. If those tapes are not immediately available
(offsite), RMAN will wait for the resources as long as you specify.
You can specify RMAN resource wait times in the following locations, each of which overrides
the preceding specifications in the list:
1. The rmanresourcewaittime policy
2. The RMAN channel configuration parameter OB_RESOURCE_WAIT_TIME

Oracle Database 10g: Backup and Recovery 12 - 18


RMAN Automatic Failover to Previous Backup

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

RMAN Automatic Failover to Previous Backup


When you need to perform recovery of your database following the loss of data, RMAN
automatically selects the most appropriate backup to restore. RMAN automatically switches to a
previous backup if the most recent backup is not available. This operation is totally transparent
and is automatically done by RMAN.
Failover from disk backups to tape backups is useful when using a Flash Recovery Area with
your Oracle database. The screenshot in the slide illustrates this situation, where the datafile
backup was inadvertently deleted from the Flash Recovery Area. As you can see, RMAN
restored the datafile using the next most recent backup, which was stored on tape by Oracle
Secure Backup. If you use tape backups exclusively in your environment and a backup or tape is
not available, then RMAN and Oracle Secure Backup can fail over to the next most recent
backup on tape.
Note: RMAN and Oracle Secure Backup work in tandem: RMAN performs the datafile or
database recovery. Oracle Secure Backup restores the necessary files, if they are located on tape.

Oracle Database 10g: Backup and Recovery 12 - 19


Summary

In this lesson, you should have learned how to:


• Create database backup storage selectors
• Describe integrated disk and tape backup
• Perform Oracle-suggested backup to tape
• Determine database recovery

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 12 - 20


Practice Overview

This practice covers the following topics:


• Creating a database backup storage selector for your
database
• Performing an Oracle-suggested backup to tape
Note: The completion of the database storage selector
practice is required for the following practice sessions.

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 12 - 21


Oracle Internal & Oracle Academy Use Only
Backing Up File-System Files
with Oracle Secure Backup

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.
Objectives

After completing this lesson, you should be able to:


• Create dataset scripts
• Schedule file backups
• Submit backup requests
• Perform file-system backups

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 13 - 2


Backing Up File-System Files
with Oracle Secure Backup

• Two ways of scheduling data backups of file systems


with Oracle Secure Backup:
– On-demand backups
– Scheduled backups
• Two types of backups:
– Full: All specified files

Oracle Internal & Oracle Academy Use Only


– Incremental: Only files that have changed since the last
lower backup
Full

Up to nine levels

Backup level 0 1 2 3 2 3

Copyright © 2006, Oracle. All rights reserved.

Backing Up File-System Files with Oracle Secure Backup


You can back up file-system files in two different ways:
• By creating on-demand (ad hoc or one-time only) backup jobs and submitting them to the Oracle
Secure Backup scheduler (with the go option)
• By using backup schedules, which define backup jobs that run at predetermined times. The
scheduler automatically initiates such jobs at a day and time that you specify.
Using Oracle Secure Backup, you can create two types of backups:
• Full backups: A full backup backs up all specified files, regardless of when they were last
backed up. This option is the same as backup level 0. You can also perform a type of full
backup, called an offsite backup, that does not affect the full or incremental backup schedule.
• Incremental backups: There are nine different incremental backup levels. In each level, Oracle
Secure Backup backs up only those files that have changed since the last backup at a lower
(numerical) backup level. You can also instruct Oracle Secure Backup to back up only those
files that have been modified since the last backup, regardless of its backup level.
Note: The “incr” level backups are not supported on certain NAS devices. Notably, this includes
Network Appliance filers.

Oracle Database 10g: Backup and Recovery 13 - 3


File-System Backups

Your steps to back up your file system:


Set-up media families.

Create datasets.

For scheduled backups: Create backup windows.

Oracle Internal & Oracle Academy Use Only


For repeating backups: Create schedule and triggers.

Create and execute backup requests.

Copyright © 2006, Oracle. All rights reserved.

File-System Backups
Assuming that you have already configured your administrative domain, you perform the following
steps when using Oracle Secure Backup to create file-system file backups:
1. Log in as a UNIX, Linux, or Windows operating system user that has access to the files to be
backed up, and log in to Oracle Secure Backup with backup privileges.
2. Configure media families to help manage the volumes created by the backup operation, if you
have not done so already.
3. Create a dataset description file that identifies the hosts and files you want to back up.
For scheduled backups, perform the following additional steps:
• Create at least one backup window, if you need to restrict the hours in which backups can be
performed. If there are no restrictions, then you can use the default backup window.
• Create a schedule for your backup job and add at least one trigger to this schedule.
For on-demand backups, perform the following additional steps:
• Create one or more backup requests.
• Send your backup requests to the scheduler. Doing so turns each backup request into a backup
job, making it eligible to run.
When you terminate your Oracle Secure Backup session, any backup requests that have not been
submitted, are lost.

Oracle Database 10g: Backup and Recovery 13 - 4


Managing Media Families

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Managing Media Families


From the EM Administrative Server page, you can click the link corresponding to the Media
Families number. This takes you to the Media Families page from where you have the options to Add
a new media family. You can also select an existing media family, and Edit or Remove that media
family.
To add a new media family, perform the following steps:
1. Enter a name for the media family in the Media Family Name field. Normally, this name will
appear as the prefix in each volume ID that uses this media family.
2. Enter a write-allowed time period in the Write window field (seconds, minutes, hours, days,
weeks, months, years). You can set the write window to a specific duration, such as 14 days or
three weeks. All volume sets that are members of the media family remain open for updates for
this period. If you do not specify a write window for a volume set, Oracle Secure Backup
considers the volume set eligible to be updated indefinitely.
3. Enter an amount of time to retain the volume using the Retain Time fields. Oracle Secure
Backup uses this to apply an expiration date to the volume set. If you intend to use this media
family to store RMAN backups, then select the Content Manages Reuse option.
4. Optionally, enter additional information in the Comment field.
5. Click OK to create your new media family.

Oracle Database 10g: Backup and Recovery 13 - 5


Dataset Script: Examples

stc1 stc2 stc3


• Textual
description
that defines which /

files to back up
home
• Examples
found in the

Oracle Internal & Oracle Academy Use Only


samples usr1 usr2 usr3 usr4
directory

tmp labs labs

labs file1.tmp file2.txt


file1.temp file2.junk labs tmp

Copyright © 2006, Oracle. All rights reserved.

Dataset Script: Examples


With Oracle Secure Backup, use datasets to describe the list of files you want to back up.
A dataset is a textual description that tells Oracle Secure Backup what files to back up. Datasets
employ a lightweight language. This dataset language gives you great flexibility in building and
organizing datasets for the files you want to protect.
The graphic in the slide illustrates the files that you can find on three different hosts. Using the
dataset script defined in the next slide, you can back up the files in the graphic except the ones
corresponding to the dashed boxes.
To familiarize yourself with the dataset language, you can find examples in the samples subdirectory
of your Oracle Secure Backup home directory.

Oracle Database 10g: Backup and Recovery 13 - 6


Dataset Script: Examples

# Dataset "common-exclusions":
exclude name tmp
exclude name *.tmp
exclude name *.temp
exclude name *.backup

# Dataset "application files":


exclude name *~
include path /home/usr1

Oracle Internal & Oracle Academy Use Only


include path /home/usr2
include host stc1
include host stc2
include host stc3 {
include dataset common-exclusions
include path /home/usr3
before backup optional "/etc/local/nfy '/usr3 begin'"
after backup optional "/etc/local/nfy '/usr3 end'"
include path /home/usr4 {
exclude name *.junk } }

Copyright © 2006, Oracle. All rights reserved.

Dataset Script: Examples (continued)


Oracle Secure Backup’s dataset language has the following characteristics:
• Comments may appear anywhere following a hash (#) character.
• Statements have the form: statement-name [statement-argument] where
statement-name may consist of multiple space-separated words, such as include path.
• Some statements may begin a nested block, and statements within the block apply only to the
statement that began the block. These have the form: statement-name [statement-
argument]{ statement-name [statement-argument] ...}
• An escape character, \, may appear anywhere to remove the special meaning of the character
following it.
• Blank lines are ignored.
The slide shows you two dataset description files that can be used to back up the data shown in the
previous slide.
The first script is used to exclude directories and files starting with tmp, *.tmp, *.temp, and
*.backup.

Oracle Database 10g: Backup and Recovery 13 - 7


Dataset Script: Examples (continued)
The second script is used to back up the following data on hosts stc1, stc2, and stc3:
• On stc1 and stc2: /home/usr1 and /home/usr2
• On stc3: /home/usr1, /home/usr2, /home/usr3, and /home/usr4 except files
starting with tmp, *.tmp, *.temp, *.backup, and *.junk only for /home/usr4.
When Oracle Secure Backup starts backing up data in /home/usr3 on stc3, it executes the
/etc/local/nfy executable. The same executable is also executed when Oracle Secure Backup
finishes its backup of /home/usr3.
When performing a normal (nondatabase) backup, you may want to skip files that would be included
in a database backup. Examples of such files include the database files themselves, control files, redo
logs, and flashback logs. To exclude these files, specify the exclude oracle files directive
in your dataset.
Note: For more information about the dataset language, refer to the Oracle Secure Backup

Oracle Internal & Oracle Academy Use Only


Administrator’s Guide.

Oracle Database 10g: Backup and Recovery 13 - 8


Creating Datasets

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Creating Datasets
Using the Web Tool Interface
You can use the Oracle Secure Backup Web tool to create a dataset:
1. From the Home page, click the Backup tab in the menu bar.
2. On the Backup menu, click Datasets in the submenu under Settings. The Datasets page appears.
Dataset directories appear in the Path box with a slash as the last character in the name.
3. Click the Add button to create a new dataset. When you create a new dataset description, the
initial contents of the dataset are defined by a dataset template.
4. Select File or Directory from the Dataset type list. Like Windows and UNIX file systems, Oracle
Secure Backup’s datasets are organized in a naming tree. You may optionally create dataset
directories to help you organize your data definitions. Later, you will discover that when you
want Oracle Secure Backup to back up data, you identify the name of the dataset description
defining the data. If you give the name of a dataset directory, it is equivalent to naming all the
dataset description files contained within that directory tree. Dataset directories may be nested
up to 10 levels deep. By default, a dataset file is created under the
<OSB_Home>/admin/dataset/NEW_CLIENTS directory.

Oracle Database 10g: Backup and Recovery 13 - 9


Creating Datasets (continued)
Using the Web Tool Interface (continued)
5. In the Name field, enter a name for the dataset.
6. Update the dataset statements displayed in the template file to define your backup data. For
more information, see “Dataset Script: Examples,” earlier in this module.
7. Choose one of the following:
- Click the Save button to accept your entries and return to the Datasets page.
- Click Cancel to abort the operation and move back one page.
If your dataset has errors, a message appears in the Status section. As you can see in the slide, you
also have the options to check, edit, rename, and remove datasets.
Using the obtool Interface
Similarly, you can manage your dataset directories and description files by using the obtool
interface. The example shown here first looks at the contents of the dataset directory, and then

Oracle Internal & Oracle Academy Use Only


creates the new directory TEST inside the existing NEWCLIENTS directory. Then, a new dataset
description file called test1 is created inside the TEST directory.
ob> lsds
Top level dataset directory:
NEW_CLIENTS/
ob> cdds NEW_CLIENTS
ob> mkds --dir TEST
ob> cdds TEST
ob> mkds -i test1
Input the new dataset contents. Terminate with an EOF or a
line containing just a dot (".").
exclude name tmp
include path /u01/oracle/solutions
.
Apply your changes [yes]? y
ob> lsds
Dataset directory NEW_CLIENTS/TEST:
Test1
The obtool commands used for managing datasets are as follows:
• cdds is used to navigate into the dataset directory structure.
• pwdds is used to show you the current path in the dataset directory structure.
• lsds is used to list the contents of the current dataset directory.
• mkds is used to create both dataset directories and dataset description files. The --dir
option is used for directories. The –i option is used to directly enter your dataset description
text without the use of any special editor. As shown in the example, the system asks you to
enter your text and finish it with a dot.
• rmds is used to remove both directories and files. The --nq option is used to avoid any
confirmation before doing the removal.
Note: For more information about these obtool commands, refer to the Oracle Secure Backup
Reference manual.

Oracle Database 10g: Backup and Recovery 13 - 10


Creating Backup Windows

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Creating Backup Windows


A backup window is a time range within which Oracle Secure Backup performs scheduled backup
jobs. You must have at least one backup window in order for scheduled backup jobs to run. You can
identify a single backup window that applies to all days of the week, or fine-tune backup windows to
specific weekdays or dates. A default backup window is always created, and is identified as daily
00:00-24:00.
Backup windows have a start time and an end time. Backups are eligible for execution after the start
time specified by a backup window. When the backup window end time arrives, Oracle Secure
Backup completes any backups that have already been started. No more backups are started until the
window opens again or a new window opens.
Perform the following steps to create a backup window by using the Oracle Secure Backup Web tool:
1. From the Backup menu, click Backup Windows in the submenu under Settings. The Backup
Windows page appears.
2. Click the Add button to add a new backup window. The Backup Window page appears.

Oracle Database 10g: Backup and Recovery 13 - 11


Creating Backup Windows (continued)
3. Select a backup window type from the Type field. Your choices are:
- Day range: If you select this option, refer to the “Creating Backup Triggers” section.
- Date: If you select this option, refer to the Oracle Secure Backup Administrator’s Guide.
4. Select a local time range (expressed in 24-hour format) from the Time range field. Oracle Secure
Backup will start scheduled backups during this time range. A time range is an interval specified
as <start time>-<end time>, where the start and end times are in the form
hour:minute:second. You can also use a four-digit hour-minute specifier (for example,
1430, which indicates 2:30 p.m.). The time range is based on the local time and takes into
account Daylight Savings Time, if it applies to your locale. If the end time precedes the start
time, Oracle Secure Backup assumes that the end time refers to the following day. For example,
20:00–02:00 indicates 8:00 p.m. as the start time and 02:00 a.m. of the next day as the end time.
5. Select one of the following:
- Click OK to save your entries and exit the page. The Backup Windows page reappears.

Oracle Internal & Oracle Academy Use Only


- Click Cancel to avoid the operation and move back one page.
Using obtool for Backup Windows
obtool has a group of commands that enable you to configure backup windows. A backup window
enables you to specify a time frame for the execution of scheduled backup operations. You can
identify a single backup window that applies to all days of the week or fine-tune backup windows
based on specific days or dates.
When you create a backup window, you specify the time and day range using the syntax:
addbw { --times/-t time-range[,time-range]... }
day-specifier[,day-specifier]...
• time-range: Represents a time-of-day range using the syntax start-time-end-time. For
example: 08:00:00-08:30:00 or 1430-14:35:30
• day-specifier: Represents a range of time in terms of days using the syntax:
year/month/day | month/day | wday | wday-wday | weekday[s] |
weekend[s] | daily | today | yesterday
wday::=
sunday[s] | monday[s] | tuesday[s] | wednesday[s] |
thursday[s] | friday[s] | saturday[s]
If no backup windows are identified, then scheduled backups will not run. The default backup
window has a day-specifier of 'daily 00:00-24:00'.

Oracle Database 10g: Backup and Recovery 13 - 12


Creating Backup Schedules

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Creating Backup Schedules


A backup schedule indicates to Oracle Secure Backup what data to back up and how to back it up.
You need to execute the following steps to create a schedule using the Oracle Secure Backup Web
tool:
1. From the Backup menu, click Schedules in the submenu under Settings. The Schedules page
appears. Backup schedules appear in the Schedule name box in the central panel.
2. Click the Add button to add a new schedule. The New Schedules page appears.
3. Enter a name for the schedule in the Schedule field.
4. Enter a priority number for the backup job in the Priority field.
5. In the Datasets box, select one or more datasets to include in the backup job.
6. Optionally, select one or more restrictions in the Restrictions box. You can restrict scheduled
backups to specific devices.
7. Optionally, enter any information that you want to store with the backup schedule in the
Comments field.
obtool commands for backup schedules include:
• Addbw: To add a new backup window
• Chkbw: To check for the existence of a backup window
• Lsbw: To list backup windows
• Rmbw: To remove a backup window or specific time ranges
• Setbw: To change the settings of a backup window
Oracle Database 10g: Backup and Recovery 13 - 13
Creating Backup Triggers

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Creating Backup Triggers


To create triggers by using the Oracle Secure Backup Web tool, perform the following steps:
1. Navigate first to Backup Schedules, and then to Triggers. The Triggers page appears with the
default setting of Day in the Trigger type field.
2. Using the Trigger type field, select a time representation you want to use to define when to
perform the backup job. Your choices are:
- one time: To perform a backup only once
- day (default): To perform a backup one or more days during the week
- month: To perform a backup one day a month
- quarter: To perform a backup one day per quarter
- year: To perform a backup one day during the year
3. Select a backup level from the Backup level field. You can choose full, incr, offsite, or
an incremental level from 1 through 9.
4. Select the hour and minute to start the backup in the Backup at fields.
5. Select a media family to be used by this scheduled backup in the Media family field.
6. Optionally, choose an expiration time period in the Expire after fields (in seconds, minutes,
hours, days, weeks, months, years, or forever). If the scheduled backup is not started by this
time, it is deleted and not run at all.

Oracle Database 10g: Backup and Recovery 13 - 14


Creating Backup Triggers (continued)
7. Depending on your selection in step 2, you end up having different screens. Here, it is
supposed that the day option is used. Select the days on which Oracle Secure Backup will run
the scheduled backup. Your choices are:
- Select daily: To trigger the schedule to run on all seven days of the week
- Select weekdays: To trigger the backup to run on weekdays only (Monday through
Friday)
- Select weekends: To trigger the backup to run only on weekends (Saturday and Sunday)
- Alternatively, from both the “Select weekdays” and “Select weekends” fields, you can
select a mix of individual days on which you can trigger scheduled backups to run. For
example, Monday, Tuesday, and Saturday at 8:00 a.m.
8. Optionally, select an option from the “Week in month” group. This option enables you to
limit which week in the month the backup schedule will run. Your choice are:
- All: This includes all weeks.

Oracle Internal & Oracle Academy Use Only


- Selected (First, Second, Third, Fourth, Fifth, and Last): This enables you to specify
the week to include.
9. Optionally, specify weekday exceptions from the Except drop-down list. An exception
prevents Oracle Secure Backup from backing up data on the day that you specify. Your
choices are:
- none (default): To disable an exception
- except: To enable an exception
10. Select a value from the Time drop-down list. Your choices are:
- before: To enable you to specify an exception before a specified day
- after: To enable you to specify an exception after a specified day
11. Select values from the Specify day fields. From the first field, your choices are none, first,
second, third, fourth, and last. From the second field, your choices are Monday, Tuesday,
Wednesday, Thursday, Friday, Saturday, and Sunday.
12. Click one of the following:
- Add to accept your entries and add the trigger
You are returned to the Triggers page with a success message. The schedule is displayed
in the Triggers field. The schedule displays the level of the backup, the time at which it
is to begin, and the days on which the backup is to be performed.
- Edit to modify the trigger
- Remove to delete the trigger
- Cancel to avoid the operation and move back one page
Note: In the slide, you can see how to create a trigger at the day level. For the other levels, refer to
the Oracle Secure Backup Administrator’s Guide.

Oracle Database 10g: Backup and Recovery 13 - 15


Previewing a Backup Trigger

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Previewing a Backup Trigger


Perform the following steps to preview a backup trigger by using the Oracle Secure Backup Web
tool:
1. Navigate first to Backup Schedules, and then to Triggers.
2. Select the trigger that you want to preview from the Triggers page.
3. Click the Preview button.

Oracle Database 10g: Backup and Recovery 13 - 16


Creating On-Demand Backup Requests

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Creating On-Demand Backup Requests


To create an on-demand backup request with the Oracle Secure Backup Web tool, perform the
following steps:
1. From the Backup page, click Backup Now in the submenu under the Operations section. The
Backup Now page appears. In the backup box in the central panel, each backup request that you
have created but have not yet sent to the scheduler is displayed. Backup requests are identified
by a backup name and number.
2. To create a new backup, click the Add button. The Options page appears.
3. Select one or more datasets from the Datasets box.
4. Optionally, select a future date and time for the backup to run from the Backup date and
Backup time fields. If you leave these fields unchanged, Oracle Secure Backup considers your
backup job immediately available for execution.
5. Optionally, enter an expiration time in the Expire after field. Do this if you want Oracle Secure
Backup to automatically delete this backup job if it has not started within the specified
expiration period after the date and time intervals defined earlier in the Backup date and
Backup time fields.
6. Select a backup level from the Backup level filed. Your choices are: full (default), 1 to 9, incr,
and offsite.

Oracle Database 10g: Backup and Recovery 13 - 17


Creating On-Demand Backup Requests (continued)
7. Select a media family to which the data of this backup should be assigned from the Media
family field.
8. Optionally, select one or more device restrictions from the Restrictions field. Oracle Secure
Backup enables you to restrict backups to one or more of the following:
- A specific tape drive, displayed as devicename
- Any tape drive attached to a specific host, displayed as @hostname
- Any tape drive-host attachment, displayed as devicename@hostname
If you do not set a restriction (the default), your backup job will use any available device at
the discretion of Oracle Secure Backup’s scheduling system.
9. Optionally, change the priority of the backup job in the Priority field. The default is 100. The
priority of a job is a positive integer value. The lower this value, the greater the priority
assigned to the job by the scheduler. It considers priority 20 jobs, for example, more
important than priority 100 jobs. The scheduler always gives preference to dispatching higher

Oracle Internal & Oracle Academy Use Only


priority jobs over lower priority ones.
10. Choose whether you want the backup to operate in unprivileged or privileged mode.
Unprivileged mode is the default. An unprivileged backup runs under your UNIX user
identity or Windows account identity, as configured in your Oracle Secure Backup user
profile. Your access to file-system data, therefore, is constrained by the rights of the UNIX
user or Windows account having that identity. On UNIX systems, a privileged backup runs
under the root user identity. On Windows systems, it runs under the same account identity
as the Oracle Secure Backup service on the Windows client.
11. Choose one of the following:
- Click OK to accept your selections. When you do so, Oracle Secure Backup displays
this backup request in the list box on the Backup Now page.
- Click Cancel to avoid the operation and move back one page.

Oracle Database 10g: Backup and Recovery 13 - 18


Submitting Backup Requests

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Submitting Backup Requests


To send backup requests to the scheduler, perform the following steps in the Oracle Secure Backup
Web tool:
1. From the Backup menu, click Backup Now in the submenu under Operations. The Backup Now
page appears.
2. Click the Go button. Oracle Secure Backup sends each backup request that appears in the
Number/Dataset central panel to the scheduler. A message appears in the status section for each
request acknowledged by the scheduler.
Oracle Secure Backup deletes each backup request upon its acceptance by the scheduler. As a
result, the Number/Dataset central panel is empty upon completion of the Go operation.
3. To view the status of your job, go to the Manage page, click the Jobs link. On the Jobs page,
you can see the output of your job by clicking the Show Transcript button.

Oracle Database 10g: Backup and Recovery 13 - 19


Reviewing Jobs

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Reviewing Jobs
On the Manage: Jobs page in the Web tool, you can view a list of jobs according to your selection
criteria. For more details, click a job (it is highlighted), then click Show Properties or Show
Transcript.

Oracle Database 10g: Backup and Recovery 13 - 20


Summary

In this lesson, you should have learned how to:


• Create dataset scripts
• Schedule file backups
• Submit backup requests
• Perform file-system backups

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 13 - 21


Practice Overview

This practice covers the following topics:


• Creating a dataset
• Scheduling a backup of the dataset
Note: The completion of this practice is a prerequisite for
the following practice, “Restoring a dataset.”

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 13 - 22


Restoring File-System Backups
with Oracle Secure Backup

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.
Objectives

After completing this lesson, you should be able to:


• Browse the catalog for file-system backup data
• Create catalog-based restore requests
• Perform file-system restoration

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 14 - 2


Browsing the Catalog for
File-System Backup Data

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Browsing the Catalog for File-System Backup Data


The administrative server maintains a catalog in which it stores metadata relating to backup and
restore operations for the administrative domain. Oracle Secure Backup maintains a discrete backup
catalog for each client in your administrative domain.
When you browse a backup catalog, Oracle Secure Backup presents the data in the form of a file-
system tree, just as it appeared on the client from which the data was saved. For example, if you
backed up the /home/myfile.dat file located on myhost, the backup catalog for myhost
represents the contents of the backup image as /home/myfile.dat.
At the root of the backup catalog appears the superdirectory, which contains all files and directories
saved from the uppermost file-system level. The superdirectory provides you with a starting point
from which to access every top-level file-system object stored in the backup catalog. For Windows
clients, this superdirectory contains the drive identifiers, such as C:.

Oracle Database 10g: Backup and Recovery 14 - 3


Restoring File-System Data

• Restoring the needed files is easily accomplished


using the Oracle Secure Backup catalog.
– Tree-style browsing of all backups
– Multiple query options for fast identification of needed
files
• You can restore files to the original location or an

Oracle Internal & Oracle Academy Use Only


alternative location.
• The end-user restore ability is based on user-level
permissions.
• Fast restoration from tape is accomplished by using
tape position data obtained during backup.

Copyright © 2006, Oracle. All rights reserved.

Restoring File-System Data


You can gain practical experience with this during the practice session.

Oracle Database 10g: Backup and Recovery 14 - 4


Restoring File-System Files with
Oracle Secure Backup

Two ways to restore data:


• Catalog-based restore: Based on catalog backup
history
• Directly from Media: Based only on the data contained
in the volumes
– Referred to as a RAW restore and is not commonly used

Oracle Internal & Oracle Academy Use Only


– Recommended only for Advanced users

Copyright © 2006, Oracle. All rights reserved.

Restoring File-System Files with Oracle Secure Backup


With Oracle Secure Backup, you can restore data in two different ways:
• By browsing backup catalogs for the file-system objects of interest. After you have located their
names and selected the instances to restore, you may direct Oracle Secure Backup to perform the
restore. This is called “catalog-based restore.”
• By knowing the names of the file-system objects of interest and the secondary storage location
(volume ID and backup image file number) in which they are stored. This is called “raw restore.”
For more information about raw restores, see the Oracle Secure Backup documentation.

Oracle Database 10g: Backup and Recovery 14 - 5


The Restore Page

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

The Restore Page


You can use the Oracle Secure Backup Web tool to restore your saved files. You do this from the
Restore page. To access the Restore page from the Web tool Home page, click the Restore tab on the
menu bar.

Oracle Database 10g: Backup and Recovery 14 - 6


Listing All File-System Backups of a Client

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Listing All File-System Backups of a Client


Perform the following steps to list all backups of a client by using the Oracle Secure Backup Web
tool:
1. From the Restore: Backup Catalog page, select any host from the Hosts Name list.
2. Click Browse Host. Oracle Secure Backup displays the Browse Host page.
3. Drill down to the file or directory for which you want to display the available backups. Click the
List Host Backups button. A properties page appears. Click the Close button when you have
finished viewing this window.

Oracle Database 10g: Backup and Recovery 14 - 7


Creating a Catalog-Based Restore Request

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Creating a Catalog-Based Restore Request


To browse a backup catalog for data restore, perform the following steps:
1. From the Web tool Home page, click the Restore tab on the menu bar. The Restore page
appears.
2. On the Restore page, click the Backup Catalog link in the Operations section.
3. On the Browse Restore Catalog page, select the client from which the data was originally saved
in the Host Name list.
4. Select one or more data selectors from the Data Selector list box.
5. Select a View mode: Inclusive or Exact.
6. Optionally, enter the path name of the directory you want to browse in the Path field. If you do
not do this, Oracle Secure Backup displays the uppermost directory in the client’s naming
hierarchy that it has backed up.
7. Click Browse Host. Oracle Secure Backup displays the Browse Host page with the selected
directory displayed.

Oracle Database 10g: Backup and Recovery 14 - 8


Creating a Catalog-Based Restore Request

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Creating a Catalog-Based Restore Request (continued)


8. On the Browse Host page, click a directory name to make it your current directory and view its
contents. You can repeat this operation many times to find the data you want to restore. You
can choose a directory to restore (and all its contents), or you can choose to restore individual
files.
9. You can change the Data selector, and then click Apply to redisplay the page.
10. You can also seamlessly change the View mode without leaving this page.
11. Select the check box next to the name of each file-system file or directory that you want to
restore. Doing so creates an Oracle Secure Backup restore request for each instance of the file
identified by the data selector.
To learn the identity of those instances, view the object’s properties page by clicking the adjacent
Properties button. When you do, Oracle Secure Backup displays a pop-up window. After viewing the
pop-up window, click Close.

Oracle Database 10g: Backup and Recovery 14 - 9


Creating a Catalog-Based Restore Request

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Creating a Catalog-Based Restore Request (continued)


12. On the Browse Host page, after you have selected the objects that you want to be restored, click
the Add button. The New Restore page appears.
13. Optionally, enter an alternative path name for each file or directory to restore. The original path
name of each object you previously selected appears in the lower-left portion of this page. To
its right is a text box in which you may enter the alternative path name. If you leave this blank,
Oracle Secure Backup restores the data using its original name.
14. Optionally, select the Device option and select a tape drive to use to perform the restore. By
default, Oracle Secure Backup automatically selects the tape drive to use.
15. Choose whether you want the restore to operate in unprivileged or privileged mode.
Unprivileged mode is the default. An unprivileged restore runs under your UNIX user identity
or Windows account identity, as configured in your Oracle Secure Backup user profile. The
privileged mode uses the root or administrator accounts. (You must have appropriate
rights to choose this option.)
16. Optionally, enter one or more obtar options in the Obtar option(s) field. For example,
-J enables debug output and provides a high level of detail in the job transcript. For details
about obtar options, refer to the Oracle Secure Backup Reference Guide.

Oracle Database 10g: Backup and Recovery 14 - 10


Creating a Catalog-Based Restore Request (continued)
17. Select the “No high speed positioning” check box if you do not want to use the available
position data to speed up the restore.
18. Select the “NDMP incremental restore” check box to direct certain NAS data servers to apply
incremental restore rules. Normally, recoveries are additive: each file and directory restored
from a full or an incremental backup is added to its destination directory. When you select
NDMP incremental restore, NAS data servers that implement this feature restore each directory
to its exact state as of the last incremental backup image applied during the restore job. Files
that were deleted before the last incremental backup are deleted by the NAS data service upon
restore of that incremental backup.
19. Select “Replace existing files” to overwrite any existing files with those restored from the
backup image. Alternatively, select “Keep existing files” to keep any existing files instead of
overwriting them with files from the backup image.

Oracle Internal & Oracle Academy Use Only


20. If you are restoring to a Windows system, select “Replace in-use files” to replace in-use files
with those from the backup image. Windows deletes each in-use file when the last user closes
it. Alternatively, select “Keep in-use files” to leave any in-use Windows files unchanged.
21. Click OK. Oracle Secure Backup displays the Browse Host page. The restore request you just
made appears in the Restore items list. Oracle Secure Backup displays the message, “Success:
file(s) added to restore list,” in the status area.

Oracle Database 10g: Backup and Recovery 14 - 11


Submitting Restore Requests

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Submitting Restore Requests


Submitting a restore request initiates the creation of an Oracle Secure Backup job.
Perform the following steps to send catalog-based restore requests to the scheduler by using the
Oracle Secure Backup Web tool:
1. From the Browse Restore Catalog page, select any host from the Hosts Name list.
2. Click Browse Host. Oracle Secure Backup displays the Browse Host page.
3. Click Go. The Web tool sends each restore request that appears in the Restore items list box to
the scheduler. A message appears in the status area for each request acknowledged by the
scheduler. It may say, for example: 2 catalog restore request items
submitted; job id is admin/2. Oracle Secure Backup deletes each restore request
upon its acceptance by the scheduler. As a result, the Restore items list is empty upon
completion of the Go operation.
4. To view the status of your job, go to the Manage page, and click the Jobs link. On the Jobs
page, select restore in the Types field, and click Apply. You can see the output of your job.

Oracle Database 10g: Backup and Recovery 14 - 12


Summary

In this lesson, you should have learned how to:


• Browse the catalog for file-system backup data
• Create catalog-based restore requests
• Perform file-system restoration

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 14 - 13


Practice Overview

This practice covers performing file-system restoration.

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 14 - 14


Managing Oracle Secure Backup Security

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.
Objectives

After completing this lesson, you should be able to:


• Manage user access control for Oracle Secure Backup
• Describe host authentication
• Determine backup security characteristics
• Describe encryption

Oracle Internal & Oracle Academy Use Only


• Perform an encrypted database backup and restore

Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 15 - 2


Guarding Access and Data

User Access Control


• Fine-granularity of control
Proven Security
with users assigned to a class
Technology of privileges
Server Authentication

Oracle Internal & Oracle Academy Use Only


• Two-way ID verification
Encryption
• Data and message level

Copyright © 2006, Oracle. All rights reserved.

Guarding Access and Data


For a comprehensive coverage of Oracle’s security concepts and tools, see the course titled
Oracle Database 10g: Security.

Oracle Database 10g: Backup and Recovery 15 - 3


Managing User Access Control > Access Control
.
Authentication
Encryption

Oracle Secure Backup user:


• Is different from an Oracle schema and an OS user
• Has one set of access rights
• Belongs to only one class
Set of user rights Set of user rights

Oracle Internal & Oracle Academy Use Only


Class Class

Copyright © 2006, Oracle. All rights reserved.

Managing User Access Control


Oracle Secure Backup maintains its own catalog of OSB users and their rights on the
administrative server. This is in addition to the database access and operating system control.
By storing OSB access control information about the administrative server, Oracle Secure
Backup maintains a consistent user identity across the administrative domain.
A set of “rights” is grouped into a “class,” which can be assigned to multiple users. However,
each user is a member of exactly one class. An Oracle Secure Backup user is different from an
Oracle schema user, as well as an operating system user. You can assign Oracle Secure
Backup usernames and passwords that are identical to or different from those of existing
operating system users. Each Oracle Secure Backup user is associated with a single UNIX
account and a single Windows account. These UNIX and Windows accounts are used when
some component of Oracle Secure Backup needs to assume a UNIX or Windows identity
when running on behalf of a given Oracle Secure Backup user.
Note: You might find it convenient to name Oracle Secure Backup users like their OS user
identity.
To configure Oracle Secure Backup users, you must belong to a class with the “Modify
administrative domain’s configuration” right.

Oracle Database 10g: Backup and Recovery 15 - 4


Predefined Classes and User Rights
Rights admin operator user oracle reader
Browse backup catalogs with this access Privileged notdenied permitted permitted named
Display administrative domain's configuration

Modify own name and password

Modify administrative domain's configuration

Perform backups as self

Perform backups as privileged user

List any jobs owned by user

Modify any jobs owned by user

Perform restores as self

Oracle Internal & Oracle Academy Use Only


Perform restores as privileged user

Receive e-mail requesting operator assistance

Receive e-mail describing internal errors

Query and display information about devices

Manage devices and change device state

List any job, regardless of its owner

Modify any job, regardless of its owner

Access Oracle backups all all owner owner none


Perform Oracle backups and restores

Copyright © 2006, Oracle. All rights reserved.

Predefined Classes and User Rights


A class defines a set of rights or access privileges. Oracle Secure Backup comes with the
following predefined classes:
• admin: Is used for the overall administration of a domain. The admin class has all the
rights and privileges needed to modify domain configurations and perform backup and
restore operations.
• operator: Is used for standard day-to-day operations. The operator class lacks
configuration privileges but has all the rights needed for backup and restore operations as
well as viewing and managing devices.
• user: Is assigned to specific users giving them permission to interact in a limited way
with their domains. This class is reserved for users who need to browse their own data
within the Oracle Secure Backup catalog and perform user-based restores.
• oracle: Is similar to the operator class with specific privileges to modify Oracle
database configuration settings, as well as to perform Oracle database backups and
restores
• reader: Enables users to view the Oracle Secure Backup catalog data. Readers are
permitted only to modify the given name and password for their Oracle Secure Backup
user accounts.
You can use the mkclass command to define your own Oracle Secure Backup user class.
Oracle Database 10g: Backup and Recovery 15 - 5
Predefined Classes and User Rights (continued)
Here is the explanation of each right:
• Browse backup catalogs with this access:
- Privileged: Users can browse all directories.
- Notdenied: Users can browse any directory for which they are not explicitly denied
access. This option differs from permitted in that it allows access to a directory
having no stat record stored in the catalog.
- Permitted: Users can browse a directory to which, based on operating system file
ownership and protection, they have read rights.
- Named: Users can browse a directory if the UNIX user defined in the Oracle Secure
Backup identity is listed as the owner of the directory or the UNIX group defined in
the Oracle Secure Backup identity matches the group of the directory. If the UNIX
user defined in the Oracle Secure Backup identity has read rights for the directory,

Oracle Internal & Oracle Academy Use Only


but is not the UNIX owner or a member of the UNIX group associated with the
directory, then the user is not able to browse the directory.
- None: Users have no rights to browse any directory.
• Display administrative domain’s configuration allows the class member to list objects
(for example, hosts, devices, and users) in the administrative domain.
• Modify own name and password allows the class member to modify certain attributes
for their own user objects (password and given name).
• Modify administrative domain’s configuration allows the class member to edit (create,
modify, rename, and remove) all configuration data in an Oracle Secure Backup
administrative domain. These include classes, users, hosts, devices, defaults and policies,
schedules, datasets, media families, summaries, and backup windows.
• Perform backups as self allows the class member to back up only those files and
directories in which they have access (using either UNIX user and group names or a
Windows domain account).
• Perform backups as privileged user allows the class member to back up files and
directories while acting as a privileged user (root on UNIX and as a member of the
Administrators group on Windows).
• Perform recoveries as self allows the class member to recover the contents of backup
images under the restrictions of the access rights imposed by the user’s UNIX name/group
or Windows domain/account.
• List any jobs owned by user enables the class member view:
- Status of scheduled, ongoing, and completed jobs that they create
- Transcripts for job that they create
• Modify any jobs owned by user allows the class member to modify only jobs that they
configured.
• Perform restore as self enables class members to restore the contents of backup images
under the restrictions of the access rights imposed by the user’s UNIX name or group, or
the Windows domain and account.

Oracle Database 10g: Backup and Recovery 15 - 6


Predefined Classes and User Rights (continued)
• Perform restore as privileged user allows the class member to recover the contents of
backup images as a privileged user (root on UNIX and as a member of the
Administrators group on Windows).
• Receive e-mail requesting operator assistance allows the class member to receive e-
mail messages when Oracle Secure Backup needs manual intervention. Occasionally,
during backups and recoveries, operator assistance may be required—for example, if a
new tape is required to continue a backup. In such cases, e-mails are sent to all users who
belong to classes having this attribute.
• Receive e-mail describing internal errors enables the class member to receive e-mail
messages describing errors that occurred in any Oracle Secure Backup activity.
• Query and display information about devices allows the class member to query the
state of all storage devices configured within the administrative domain.

Oracle Internal & Oracle Academy Use Only


• Manage devices and change device state allows a class member to control the state of
devices.
• List any job, regardless of owner allows the class member to view:
- Status of any scheduled, ongoing, and completed jobs
- Transcripts for any job
• Modify job, regardless of owner permits the class member to make changes to any job.
• Access Oracle backups specifies the type of access to Oracle Database backups made
through the SBT interface. The values are as follows:
- owner indicates that the user can access only SBT backups created by the user.
- class indicates that the user can access SBT backups created by any Oracle Secure
Backup user in the same class.
- all indicates that the user can access all SBT backups.
- none indicates that the user has no access to SBT backups.
• Perform Oracle backups and restores enables the class member to back up and restore
Oracle databases. Users with this right are Oracle Secure Backup users that are mapped to
operating system accounts used when performing Oracle database installations.
SBT requests will be honored only if the OS account making the request is mapped to an
Oracle Secure Backup user who has the “Oracle database backup/restore” right. In addition to
this, SBT restore, query, and remove requests will be honored only if the OS account making
the request is mapped to an Oracle Secure Backup user whose “Access Oracle backups” right
allows access to the piece requested.

Oracle Database 10g: Backup and Recovery 15 - 7


Defining an Oracle Secure Backup User

Name & password

Preauthorization Class
user information privileges

Oracle
Secure UNIX username
Given name

Oracle Internal & Oracle Academy Use Only


Backup and group
user

Windows domain
E-mail address account & password

NDMP access
authorization

Copyright © 2006, Oracle. All rights reserved.

Defining an Oracle Secure Backup User


Here is a description of the parameters that need to be specified when creating Oracle Secure
Backup users:
• The name of the Oracle Secure Backup user as well as his or her password
• The Oracle Secure Backup class to which this user is assigned
• A UNIX username and group
• A Windows domain name, user account, and password. If your Oracle Secure Backup
user needs to initiate backup and restore operations on Windows clients, then you need to
add the “Windows Domains” information.
• An indicator as to whether or not the Oracle Secure Backup user is permitted to log in to
an NDMP server. This login is done using an external client program.
• An e-mail address used to send Oracle Secure Backup operation notifications and reports
• The given name of the user, if different from the username (optional)
• An indicator as to whether or not the operating system user has preauthorized access to
the administrative domain as the specified Oracle Secure Backup user. You can
preauthorize Oracle Secure Backup users for the use of the obtool, RMAN, or both. For
example, the OS user oracle could be preauthorized to use Oracle Secure Backup as the
oracle Oracle Secure Backup user, without having to supply an Oracle Secure Backup
username or password.
Oracle Database 10g: Backup and Recovery 15 - 8
Oracle Secure Backup User:
OS Permissions

% obtool
Oracle Secure Backup 10.1
login: osbuser1 osbuser1 acquires
operator privileges and
can perform on-demand
backups as
UNIX name: jdoe
UNIX group: sysadmin

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Secure Backup User: OS Permissions


When writing backup data to tape, you need to log in to Oracle Secure Backup. You can log in
explicitly or transparently by using “preauthorization.” When you log in to OSB, you become
a particular Oracle Secure Backup user, who, depending on the class to which you belong,
acquires a set of OSB privileges (the rights belonging to that class).
In the example in the slide, Oracle Secure Backup uses the class and rights assigned to the
osbuser1 user to determine whether or not the requested action is allowed.
• If you then run a scheduled backup, it runs as the privileged user (root or
administrator).
• If you run an on-demand backup, it runs under that OS user identity associated with the
OSB user that you logged in as.
- If a UNIX or Linux host is backed up or restored, then Oracle Secure Backup uses
the UNIX username and group values for the operating system identity.
- If a Windows host is backed up or restored, however, then Oracle Secure Backup
uses the first (domain, account, password) triplet that allows access to the host.
• Of course, the user must have access to the files being backed up or restored.

Oracle Database 10g: Backup and Recovery 15 - 9


Oracle Secure Backup User: OS Permissions (continued)
The OS user that is used to access the files being backed up depends upon the type of backup
operation:
• If you create a scheduled job, the backup runs in the OS namespace associated with the
Oracle Secure Backup admin user, which is typically root on UNIX-like systems or
LocalSystem on Windows systems.
• If you perform an on-demand backup, the OS namespace associated with the Oracle
Secure Backup user of the current session is used, unless you specify the backup should
run as a privileged operation. A backup that runs in privileged mode runs under the root
operating system identity. On Windows systems, the backup runs under the same account
as the Oracle Secure Backup service on the Windows client. Backup and restore requests
submitted through the RMAN interface are treated as on-demand jobs.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery 15 - 10


Preauthorization

RMAN script: run { …


allocate channel oem_sbt_backup1 type 'SBT_TAPE' format '%U';
…}

Oracle Internal & Oracle Academy Use Only


Preauthorized users do
not log in explicitly.

Copyright © 2006, Oracle. All rights reserved.

Preauthorization
You can preauthorize Oracle Secure Backup users for the use of the obtool (cmdline)
utility, RMAN, or both. Continuing the previous example, you can preauthorize the jdoe OS
user as the osbuser1 user to allow login without explicitly supplying an Oracle Secure
Backup username or password.
When you run a customized script (for example, for file-system backup), you need to either
supply an Oracle Secure Backup username and password, or use a cmdline preauthorized
Oracle Secure Backup user account.
cmdline preauthorization is optional, whereas RMAN preauthorization is required. Oracle
database backups are evoked from RMAN or EM, which then communicates with Oracle
Secure Backup. Because access to Oracle Secure Backup requires login as an authorized
Oracle Secure Backup user, the communication attempt will fail unless the Oracle Secure
Backup user has been preauthorized to perform RMAN backup and restore on that host. When
Oracle Secure Backup receives communication from RMAN (via sbt), Oracle Secure Backup
verifies that an Oracle Secure Backup user meets key criteria:
• RMAN preauthorization on for a specific host
• Matching O/S permissions to the Oracle database instance
• Association to an OSB class with rights to back up and/or restore the Oracle database

Oracle Database 10g: Backup and Recovery 15 - 11


Assigning Windows Account Information

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Assigning Windows Account Information


You can associate an Oracle Secure Backup user with multiple Windows domain accounts or
use a single account that applies to all Windows domains.
This section explains how to configure Windows account information for existing Oracle
Secure Backup users who need to initiate backups and restores on Windows clients.
To assign Windows account information to an Oracle Secure Backup user, perform the
following steps:
1. From the Users page, select the name of the user from the User Name box.
2. Click the Edit button. A page appears with details for the user you selected.
3. Click the Windows Domains button. The Windows Domains page displays.
4. Enter a Windows domain name in the Domain name field. Type an asterisk (*) in this
box for all Windows domains.
5. Enter a Windows user account in the Username field.
6. Enter a Windows password in the Password field.
7. Click the Add button to add the Windows account information. The domain appears in
the Domain: Username list.

Oracle Database 10g: Backup and Recovery 15 - 12


Authentication Access Control
> Authentication
Encryption

The identity of each host is securely established before


accepting communications.

X.509 certificate 2 Identity verified


transmitted
proving identity Ethernet Network

1 3

Oracle Internal & Oracle Academy Use Only


Reply submitted

Messages sent securely SSL communication


4 established; backup or
restore operations may
proceed

Copyright © 2006, Oracle. All rights reserved.

Authentication
For hosts to securely exchange control messages and backup data within the domain, they
must first authenticate themselves to one another. Host connections are always two-way
authenticated with the exception of the initial host invitation to join a domain and
communication with NDMP servers.
In two-way authentication, the hosts participate in a handshake process whereby they mutually
decide on a cipher suite to use, exchange identity certificates, and validate that each other’s
certificate has been issued by a trusted certificate authority (CA). At the end of this process, a
secure and trusted communication channel is established for the exchange of data.
The use of identity certificates and SSL prevents outside attackers from impersonating a client
in the administrative domain and accessing backup data. For example, an outside attacker
would not be able to run an application on a nondomain host that sends messages to domain
hosts that claim origin from a host within the domain.
Note: Currently, the NDMP protocol does not include a mechanism to accommodate the
negotiation of an SSL connection to NDMP filers.

Oracle Database 10g: Backup and Recovery 15 - 13


Leveraging Oracle Security Technology

• Interdomain communications are secured by using the


Secure Socket Layer (SSL) protocol.
– Backup messages are encrypted as part of SSL
communication.
– Two-way authentication of clients and servers is
performed, with an SSL “handshake” verifying identity.

Oracle Internal & Oracle Academy Use Only


• Every client and server has a unique X.509 certificate
signed by a trusted Certificate Authority (CA).
– The Oracle Secure Backup administrative server is the CA
that issues and manages security credentials within the
domain.
• Oracle Wallets are encrypted containers storing X.509
certificates on all machines within the domain.

Copyright © 2006, Oracle. All rights reserved.

Leveraging Oracle Security Technology


Oracle Secure Backup uses the SSL protocol to establish a secure communication channel
between hosts in an administrative domain. Any host in the domain can use a public key to
send an encrypted message to another host, but only the host with the corresponding private
key can decrypt the message. The default key size for all hosts in the domain is 1,024 bits. If
you accept this default, then you do not need to perform any additional configuration. You can
set the size of the key to values between 512 (not secure) and 4,096 (very secure). The
Advanced Encryption Standard (AES) defines three standard key lengths, which are 128-bit,
192-bit, and 256-bit.
The Web server requires a signed X.509 certificate and associated public and private keys to
establish an SSL connection with a client browser. The X.509 certificate for the Web server is
self-signed by the installation script when you install Oracle Secure Backup on the
administrative server.

Oracle Database 10g: Backup and Recovery 15 - 14


Leveraging Oracle Security Technology (continued)
You can modify the default security configuration in the following ways:
• Disable SSL for interhost authentication and communication by setting the
securecomms security policy.
• Transmit identity certificates in manual certificate provisioning mode.
• Set the key size for a host to a value greater or less than the default of 1,024 bytes.
• Disable encryption for backup data in transit by setting the encryptdataintransit
security policy.
For more information about how to modify the secure settings for your installation, refer to the
Oracle Secure Backup Administrator’s Guide.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery 15 - 15


Administrative Server
Certificate Authority (CA)

Administrative Media server


server and client

Oracle Internal & Oracle Academy Use Only


Wallet Wallet
Signing Identity
certificate certificate

Identity
certificate

Copyright © 2006, Oracle. All rights reserved.

Administrative Server Certificate Authority (CA)


The Oracle Secure Backup Administrative server is automatically configured as the Certificate
Authority (CA) upon installation. During the installation of an administrative server, its wallet
(encrypted and obfuscated) is created along with a signing certificate and identity certificate.
The administrative server has the signing certificate, which it needs to sign the identity
certificates for other hosts, and its identity certificate, which it needs to establish authenticated
SSL connections with other hosts in the domain.
By default, wallets and identity certificates are automatically created during the installation of
media servers and clients. However, you can manually provision these certificates by using the
obcm utility. For more information about obcm and manual certificate provisioning, see the
Oracle Secure Backup Reference guide.
The encrypted wallets should be backed up, whereas the obfuscated wallets should not be
backed up. If a host wallet becomes destroyed, the host must be reinstalled and configured.
This generates a new host wallet, which again is to be digitally signed by the administrative
server. If the administrative server wallet is destroyed, the wallet must be re-created using the
--initnewdomain command. However, if a new administrative server wallet is created,
then a new wallet for each host in the domain must be created, so that their identity certificates
are digitally signed by the new administrative server signing certificate.

Oracle Database 10g: Backup and Recovery 15 - 16


Administrative Server Certificate Authority (CA) (continued)
Because Oracle Secure Backup–embedded wallets are used only for interdomain
communication, they do not have any direct relationship to the backup data written to tape.
Therefore, if wallets are destroyed and re-created, it does not affect the restoration of data
from tape.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery 15 - 17


Oracle Wallets

• Oracle Secure Backup creates a unique wallet for every


host in the administrative domain. (No additional
configuration is needed.)
• The wallets contain X.509 certificates, but no
encryption keys (unlike the database wallets).
• There are two types of wallets:

Oracle Internal & Oracle Academy Use Only


– A password protected, encrypted file to establish security
credentials
– An obfuscated wallet, used by Oracle Secure
Backup daemons
Note: Back up the encrypted wallet regularly,
but never the obfuscated one.

Copyright © 2006, Oracle. All rights reserved.

Oracle Wallets
When you add hosts to the administrative domain, Oracle Secure Backup creates the wallet,
keys, and certificates for each host. No additional intervention or configuration is required. All
required wallet functionality is embedded in Oracle Secure Backup, thereby eliminating the
need for other wallet utilities.
Every host in the domain, including the administrative server, has a private key known only to
that host that is stored with the host’s identity certificate. This private key corresponds to a
public key that is made available to other hosts in the administrative domain. Any host in the
domain can use a public key to send an encrypted message to another host, but only the host
with the corresponding private key can decrypt the message. Oracle Wallets are encrypted
containers designed to store X.509 certificates. Unlike the database encryption key wallet, the
Oracle Secure Backup wallet does not store encryption keys for data.
Oracle Secure Backup does not share its wallets with other Oracle products.
Besides maintaining its password-protected wallet, each host in the domain maintains an
obfuscated wallet. This version of the wallet does not require a password. The obfuscated
wallet, which is scrambled but not encrypted, enables the Oracle Secure Backup software to
run without requiring a password during system startup.

Oracle Database 10g: Backup and Recovery 15 - 18


Oracle Wallets (continued)
The password for the password-protected wallet is generated by Oracle Secure Backup and not
made available to the user. The password-protected wallet is not normally used after the
security credentials for the host have been established because the Oracle Secure Backup
daemons use the obfuscated wallet.
To reduce the risk of unauthorized access to obfuscated wallets, Oracle Secure Backup does
not back them up. The obfuscated version of a wallet is named cwallet.sso. By default,
the wallet is located in /usr/etc/ob/wallet on Linux and UNIX and C:\Program
Files\Oracle\Backup\db\wallet on Windows.
Best practice tip: Backup the encrypted wallet.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery 15 - 19


Encrypted Backups to Tape . Access Control
Authentication
> Encryption

RMAN backup encryption:


• Encryption keys are transparently managed by the
database
• Backup encryption at the database or tablespace level
• Encryption algorithms up to 256-bit AES

Oracle Internal & Oracle Academy Use Only


Secure transportation over the network:
• Database backups with RMAN encryption
• File-system backups with SSL
RMAN encrypted backups on tape—only available with
Oracle Secure Backup.

Copyright © 2006, Oracle. All rights reserved.

Encrypted Backups to Tape


Oracle Secure Backup leverages RMAN backup encryption technology, such as:
• Encryption keys being transparently managed by the database
• Your ability to choose backup encryption at the database or tablespace level. (This is in
addition to the Transparent Data Encryption (TDE), which you can use inside the Oracle
database.)
• Substantial protection through encryption algorithms up to 256-bit AES
During transportation over the network, database backups are secured with RMAN encryption
(in which case, no additional SSL is used). If your database backups are not encrypted by
RMAN, Oracle Secure Backup uses SSL by default. It also secures your file-system backups
over the network by using SSL.
To store RMAN encrypted backups on tape, you need to use Oracle Secure Backup.

Oracle Database 10g: Backup and Recovery 15 - 20


Creating RMAN Encrypted Backups

RMAN offers three encryption modes:


• Transparent mode:
– Uses the Oracle key management infrastructure
– Requires that you first configure Oracle Encryption
Wallet
• Password mode: Requires the use of the SET

Oracle Internal & Oracle Academy Use Only


ENCRYPTION ON IDENTIFIED BY password ONLY
command in your RMAN scripts
• Dual mode: Requires the use of the SET ENCRYPTION
ON IDENTIFIED BY password command in your RMAN
scripts

Copyright © 2006, Oracle. All rights reserved.

Creating RMAN Encrypted Backups


For improved security, RMAN backup set backups can be encrypted. Any RMAN backups
created as backup sets can be encrypted. Image copy backups cannot be encrypted.
Encrypted backups are decrypted automatically during restore and recover operations, as long
as the required decryption keys are available, by means of either a user-supplied password or
the Oracle Encryption Wallet.
RMAN supports three encryption modes:
• Transparent mode
• Password mode
• Dual mode
Additional information about each mode follows.

Oracle Database 10g: Backup and Recovery 15 - 21


Using Transparent Mode Encryption

Perform the following steps:


1. Create a wallet using Oracle Wallet Manager:
ENCRYPTION_WALLET_LOCATION=
(SOURCE=(METHOD=FILE)(METHOD_DATA=
(DIRECTORY=/opt/oracle/product/10.2.0/db_1/)))

Oracle Internal & Oracle Academy Use Only


2. Open the wallet:
ALTER SYSTEM SET ENCRYPTION WALLET OPEN IDENTIFIED
BY <password>;
3. Set the master key:
ALTER SYSTEM SET ENCRYPTION KEY IDENTIFIED BY
<password>;

Copyright © 2006, Oracle. All rights reserved.

Using Transparent Mode Encryption


Transparent encryption does not require DBA intervention as long as the required Oracle key
management infrastructure is available. Transparent encryption is best suited for day-to-day
backup operations, where backups will be restored on the same database that they were backed
up from. Transparent encryption is the default encryption mode.
You must first configure the Oracle Encryption Wallet to use transparent encryption. Refer to
the Oracle Advanced Security Administrator’s Guide for detailed information about the Oracle
Encryption Wallet.
Perform the following steps to use transparent mode encryption:
1. Create a wallet using Oracle Wallet Manager. By default, an unencrypted wallet
(cwallet.sso) is created when Oracle Database is installed. An encrypted wallet
(ewallet.p12) is recommended for use with backup set encryption. Place an entry in
the sqlnet.ora file as shown in the slide.
2. Open the wallet. Before you can use backup set encryption , you need to make sure that
the wallet is opened by your instance. The password specified with the ALTER SYSTEM
command is the same password you specified when you created the wallet in step 1.
3. Set the master key from within your instance. When the wallet is opened, you need to set
the master key.

Oracle Database 10g: Backup and Recovery 15 - 22


Using Transparent Mode Encryption

4. Configure RMAN encryption level (database,


tablespace, or database excluding tablespaces):

CONFIGURE ENCRYPTION FOR DATABASE ON

CONFIGURE ENCRYPTION FOR TABLESPACE

Oracle Internal & Oracle Academy Use Only


<tablespace_name> ON

5. Set encryption algorithm, if needed:

SET ENCRYPTION ALGORITHM 'algorithm name'

Copyright © 2006, Oracle. All rights reserved.

Using Transparent Mode Encryption (continued)


4. Configure the RMAN encryption level. The CONFIGURE ENCRYPTION command is
used to specify encryption settings for the database or tablespaces within the database,
which apply unless overridden using the SET command. Options specified for an
individual tablespace take precedence over options specified for the whole database.
5. Set encryption algorithm, if needed. Query V$RMAN_ENCRYPTION_ALGORITHMS to
obtain a list of encryption algorithms supported by RMAN. The default encryption
algorithm is 128-bit AES.

Oracle Database 10g: Backup and Recovery 15 - 23


Using Password Mode Encryption

Enable password mode encryption in your RMAN session:

SET ENCRYPTION ON IDENTIFIED BY <password> ONLY

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using Password Mode Encryption


When you use password encryption, you must provide a password when you create and restore
encrypted backups. When you restore the password-encrypted backup, you must supply the
same password that was used to create the backup. Password encryption is most appropriate
for backups that will be restored at remote locations, but which must remain secure in transit.
Use the SET ENCRYPTION ON IDENTIFIED BY password ONLY command in your
RMAN scripts to enable password encryption. Password encryption cannot be persistently
configured.
Note: For security reasons, it is not possible to permanently modify your existing backup
environment so that RMAN backups are encrypted using the password mode. You can enable
only password-encrypted backups for the duration of an RMAN session.

Oracle Database 10g: Backup and Recovery 15 - 24


Using Dual Mode Encryption

• Dual-mode encrypted backups can be restored


transparently or by specifying a password.
• Enable password mode encryption in your RMAN
session:

SET ENCRYPTION ON IDENTIFIED BY 'password'

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Using Dual Mode Encryption


Dual-mode encrypted backups can be restored transparently or by specifying a password.
Dual-mode encrypted backups are useful when you create backups that are normally restored
using the Oracle Encryption Wallet, but which occasionally need to be restored where the
Oracle Encryption Wallet is not available.
To create dual-mode encrypted backup sets, specify the SET ENCRYPTION ON
IDENTIFIED BY password command in your RMAN scripts.

Oracle Database 10g: Backup and Recovery 15 - 25


Restoring Encrypted Backups

• Before restoration, set the RMAN session to decrypt


backups.
• Specify all required passwords with the SET
DECRYPTION command when restoring from a set of
backups that were created with different passwords.

Oracle Internal & Oracle Academy Use Only


SET DECRYPTION IDENTIFIED BY '<password_1>'
{, '<password_2>',…,'<password_n> }

Copyright © 2006, Oracle. All rights reserved.

Restoring Encrypted Backups


Use the SET DECRYPTION command to specify one or more decryption passwords to be used
when reading dual-mode or password-encrypted backups. When RMAN reads encrypted
backup pieces, it tries each password in the list until it finds the correct one to decrypt that
backup piece. An error is signaled if none of the specified keys are correct.

Oracle Database 10g: Backup and Recovery 15 - 26


Performing Encrypted Recovery

Oracle Internal & Oracle Academy Use Only


2

Copyright © 2006, Oracle. All rights reserved.

Performing Encrypted Recovery


While performing encrypted database recovery from tape and disk, you can notice the
following:
1. The SET DECRYPTION command is executed.
2. The recovery completed successfully and the EXAMPLE tablespace is brought back
online.

Oracle Database 10g: Backup and Recovery 15 - 27


Summary

In this lesson, you should have learned how to:


• Manage user access control for Oracle Secure Backup
• Describe host authentication
• Determine backup security characteristics
• Describe encryption

Oracle Internal & Oracle Academy Use Only


• Perform an encrypted database backup and restore

Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 15 - 28


Practice Overview

This practice covers the following topics:


• Perform a password encrypted database backup
• Attempt to restore a tablespace without encryption
password
• Perform decrypted restoration

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 15 - 29


Oracle Internal & Oracle Academy Use Only
Managing the Administrative Domain

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.
Objectives

After completing this lesson, you should be able to:


• Describe Oracle Secure Backup processes
• Configure policies and defaults
• Browse primary Oracle Secure Backup catalogs
• Manage clients

Oracle Internal & Oracle Academy Use Only


• Manage media servers (tape devices and libraries)
• Manage volumes
• Manage jobs

Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 16 - 2


> Daemons
Policies
Oracle Secure Backup Processes: Daemons Catalogs
Clients
Media Serv.
- Devices
- Libraries
Volumes
Jobs

Client Administrative server Media server

Oracle Internal & Oracle Academy Use Only


observiced obscheduled observiced

obproxyd observiced obrobotd

obhttpd obndmpd

obixd obproxyd

obproxyd

Copyright © 2006, Oracle. All rights reserved.

Oracle Secure Backup Processes: Daemons


To oversee data protection activities among diverse hosts, devices, and databases, you define
an administrative domain. There must be one and only one administrative server for each
administrative domain.
The administrative server includes:
• Oracle Secure Backup catalog, a directory structure with host-specific subdirectories. This
means, the contents vary depending on the roles you assign to the host. An administrative
server has the central catalog with configuration and metadata.
• Daemons (or services), which are processes, that run in the background and perform OSB
operations on behalf of an application
Some daemons run continually; others run only to perform specific work and then exit when
they have finished. The Oracle Secure Backup daemons actively participate in managing
backup and restore operations:
• observiced daemon: On the administrative server, this daemon runs jobs (such as
backups and restores) at the request of the obscheduled daemon, cleans up old log
files and transcripts, and provides access to Oracle Secure Backup configuration data to
other hosts in the domain.

Oracle Database 10g: Backup and Recovery 16 - 3


Oracle Secure Backup Daemons (continued)
observiced daemon (continued)
• The observiced daemon starts the obscheduled daemon and the Web server
during initialization. When running on a client or media server, observiced is
primarily responsible for invoking Oracle Secure Backup programs in response to a
request from the administrative server. On all hosts, the observiced daemon is
normally started as part of system startup and runs continually. On UNIX and Linux,
startup is usually performed through entries in /etc/init.d, whereas on a Windows
host, the observiced daemon is started by the Service Control Manager.
• obscheduled daemon: This daemon initiates scheduled events and manages jobs. The
daemon receives job creation requests from obtool users and from the SBT interface in
response to RMAN commands.
• obixd daemon: This daemon manages the backup catalog. One instance of this daemon

Oracle Internal & Oracle Academy Use Only


runs for each client whenever the contents of that client’s catalog must be read or updated.
• Apache Web server daemon (obhttpd): This daemon provides the Web tool GUI for
Oracle Secure Backup.
• obndmpd daemon: This daemon implements the NDMP tape service and provides
media services to remote clients. It is launched by the observiced daemon in response
to client requests to open a channel to a tape drive that is not locally connected to the
client.
• obrobotd daemon: This daemon is launched by the observiced daemon in response
to requests to manipulate tapes in a tape library. One instance of this daemon runs for
each tape library whenever the services of that tape library are required.
• obproxyd daemon: This daemon verifies user access for SBT backup and restore
operations. The proxy daemon runs on the host that contains the SBT library accessed
during the operations. The invocation of the proxy daemon is platform specific. The proxy
daemon uses the operating system user identity of the process invoking the SBT library
and the local host name to determine the Oracle Secure Backup user account for the
backup operation. If a preauthorization exists for this OS user and host, and if the
associated Oracle Secure Backup user is permitted to perform RMAN backups, then the
login to Oracle Secure Backup is permitted.
On a host running the Windows operating system, only the observiced daemon runs as a
Windows service. The other Oracle Secure Backup daemons do not run as services.

Oracle Database 10g: Backup and Recovery 16 - 4


Managing Common Daemon Operations

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Managing Common Daemon Operations


Oracle Secure Backup daemons respond to a common set of control commands. Sending
control commands to daemons is an infrequently performed task that you would normally use
only under the guidance of Oracle Support Services.
The daemon control commands are:
• dump: To direct the daemon to dump internal state information into its log file
• reinitialize: To direct the daemon to reread configuration data from the file
system
• debugon: To direct the daemon to generate extra information to its log file
• debugoff: To cancel a previous debugon command. This is the default state.
To send a command to a daemon, perform the following steps:
1. From the Web tool Home page, click the Manage tab.
2. From the Manage page, click the Daemons link in the Maintenance section.
3. On the Daemons page, select a daemon from the Type list.
4. From the Host list, select the host on which the daemon is running.
5. Select a command from the Command list.
6. Click Apply to accept your selections.

Oracle Database 10g: Backup and Recovery 16 - 5


Daemons
Managing Policies and Defaults > Policies
Catalogs
Clients
Media Serv.
- Devices
- Libraries
Volumes
Oracle Secure Backup provides customizable Jobs
administrative policies to easily manage simple
or complex environments:
• Policy settings for devices, catalog indexing, log
management, and general backup and recovery
operations

Oracle Internal & Oracle Academy Use Only


• E-mail notification of system events and reports
• Policies that control the behavior of daemons and
services
• NDMP Data Management Agent (DMA) defaults
• Policies that control aspects of domain security

Copyright © 2006, Oracle. All rights reserved.

Managing Policies and Defaults


Defaults and policies are configuration data that control how Oracle Secure Backup operates
within an administrative domain. The data is maintained on the administrative server.
Oracle Secure Backup is preconfigured with a set of defaults and policies for fast deployment
in most environments. Oracle Secure Backup policies are grouped into several policy classes.
Each policy class contains policies that describe a particular area of Oracle Secure Backup
operations:
• Daemon policies
• Device policies
• Index policies
• Log policies
• Media policies
• Naming policies
• NDMP policies
• Operations policies
• Scheduler policies
• Security policies

Oracle Database 10g: Backup and Recovery 16 - 6


Configuring Oracle Secure Backup Policies

1
3

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Configuring Oracle Secure Backup Policies


To modify the policies settings by using the Web tool, perform the following steps:
1. From the Configure page, select Defaults and Policies.
2. Click the name of the policy that you want to modify.
3. Make any required changes.
4. Choose one of the following:
- Click Apply to remain in this page.
- Click OK to save the changes and return to the Configure page.
- Click Cancel to avoid the operation and move back one page.
5. Operations: You can set operation policies to specify the following:
- Whether Oracle Secure Backup updates backup history data every time a client host
is backed up
- Whether Oracle Secure Backup creates volume and backup image labels for a new
backup image whenever it backs up data
- Whether Oracle Secure Backup performs block-level verification after each backup
section is completed
- Additional options to apply to scheduler-dispatched backup and restore operations,
such as enabling diagnostic output mode with the obtar -J option

Oracle Database 10g: Backup and Recovery 16 - 7


Daemons
Oracle Secure Backup: Policies
> Catalogs
Backup Metadata Catalogs Clients
Media Serv.
- Devices
- Libraries
Volumes
Jobs

File-system metadata: indices.cur

Oracle Internal & Oracle Academy Use Only


Piece catalog: sbtpiece.dat and sbtpiece.idx

Volumes catalog: volumes.dat and volumes.idx

Backup sections catalog: archives.dat and


archives.idx

Copyright © 2006, Oracle. All rights reserved.

Oracle Secure Backup: Backup Metadata Catalogs


The Oracle Secure Backup catalog is a collection of backup metadata catalogs and
configuration files. They are centrally located on the Administrative server in a hierarchical
file system under the <OSB_Home> directory. The following are the four primary catalogs:
1. File-system backup metadata is stored for each client in the indices.cur catalog (also
known as the index database). That means, if the administrative server has 100 clients, it
has 100 indices.cur files. The indices.cur file is located in the
/usr/local/oracle/backup/admin/history/host/<host_name>
directory.
2. Oracle database backup piece metadata is stored in the sbtpiece.dat and
sbtpiece.idx files.
3. A listing of all tapes, which contain backups registered with the Oracle Secure Backup
catalog, is stored in the volumes.dat and volumes.idx files. When a tape is
overwritten, the volumes catalog is immediately updated.
4. Information about backup sections is stored in the archives.dat and
archives.idx files. This is important when a backup spans multiple volumes.
The last three catalogs are located in the
/usr/local/oracle/backup/admin/state/general/ directory.

Oracle Database 10g: Backup and Recovery 16 - 8


Oracle Secure Backup: Backup Metadata Catalogs (continued)
After volumes have been overwritten or unlabeled, the backup metadata is no longer needed.
The index daemon will automatically remove this backup metadata from the catalog at the
interval set by the indexcleanupfrequency index policy (default is 21 days).

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery 16 - 9


Oracle Secure Backup: Directory Structure

/usr/local/oracle/backup

<OSB_Home> directory

admin apache bin etc device help

Oracle Internal & Oracle Academy Use Only


• config • conf
• history • htdocs lib tools.linux32 man
• log • images
• state • logs
• modules .drv.linux32 samples

Administrative server

Copyright © 2006, Oracle. All rights reserved.

Oracle Secure Backup: Directory Structure


The Oracle Secure Backup home directory is created on every host where you install Oracle
Secure Backup, although the contents of the directory vary depending on the roles you
assigned to the host. The illustration in the slide shows the installed directories for an
administrative server on a Linux operating system. The directories in the dashed box contain
executable files, or information related to storage devices. Not shown in the slide are the
following directories: .bin.linux32, .etc.linux32, and .lib.linux32.
Oracle Secure Backup maintains its own centralized catalog on the administrative server. The
Oracle Secure Backup catalog contains all the information used to define your configuration
and also metadata relating to your backup and restore operations. Oracle Secure Backup
organizes its catalog in a hierarchical way. The admin directory contains the administrative
domain catalogs.

Oracle Database 10g: Backup and Recovery 16 - 10


Backing Up the Catalog

1. Create a dataset that includes:


– Oracle Secure Backup home directory
– The /etc/obconfig file
– The /usr/etc/ob directory
2. Create a backup request, either on-demand or
scheduled.

Oracle Internal & Oracle Academy Use Only


3. Submit the backup request to the scheduler.
4. Store the volume set in a known location.

Copyright © 2006, Oracle. All rights reserved.

Backing Up the Catalog


Given that you know that you will need the catalog backup only in dire circumstances, you
should make special provisions when storing the backup, such as:
• Storing the volume set in a known location so that the tapes can be retrieved without
having to look up which volumes were used to store the backup
• Configuring the operations/backupoptions policy to use the -v option (if you
configured a scheduled backup). This generates a full transcript and lists all the files
backed up. Then, save the transcript along with the tapes. For additional protection, you
can back up the /usr/etc/ob directory, which is the job transcript directory.
You may also want to save a copy of the SCSI parameters used to create the device special
files for your tape devices. This can assist you in reconfiguring the tape devices during disaster
recovery of your administrative server. The parameter specifications should be saved along
with the volumes that contain the catalog backup.

Oracle Database 10g: Backup and Recovery 16 - 11


Daemons
Adding Clients Policies
Catalogs
> Clients
Media Serv.
- Devices
- Libraries
Volumes
Jobs

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Adding Client
Adding Clients may be your most common management task:
1. In the Oracle Secure Backup Web tool, click Configure, and then click Hosts.
2. Select the “Suppress communication with host” check box if you want to add a (stand-
alone) machine to the administrative domain.
3. Click the Add button. Then enter a host name of your choice in the Host field. The name
must be unique among all Oracle Secure Backup host names.
4. Optionally, enter one IP interface name in the “IP Interface name(s)” field. If you leave
this blank, Oracle Secure Backup uses the name of the host (step 3) as the resolvable IP
name for the host.
5. Select a status from the Status field. Your choices are:
- In service: Indicates that the machine is logically available for backup and restores
- Not in service: Indicates that the machine is unavailable
6. Select one or more administrative domain roles for the host from the Roles field.
7. Select an access method for the host (if applicable) from the “Access method” field. Your
choices are: ob or NDMP.

Oracle Database 10g: Backup and Recovery 16 - 12


Daemons
Adding Media Servers Policies
Catalogs
Clients
> Media Serv.
- Devices
- Libraries
Volumes
Jobs

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Adding Media Servers


From the Administrative Server page, you can click the link corresponding to the number of
configured Media Servers in the administrative domain.
This takes you to the Media Servers page from which you can manage your media servers. On
the Media Servers page, click Add to add a new media server to your administrative domain.
To configure a new media server on the Add Media Server page, perform the following steps:
1. Select the “Suppress communication with host” check box if you want to add a host to the
administrative domain that is not yet connected to the network.
2. Enter the name by which you want to refer to the host in the Name field. The host you
choose must be unique among all Oracle Secure Backup host names.
3. Optionally, enter one IP interface name in the “DNS Hostname(s) or IP Address(es)”
field. If you leave this blank, Oracle Secure Backup uses the name you assigned to the
host in step 2 as the resolvable IP name for the host.

Oracle Database 10g: Backup and Recovery 16 - 13


Adding Media Servers (continued)
4. Select a status from the Status field. Your choices are:
- In Service: Indicates that the machine is logically available to perform backup and
restore operations
- Not In Service: Indicates that the machine is logically unavailable to perform
backup or restore operations
5. Select an access method for the host (if applicable) from the Access Mode field. Your
choices are:
- Native: The host contains a local installation of Oracle Secure Backup.
- NDMP: The host is accessed through the Oracle Secure Backup RPC protocol (plus
NDMP) or solely through Network Data Management Protocol (NDMP).
6. Click OK.
Note: For more information about how to manage media servers within Oracle Secure

Oracle Internal & Oracle Academy Use Only


Backup, refer to the Oracle Secure Backup Administrator’s Guide.

Oracle Database 10g: Backup and Recovery 16 - 14


Daemons
NAS Devices Policies
Catalogs
Clients
Media Serv.
> - Devices
- Libraries
Volumes
• Communicate via NDMP Jobs
• Do not require installation of Oracle Secure
Backup software on NAS appliance
• Support local data transfer (from file server directly to
and from tape drives) with simultaneous central
management

Oracle Internal & Oracle Academy Use Only


• May be a client or media server but not an
administrative server

Copyright © 2006, Oracle. All rights reserved.

NAS Devices
The Network Data Management Protocol (NDMP) defines a common architecture for backups
of heterogeneous file servers on a network. NDMP allows administrators to back up data using
any combination of compliant network–attached servers, backup devices, and management
applications. With NDMP, network congestion is minimized because the data path and control
path are separated. Backups can occur locally—from file servers directly to tape drives—
whereas management occurs centrally.
NDMP is commonly used by NAS devices, which are also known as filers, to perform backup
and restore operations without requiring an Oracle Secure Backup installation on the
appliance. The filer communicates with the backup software through NDMP. This model is
very different from the classical backup model, which requires the installation of an agent or
backup software component on each host to communicate and perform backup and restore
operations as directed by the backup software server.
For supported NAS devices, see Certify on MetaLink.

Oracle Database 10g: Backup and Recovery 16 - 15


Adding NDMP Media Servers

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Adding NDMP Media Servers


If you select NDMP in the Access Mode field on the Add Media Server page, the following
additional options should be specified for your new host:
1. Select an authorization type from the Authentication Type field. The authentication type
defines the way in which Oracle Secure Backup authenticates itself to the NDMP server.
Typically, you should use the negotiated default setting. Your choices are:
- default: Uses the value of the Authentication type for the NDMP policy
- none: Attempts to use the NDMP server from Oracle Secure Backup without
providing authentication data (this is usually unsuccessful)
- negotiated: Instructs Oracle Secure Backup to negotiate with the NDMP server to
determine the best authentication mode to use
- text: Uses plain (unencrypted) text to authenticate
- md5: Uses the MD5 digest algorithm to authenticate
2. Enter a username in the Username field. The username is used to authenticate Oracle
Secure Backup to this NDMP server.

Oracle Database 10g: Backup and Recovery 16 - 16


Adding Devices

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Adding Devices
You can add new devices in one of two ways:
• By automatically discovering them. Oracle Secure Backup can automatically discover and
configure secondary storage devices connected to certain types of NDMP servers, such as
Network Appliance filers.
• By adding them manually to define devices that cannot be automatically discovered
On the Device page, click either Add Library or Add Drive to add a new device to your
configuration.
You can also use the obtool command mkdev to add an Oracle Secure Backup device
object to your administrative domain configuration. Here are some examples:
ob> mkdev --type library --attach hasun20:/dev/obl0 tc-lib
ob> mkdev --type tape --library tc-lib --dte 1 --attach hasun20:/dev/obt0
tc-tape
ob> lsdev
The following output displays:
library tc-lib in service
drive 1 tc-tape in service

Oracle Database 10g: Backup and Recovery 16 - 17


Adding Devices (continued)
The first example shows you how to add a tape library device to your configuration. As shown,
you need to specify the device type, its attachment, and its Oracle Secure Backup name.
The second example is doing the same thing for a tape drive that is part of your tape library. In
addition to the type, attachment, and name, you need to specify the corresponding tape library
as well as the tape drive’s data transfer element (DTE). Oracle Secure Backup identifies each
tape drive within a tape library by its DTE number. A DTE must be specified if library is
specified.
The third example shows you the output of the lsdev command, which shows you the
current configuration for both devices.
Unlike SCSI, which is a host-centric protocol, Fibre Channel libraries and tape drives are
typically shared among multiple Oracle Secure Backup media servers. A Fibre Channel–

Oracle Internal & Oracle Academy Use Only


attached tape drive or tape library often has multiple attachments, one for each host that can
directly access it. You can specify multiple attach points when creating a device with the
mkdev or chdev commands of obtool, the Web tool, or EM. Multiple attach points enable
you to attach the same device to multiple hosts on a network.
Note: For more information about the mkdev and chdev commands, refer to the Oracle
Secure Backup Reference guide.

Oracle Database 10g: Backup and Recovery 16 - 18


Discovering Devices on NDMP Hosts

Oracle Internal & Oracle Academy Use Only


ob> discoverdev --verbose --host
edrsr12p1

Copyright © 2006, Oracle. All rights reserved.

Discovering Devices on NDMP Hosts


Libraries and tape devices attached to Network-Attached Storage (NAS) filers are
automatically configured by the operating system on which the NAS device runs. Both SCSI
device and Fibre Channel configuration occur automatically and require no input from the
user.
Oracle Secure Backup can detect changes in device configuration for some types of these
NDMP-accessed hosts and, on the basis of this information, automatically update the
administrative domain’s device configuration.
However, NAS tape libraries and tape drives must first be made accessible to the Oracle
Secure Backup software. This is accomplished by performing device discovery on each of the
NAS filers in the administrative domain. You can discover devices by using Enterprise
Manager, the Web tool, or obtool.
Oracle Secure Backup detects multiple hosts connected to the same device by comparing the
serial numbers reported by the operating system.

Oracle Database 10g: Backup and Recovery 16 - 19


Managing Devices

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Managing Devices
From the EM Administrative Server page, you can click the link corresponding to the Devices
number.
This takes you to the Devices page from where you have the options to Add Library and Add
Drive. You can also select an existing device, and Edit or Remove that device.
A tape has to be mounted in the drive before you can write to it. “Mounting a volume” means
logically preparing a tape volume in a drive to be read or written.
Note: Unlike tape devices, Oracle Secure Backup will refuse to communicate with a tape
library that it does not recognize (a tape library whose product ID does not appear in the
<OSB_Home>/devices/ob_robots file). Too many things may go wrong when trying
to control an unknown tape library.

Oracle Database 10g: Backup and Recovery 16 - 20


Daemons
Tape Library Properties Policies
Catalogs
Clients
Media Serv.
- Devices
> - Libraries
Volumes
Jobs

Em_devices_crop.gif

Oracle Internal & Oracle Academy Use Only


Em_08_lib_prop_2.gif

Copyright © 2006, Oracle. All rights reserved.

Tape Library Properties


To view tape library properties, perform the following steps in EM:
1. On the Devices page, click the name of a tape library in the main text box.
The Edit Library page is displayed, showing the properties of the selected tape library.
The device attachment information is displayed at the bottom of the page.
2. Click Show Advanced Settings to view additional properties for the device.
3. You can make changes to the tape library configuration and then click one of the
following:
- Apply, to implement those changes and remain in this page
- OK, to save the changes and return to the Device page
- Cancel, to avoid the operation and move back one page
- Attachments, to configure device attachments
Using the Web tool interface:
1. On the Manage page, select a tape library or tape drive in the main text box
2. Click Show Properties

Oracle Database 10g: Backup and Recovery 16 - 21


Tape Drive Properties

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Tape Drive Properties


To view tape drive properties, perform the following steps:
1. On the Manage page, select a tape drive in the main text box.
2. Click Show Properties.
The Web tool displays a page with the properties for the tape drive that you selected.
3. Click Close to return to the Manage page.

Oracle Database 10g: Backup and Recovery 16 - 22


Daemons
Managing Volumes Policies
Catalogs
Clients
Media Serv.
- Devices
- Libraries
> Volumes
Jobs

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Managing Volumes
You can access the Volumes page from the EM Administrative Server page by clicking the
Details link to the right of the Volumes label in the Resources section. You can use the
Volumes page to display a list of all volumes associated with an administrative server.
To display the volumes, you have to first specify a filter option. You do so by using the Search
section. In the example in the slide, the filter option limits the volumes displayed to only those
for the RMAN-DEFAULT media family. If you want a listing of all volumes, then choose the
All search option, and then click Go.
The Results table identifies the Volume ID and other important information related to your
volumes. You can view all the backup sections in a selected volume by choosing Backup
Sections.
Note: For more information about how to manage volumes within Oracle Secure Backup,
refer to the Oracle Secure Backup Administrator’s Guide.

Oracle Database 10g: Backup and Recovery 16 - 23


Managing Volumes

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Managing Volumes (continued)


Use the Backup Sections page to display the sections of a backup. A backup section is that
portion of a backup image that fits on one physical volume. The Sections table displays the
client host, attributes, and time stamp for each section.

Oracle Database 10g: Backup and Recovery 16 - 24


Daemons
Oracle Secure Backup Jobs Policies
Catalogs
Clients
Media Serv.
- Devices
- Libraries
Volumes
• Oracle Secure Backup uses different types of > Jobs
jobs to perform backup and restore tasks:
– Dataset jobs
– Backup jobs
– Restore jobs
– Oracle backup jobs (RMAN)

Oracle Internal & Oracle Academy Use Only


– Oracle restore jobs (RMAN)
• For each job, Oracle Secure Backup maintains a:
– Log
– Running transcript

Copyright © 2006, Oracle. All rights reserved.

Oracle Secure Backup Jobs


Oracle Secure Backup creates jobs in response to work you ask it to do. It assigns each job a
name, called a job identifier, that is unique among all jobs within the administrative domain.
Several events cause Oracle Secure Backup to create new jobs:
• At the beginning of the day, Oracle Secure Backup inspects the triggers defined in each
schedule. For each trigger that fires that day, it creates one new job for each dataset listed
in the schedule. In job descriptions, Oracle Secure Backup identifies this as a dataset job.
It assigns the scheduled dataset job a numerical job identifier.
• Also, each time you explicitly request that Oracle Secure Backup perform a backup using
a dataset, and send your request to the scheduler, Oracle Secure Backup creates a dataset
job. It assigns the job an identifier consisting of the username of the logged-in user, a
slash, and a unique numerical identifier. An example of such a job identifier is
admin/233.
• At the scheduled start time for a dataset job, Oracle Secure Backup reads the dataset, and
then creates one subordinate job for each host it includes. In job descriptions, Oracle
Secure Backup calls this a backup job. It assigns each backup job an identifier whose
prefix is the parent (dataset) job ID, followed by a dot, and then followed by a unique
small number. An example of such a job identifier is admin/233.1.

Oracle Database 10g: Backup and Recovery 16 - 25


Oracle Secure Backup Jobs (continued)
• Each time you explicitly request that Oracle Secure Backup restore data, and send your
request to the scheduler, Oracle Secure Backup creates a “restore job” for each backup
image that must be read to effect the restore. It assigns each job an identifier consisting
of the logged-in username, a slash, and a unique numerical identifier. If Oracle Secure
Backup creates multiple jobs to satisfy one restore request, it marks each job except the
first as dependent on the success of the previous job. The effect of this notation is that,
should a job fail on which a later job is dependent, that later job is also marked as
failed.
• RMAN creates an Oracle Secure Backup job with types of oracle backup or
oracle restore instead of the backup and restore type.
Oracle Secure Backup keeps a log for each job. This “job log” describes high-level events,
such as the creation, dispatch, and completion times of the job. You may view the log

Oracle Internal & Oracle Academy Use Only


through both the Oracle Secure Backup Web tool and obtool.
Oracle Secure Backup also maintains a running transcript for each job. The transcript
contains everything that is written to the standard output stream by the job’s components,
such as obtar. Oracle Secure Backup creates this transcript when dispatching the job for
the first time, and updates it as the job progresses. When a job requires operator assistance,
Oracle Secure Backup prompts for assistance by using the transcript and by sending an e-
mail notification, if configured.
When you list the jobs by using the obtool utility, it displays the job ID, the scheduled
time, the contents, and the job state. The contents field contains the following information,
depending on the backup job type:
• The dataset being backed up (dataset jobs)
• The host on which the data set is being backed up (backup job)
• A description of the data being restored (restore job)
• The database backup operation, such as datafile or archivelog (Oracle backup
job)
• The backup piece restored (Oracle restore job)

Oracle Database 10g: Backup and Recovery 16 - 26


Managing Jobs

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Managing Jobs
After your backup has been submitted to the Oracle Secure Backup scheduler, you manage
these jobs from the Oracle Secure Backup Web tool:
1. From the Manage page, click the Jobs link in the Maintenance section. You are directed to
the Jobs page.
2. To limit the jobs displayed to:
a. A specific host, select that host from the Host list
b. Those instantiated by a certain user, select that user from the User list
c. A particular dataset, select that dataset from the Dataset list
3. Select one or more of the following Viewing options:
- Active: Select this option if you want to view the status of backup jobs that are
currently in progress.
- Complete: Select this option to view the status of completed jobs, whether they
succeeded or not.
- Pending: Select this option if you want to view the statuses of jobs that are pending,
but not presently running.
- Input pending: Select this option to view the statuses of jobs that are running and
requesting input now.

Oracle Database 10g: Backup and Recovery 16 - 27


Managing Jobs (continued)
- Today: Select this option if you want to view the statuses of backup jobs that are
scheduled to run today.
- Scheduled time: Select this option to display jobs scheduled within a time range you
select from the From date and To date boxes.
4. Select the type of jobs that you want to see in the report. Your choices are: backup,
recover, dataset, Oracle backup, and Oracle restore. You can select multiple job types by
holding down [Shift] while selecting a job type.
5. Click Apply to accept your selections. Information is displayed in the job management
table in the central panel. The following information is available for each job:
- ID: The Oracle Secure Backup-assigned job identifier
- Type: The type of Oracle Secure Backup job associated to a host
- Time: The date and time the job began or is scheduled to begin

Oracle Internal & Oracle Academy Use Only


- State: The job status, which can be pending, completed successfully, or failed
To monitor jobs with the obtool interface, use the lsjob command. Note that the state of
newly created jobs is future work until the job has been submitted.
On-demand backups (created as backup requests) are named using the Oracle Secure Backup
username and a system-generated number. For example, admin/1. Scheduled jobs are named
using a system-generated number, but do not include the username as part of the job name. For
example, 1.1. Oracle Database backup jobs are considered on-demand backups, so the
username is included in the job ID. For example, oracle/1.1.

Oracle Database 10g: Backup and Recovery 16 - 28


Viewing Job Properties and Transcripts

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Viewing Job Properties and Transcripts


To view job properties in the Oracle Secure Backup Web tool, perform the following steps:
1. Select a job ID from the job management table in the central panel of the Jobs page.
2. Click the Show Properties button. The Job Properties page appears showing the
characteristics of the selected job.
To view a job transcript in the Oracle Secure Backup Web tool, perform the following steps:
1. Select a job from the job management table in the central panel of the Jobs page.
2. Click Show Transcripts. A transcript page appears.
3. Scroll down the page to view more information. At the end of the page, you can modify
the transcript viewing criteria. Optionally, select a message level from the Level list.
Oracle Secure Backup tags each message it writes to a transcript with a severity level.
These levels range from “0 Debug message (extra output)” to “9 Fatal.”
4. Optionally, select “Start at line” and enter a line number at which you want the transcript
view messages to start.
5. Optionally, select the “Suppress input” check box to suppress input requests. When a
request for input is recognized, Oracle Secure Backup prompts for a response. Specifying
this option suppresses this action.

Oracle Database 10g: Backup and Recovery 16 - 29


Viewing Job Properties and Transcripts (continued)
6. Optionally, select the “Show line numbers” check box to prefix each line with its
message number.
7. Optionally, select the “Head lines” option and enter a number representing the first N
lines of the transcript having a message severity level at or above the value you
selected.
8. Optionally, select the “Tail lines” option if you want to display the last N lines of the
transcript having a message severity level at or above the value you selected.
9. Optionally, select a value in the “Page refresh (in seconds)” list. The default is 60
seconds.
10. Click Apply to accept your changes, if any, and redisplay the transcript.
To view a job transcript, you must be the owner of the job or belong to a user class that has
either the list any jobs owned by user or the list any job,

Oracle Internal & Oracle Academy Use Only


regardless of its owner right.

Oracle Database 10g: Backup and Recovery 16 - 30


Suspending and Resuming Job Dispatching

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Suspending and Resuming Job Dispatching


It is possible to temporarily suspend and later resume Oracle Secure Backup’s dispatching of
jobs. When job dispatching is suspended, running jobs are allowed to complete; however, the
scheduler starts no new jobs. After job dispatching is suspended, the scheduler resumes it
when you select the resume function or restart Oracle Secure Backup on the administrative
server.
To suspend job dispatching, from the Daemons page, click the Suspend button. The message
“obscheduled suspended” appears in the Status area. Any pending backup and restore
(scheduled or one-time) jobs are no longer dispatched. Jobs that are already running are
permitted to finish.
To resume job dispatching, from the Daemons page, click the Resume button. The message
“obscheduled processing resumed” appears in the Status area.
The following scenario shows you how to do that with the obtool utility:
ob> ctldaemon --command suspend
ob> lsdaemon
Process Daemon/ Listen
ID Service State port Qualifier
31815 observiced normal 400
31817 obscheduled suspended 64739
Oracle Database 10g: Backup and Recovery 16 - 31
Suspending and Resuming Job Dispatching (continued)
ob> ctldaemon --command resume
ob> lsdaemon --long --host EDRSR14P1
Process ID: 31815
Daemon/Service: observiced
State: normal
Listen port: 400
Qualifier: (none)
Process ID: 31817
Daemon/Service: obscheduled
State: normal
Listen port: 64739

Oracle Internal & Oracle Academy Use Only


Qualifier: (none)
ob>
The ctldaemon command is generally used to control the operation of an Oracle Secure
Backup daemon. In the above example, ctldaemon is used to suspend and resume Oracle
Secure Backup job scheduling.
The lsdaemon command is used to list the Oracle Secure Backup daemons running on a
particular host.
Note: For more information about the above commands, refer to the Oracle Secure Backup
Reference guide.

Oracle Database 10g: Backup and Recovery 16 - 32


Job Summaries

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Job Summaries
A “job summary” is a text file report that describes the backup and restore activity performed
by Oracle Secure Backup. You can use job summaries to monitor specific backup jobs, or you
can use a job summary report to monitor all backup and restore activity for a time period.
You can create a “job summary schedule,” which enables Oracle Secure Backup to generate
multiple summary reports, each covering different time periods or activities. If an e-mail
system such as sendmail is operational on the administrative server, then you can supply the
e-mail addresses for the recipients of job summary reports and the report will be sent in an e-
mail to those recipients.
It is recommended that you create at least one job summary schedule so that you receive an
automated e-mail describing your backup jobs.
Using the Web tool, in the Advanced section of the Configure page, click Job Summaries to
list the configured job summary schedules. To remove a job summary schedule, select the
schedule you want to remove, and then click Remove.

Oracle Database 10g: Backup and Recovery 16 - 33


Displaying Log Files and Transcripts

RMAN Oracle Secure Backup


($ORACLE_HOME) (<OSB_Home> directory)

Oracle Internal & Oracle Academy Use Only


rdbms/log/sbtio.log admin/log/scheduler/log

Copyright © 2006, Oracle. All rights reserved.

Displaying Log Files and Transcripts


If an error occurs during an SBT session, Oracle Secure Backup tries to send the error
description to the administrative server to be saved in the job transcript. RMAN records the
error in the trace file named sbtio.log, unless the user has configured a different file to be
used by RMAN. By default, this trace file is located in the $ORACLE_HOME/rdbms/log
directory.
All SBT errors contain the following information:
• The location (function) where the failure occurred (for example, sbtbackup)
• The operation that was being performed (for example, “creating a backup piece”)
• A brief description of the problem (for example, “unable to contact admin server”)
• If applicable, a brief description of the remedy that the user may apply
• If applicable, the name of the trace or debug file where additional information about the
problem can be found
You can get more trace information by using the TRACE option of the ALLOCATE CHANNEL
command. For example: ALLOCATE CHANNEL c1 TYPE sbt TRACE 5 …
Trace levels range from 0 (errors only) to 6 (verbose debugging).

Oracle Database 10g: Backup and Recovery 16 - 34


Summary

In this lesson, you should have learned how to:


• Describe Oracle Secure Backup processes
• Configure policies and defaults
• Browse primary Oracle Secure Backup catalogs
• Manage clients

Oracle Internal & Oracle Academy Use Only


• Manage media servers (tape devices and libraries)
• Manage volumes
• Manage jobs

Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 16 - 35


Practice Overview

This practice covers the following topics:


• Backing up the Oracle Secure Backup catalog data and
critical files
• Performing disaster recovery of the Oracle Secure
Backup catalog files

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery 16 - 36


Practices
Appendix A

Oracle Internal & Oracle Academy Use Only


Table of Contents
Practice 2-1: Configure Your Database .......................................................................... 5
Practice 3-1: Use RMAN to Create and Manage Backups ............................................. 7
Practice 4-1: Use RMAN to Recover a Datafile............................................................. 9
Practice 4-2: Use the Flash Recovery Area to Quickly Recover a Datafile ................. 10
Practice 4-3: Recover Control Files.............................................................................. 11
Practice 4-4: Delete Obsolete Backups......................................................................... 12
Practice 5-1: Enable Flashback Database ..................................................................... 14
Practice 5-2: Set Restore Points and Perform Flashback Table.................................... 15
Practice 5-3: Use Flashback Query and Flashback Versions Query............................. 16
Practice 5-4: Use Flashback Database .......................................................................... 17
Practice 6-1: Create a Duplicate Database.................................................................... 19

Oracle Internal & Oracle Academy Use Only


Practice 7-1: Use Tablespace Point-in-time Recovery ................................................. 21
Practice 8-1: Create the Recovery Catalog and Register the Database ........................ 23
Practice 9-1: Use SQL to Monitor the Progress of RMAN Backups ........................... 25
Practice 9-2: Use Enterprise Manager to Monitor RMAN Jobs ................................... 26
Practice 11-1: Install Oracle Secure Backup ................................................................ 29
Practice 11-2: Configure Devices for Oracle Secure Backup....................................... 30
Practice 11-3: Register the Administrative Server........................................................ 31
Practice 11-4: Configure Oracle Secure Backup User.................................................. 32
Practice 12-1: Create a Database Backup Storage Selector.......................................... 34
Practice 12-2: Perform Oracle-Suggested Backup ....................................................... 35
Practice 13-1: Back Up Your File System with Oracle Secure Backup ....................... 37
Practice 14-1: Restore File-System Data with Oracle Secure Backup ......................... 39
Practice 15-1: Create an Encrypted Backup ................................................................. 41
Practice 15-2: Recover a Tablespace from an Encrypted Backup................................ 42
Practice 16-1: View Oracle Secure Backup Information.............................................. 44
Practice 16-2: Back Up the Oracle Secure Backup Catalog ......................................... 45

Oracle Database 10g: Backup and Recovery A-2


Practice for Lesson 1

There are no practices for Lesson 1.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery A-3


Practice for Lesson 2

In this practice, you configure your database for recoverability.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery A-4


Practice 2-1: Configure Your Database
1) Use Enterprise Manager to configure your database in ARCHIVELOG mode.
2) Use Enterprise Manager to verify that the Flash Recovery Area has been configured
for your database and increase the Flash Recovery Area size to 3 GB.
3) Set Preferred Credentials in Enterprise Manager.
4) Use Recovery Manager (RMAN) to connect to your target database. Make note of the
database identifier (DBID) of your database.

Database Identifier: ____________________________


Make note of the database identifier (DBID) of your database.
5) Use the RMAN SHOW ALL command to view the configuration settings in your

Oracle Internal & Oracle Academy Use Only


database and then exit from your RMAN session.

Oracle Database 10g: Backup and Recovery A-5


Practice for Lesson 3

In this practice, you configure automatic backup of the control file. You also configure a
backup of your database using the Oracle-Suggested Backup Strategy feature in
Enterprise Manager Database Control.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery A-6


Practice 3-1: Use RMAN to Create and Manage Backups
1) Use Enterprise Manager Database Control to configure autobackup of the control file
and the server parameter file.
2) Use Enterprise Manager Database Control to configure backup optimization and
enable block change tracking. Specify
/u01/app/oracle/oradata/orcl/chg_track.f for the name of the block
change tracking file.
3) Use Enterprise Manager Database Control to create a whole database backup using
the Oracle-suggested backup strategy.
4) Use Enterprise Manager to view information about your backups.
5) Use RMAN to create a duplexed backup set of the EXAMPLE tablespace.

Oracle Internal & Oracle Academy Use Only


6) Use Enterprise Manager Database Control to perform a crosscheck of your backups.

Oracle Database 10g: Backup and Recovery A-7


Practice for Lesson 4

In this practice, you use RMAN to perform recovery.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery A-8


Practice 4-1: Use RMAN to Recover a Datafile
In this practice, you use RMAN to recover a lost datafile. Notice how you are prompted
by Enterprise Manager to recover the lost datafile.
1) Use SQL*Plus to query the HR.REGIONS table. Make note of the number of rows in
the HR.REGIONS table.
2) At the operating system prompt, execute the lab_04_01_02_01.sh script to
simulate a failure in your database. This script deletes the EXAMPLE tablespace
datafile.
3) Use SQL*Plus to query the HR.JOBS table.
4) Use Enterprise Manager to perform database recovery of the EXAMPLE tablespace
datafile.

Oracle Internal & Oracle Academy Use Only


5) Return to your SQL*Plus session and again attempt to query the HR.JOBS table.

Oracle Database 10g: Backup and Recovery A-9


Practice 4-2: Use the Flash Recovery Area to Quickly Recover a
Datafile
In this practice, you recover a lost datafile by using the Flash Recovery Area for fast
recovery.
1) Use SQL*Plus to query the HR.REGIONS table. Make note of the number of rows in
the HR.REGIONS table.
2) At the operating system prompt, execute the lab_04_02_02_01.sh script to
simulate a failure in your database. This script deletes the EXAMPLE tablespace
datafile.
3) Use SQL*Plus to query the HR.DEPARTMENTS table.
4) Use the RMAN SWITCH TO COPY command to recover the datafile.

Oracle Internal & Oracle Academy Use Only


5) Query the HR.JOBS table.
6) Using Enterprise Manager Database Control, verify that the datafile being used for
the EXAMPLE tablespace is in the Flash Recovery Area.
7) Make a copy of the datafile in the original location and switch back to it.
8) Use Enterprise Manager Database Control to verify the file.

Oracle Database 10g: Backup and Recovery A-10


Practice 4-3: Recover Control Files
In this practice, you recover your control file using an autobackup.
1) Use SQL*Plus to view files information for the control files in your database. Query
V$CONTROLFILE.
2) Simulate a failure in your environment by executing the lab_04_03_02_01.sh
script to delete all your control files.
3) You need some more information about your control files. Query
V$CONTROLFILE_RECORD_SECTION to learn more about the contents of your
control file.
4) You have lost all your control files and will need to recover them from the control file
autobackup. Use Recovery Manager to recover the control files.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery A-11


Practice 4-4: Delete Obsolete Backups
1) Use Recovery Manager to view obsolete backups.
2) Use Enterprise Manager Database Control to delete obsolete backups.
3) You can also use RMAN to verify that your obsolete backups were deleted.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery A-12


Practice for Lesson 5

In this practice, you use Oracle Flashback features to recover from errors in your
database.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery A-13


Practice 5-1: Enable Flashback Database
1) Use Enterprise Manager to enable Flashback Database.
2) Use the ALTER DATABASE command to enable supplemental logging.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery A-14


Practice 5-2: Set Restore Points and Perform Flashback Table
Restore points are a way to “bookmark” database points in time. Set a restore point to
remember a significant change so that you can quickly recover to that point in time
without having to record an SCN or time.
1) You must enable row movement to use restore points. Use Enterprise Manager to
enable row movement for the HR.LOCATIONS table.
2) Create a normal restore point.
3) Use SQL*Plus to query the POSTAL_CODE column in the HR.LOCATIONS table.
4) Execute the lab_05_02_04_01.sql script to update the POSTAL_CODE column
in the HR.LOCATIONS table so that all postal codes are set to 11111.
5) Execute the lab_05_02_05_01.sql script to query the POSTAL_CODE column

Oracle Internal & Oracle Academy Use Only


in the HR.LOCATIONS table again.
6) Restore the POSTAL_CODE column values using the restore point.
7) Return to your SQL*Plus session. Execute the lab_05_02_07_01.sql script to
query the POSTAL_CODE column in HR.LOCATIONS again to be sure the correct
values have been restored.

Oracle Database 10g: Backup and Recovery A-15


Practice 5-3: Use Flashback Query and Flashback Versions
Query
1) Execute the lab_05_03_01_01.sql script to query the HR.LOCATIONS table
for location ID 1400.
2) Execute the lab_05_03_02_01.sql script to update the POSTAL_CODE column
in the HR.LOCATIONS table, simulating user error.
3) Execute the lab_05_03_03_01.sql script to query the POSTAL_CODE column
in HR.LOCATIONS and view the change.
4) Execute the lab_05_03_04_01.sql script to update the POSTAL_CODE column
in the HR.LOCATIONS table, simulating user error.
5) Use Enterprise Manager to perform Flashback Versions Query to correct the user

Oracle Internal & Oracle Academy Use Only


errors.
6) Return to your SQL*Plus session. Query the HR.LOCATIONS table to confirm the
Flashback operation.

Oracle Database 10g: Backup and Recovery A-16


Practice 5-4: Use Flashback Database
1) Use Enterprise Manager to verify that Flashback Database is enabled.
2) Use Enterprise Manager to create a Guaranteed Restore Point.
3) Execute the lab_05_04_03_01.sql script to determine the number of rows in
the HR.JOB_HISTORY table. Record the number of rows: ___________
4) Execute the lab_05_04_04_01.sql script to truncate the HR.JOB_HISTORY
table.
5) Execute the lab_05_04_05_01.sql script to determine the number of rows in
the HR.JOB_HISTORY table.
6) Use Flashback Database to restore the HR.JOB_HISTORY table rows.
7) Return to your SQL*Plus session. Execute the lab_05_04_07_02.sql script to

Oracle Internal & Oracle Academy Use Only


query the HR.JOB_HISTORY table again to be sure the data has been restored.

Oracle Database 10g: Backup and Recovery A-17


Practice for Lesson 6

In this practice, you create a duplicate database.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery A-18


Practice 6-1: Create a Duplicate Database
In this practice, you use RMAN to create a duplicate database on the same host as your
database.
1) Create an Oracle password file for your auxiliary instance.
2) Use Oracle Net Manager to create an entry called AUXDB in the tnsnames.ora
file.
3) Create an initialization parameter file for the auxiliary instance.
4) Start the auxiliary instance in NOMOUNT mode using the initAUX.ora file.
5) Create a server parameter file (SPFILE).
6) Verify that your target database (orcl database) is mounted or open.
7) Start RMAN with a connection to the target database (orcl) and the auxiliary

Oracle Internal & Oracle Academy Use Only


instance.
8) Create the duplicate database by executing the DUPLICATE command.
9) Use SQL*Plus to log in to your AUX database and execute a query against the
HR.REGIONS table.
10) Now that you have completed the test recovery by creating a duplicate database, shut
down the aux instance.
11) Change your ORACLE_SID to orcl in preparation for later practices.

Oracle Database 10g: Backup and Recovery A-19


Practice for Lesson 7

In this practice, you use tablespace point-in-time recovery to recover from unwanted
changes to your database.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery A-20


Practice 7-1: Use Tablespace Point-in-time Recovery
1) Execute the lab_07_01_01_01.sh script to export the HR schema.
2) Execute the lab_07_01_02_02.sql script to create a new tablespace and a new
user in your database.
3) Execute the lab_07_01_03_01.sh script to populate the new tablespace with a
copy of the data from the HR schema.
Note: The import should complete successfully. You will receive error messages
because the import excludes the COUNTRIES, REGIONS, and LOCATIONS tables.
These messages can be ignored.
4) Create a backup of your database using RMAN.
5) Record the current SCN: ____________

Oracle Internal & Oracle Academy Use Only


6) Record the current time.
7) Execute the lab_07_01_07_01.sql script to query the HRTEST.EMPLOYEES
table and view information about employees in department 60.
Make note of the highest salary that is displayed: ________
8) Execute the lab_07_01_08_01.sql script to update the salaries for the
employees in department 60 and note the highest salary displayed.
Highest salary: _____________
9) You now want to perform TSPITR for the HRTEST tablespace to return it to the state
prior to the updates. Execute the lab_07_01_09_01.sql script to determine
whether there are any dependencies that will prevent the TSPITR operation.
10) You can use Enterprise Manager Database Control or RMAN command line to
perform tablespace point-in-time recovery.
11) Verify that the HRTEST tablespace is online.
12) Verify that the SALARY columns in HRTEST.EMPLOYEES for the employees in
department 60 contain the correct values.
13) Execute the lab_07_01_13_02.sql script to add a constraint to the
HRTEST.DEPARTMENTS table.
14) Assume you need to perform TSPITR on the HRTEST tablespace again. Execute the
lab_07_01_14_02.sql query to determine whether there are any dependencies
outside the recovery set.
15) If you wanted to complete the tablespace point-in-time recovery for the HRTEST
tablespace now, what would you need to do?
Note: You will not perform another tablespace point-in-recovery in this practice.
You would need to disable the DEPT_LOC_ID_FK constraint that was added to your
HRTEST.DEPARTMENTS table or you would need to add the tablespace that
contains the HR.LOCATIONS table to your recovery set.

Oracle Database 10g: Backup and Recovery A-21


Practice for Lesson 8

In this practice, you create a recovery catalog in your instructor’s database and register
your database in the recovery catalog.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery A-22


Practice 8-1: Create the Recovery Catalog and Register the
Database
The tablespace for the recovery catalog and the recovery catalog owner have been created
in the instructor database. The tablespaces are named RCTS01 – RCTS12. The users are
named RCUSER01 – RCUSER12.
1) Connect to the recovery catalog database (instructor’s database) with the appropriate
recovery catalog owner name (if you are using PC01, connect as RCUSER01) using
RMAN. Create the recovery catalog in your assigned tablespace. (If you are using
PC01, your assigned tablespace is RCTS01.) The service name is RCDB.
2) Using RMAN, connect to your target database and the recovery catalog database.
3) Using RMAN, execute the command to resynchronize the control file and recovery
catalog. What happens? Why?

Oracle Internal & Oracle Academy Use Only


4) Register the target database in the recovery catalog. You can use RMAN command-
line or Enterprise Manager for this step.
5) Create an RMAN script named whole_backup to make a whole database backup.
Do not execute the whole_backup script at this time.
6) Use the PRINT command to query the recovery catalog and verify the creation of
your whole_backup script.
7) In preparation for later practices, use RMAN to unregister your database from the
recovery catalog.

Oracle Database 10g: Backup and Recovery A-23


Practice for Lesson 9

In this practice, you monitor the progress of your RMAN backup jobs.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery A-24


Practice 9-1: Use SQL to Monitor the Progress of RMAN
Backups
1) Invoke RMAN and delete all obsolete backups.
2) Open a second terminal window. Change to the labs directory. Invoke SQL*Plus
and connect as SYSDBA. You will use this second session to monitor a database
backup.
3) Return to your first terminal window. In your RMAN session, begin a whole database
backup.
4) Use your SQL*Plus session to monitor the progress of the whole database backup by
querying the V$SESSION_LONGOPS view. By using this view you can determine
whether the backup is progressing normally or hanging. If the backup is progressing
normally, the TIME_REMAINING column should be decreasing. Execute the

Oracle Internal & Oracle Academy Use Only


lab_09_01_04_01.sql script to query V$SESSION_LONGOPS.

Oracle Database 10g: Backup and Recovery A-25


Practice 9-2: Use Enterprise Manager to Monitor RMAN Jobs
You can easily monitor RMAN jobs in Enterprise Manager.
1) Start Enterprise Manager and log in as SYS/ORACLE as SYSDBA.
2) Delete obsolete backups.
3) Start a whole database backup.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery A-26


Practice for Lesson 10

There are no practices for Lesson 10.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery A-27


Practice for Lesson 11

In this practice, you perform the following tasks:


• Create your Oracle Secure Backup home directory.
• Install the Oracle Secure Backup software.
• Configure virtual test devices.
• View information about the configured devices.
• Connect to the EM Database Console application using your browser.
• Register your administrative server with EM.
• Insert four volumes into the tape library.
• Test connectivity to the tape drive.
• Define a new Oracle Secure Backup user.
• Configure preauthorization for this user.

Oracle Internal & Oracle Academy Use Only


THE VIRTUAL TEST DEVICES USED IN THIS LAB ARE FOR TRAINING
PURPOSES ONLY. THEY ARE NOT SUPPORTED FOR PRODUCTION USE.

Oracle Database 10g: Backup and Recovery A-28


Practice 11-1: Install Oracle Secure Backup
In this practice, you perform the following tasks:
• Create your Oracle Secure Backup home directory.
• Install the Oracle Secure Backup software.
Unless specified otherwise during this practice, you should log in as the oracle user to
your terminal emulator session.

Use the following information to install the software:


• The Oracle Secure Backup software is staged on your server in the
/stage/osb/osb_10_1cdrom directory.
• Your Oracle Secure Backup home directory is
/usr/local/oracle/backup.
• During installation, you configure only the local machine as an administrative
server with no attached devices.

Oracle Internal & Oracle Academy Use Only


1) Log in as the root user and create /usr/local/oracle/backup as your
Oracle Secure Backup home directory. Change to that directory.
2) Continue as the root user. Start the installation of Oracle Secure Backup from the
staging directory. Begin with the setup program.

Oracle Database 10g: Backup and Recovery A-29


Practice 11-2: Configure Devices for Oracle Secure Backup
In this practice, you perform the following tasks:
• Configure a virtual test library and a virtual test drive.
• View information about the configured devices and the default media family via
the obtool interface.
1) In a terminal window, navigate to the /home/oracle/labs directory and execute
the ./lab_11_02_01.sh script, to configure the vlib tape library directly attached
to your administrative server.
2) In the /home/oracle/labs directory, execute the ./lab_11_02_02.sh script, to
configure the vt tape drive for the library:
3) Start the obtool as the admin user with the oracle password, and view the
currently configured devices.

Oracle Internal & Oracle Academy Use Only


(Hint: Use the lsdev command.)
4) View the RMAN-DEFAULT media family.
(Hint: Use the lsmf --long command, , and use the quit command to exit.)

Oracle Database 10g: Backup and Recovery A-30


Practice 11-3: Register the Administrative Server
In this practice, you perform the following tasks:
• Connect to the EM Database Console application using your browser.
• Register your administrative server with EM.
• Insert four volumes into the virtual test library.
• Test connectivity to the virtual test drive.
Unless specified otherwise, you should log in as the oracle user to your terminal
emulator session, and as SYSDBA to your Database Control console and SQL*Plus
sessions.
1) With your browser, connect to Enterprise Manager Database Control using the IP
address or machine name for your host.
2) In Enterprise Manager, register your administrative server.

Oracle Internal & Oracle Academy Use Only


3) Use Enterprise Manager to insert four volumes into the vlib test library. (An
unlabeled tape is synonymous with a blank tape within Oracle Secure Backup.)
4) Before taking any backups, you want to make sure you can access your tape drives.
On the Devices page, test the virtual tape drive access.

Oracle Database 10g: Backup and Recovery A-31


Practice 11-4: Configure Oracle Secure Backup User
In this practice, you perform the following tasks:
• Define a new Oracle Secure Backup user.
• Configure preauthorization for this user.
Unless specified otherwise, you should log on as the oracle user to your terminal
emulator session and as SYSDBA to your EM Database Control Console session.
If you are already in Enterprise Manager, you can use shortcuts, such as clicking the
Administrative Server link in the upper-left part of the Devices page. Then if you right-
click the “File System Backup and Restore” link (at the bottom of the page) and select the
“Open Link in New Window” or “Open Link in New Tab” option, you can have two
windows open, one for Enterprise Manager and the other for the Oracle Secure Backup
Web tool.
1) Use the Oracle Secure Backup Web tool to create the oracle Oracle Secure Backup

Oracle Internal & Oracle Academy Use Only


user with the following values: User oracle, Password: oracle, User class:
oracle, UNIX name: oracle, UNIX group: dba and NDMP server user: no.
Note: If you have an NDMP server, set the value to “yes”; but inside the regular
classrooms, an NDMP server is not available, so set the value to “no.”
2) Configure the oracle Oracle Secure Backup user as a preauthorized RMAN and
command line user with following values: Hosts: all hosts, OS username: *,
Windows domain name: *, and Attributes: cmdline and rman.
Best Practice Tip: Limit pre-authorized access to selected hosts.

Oracle Database 10g: Backup and Recovery A-32


Practice for Lesson 12

In this practice, you perform the following tasks:


• Create a database backup storage selector for your database.
• Perform a backup of your Oracle database with the Oracle-Suggested Backup
strategy.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery A-33


Practice 12-1: Create a Database Backup Storage Selector
In this practice, you perform the following tasks:
• In SQL*Plus, verify that the database is in ARCHIVELOG mode.
• In Enterprise Manager, create a database backup storage selector for your Oracle
database.
• In Enterprise Manager, perform a test backup to verify that the Oracle Secure
Backup configuration is correct.
Unless specified otherwise, you should log on as the oracle user to your terminal
emulator session, and as SYSDBA to your Database Control Console and SQL*Plus
sessions.
1) First, verify that the database is in ARCHIVELOG mode. If your database is in
ARCHIVELOG mode, continue with the next step. If not, shut down the database,
enable archiving, and then restart the database.

Oracle Internal & Oracle Academy Use Only


2) In Enterprise Manager, create a backup selector for your database with the following
specifications:
• Tape Drives: 1
• Host Credentials Username: oracle, Password: oracle, and “Save as
Preferred Credential”
• Database Backup Types: Archive log, Auto Backup, Full, and Incremental
3) Test your tape backup.

Oracle Database 10g: Backup and Recovery A-34


Practice 12-2: Perform Oracle-Suggested Backup
In Enterprise Manager, perform Oracle-Suggested Backup.
Unless specified otherwise, you should log on as the oracle user to your terminal emulator
session, and as SYSDBA to your Database Control Console and SQL*Plus sessions.
1) In Enterprise Manager, schedule Oracle-Suggested Backup with the following
specifications:
• Backup destination: both disk and tape
• Daily backup of archivelogs and incremental backup
• Tape Drives: 1
• Schedule daily backup within 5 minutes of your current date and time
2) Review your backup job. If this is your first scheduled backup, you should see a full
backup (otherwise an incremental one) first to the Flash Recovery Area, then to tape.

Oracle Internal & Oracle Academy Use Only


Review the RMAN command, as well as the job execution.
3) Optionally, to reinforce this practice topic, you can view the
Oracle_Suggested_Strategy_viewlet_swf.html viewlet in the
/home/oracle/solutions/viewlets directory.

Oracle Database 10g: Backup and Recovery A-35


Practice for Lesson 13

In this practice, you perform the following tasks:


• Create a dataset for a file-system backup.
• Schedule a backup of the dataset.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery A-36


Practice 13-1: Back Up Your File System with Oracle Secure
Backup
Use the Oracle Secure Backup Web tool, which can be accessed from Enterprise
Manager for the tasks in this practice session.
Unless specified otherwise, access Enterprise Manager as SYDBA and the Oracle Secure
Backup Web tool as admin user. Both use oracle as password.
1) Create a new dataset called mylabs that you will use to back up your $HOME/labs
directory. The dataset should be of the form:
include host <hostname> {
include path /home/oracle/labs
}
Make sure that you replace <hostname> with the machine name of your student

Oracle Internal & Oracle Academy Use Only


computer.
Note: Do not back up the local root directory.
2) Create a backup with your mylabs dataset. The backup should run immediately.
3) View Oracle Secure Backup job information. Query the Manage: Jobs page for the
previously created and executed job.
4) Optionally, to reinforce this practice topic, you can view the
Scheduling_filesystem_backups_viewlet_swf.html viewlet in the
/home/oracle/solutions/viewlets directory.

Oracle Database 10g: Backup and Recovery A-37


Practice for Lesson 14

In this practice, you perform the following tasks:


• Delete the contents of your labs directory.
• Restore the missing lab files.
• Verify that the files are recovered.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery A-38


Practice 14-1: Restore File-System Data with Oracle Secure
Backup
In this practice, you first delete your lab files and then restore them from the backup
created in the previous practice.
Unless specified otherwise, you should log on as the oracle user to your terminal
emulator session, and as SYSDBA to your Database Control Console session.
For tasks 2 to 5, log in as admin user (with the oracle password) into the Oracle
Secure Backup Web tool, which can be accessed from Enterprise Manager.
1) From your terminal emulator session, remove all the files located in your
$HOME/labs directory.
2) Restore your $HOME/labs directory contents by selecting the appropriate backup
from the Oracle Secure Backup catalog. Use the Browse Host button to locate the
desired backup.

Oracle Internal & Oracle Academy Use Only


3) Monitor the progress of the restore request.
4) In a terminal window, verify that your lab files are present.

Oracle Database 10g: Backup and Recovery A-39


Practice for Lesson 15

In this practice, you perform the following tasks:


• Create an encrypted backup.
• Recover a tablespace from an encrypted backup.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery A-40


Practice 15-1: Create an Encrypted Backup
In this practice, you perform the following tasks:
• Schedule a customized tape backup of the whole database.
• Edit the RMAN script to encrypt the backup using a password.
• After the backup operation completes, verify that the backup was encrypted.
Unless specified otherwise, you should log in as SYS user (with the oracle password)
and connect as SYSDBA to Enterprise Manager Database Control.
1) In Enterprise Manager, schedule a customized tape backup of the whole database
with the following specifications: full online backup with archive logs to tape. Start
the backup immediately.
2) Edit the RMAN script and include the command to encrypt the backup, specifying
demo as the password. The command syntax is:

Oracle Internal & Oracle Academy Use Only


SET ENCRYPTION ON IDENTIFIED BY demo ONLY;
Note: Specifying “ONLY” in the command means decryption will require the demo
password, and no other encryption keys will exist for this backup.
3) Check the backup job status. Verify that the RMAN SET ENCRYPTION command is
successfully executed.
4) Verify the successful completion of your backup.
5) Optionally, to reinforce this practice topic, you can view the
Backup_Encryption_viewlet_swf.html viewlet the
/home/oracle/solutions/viewlets directory.

Oracle Database 10g: Backup and Recovery A-41


Practice 15-2: Recover a Tablespace from an Encrypted Backup
In this practice, you perform the following tasks:
• Perform a tablespace recovery using the encrypted backup.
• Troubleshoot the recovery process.
• Edit the RMAN script to decrypt the backup.
Unless specified otherwise, you should log in as SYS user (with the oracle password)
and connect as SYSDBA to Enterprise Manager Database Control.
1) In Enterprise Manager, perform an object level recovery of the EXAMPLE tablespace
to the current time or a previous point in time. Restore the files to the default location.
2) The recovery operation fails. Why?
3) Troubleshoot the recovery process. What do you notice on the Perform Recovery
page?

Oracle Internal & Oracle Academy Use Only


4) Perform an object level recovery of the EXAMPLE tablespace to the current time or a
previous point in time. Restore the files to the default location.
5) Edit the RMAN script on the “Perform Object Level Recovery: Review” page.
Include the command to decrypt the backup, specifying demo as the password. The
command syntax is:

SET ENCRYPTION ON IDENTIFIED BY demo ONLY;


6) View the Perform Recovery: Result page. Notice the successful execution of your
SET DECRYPTION command.

Oracle Database 10g: Backup and Recovery A-42


Practice for Lesson 16

In this practice, you perform the following tasks:


• View Oracle Secure Backup information.
• Back up the Oracle Secure Backup catalog.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery A-43


Practice 16-1: View Oracle Secure Backup Information
In this practice, you view Oracle Secure Backup information: the catalog, volumes and
their content, jobs and job transcripts, and defaults and policies.
Unless specified otherwise, you should log in as the SYS user (with the oracle
password) and connect as SYSDBA to Enterprise Manager Database Control. To access
the Oracle Secure Backup Web tool, use admin as username and oracle as password.
1) The administrative server maintains a catalog in which it stores metadata relating to
backup and restore operations for the administrative domain. Use the Oracle Secure
Backup Web tool to browse the Oracle Secure Backup catalog to view what you have
backed up so far.
2) View the volumes and their content.
3) View a category of jobs—for example, completed ones. Include a review of a job

Oracle Internal & Oracle Academy Use Only


transcript.
4) View the configuration of your security policies. What is the value of the “Login
token duration” policy?

Oracle Database 10g: Backup and Recovery A-44


Practice 16-2: Back Up the Oracle Secure Backup Catalog
In this practice, you perform the following tasks using obtool:
• Create a dataset for the <OSB_HOME>/admin directory.
• Create a backup request.
• Submit the backup request to the scheduler.
• Verify that the backup completed successfully.
• Identify the volume that contains the backup data.
Previously, you used the Oracle Secure Backup Web tool for a file-system backup. Now
use the obtool utility with admin as username and oracle as password.
1) Create a media family to be used when backing up the Oracle Secure Backup catalog
files. Use the following command:
mkmf --vidunique --writewindow 7days --retain 28days
--noappend OSB_catalogs

Oracle Internal & Oracle Academy Use Only


2) Create a backup set for the catalog data, using the commands listed here:
mkds --dir catalog_backup
mkds --input catback.ds

When prompted for input, supply the following dataset directives, where
<hostname> is the host name of your assigned computer:
include host <hostname> {
include path /etc/obconfig
include path /usr/etc/ob/xcr
include path /usr/local/oracle/backup/admin }
3) Create a backup request for this dataset, and then submit the backup request.
To create the backup request using the following obtool command:
backup –l full –p 1 –r vt –g --dataset catback.ds
What does this command do?
4) Use the information from the message returned in the previous step to verify that the
backup completed successfully. (State should show “completed successfully”).
5) Identify the volume that contains the backup.

Oracle Database 10g: Backup and Recovery A-45


Oracle Internal & Oracle Academy Use Only
Appendix B
Practice Solutions

Oracle Internal & Oracle Academy Use Only


Table of Contents
Solutions for Practice 2-1: Configure Your Database .................................................... 5
Solutions for Practice 3-1: Use RMAN to Create and Manage Backups ..................... 10
Solutions for Practice 4-1: Use RMAN to Recover a Datafile ..................................... 17
Solutions for Practice 4-2: Use the Flash Recovery Area to Quickly Recover a Datafile
....................................................................................................................................... 21
Solutions for Practice 4-3: Recover Control Files ........................................................ 26
Solutions for Practice 4-4: Delete Obsolete Backups ................................................... 33
Solutions for Practice 5-1: Enable Flashback Database ............................................... 36
Solutions for Practice 5-2: Set Restore Points and Perform Flashback Table.............. 38
Solutions for Practice 5-3: Use Flashback Query and Flashback Versions Query....... 46
Solutions for Practice 5-4: Use Flashback Database .................................................... 52

Oracle Internal & Oracle Academy Use Only


Solutions for Practice 6-1: Create a Duplicate Database .............................................. 60
Solutions for Practice 7-1: Use Tablespace Point-in-time Recovery............................ 74
Solutions for Practice 8-1: Create the Recovery Catalog and Register the Database... 89
Solutions for Practice 9-1: Use SQL to Monitor the Progress of RMAN Backups...... 96
Solutions for Practice 9-2: Use Enterprise Manager to Monitor RMAN Jobs ............. 99
Solutions for Practice 11-1: Install Oracle Secure Backup......................................... 106
Solutions for Practice 11-2: Configure Devices for Oracle Secure Backup............... 110
Solutions for Practice 11-3: Register the Administrative Server................................ 112
Solutions for Practice 11-4: Configure Oracle Secure Backup User.......................... 118
Solutions for Practice 12-1: Create a Database Backup Storage Selector .................. 123
Solutions for Practice 12-2: Perform Oracle-Suggested Backup................................ 129
Solutions for Practice 13-1: Back Up Your File System with Oracle Secure Backup 138
Solutions for Practice 14-1: Restore File-System Data with Oracle Secure Backup . 145
Solutions for Practice 15-1: Create an Encrypted Backup.......................................... 151
Solutions for Practice 15-2: Recover a Tablespace from an Encrypted Backup ........ 158
Solutions for Practice 16-1: View Oracle Secure Backup Information...................... 168
Solutions for Practice 16-2: Back Up the Oracle Secure Backup Catalog ................. 174

Oracle Database 10g: Backup and Recovery B-2


Practice Solutions for Lesson 1

There are no practices for Lesson 1.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-3


Practice Solutions for Lesson 2

In this practice, you configure your database for recoverability.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-4


Solutions for Practice 2-1: Configure Your Database
1) Use Enterprise Manager to configure your database in ARCHIVELOG mode.
Answer:
1. Start the Web browser and enter http://your host name:1158/em.
2. Enter SYS in the User Name field and oracle in the Password field. Select
SYSDBA in the Connect As menu. Click Login.
3. Click “I agree” on the Oracle Database 10g Licensing Information page.
4. Select the Maintenance page.
5. Select Recovery Settings in the Backup/Recovery Settings section.
6. In the Media Recovery section, select “ARCHIVELOG Mode” and click Apply.

Oracle Internal & Oracle Academy Use Only


7. The Confirmation page is displayed. Click Yes to restart the database instance.
8. On the Restart Database: Specify Host and Target Database Credentials page. In
the Host Credentials section, enter oracle in the Username and Password fields.
In the Database Credentials section, enter SYS in the Username field and
oracle in the Password field. Select “Save as Preferred Credential.” Click OK.
9. The Restart Database: Confirmation page is displayed. Click Yes to confirm the
restart of the database instance.
10. The Restart Database: Activity Information page is displayed. Wait a few minutes
and then click Refresh.
2) Use Enterprise Manager to verify that the Flash Recovery Area has been configured
for your database and increase the Flash Recovery Area size to 3 GB.
Answer:
1. Select the Maintenance page.
2. Select Recovery Settings in the Backup/Recovery Settings section.

Oracle Database 10g: Backup and Recovery B-5


Solutions for Practice 2-1: Configure Your Database (continued)
3. Scroll to the Flash Recovery Area and verify that the Flash Recovery Area is
enabled.

Oracle Internal & Oracle Academy Use Only


4. Enter 3 in the Flash Recovery Area Size field and click Apply.
5. The Update Message is displayed. Click the Database instance link to return to the
Maintenance page.
3) Set Preferred Credentials in Enterprise Manager.
Answer:
1. Select Preferences at the top of the Maintenance page.
2. Select Preferred Credentials on the left side of the page.
3. Click the Set Credentials icon for the database instance.
4. Supply the following values:
Normal Username: system
Normal Password: oracle
SYSDBA Username: sys
SYSDBA Password: oracle
Host Username: oracle
Host Password: oracle
5. Click Test. The “Credentials successfully verified for orcl.oracle.com” message is
displayed. If you have any errors, correct them and click Test again.
6. Click Apply to save the settings.
7. Click Database to return to the Database home page.
4) Use Recovery Manager (RMAN) to connect to your target database. Make note of the
database identifier (DBID) of your database.

Database Identifier: ____________________________


Answer:
1. Open a terminal window and log in as oracle/oracle.

Oracle Database 10g: Backup and Recovery B-6


Solutions for Practice 2-1: Configure Your Database (continued)
2. Start RMAN and connect to the target database by entering the following
command at the operating system prompt: rman target /
[oracle@edrsr10p1 oracle]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Tue


Mar 7 12:51:53 2006

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: ORCL (DBID=1090770270)

RMAN>

Make note of the database identifier (DBID) of your database.

Oracle Internal & Oracle Academy Use Only


5) Use the RMAN SHOW ALL command to view the configuration settings in your
database and then exit from your RMAN session.
Answer:
RMAN> show all;

using target database control file instead of recovery


catalog
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE
DISK TO '%F'; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE
SBT_TAPE TO '%F'; # deft
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO
BACKUPSET; # default
CONFIGURE DEVICE TYPE SBT_TAPE PARALLELISM 1 BACKUP TYPE
TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO
1; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE
TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO
1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE
SBT_TAPE TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' FORMAT '%U';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO
'/u01/app/oracle/product/10.2.0/db_1/dbst

Oracle Database 10g: Backup and Recovery B-7


Solutions for Practice 2-1: Configure Your Database (continued)
RMAN> exit
Recovery Manager complete.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-8


Practice Solutions for Lesson 3

In this practice, you configure automatic backup of the control file. You also configure a
backup of your database using the Oracle-Suggested Backup Strategy feature in
Enterprise Manager Database Control.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-9


Solutions for Practice 3-1: Use RMAN to Create and Manage
Backups
1) Use Enterprise Manager Database Control to configure autobackup of the control file
and the server parameter file.
Answer:
1. Select Maintenance > High Availability > Backup/Recovery Settings > Backup
Settings.
2. On the Backup Settings page, select the Policy tab.
3. In the Backup Policy section, select “Automatically backup the control file and
server parameter file (SPFILE) with every backup and database structural
change.” Click OK.

Oracle Internal & Oracle Academy Use Only


4. You are returned to the Maintenance page.
2) Use Enterprise Manager Database Control to configure backup optimization and
enable block change tracking. Specify
/u01/app/oracle/oradata/orcl/chg_track.f for the name of the block
change tracking file.
Answer:
1. Select Maintenance > High Availability > Backup/Recovery Settings > Backup
Settings.
2. On the Backup Settings page, select the Policy tab.
3. In the Backup Policy section, select “Optimize the whole database backup by
skipping unchanged files such as read-only and offline datafiles that have been
backed up.”
4. Select “Enable block change tracking for faster incremental backups” and enter
/u01/app/oracle/oradata/orcl/chg_track.f in the Block Change
Tracking File field. Click OK.

Oracle Database 10g: Backup and Recovery B-10


Solutions for Practice 3-1: Use RMAN to Create and Manage Backups
(continued)

Oracle Internal & Oracle Academy Use Only


5. You are returned to the Maintenance page.
3) Use Enterprise Manager Database Control to create a whole database backup using
the Oracle-suggested backup strategy.
Answer:
1. Select Maintenance > High Availability > Backup/Recovery > Schedule Backup.
2. In the Oracle-Suggested Backup section of the Schedule Backup page, click
Schedule Oracle-Suggested Backup.

3. On the Schedule Oracle-Suggested Backup: Destination page, select Disk. Click


Next.
4. Review the information on the Schedule Oracle-Suggested Backup: Setup page.
Note that a full database copy will be performed during the first backup. After
that, an incremental backup to disk will be performed every day. Click Next.
5. On the Schedule Oracle-Suggested Backup: Schedule page, you can specify the
time for your backups. Set the Time Zone field to correspond to your time zone.

Oracle Database 10g: Backup and Recovery B-11


Solutions for Practice 3-1: Use RMAN to Create and Manage Backups
(continued)
Select a backup time that is five minutes from the current time. Click Next.

Oracle Internal & Oracle Academy Use Only


6. Review the information on the Schedule Oracle-Suggested Backup: Review page.
Click Submit Job.
7. The Status page is displayed indicating that the job has been submitted. Click
View Job to monitor the status of the backup job.
8. Click the Refresh button on your browser to refresh the Execution page. Click the
Backup link to view the output log.

9. In the output log, you can see that RMAN has made a datafile copy backup of
each datafile in your database.

10. Click the Database tab to return to the Database Home page.
4) Use Enterprise Manager to view information about your backups.
Answer:
1. Select Maintenance > High Availability > Backup/Recovery > Backup Reports.

Oracle Database 10g: Backup and Recovery B-12


Solutions for Practice 3-1: Use RMAN to Create and Manage Backups
(continued)
2. Click the link for the backup you took in Question 3 to view detailed information
about the backup.

Oracle Internal & Oracle Academy Use Only


3. Click the Database Instance link to return to the Maintenance page.
5) Use RMAN to create a duplexed backup set of the EXAMPLE tablespace.
Answer:
1. Start RMAN and connect to the target database.
[oracle@edrsr10p1 backup1]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Wed


Mar 22 10:38:18 2006

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: ORCL (DBID=1090770270)


2. Create two backup set copies. One copy should be in the
/home/oracle/backup1 directory and one copy should be in the
/home/oracle/backup2 directory.
RMAN> @sol_03_01_05_02.rmn
RMAN> backup device type disk
2> copies 2
3> tablespace example
4> format '/home/oracle/backup1/%U',
'/home/oracle/backup2/%U';
Starting backup at 22-MAR-06
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset

Oracle Database 10g: Backup and Recovery B-13


Solutions for Practice 3-1: Use RMAN to Create and Manage Backups
(continued)
input datafile fno=00005
name=/u01/app/oracle/oradata/orcl/example01.dbf
channel ORA_DISK_1: starting piece 1 at 22-MAR-06
channel ORA_DISK_1: finished piece 1 at 22-MAR-06 with 2
copies and tag TAG20063
piece handle=/home/oracle/backup1/0ehejks7_1_1
comment=NONE
piece handle=/home/oracle/backup2/0ehejks7_1_2
comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time:
00:00:15
Finished backup at 22-MAR-06

Oracle Internal & Oracle Academy Use Only


Starting Control File and SPFILE Autobackup at 22-MAR-06
piece
handle=/u01/app/oracle/flash_recovery_area/ORCL/autobackup
/2006_03_22/o1_E
Finished Control File and SPFILE Autobackup at 22-MAR-06
RMAN> **end-of-file**
RMAN>

3. Use the RMAN LIST BACKUP SUMMARY command to view a listing of the
backup sets and pieces. The #Copies column shows the duplexed backup set
copies you made. Exit from RMAN.
RMAN> @sol_03_01_05_03.rmn
RMAN> list backup summary;

using target database control file instead of recovery


catalog

List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces
#Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------
- ---------- ---
5 B F A DISK 21-MAR-06 1 1
NO TAG200600
7 B F A DISK 22-MAR-06 1 1
NO TAG200607
8 B F A DISK 22-MAR-06 1 2
NO TAG200603
9 B F A DISK 22-MAR-06 1 1
NO TAG200608
RMAN> **end-of-file**
RMAN> exit

Recovery Manager complete.

Oracle Database 10g: Backup and Recovery B-14


Solutions for Practice 3-1: Use RMAN to Create and Manage Backups
(continued)
6) Use Enterprise Manager Database Control to perform a cross-check of your backups.
Answer:
1. Select Maintenance > High Availability > Backup/Recovery > Manage Current
Backups.
2. Click Crosscheck All.

3. Review the information on the Crosscheck All: Specify Job Parameters page and

Oracle Internal & Oracle Academy Use Only


accept the default values. Click Submit Job.
4. You receive the “Job submission succeeded” message. You can click View Job to
monitor the cross-check job. After it completes successfully, return to the
Database Home page.
5. Log out of Enterprise Manager.

Oracle Database 10g: Backup and Recovery B-15


Practice Solutions for Lesson 4

In this practice, you use RMAN to perform recovery.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-16


Solutions for Practice 4-1: Use RMAN to Recover a Datafile
In this practice, you use RMAN to recover a lost datafile. Notice how you are prompted
by Enterprise Manager to recover the lost datafile.
1) Use SQL*Plus to query the HR.REGIONS table. Make note of the number of rows in
the HR.REGIONS table.
Answer:
1. Open a terminal window and log in to SQL*Plus and connect as the HR user with
HR as the password.
2. Query the HR.REGIONS table and record the number of rows.

Number of rows: ___________

Oracle Internal & Oracle Academy Use Only


[oracle@edrsr10p1 oracle]$ sqlplus hr/hr

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Mar 23


12:51:00 2006

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
- Production
With the Partitioning, OLAP and Data Mining options

SQL> select * from regions;

REGION_ID REGION_NAME
---------- -------------------------
1 Europe
2 Americas
3 Asia
4 Middle East and Africa

3. Exit from your SQL*Plus session.


2) At the operating system prompt, execute the lab_04_01_02_01.sh script to
simulate a failure in your database. This script deletes the EXAMPLE tablespace
datafile.
Answer:
1. At the operating system prompt, change to the labs directory and execute the
lab_04_01_02_01.sh script.
[oracle@edrsr10p1 labs]$ ./lab_04_01_02_01.sh

EXAMPLE tablespace file deleted

Oracle Database 10g: Backup and Recovery B-17


Solutions for Practice 4-1: Use RMAN to Recover a Datafile (continued)
3) Use SQL*Plus to query the HR.JOBS table.
Answer:
1. Log in to SQL*Plus and connect as the HR user with HR as the password.
2. Query the HR.JOBS table.
SQL> select * from jobs;
select * from jobs
*
ERROR at line 1:
ORA-00376: file 5 cannot be read at this time
ORA-01110: data file 5:
'/u01/app/oracle/oradata/orcl/example01.dbf'

Oracle Internal & Oracle Academy Use Only


4) Use Enterprise Manager to perform database recovery of the EXAMPLE tablespace
datafile.
Answer:
1. Start Enterprise Manager and log in as SYS/ORACLE as SYSDBA.
2. Navigate to the Maintenance page.
3. Select Perform Recovery on the Maintenance page.
4. Click the “Datafiles Need Media Recovery” link.

Oracle Database 10g: Backup and Recovery B-18


Solutions for Practice 4-1: Use RMAN to Recover a Datafile (continued)
5. Select the file and click Next.

Oracle Internal & Oracle Academy Use Only


6. Select “No. Restore the files to the default location.” Click Next.

7. On the “Perform Object Level Recovery: Review” page, click Edit RMAN Script
to view the script that will be executed. Click Submit.
8. The Processing page is displayed. After the recovery operation completes, the
Result page is displayed indicating that the recovery operation succeeded.

Oracle Database 10g: Backup and Recovery B-19


Solutions for Practice 4-1: Use RMAN to Recover a Datafile (continued)

Oracle Internal & Oracle Academy Use Only


9. Click OK to return to the Maintenance page.

5) Return to your SQL*Plus session and again attempt to query the HR.JOBS table.
Answer:
1. Query the HR.JOBS table.
SQL> select * from jobs;

JOB_ID JOB_TITLE MIN_SALARY


MAX_SALARY
---------- ----------------------------------- ----------
----------
AD_PRES President 20000
40000
AD_VP Administration Vice President 15000
30000
AD_ASST Administration Assistant 3000
6000
FI_MGR Finance Manager 8200
16000

MK_REP Marketing Representative 4000
9000
HR_REP Human Resources Representative 4000
9000
PR_REP Public Relations Representative 4500
10500

19 rows selected.

Oracle Database 10g: Backup and Recovery B-20


Solutions for Practice 4-2: Use the Flash Recovery Area to
Quickly Recover a Datafile
In this practice, you recover a lost datafile by using the Flash Recovery Area for fast
recovery.
1) Use SQL*Plus to query the HR.REGIONS table. Make note of the number of rows in
the HR.REGIONS table.
Answer:
1. Log in to SQL*Plus and connect as the HR user with HR as the password.
2. Query the HR.REGIONS table.
3. Exit from SQL*Plus.
2) At the operating system prompt, execute the lab_04_02_02_01.sh script to

Oracle Internal & Oracle Academy Use Only


simulate a failure in your database. This script deletes the EXAMPLE tablespace
datafile.
Answer:
1. At the operating system prompt, change to the labs directory and execute the
lab_04_02_02_01.sh script.
[oracle@edrsr10p1 labs]$ ./lab_04_02_02_01.sh

EXAMPLE tablespace file deleted

[oracle@edrsr10p1 labs]$

3) Use SQL*Plus to query the HR.DEPARTMENTS table.


Answer:
1. Log in to SQL*Plus and connect as the HR user with HR as the password.
2. Query the HR.DEPARTMENTS table.
SQL> select * from departments;
select * from departments
*
ERROR at line 1:
ORA-01116: error in opening database file 5
ORA-01110: data file 5:
'/u01/app/oracle/oradata/orcl/example01.dbf'
ORA-27041: unable to open file
Linux Error: 2: No such file or directory
Additional information: 3
3. Make note of the number of the datafile that is unavailable. Datafile number: ____
4. Exit from your SQL*Plus session.
4) Use the RMAN SWITCH TO COPY command to recover the datafile.

Oracle Database 10g: Backup and Recovery B-21


Solutions for Practice 4-2: Use the Flash Recovery Area to Quickly Recover
a Datafile (continued)
Answer:
1. Log in to your target database using RMAN.
2. Take the datafile offline.
RMAN> SQL 'alter database datafile 5 offline';

sql statement: alter database datafile 5 offline

3. Execute the SWITCH TO COPY command for the datafile you noted in step 3.
RMAN> switch datafile 5 to copy;

datafile 5 switched to datafile copy

Oracle Internal & Oracle Academy Use Only


"/u01/app/oracle/flash_recovery_area/ORCL/"

4. Recover the datafile.


RMAN> recover datafile 5;

Starting recover at 24-MAR-06


allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=132 devtype=DISK
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=130 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Oracle Secure Backup

starting media recovery


media recovery complete, elapsed time: 00:00:03

Finished recover at 24-MAR-06


5. Bring the datafile online.
RMAN> sql 'alter database datafile 5 online';

sql statement: alter database datafile 5 online

RMAN>
6. Exit from your RMAN session.
5) Query the HR.JOBS table.
Answer:
1. Log in to SQL*Plus as HR/HR and query the HR.JOBS table. (Output has been
formatted to fit the code box.)
SQL> select * from jobs;

JOB_ID JOB_TITLE MIN_S MAX_SALARY


---------- ------------------------------ ----- ----------
AD_PRES President 20000 40000

Oracle Database 10g: Backup and Recovery B-22


Solutions for Practice 4-2: Use the Flash Recovery Area to Quickly Recover
a Datafile (continued)
AD_VP Administration Vice President 15000 30000

HR_REP Human Resources Representative 4000 9000
PR_REP Public Relations Representative 4500 10500

19 rows selected.

6) Using Enterprise Manager Database Control, verify that the datafile being used for
the EXAMPLE tablespace is in the Flash Recovery Area.
Answer:
1. Select Tablespaces on the Administration page.

Oracle Internal & Oracle Academy Use Only


2. Select the Example tablespace and click View.

3. Click Return to return to the Tablespaces page.


7) Make a copy of the datafile in the original location and switch back to it.
Answer:
1. Log in to RMAN and connect to your target database.
2. Create an image copy of the datafile in the original location.
RMAN> @sol_04_02_07_02.rmn
RMAN> backup as copy datafile 5
2> format '/u01/app/oracle/oradata/orcl/example01.dbf';

Starting backup at 24-MAR-06


using target database control file instead of recovery
catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=129 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00005
name=/u01/app/oracle/flash_recovery_area/ORCL/datafilef
output filename=/u01/app/oracle/oradata/orcl/example01.dbf
tag=TAG20060324T13447
channel ORA_DISK_1: datafile copy complete, elapsed time:
00:00:07

Oracle Database 10g: Backup and Recovery B-23


Solutions for Practice 4-2: Use the Flash Recovery Area to Quickly Recover
a Datafile (continued)
Finished backup at 24-MAR-06

Starting Control File and SPFILE Autobackup at 24-MAR-06


piece
handle=/u01/app/oracle/flash_recovery_area/ORCL/autobackup
/2006_03_24/o1_E
Finished Control File and SPFILE Autobackup at 24-MAR-06
RMAN> **end-of-file**
3. Take the datafile offline.
RMAN> sql 'alter database datafile 5 offline';

sql statement: alter database datafile 5 offline

Oracle Internal & Oracle Academy Use Only


4. Switch to the new copy you made.
RMAN> switch datafile 5 to copy;

datafile 5 switched to datafile copy


"/u01/app/oracle/oradata/orcl/example01.dbf"
5. Recover the datafile.
RMAN> recover datafile 5;

Starting recover at 24-MAR-06


using channel ORA_DISK_1
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=154 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Oracle Secure Backup

starting media recovery


media recovery complete, elapsed time: 00:00:02

Finished recover at 24-MAR-06


6. Bring the datafile back online. Exit from RMAN.
RMAN> sql 'alter database datafile 5 online';

sql statement: alter database datafile 5 online

8) Use Enterprise Manager Database Control to verify the file.


Answer:
1. Select Tablespace on the Administration page.

Oracle Database 10g: Backup and Recovery B-24


Solutions for Practice 4-2: Use the Flash Recovery Area to Quickly Recover
a Datafile (continued)
2. Select the EXAMPLE tablespace and click View.

Oracle Internal & Oracle Academy Use Only


3. Note that the datafile is the one you switched to.
4. Click the Database tab to return to your database home page.

Oracle Database 10g: Backup and Recovery B-25


Solutions for Practice 4-3: Recover Control Files
In this practice, you recover your control file by using an autobackup.
1) Use SQL*Plus to view files information for the control files in your database. Query
V$CONTROLFILE.
Answer:
1. Log in to SQL*Plus as SYSDBA.
2. Query the NAME column in V$CONTROLFILE. Exit from SQL*Plus.
SQL> SELECT name FROM v$controlfile;

NAME
---------------------------------------------
/u01/app/oracle/oradata/orcl/control01.ctl

Oracle Internal & Oracle Academy Use Only


/u01/app/oracle/oradata/orcl/control02.ctl
/u01/app/oracle/oradata/orcl/control03.ctl

2) Simulate a failure in your environment by executing the lab_04_03_02_01.sh


script to delete all your control files.
Answer:
1. In your terminal window session, change to the labs directory and execute the
lab_04_03_02_01.sh script.
[oracle@edrsr10p1 oracle]$ cd labs
[oracle@edrsr10p1 labs]$ ./lab_04_03_02_01.sh

Control files deleted

[oracle@edrsr10p1 labs]$

3) You need some more information about your control files. Query
V$CONTROLFILE_RECORD_SECTION to learn more about the contents of your
control file.
Answer:
1. Log in to SQL*Plus as SYSDBA.
2. Query the V$CONTROLFILE_RECORD_SECTION view.
SQL> SELECT * FROM v$controlfile_record_section;
SELECT * FROM v$controlfile_record_section
*
ERROR at line 1:
ORA-00210: cannot open the specified control file
ORA-00202: control file:
'/u01/app/oracle/oradata/orcl/control01.ctl'
ORA-27041: unable to open file
Linux Error: 2: No such file or directory

Oracle Database 10g: Backup and Recovery B-26


Solutions for Practice 4-3: Recover Control Files (continued)
Additional information: 3

4) You have lost all your control files and will need to recover them from the control file
autobackup. Use Recovery Manager to recover the control files.
Answer:
1. Use SQL*Plus to shut down your instance. Exit from your SQL*Plus session.
[oracle@edrsr10p1 oracle]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 28


10:20:26 2006

Oracle Internal & Oracle Academy Use Only


Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
- Production
With the Partitioning, OLAP and Data Mining options
SQL> shutdown abort
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition
Release 10.2.0.1.0 - Pn
With the Partitioning, OLAP and Data Mining options
[oracle@edrsr10p1 oracle]$
2. Use RMAN to connect to your target database.
[oracle@edrsr10p1 oracle]$ rman

Recovery Manager: Release 10.2.0.1.0 - Production on Tue


Mar 28 10:23:17 2006

Copyright (c) 1982, 2005, Oracle. All rights reserved.

RMAN> connect target /

connected to target database (not started)

RMAN>

3. Restart the instance in NOMOUNT mode.


RMAN> startup nomount

Oracle instance started

Total System Global Area 285212672 bytes

Oracle Database 10g: Backup and Recovery B-27


Solutions for Practice 4-3: Recover Control Files (continued)

Fixed Size 1218992 bytes


Variable Size 109053520 bytes
Database Buffers 171966464 bytes
Redo Buffers 2973696 bytes

4. Set the database identifier.


Note: Your database identifier will be a different value from that shown in the
solution. You recorded the database identifier in Practice 2-1.
RMAN> set dbid 1090770270;

executing command: SET DBID


5. Restore the control file from the autobackup.

Oracle Internal & Oracle Academy Use Only


RMAN> restore controlfile from autobackup;

Starting restore at 28-MAR-06


using target database control file instead of recovery
catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK

recovery area destination:


/u01/app/oracle/flash_recovery_area
database name (or database unique name) used for search:
ORCL
channel ORA_DISK_1: autobackup found in the recovery area
channel ORA_DISK_1: autobackup found:
/u01/app/oracle/flash_recovery_area/ORCL/p
channel ORA_DISK_1: control file restore from autobackup
complete
output filename=/u01/app/oracle/oradata/orcl/control01.ctl
output filename=/u01/app/oracle/oradata/orcl/control02.ctl
output filename=/u01/app/oracle/oradata/orcl/control03.ctl
Finished restore at 28-MAR-06

6. Mount the database.


RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

7. Recover the database by issuing the RECOVER DATABASE command.


RMAN> recover database;

Starting recover at 28-MAR-06


Starting implicit crosscheck backup at 28-MAR-06
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
Crosschecked 11 objects

Oracle Database 10g: Backup and Recovery B-28


Solutions for Practice 4-3: Recover Control Files (continued)
Finished implicit crosscheck backup at 28-MAR-06

Starting implicit crosscheck copy at 28-MAR-06


using channel ORA_DISK_1
Crosschecked 5 objects
Finished implicit crosscheck copy at 28-MAR-06

searching for all files in the recovery area


cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name:
/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2006_0
3_28/o1_mfc

Oracle Internal & Oracle Academy Use Only


File Name:
/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2006_0
3_28/o1_mfc
File Name:
/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2006_0
3_28/o1_mfc
File Name:
/u01/app/oracle/flash_recovery_area/ORCL/autobackup/2006_0
3_27/o1_mfp

using channel ORA_DISK_1


allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=155 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Oracle Secure Backup

starting media recovery


archive log thread 1 sequence 116 is already on disk as
file /u01/app/oracle/flc
archive log thread 1 sequence 117 is already on disk as
file /u01/app/oracle/flc
archive log thread 1 sequence 118 is already on disk as
file /u01/app/oracle/flc
archive log thread 1 sequence 119 is already on disk as
file /u01/app/oracle/org
archive log
filename=/u01/app/oracle/flash_recovery_area/ORCL/archivel
og/2006_06
archive log
filename=/u01/app/oracle/flash_recovery_area/ORCL/archivel
og/2006_07
archive log
filename=/u01/app/oracle/flash_recovery_area/ORCL/archivel
og/2006_08
archive log
filename=/u01/app/oracle/oradata/orcl/redo01.log thread=1
sequence=9
media recovery complete, elapsed time: 00:00:02

Oracle Database 10g: Backup and Recovery B-29


Solutions for Practice 4-3: Recover Control Files (continued)
Finished recover at 28-MAR-06

8. Open the database with the RESETLOGS option.


RMAN> alter database open resetlogs;

database opened
9. Back up the current online redo log file and back up all the archived redo log
files.
RMAN> SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';

using target database control file instead of recovery


catalog
sql statement: ALTER SYSTEM ARCHIVE LOG CURRENT

Oracle Internal & Oracle Academy Use Only


RMAN> backup archivelog all;

Starting backup at 10-APR-06


current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=159 devtype=DISK
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup
set
input archive log thread=1 sequence=15 recid=53
stamp=587378250
input archive log thread=1 sequence=16 recid=54
stamp=587379659
input archive log thread=1 sequence=17 recid=55
stamp=587379860
input archive log thread=1 sequence=18 recid=56
stamp=587379970
input archive log thread=1 sequence=19 recid=57
stamp=587380091
input archive log thread=1 sequence=20 recid=58
stamp=587380115
input archive log thread=1 sequence=21 recid=59
stamp=587380409
input archive log thread=1 sequence=22 recid=65
stamp=587386310
input archive log thread=1 sequence=23 recid=66
stamp=587386310
input archive log thread=1 sequence=24 recid=67
stamp=587386311
channel ORA_DISK_1: starting piece 1 at 10-APR-06
channel ORA_DISK_1: finished piece 1 at 10-APR-06
piece
handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/
2006_04_10/o1_mE
channel ORA_DISK_1: backup set complete, elapsed time:
00:00:26
channel ORA_DISK_1: starting archive log backupset

Oracle Database 10g: Backup and Recovery B-30


Solutions for Practice 4-3: Recover Control Files (continued)
channel ORA_DISK_1: specifying archive log(s) in backup
set
input archive log thread=1 sequence=1 recid=68
stamp=587391539
input archive log thread=1 sequence=2 recid=69
stamp=587391580
channel ORA_DISK_1: starting piece 1 at 10-APR-06
channel ORA_DISK_1: finished piece 1 at 10-APR-06
piece
handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/
2006_04_10/o1_mE
channel ORA_DISK_1: backup set complete, elapsed time:
00:00:02
Finished backup at 10-APR-06

Oracle Internal & Oracle Academy Use Only


Starting Control File and SPFILE Autobackup at 10-APR-06
piece
handle=/u01/app/oracle/flash_recovery_area/ORCL/autobackup
/2006_04_10/o1_E
Finished Control File and SPFILE Autobackup at 10-APR-06
10. Create a whole database backup.
RMAN> backup database;
Starting backup at 10-APR-06
released channel: ORA_SBT_TAPE_1
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001
name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile fno=00003
name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile fno=00005
name=/u01/app/oracle/oradata/orcl/example01.dbf
input datafile fno=00002
name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile fno=00004
name=/u01/app/oracle/oradata/orcl/users01.dbf
input datafile fno=00006
name=/u01/app/oracle/oradata/orcl/example02.dbf
channel ORA_DISK_1: starting piece 1 at 10-APR-06
channel ORA_DISK_1: finished piece 1 at 10-APR-06
piece
handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/
2006_04_10/o1_mE
channel ORA_DISK_1: backup set complete, elapsed time:
00:01:25
Finished backup at 10-APR-06
Starting Control File and SPFILE Autobackup at 10-APR-06
piece
handle=/u01/app/oracle/flash_recovery_area/ORCL/autobackup
/2006_04_10/o1_E

Oracle Database 10g: Backup and Recovery B-31


Solutions for Practice 4-3: Recover Control Files (continued)
Finished Control File and SPFILE Autobackup at 10-APR-06

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-32


Solutions for Practice 4-4: Delete Obsolete Backups
1) Use Recovery Manager to view obsolete backups.
Answer:
1. In your RMAN session, issue the REPORT OBSOLETE command to determine
whether you have any obsolete backups.
Note: Your results may vary from the following output.
RMAN> report obsolete;

RMAN retention policy will be applied to the command


RMAN retention policy is set to redundancy 1
Report of obsolete backups and copies
Type Key Completion Time
Filename/Handle

Oracle Internal & Oracle Academy Use Only


-------------------- ------ ------------------ -----------
---------
Archive Log 19 15-MAR-06
/u01/app/oracle/flash_recovery_ac
Archive Log 20 16-MAR-06
/u01/app/oracle/flash_recovery_ac
Archive Log 21 20-MAR-06
/u01/app/oracle/flash_recovery_ac
Archive Log 22 20-MAR-06
/u01/app/oracle/flash_recovery_ac
Archive Log 23 20-MAR-06
/u01/app/oracle/flash_recovery_ac
Archive Log 24 21-MAR-06
/u01/app/oracle/flash_recovery_ac
Datafile Copy 4 21-MAR-06
/u01/app/oracle/flash_recovery_af
Backup Set 5 21-MAR-06
Backup Piece 5 21-MAR-06
/u01/app/oracle/flash_recovery_ap
Backup Set 7 22-MAR-06
Backup Piece 7 22-MAR-06
/u01/app/oracle/flash_recovery_ap
Backup Set 9 22-MAR-06
Backup Piece 10 22-MAR-06
/u01/app/oracle/flash_recovery_ap

2) Use Enterprise Manager Database Control to delete obsolete backups.


Answer:
1. Invoke Enterprise Manager and log in as sys/oracle as SYSDBA.
2. Select Maintenance > High Availability > Backup/Recovery > Manage Current
Backups.

Oracle Database 10g: Backup and Recovery B-33


Solutions for Practice 4-4: Delete Obsolete Backups (continued)
3. Click Delete All Obsolete to remove obsolete backups.

4. Review the information on the Delete All Obsolete: Specify Job Parameters page
and click Submit Job.
5. You receive the “Job submission succeeded” message. You can click View Job to

Oracle Internal & Oracle Academy Use Only


monitor the job. After it completes successfully, return to the Database Home
page.
6. Access the Manage Current Backups page again to view the backup sets and
image copies that were retained.
3) You can also use RMAN to verify that your obsolete backups were deleted.
Answer:
1. In your RMAN session, execute the REPORT OBSOLETE command.

RMAN> report obsolete;

RMAN retention policy will be applied to the command


RMAN retention policy is set to redundancy 1
no obsolete backups found

Oracle Database 10g: Backup and Recovery B-34


Practice Solutions for Lesson 5

In this practice, you use Oracle Flashback features to recover from errors in your
database.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-35


Solutions for Practice 5-1: Enable Flashback Database
1) Use Enterprise Manager to enable Flashback Database.
Answer:
1. Start Enterprise Manager and connect as SYS/ORACLE as SYSDBA.
2. Click the Maintenance tab.
3. Select Recovery Settings in the Backup/Recovery Settings section.
4. Scroll to the Flash Recovery section.
5. Select “Enable Flashback Database - flashback logging can be used for fast
database point-in-time recovery” and click Apply.

Oracle Internal & Oracle Academy Use Only


6. The Confirmation message is displayed. You must restart the database instance to
enable Flashback Database. Click Yes to restart the database instance.
7. Supply the Host and Operating System credentials if they are not filled in by
default. Click OK.

Oracle Database 10g: Backup and Recovery B-36


Solutions for Practice 5-1: Enable Flashback Database (continued)

Oracle Internal & Oracle Academy Use Only


8. The “Restart Database: Confirmation” page is displayed. Click Yes.
9. The “Restart Database:Activity Information” page is displayed. Wait a few
minutes and click Refresh.
10. Log in to Enterprise Manager as SYS/ORACLE as SYSDBA.
2) Use the ALTER DATABASE command to enable supplemental logging.
Answer:
1. In a terminal window, log in to SQL*Plus as SYSDBA.
[oracle@edrsr10p1 oracle]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Apr 18


09:10:07 2006

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
- Production
With the Partitioning, OLAP and Data Mining options

2. Execute the ALTER DATABASE command to enable supplemental logging.

SQL> ALTER DATABASE add supplemental log data;

Database altered.

Oracle Database 10g: Backup and Recovery B-37


Solutions for Practice 5-2: Set Restore Points and Perform
Flashback Table
Restore points are a way to “bookmark” database points in time. Set a restore point to
remember a significant change so that you can quickly recover to that point in time
without having to record an SCN or time.
1) You must enable row movement to use restore points. Use Enterprise Manager to
enable row movement for the HR.LOCATIONS table.
Answer:
1. Navigate to the Administration page. Select Tables in the Database Objects
section.
2. Enter HR in the Schema field and LOCATIONS in the Object Name field. Click
Go.

Oracle Internal & Oracle Academy Use Only


3. Select the HR.LOCATIONS table and click Edit.

4. Select the Options subtab.

Oracle Database 10g: Backup and Recovery B-38


Solutions for Practice 5-2: Set Restore Points and Perform Flashback Table
(continued)
5. Select Yes in the Enable Row Movement menu. Click Apply.

Oracle Internal & Oracle Academy Use Only


6. The Update Message is displayed indicating that the change has been made to the
HR.LOCATIONS table.
7. Click the Database tab to return to the home page.
2) Create a normal restore point.
Answer:
1. Select the Maintenance tab.
2. Select Manage Restore Points in the Backup/Recovery section.
3. Click Create on the Manage Restore Points page.

4. Enter Before_LOC_Update in the Restore Point Name field. Ensure that


“Normal Restore Point” is selected. Click OK.

Oracle Database 10g: Backup and Recovery B-39


Solutions for Practice 5-2: Set Restore Points and Perform Flashback Table
(continued)

Oracle Internal & Oracle Academy Use Only


5. Your restore point has been created.

3) Use SQL*Plus to query the POSTAL_CODE column in the HR.LOCATIONS table.


Answer:
1. Log in to SQL*Plus as SYSDBA.
2. Execute the lab_05_02_03_02.sql script to query the POSTAL_CODE
column of the HR.LOCATIONS table.
SQL> @lab_05_02_03_02
SQL> SELECT unique (postal_code)
2 FROM hr.locations
3 /

POSTAL_CODE
------------
10934

Oracle Database 10g: Backup and Recovery B-40


Solutions for Practice 5-2: Set Restore Points and Perform Flashback Table
(continued)
YSW 9T2

2901
26192
M5V 2L7
01307-002

1730
3095
99236
80925

23 rows selected.

Oracle Internal & Oracle Academy Use Only


4) Execute the lab_05_02_04_01.sql script to update the POSTAL_CODE column
in the HR.LOCATIONS table so that all postal codes are set to 11111.
Answer:
1. Execute the lab_05_02_04_01.sql script.
SQL> @lab_05_02_04_01
SQL> UPDATE hr.locations
2 SET postal_code = 11111
3 /

23 rows updated.

5) Execute the lab_05_02_05_01.sql script to query the POSTAL_CODE column


in the HR.LOCATIONS table again.
Answer:
1. Execute the lab_05_02_05_01.sql script.
SQL> @lab_05_02_05_01
SQL> SELECT unique (postal_code)
2 FROM hr.locations
3 /

POSTAL_CODE
------------
11111

6) Restore the POSTAL_CODE column values using the restore point.


Answer:
1. Return to your Enterprise Manager session.

Oracle Database 10g: Backup and Recovery B-41


Solutions for Practice 5-2: Set Restore Points and Perform Flashback Table
(continued)
2. Copy the SCN value in the Creation SCN field to the buffer.

Oracle Internal & Oracle Academy Use Only


3. Click the database instance link to return to the Maintenance page.
4. Click Perform Recovery.
5. In the “Object Level Recovery” section, select Tables in the Object Type menu.
Click “Perform Object Level Recovery.”

6. Select “Flashback to a known SCN” and paste the SCN that you copied in step 2.
Click Next.

Oracle Database 10g: Backup and Recovery B-42


Solutions for Practice 5-2: Set Restore Points and Perform Flashback Table
(continued)

Oracle Internal & Oracle Academy Use Only


7. Click Add Tables to add the HR.LOCATIONS table.

8. Enter HR in the Schema Name field and LOCATIONS in the Table field. Click
Search.

Oracle Database 10g: Backup and Recovery B-43


Solutions for Practice 5-2: Set Restore Points and Perform Flashback Table
(continued)
9. Select the HR.LOCATIONS table and click OK.

Oracle Internal & Oracle Academy Use Only


10. The HR.LOCATIONS table is added to the “Tables to Flashback” field. Click
Next.

11. Accept the default of “Cascade: Flashback the selected tables and all dependent
tables” on the Dependency Options page. Click Next.
12. On the “Perform Object Level Recovery: Review” page, confirm the information.
Click Submit.

Oracle Database 10g: Backup and Recovery B-44


Solutions for Practice 5-2: Set Restore Points and Perform Flashback Table
(continued)

Oracle Internal & Oracle Academy Use Only


13. The Confirmation page is displayed. Click OK to return to the Maintenance page.

7) Return to your SQL*Plus session. Execute the lab_05_02_07_01.sql script to


query the POSTAL_CODE column in HR.LOCATIONS again to be sure the correct
values have been restored.
Answer:
1. Execute the lab_05_02_07_01.sql script.
SQL> @lab_05_02_07_01
SQL> SELECT unique (postal_code)
2 FROM hr.locations
3 /

POSTAL_CODE
------------
10934
YSW 9T2

99236
80925

23 rows selected.

Oracle Database 10g: Backup and Recovery B-45


Solutions for Practice 5-3: Use Flashback Query and Flashback
Versions Query

1) Execute the lab_05_03_01_01.sql script to query the HR.LOCATIONS table


for location ID 1400.
Answer:
1. In SQL*Plus, execute the lab_05_03_01_01.sql script.
SQL> @lab_05_03_01_01
SQL> SELECT *
2 FROM hr.locations
3 WHERE location_id = 1400
4 /

Oracle Internal & Oracle Academy Use Only


LOCATION_ID STREET_ADDRESS
POSTAL_CODE
----------- ---------------------------------------- -----
-------
CITY STATE_PROVINCE
CO
------------------------------ ------------------------- -
-
1400 2014 Jabberwocky Rd 26192
Southlake Texas
US

2) Execute the lab_05_03_02_01.sql script to update the POSTAL_CODE column


in the HR.LOCATIONS table, simulating user error.
Answer:
1. Invoke SQL*Plus and execute the lab_05_03_02_01.sql script.
SQL> @lab_05_03_02_01
SQL> UPDATE hr.locations
2 SET postal_code = postal_code + 100
3 WHERE location_id = 1400
4 /

1 row updated.

SQL> commit
2 /

Commit complete.

3) Execute the lab_05_03_03_01.sql script to query the POSTAL_CODE column


in HR.LOCATIONS and view the change.

Oracle Database 10g: Backup and Recovery B-46


Solutions for Practice 5-3: Use Flashback Query and Flashback Versions
Query (continued)
Answer:
1. Execute the lab_05_03_03_01.sql script.
SQL> @lab_05_03_03_01
SQL> SELECT *
2 FROM hr.locations
3 WHERE location_id = 1400
4 /

LOCATION_ID STREET_ADDRESS
POSTAL_CODE
----------- ---------------------------------------- -----
-------

Oracle Internal & Oracle Academy Use Only


CITY STATE_PROVINCE
CO
------------------------------ ------------------------- -
-
1400 2014 Jabberwocky Rd 26292
Southlake Texas
US

4) Execute the lab_05_03_04_01.sql script to update the POSTAL_CODE column


in the HR.LOCATIONS table, simulating user error.
Answer:
1. Execute the lab_05_03_04_01.sql script.
SQL> @lab_05_03_04_01
SQL> UPDATE hr.locations
2 SET postal_code = postal_code + 100
3 WHERE location_id = 1400
4 /

1 row updated.

SQL> commit
2 /

Commit complete.

5) Use Enterprise Manager to perform Flashback Versions Query to correct the user
errors.
Answer:
1. Navigate to the Administration page.
2. Select Tables in the Database Objects section.

Oracle Database 10g: Backup and Recovery B-47


Solutions for Practice 5-3: Use Flashback Query and Flashback Versions
Query (continued)
3. Enter HR in the Schema Name field and LOCATIONS in the Table field. Click
Go.
4. Select the HR.LOCATIONS table. Select Flashback Versions Query in the
Actions menu. Click Go.

Oracle Internal & Oracle Academy Use Only


5. Choose all the columns by selecting each in the Available Columns list and
clicking Move to move it to the Selected Columns list.

6. Enter “where location_id = 1400” in the “Bind the Row Value” field.
Click Next.

Oracle Database 10g: Backup and Recovery B-48


Solutions for Practice 5-3: Use Flashback Query and Flashback Versions
Query (continued)

7. Select the oldest change to the table and click Next.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-49


Solutions for Practice 5-3: Use Flashback Query and Flashback Versions
Query (continued)
8. Confirm the flashback information. Click Next.

Oracle Internal & Oracle Academy Use Only


9. Accept the default of “Cascade: Flashback the selected tables and all dependent
tables.” Click Next.
10. Review the information. Click Submit.

11. The Confirmation page is displayed. Click OK.


6) Return to your SQL*Plus session. Query the HR.LOCATIONS table to confirm the
Flashback operation.
Answer:
1. Execute the lab_05_03_06_01.sql script to query the HR.LOCATIONS
table.
SQL> @lab_05_03_06_01
SQL> SELECT *
2 FROM hr.locations
3 WHERE location_id = 1400

Oracle Database 10g: Backup and Recovery B-50


Solutions for Practice 5-3: Use Flashback Query and Flashback Versions
Query (continued)
4 /

LOCATION_ID STREET_ADDRESS
POSTAL_CODE
----------- ---------------------------------------- -----
-------
CITY STATE_PROVINCE
CO
------------------------------ ------------------------- -
-
1400 2014 Jabberwocky Rd 26192
Southlake Texas
US

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-51


Solutions for Practice 5-4: Use Flashback Database
1) Use Enterprise Manager to verify that Flashback Database is enabled.
Answer:
1. Navigate to the Maintenance page.
2. Select Recovery Settings in the Backup/Recovery Settings section. Scroll to the
Flash Recovery section. Verify that Flashback Database is enabled.

Oracle Internal & Oracle Academy Use Only


3. Click the Database Instance link to return to the Maintenance page.
2) Use Enterprise Manager to create a Guaranteed Restore Point.
Answer:
1. Select Manage Restore Points in the Backup/Recovery section.
2. Click Create to create a new restore point.
3. Enter “Before_Truncate” in the Restore Point Name field. Select
“Guaranteed Restore Point.” Click OK.

Oracle Database 10g: Backup and Recovery B-52


Solutions for Practice 5-4: Use Flashback Database (continued)

Oracle Internal & Oracle Academy Use Only


4. The Restore Point is created.

3) Execute the lab_05_04_03_01.sql script to determine the number of rows in


the HR.JOB_HISTORY table. Record the number of rows: ___________
Answer:
1. Execute the lab_05_04_03_01.sql script to determine the number of rows
in the HR.JOB_HISTORY table.
SQL> @lab_05_04_03_01
SQL> SELECT count(*)
2 FROM hr.job_history
3 /

COUNT(*)
----------
10

Oracle Database 10g: Backup and Recovery B-53


Solutions for Practice 5-4: Use Flashback Database (continued)

4) Execute the lab_05_04_04_01.sql script to truncate the HR.JOB_HISTORY


table.
Answer:
1. Execute the lab_05_04_04_01.sql script.
SQL> @lab_05_04_04_01
SQL> truncate table hr.job_history
2 /

Table truncated.

Oracle Internal & Oracle Academy Use Only


5) Execute the lab_05_04_05_01.sql script to determine the number of rows in
the HR.JOB_HISTORY table.
Answer:
1. Execute the lab_05_04_05_01.sql script.
SQL> @lab_05_04_05_01
SQL> SELECT count(*)
2 FROM hr.job_history
3 /

COUNT(*)
----------
0

6) Use Flashback Database to restore the HR.JOB_HISTORY table rows.


Answer:
1. Return to your Enterprise Manager window.
2. Navigate to the Maintenance page.
3. Select Manage Restore Points in the Backup/Recovery section.
4. Select the BEFORE_TRUNCATE restore point. Click “Recover Whole Database
To.”

Oracle Database 10g: Backup and Recovery B-54


Solutions for Practice 5-4: Use Flashback Database (continued)

Oracle Internal & Oracle Academy Use Only


5. Enter the host credential information. Click Yes.

6. The database is shut down. Click Refresh.


7. Click Perform Recovery.
8. Enter Host Credentials. Click Continue.
9. Enter Database login. Click Login.

Oracle Database 10g: Backup and Recovery B-55


Solutions for Practice 5-4: Use Flashback Database (continued)
10. Click “Perform Whole Database Recovery.”

Oracle Internal & Oracle Academy Use Only


11. Select “Recover to a prior point in time.”
12. Select Restore Point and click the Flashlight icon.
13. Select the BEFORE_TRUNCATE restore point. Click Select.

Oracle Database 10g: Backup and Recovery B-56


Solutions for Practice 5-4: Use Flashback Database (continued)
14. The Restore Point field is populated. Click Next.

Oracle Internal & Oracle Academy Use Only


15. Select Yes. Click Next.

Oracle Database 10g: Backup and Recovery B-57


Solutions for Practice 5-4: Use Flashback Database (continued)
16. Review the information. Click Submit.

Oracle Internal & Oracle Academy Use Only


17. The “Processing: Perform Whole Database Recovery” page is displayed.
18. The operation is complete. You can scroll through the output to view the details
of the operation. Click “Open Database” to open the database.

19. The “The database has been opened successfully” message is displayed. Click
OK.
7) Return to your SQL*Plus session. Execute the lab_05_04_07_02.sql script to
query the HR.JOB_HISTORY table again to be sure the data has been restored.
Answer:
1. Invoke SQL*Plus and log in as SYS/ORACLE as SYSDBA.
2. Execute the lab_05_04_07_02.sql script.
SQL> @query_job_hist
SQL> SELECT count(*)
2 FROM hr.job_history
3 /
COUNT(*)
----------
10

Oracle Database 10g: Backup and Recovery B-58


Practice Solutions for Lesson 6

In this practice, you create a duplicate database.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-59


Solutions for Practice 6-1: Create a Duplicate Database
In this practice, you use RMAN to create a duplicate database on the same host as your
database.
1) Create an Oracle password file for your auxiliary instance.
Answer:
1. Change to the $ORACLE_HOME/dbs directory and use the orapwd utility to
create a password file named orapwaux. Specify a password of oracle and
10 for the number of entries.
[oracle@edrsr10p1 oracle]$ cd $ORACLE_HOME/dbs
[oracle@edrsr10p1 dbs]$ orapwd file=orapwaux
password=oracle entries=10
[oracle@edrsr10p1 dbs]$ ls

Oracle Internal & Oracle Academy Use Only


hc_orcl.dat init.ora orapwaux snapcf_orcl.f
initdw.ora lkORCL orapworcl spfileorcl.ora

2) Use Oracle Net Manager to create an entry called AUXDB in the tnsnames.ora
file.
Answer:
1. Open a terminal window and enter netmgr at the operating system prompt.
[oracle@edrsr10p1 oracle]$ netmgr
2. The Oracle Net Manager window appears.
3. Expand Local and Service Naming.
4. Select Service Naming and click the green plus sign to create a new Net service
name.

Oracle Database 10g: Backup and Recovery B-60


Solutions for Practice 6-1: Create a Duplicate Database (continued)
5. Enter auxdb in the Net Service Name field and click Next.

Oracle Internal & Oracle Academy Use Only


6. Select TCP/IP (default) as the protocol. Click Next.
7. Enter the host name of your PC in the Host Name field. Accept the default of
1521 for the port number. Click Next.

Oracle Database 10g: Backup and Recovery B-61


Solutions for Practice 6-1: Create a Duplicate Database (continued)
8. Enter aux.oracle.com in the Service Name field. Click Next.

Oracle Internal & Oracle Academy Use Only


9. Click Finish.
10. Select File and Save Network Configuration to save the changes you made.

11. Click File and Exit to exit from Oracle Net Manager.
12. You can view your updated tnsnames.ora file in the
/u01/app/oracle/product/10.2.0/db_1/network/admin
directory.

Oracle Database 10g: Backup and Recovery B-62


Solutions for Practice 6-1: Create a Duplicate Database (continued)
AUXDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =
edrsr10p1.us.oracle.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = aux.oracle.com)
)
3) Create an initialization parameter file for the auxiliary instance.
Answer:
1. Create a text initialization parameter file named initAUX.ora from your server
parameter file in the $HOME/auxinstance directory.

Oracle Internal & Oracle Academy Use Only


[oracle@edrsr10p1 oracle]$ cd $HOME/auxinstance
[oracle@edrsr10p1 auxinstance]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Mar 29


10:51:53 2006

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
- Production
With the Partitioning, OLAP and Data Mining options

SQL> create pfile='$HOME/auxinstance/initAUX.ora' from


spfile;

File created.

2. Edit the initAUX.ora initialization parameter file to make the following


changes for the auxiliary instance:
audit_file_dest='/u01/app/oracle/admin/aux/adump'
background_dump_dest='/u01/app/oracle/admin/aux/bdump
control_files='/u01/app/oracle/oradata/aux/control01.c
tl','/u01/app/oracle/oradata/aux/control02.ctl','/u01/
app/oracle/oradata/aux/control03.ctl'
db_name='aux'
user_dump_dest='/u01/app/oracle/admin/aux/udump'

Add the following parameters:


DB_FILE_NAME_CONVERT=‘/u01/app/oracle/oradata/orcl’,
‘/u01/app/oracle/oradata/aux’
LOG_FILE_NAME_CONVERT=‘/u01/app/oracle/oradata/orcl’,
‘/u01/app/oracle/oradata/aux’

Remove the lines at the beginning of the file that begin with orcl.__.

Oracle Database 10g: Backup and Recovery B-63


Solutions for Practice 6-1: Create a Duplicate Database (continued)

Add the comment character, #, to this line:


*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
4) Start the auxiliary instance in NOMOUNT mode using the initAUX.ora file.
Answer:
1. Set the ORACLE_SID environment variable to aux.
[oracle@edrsr10p1 oracle]$ ORACLE_SID=aux
[oracle@edrsr10p1 oracle]$ echo $ORACLE_SID
aux

2. Invoke SQL*Plus and connect as SYSDBA.

Oracle Internal & Oracle Academy Use Only


[oracle@edrsr10p1 oracle]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Mar 29


11:38:53 2006

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to an idle instance.

3. Start the instance in NOMOUNT mode using the initialization parameter file you
created in step 2.
SQL> startup nomount pfile='$HOME/auxinstance/initAUX.ora'
ORACLE instance started.

Total System Global Area 285212672 bytes


Fixed Size 1218992 bytes
Variable Size 92276304 bytes
Database Buffers 188743680 bytes
Redo Buffers 2973696 bytes
5) Create a server parameter file (SPFILE).
Answer:
1. Create a server parameter file with the default name of spfileaux.ora from
the text initialization parameter file.
SQL> create spfile from
pfile='$HOME/auxinstance/initAUX.ora';

File created.

2. Exit from SQL*Plus.

6) Verify that your target database (orcl database) is mounted or open.


Answer:

Oracle Database 10g: Backup and Recovery B-64


Solutions for Practice 6-1: Create a Duplicate Database (continued)
1. Set your ORACLE_SID to orcl.
[oracle@edrsr10p1 oracle]$ ORACLE_SID=orcl
[oracle@edrsr10p1 oracle]$ echo $ORACLE_SID
orcl
[oracle@edrsr10p1 oracle]$

2. Log in to SQL*Plus as SYSDBA.


3. Query V$DATABASE to determine whether your database is open.
SQL> select open_mode from v$database;

OPEN_MODE
----------
READ WRITE

Oracle Internal & Oracle Academy Use Only


4. Exit from SQL*Plus.
7) Start RMAN with a connection to the target database (orcl) and the auxiliary
instance.
Answer:
1. Set your ORACLE_SID to aux. Invoke RMAN and connect as SYSDBA.
Connect to the target database.
[oracle@edrsr10p1 oracle]$ ORACLE_SID=aux
[oracle@edrsr10p1 oracle]$ echo $ORACLE_SID
aux
[oracle@edrsr10p1 oracle]$ rman

Recovery Manager: Release 10.2.0.1.0 - Production on Thu


Mar 30 07:34:06 2006

Copyright (c) 1982, 2005, Oracle. All rights reserved.

RMAN> connect auxiliary sys/oracle

connected to auxiliary database: AUX (not mounted)

RMAN> connect target sys/oracle@orcl

connected to target database: ORCL (DBID=1090770270)

8) Create the duplicate database by executing the DUPLICATE command.


Answer:
1. Create a RUN block to allocate the auxiliary channel and execute the DUPLICATE
command.
RMAN> run
2> {

Oracle Database 10g: Backup and Recovery B-65


Solutions for Practice 6-1: Create a Duplicate Database (continued)
3> allocate auxiliary channel aux1 device type disk;
4> duplicate target database to aux;
5> }
allocated channel: aux1
channel aux1: sid=156 devtype=DISK

Starting Duplicate Db at 30-MAR-06


allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=154 devtype=DISK
using channel ORA_AUX_SBT_TAPE_1

contents of Memory Script:


{
set until scn 4236965;
set newname for datafile 1 to

Oracle Internal & Oracle Academy Use Only


"/u01/app/oracle/oradata/aux/system01.dbf";
set newname for datafile 2 to
"/u01/app/oracle/oradata/aux/undotbs01.dbf";
set newname for datafile 3 to
"/u01/app/oracle/oradata/aux/sysaux01.dbf";
set newname for datafile 4 to
"/u01/app/oracle/oradata/aux/users01.dbf";
set newname for datafile 5 to
"/u01/app/oracle/oradata/aux/example01.dbf";
restore
check readonly
clone database
;
}
executing Memory Script
executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 30-MAR-06


using channel ORA_AUX_DISK_1
using channel ORA_AUX_SBT_TAPE_1
channel aux1: restoring datafile 00001
input datafile copy recid=23 stamp=586270526
filename=/u01/app/oracle/flash_recf
destination for restore of datafile 00001:
/u01/app/oracle/oradata/aux/system01f
channel ORA_AUX_DISK_1: restoring datafile 00002

Oracle Database 10g: Backup and Recovery B-66


Solutions for Practice 6-1: Create a Duplicate Database (continued)
input datafile copy recid=20 stamp=586270521
filename=/u01/app/oracle/flash_recf
destination for restore of datafile 00002:
/u01/app/oracle/oradata/aux/undotbs0f
channel ORA_AUX_DISK_1: copied datafile copy of datafile
00002
output filename=/u01/app/oracle/oradata/aux/undotbs01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003
input datafile copy recid=22 stamp=586270526
filename=/u01/app/oracle/flash_recf
destination for restore of datafile 00003:
/u01/app/oracle/oradata/aux/sysaux01f
channel aux1: copied datafile copy of datafile 00001
output filename=/u01/app/oracle/oradata/aux/system01.dbf
channel aux1: restoring datafile 00004

Oracle Internal & Oracle Academy Use Only


input datafile copy recid=19 stamp=586270517
filename=/u01/app/oracle/flash_recf
destination for restore of datafile 00004:
/u01/app/oracle/oradata/aux/users01.f
channel ORA_AUX_DISK_1: copied datafile copy of datafile
00003
output filename=/u01/app/oracle/oradata/aux/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00005
input datafile copy recid=21 stamp=586270521
filename=/u01/app/oracle/flash_recf
destination for restore of datafile 00005:
/u01/app/oracle/oradata/aux/example0f
channel aux1: copied datafile copy of datafile 00004
output filename=/u01/app/oracle/oradata/aux/users01.dbf
channel ORA_AUX_DISK_1: copied datafile copy of datafile
00005
output filename=/u01/app/oracle/oradata/aux/example01.dbf
Finished restore at 30-MAR-06
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "AUX"
RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ( '/u01/app/oracle/oradata/aux/redo01.log' )
SIZE 50 M REUSE,
GROUP 2 ( '/u01/app/oracle/oradata/aux/redo02.log' )
SIZE 50 M REUSE,
GROUP 3 ( '/u01/app/oracle/oradata/aux/redo03.log' )
SIZE 50 M REUSE
DATAFILE
'/u01/app/oracle/oradata/aux/system01.dbf'
CHARACTER SET AL32UTF8

Oracle Database 10g: Backup and Recovery B-67


Solutions for Practice 6-1: Create a Duplicate Database (continued)
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script

released channel: ORA_AUX_DISK_1


released channel: ORA_AUX_SBT_TAPE_1
datafile 2 switched to datafile copy
input datafile copy recid=1 stamp=586438014
filename=/u01/app/oracle/oradata/auf
datafile 3 switched to datafile copy
input datafile copy recid=2 stamp=586438014
filename=/u01/app/oracle/oradata/auf
datafile 4 switched to datafile copy

Oracle Internal & Oracle Academy Use Only


input datafile copy recid=3 stamp=586438014
filename=/u01/app/oracle/oradata/auf
datafile 5 switched to datafile copy
input datafile copy recid=4 stamp=586438014
filename=/u01/app/oracle/oradata/auf

contents of Memory Script:


{
set until scn 4236965;
recover
clone database
delete archivelog
;
}
executing Memory Script

executing command: SET until clause

Starting recover at 30-MAR-06


channel aux1: starting incremental datafile backupset
restore
channel aux1: specifying datafile(s) to restore from
backup set
destination for restore of datafile 00001:
/u01/app/oracle/oradata/aux/system01f
destination for restore of datafile 00002:
/u01/app/oracle/oradata/aux/undotbs0f
destination for restore of datafile 00003:
/u01/app/oracle/oradata/aux/sysaux01f
destination for restore of datafile 00004:
/u01/app/oracle/oradata/aux/users01.f
destination for restore of datafile 00005:
/u01/app/oracle/oradata/aux/example0f
channel aux1: reading from backup piece
/u01/app/oracle/flash_recovery_area/ORCp
channel aux1: restored backup piece 1

Oracle Database 10g: Backup and Recovery B-68


Solutions for Practice 6-1: Create a Duplicate Database (continued)
piece
handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/
2006_03_28/o1_m4
channel aux1: restore complete, elapsed time: 00:00:16

starting media recovery


archive log thread 1 sequence 1 is already on disk as file
/u01/app/oracle/flasc
archive log thread 1 sequence 2 is already on disk as file
/u01/app/oracle/flasc
archive log
filename=/u01/app/oracle/flash_recovery_area/ORCL/archivel
og/2006_01
archive log
filename=/u01/app/oracle/flash_recovery_area/ORCL/archivel

Oracle Internal & Oracle Academy Use Only


og/2006_02
media recovery complete, elapsed time: 00:00:05
Finished recover at 10-APR-06

contents of Memory Script:


{
shutdown clone;
startup clone nomount ;
}
executing Memory Script
database dismounted
Oracle instance shut down

connected to auxiliary database (not started)


Oracle instance started

Total System Global Area 285212672 bytes

Fixed Size 1218992 bytes


Variable Size 92276304 bytes
Database Buffers 188743680 bytes
Redo Buffers 2973696 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "AUX"
RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ( '/u01/app/oracle/oradata/aux/redo01.log' )
SIZE 50 M REUSE,
GROUP 2 ( '/u01/app/oracle/oradata/aux/redo02.log' )
SIZE 50 M REUSE,
GROUP 3 ( '/u01/app/oracle/oradata/aux/redo03.log' )
SIZE 50 M REUSE
DATAFILE

Oracle Database 10g: Backup and Recovery B-69


Solutions for Practice 6-1: Create a Duplicate Database (continued)
'/u01/app/oracle/oradata/aux/system01.dbf'
CHARACTER SET AL32UTF8

contents of Memory Script:


{
set newname for tempfile 1 to
"/u01/app/oracle/oradata/aux/temp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy
"/u01/app/oracle/oradata/aux/undotbs01.dbf";
catalog clone datafilecopy
"/u01/app/oracle/oradata/aux/sysaux01.dbf";
catalog clone datafilecopy
"/u01/app/oracle/oradata/aux/users01.dbf";

Oracle Internal & Oracle Academy Use Only


catalog clone datafilecopy
"/u01/app/oracle/oradata/aux/example01.dbf";
catalog clone datafilecopy
"/u01/app/oracle/oradata/aux/example02.dbf";
switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed temporary file 1 to


/u01/app/oracle/oradata/aux/temp01.dbf in control fe

cataloged datafile copy


datafile copy
filename=/u01/app/oracle/oradata/aux/undotbs01.dbf recid=1
stamp=8

cataloged datafile copy


datafile copy
filename=/u01/app/oracle/oradata/aux/sysaux01.dbf recid=2
stamp=59

cataloged datafile copy


datafile copy
filename=/u01/app/oracle/oradata/aux/users01.dbf recid=3
stamp=589

cataloged datafile copy


datafile copy
filename=/u01/app/oracle/oradata/aux/example01.dbf recid=4
stamp=9

cataloged datafile copy


datafile copy
filename=/u01/app/oracle/oradata/aux/example02.dbf recid=5
stamp=9

Oracle Database 10g: Backup and Recovery B-70


Solutions for Practice 6-1: Create a Duplicate Database (continued)
datafile 2 switched to datafile copy
input datafile copy recid=1 stamp=587391888
filename=/u01/app/oracle/oradata/auf
datafile 3 switched to datafile copy
input datafile copy recid=2 stamp=587391889
filename=/u01/app/oracle/oradata/auf
datafile 4 switched to datafile copy
input datafile copy recid=3 stamp=587391889
filename=/u01/app/oracle/oradata/auf
datafile 5 switched to datafile copy
input datafile copy recid=4 stamp=587391889
filename=/u01/app/oracle/oradata/auf
datafile 6 switched to datafile copy
input datafile copy recid=5 stamp=587391889
filename=/u01/app/oracle/oradata/auf

Oracle Internal & Oracle Academy Use Only


contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 10-APR-06

2. After the DUPLICATE DATABASE operation completes, exit from RMAN.


9) Use SQL*Plus to log in to your AUX database and execute a query against the
HR.REGIONS table.
Answer:
1. Verify that ORACLE_SID is set to aux.
2. Log in to SQL*Plus as SYSDBA and execute a query against the HR.REGIONS
table.
SQL> select * from hr.regions;

REGION_ID REGION_NAME
---------- -------------------------
1 Europe
2 Americas
3 Asia
4 Middle East and Africa

10) Now that you have completed the test recovery by creating a duplicate database, shut
down the aux instance.
Answer:
1. Connect as SYSDBA and execute the SHUTDOWN IMMEDIATE command.
SQL> shutdown immediate

Oracle Database 10g: Backup and Recovery B-71


Solutions for Practice 6-1: Create a Duplicate Database (continued)
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

2. Exit from SQL*Plus.


11) Change your ORACLE_SID to orcl in preparation for later practices.
Answer:
1. At the operating prompt, enter ORACLE_SID=orcl to change your
ORACLE_SID.
[oracle@edrsr10p1 oracle]$ ORACLE_SID=orcl
[oracle@edrsr10p1 oracle]$ echo $ORACLE_SID

Oracle Internal & Oracle Academy Use Only


orcl

Oracle Database 10g: Backup and Recovery B-72


Practice Solutions for Lesson 7

In this practice, you use tablespace point-in-time recovery to recover from unwanted
changes to your database.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-73


Solutions for Practice 7-1: Use Tablespace Point-in-time
Recovery
1) Execute the lab_07_01_01_01.sh script to export the HR schema.
Answer:
1. In a terminal window, change to the labs directory and execute the
lab_07_01_01_01.sh script to export the HR schema.

[oracle@edrsr10p1 labs]$ ./lab_07_01_01_01.sh

Export: Release 10.2.0.1.0 - Production on Wednesday, 12


April, 2006 13:03:27

Oracle Internal & Oracle Academy Use Only


Copyright (c) 2003, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition


Release 10.2.0.1.0 - Produn
With the Partitioning, OLAP and Data Mining options
tarting "SYSTEM"."SYS_EXPORT_SCHEMA_01": system/********
dumpfile=hrexp.dmp sr
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 448 KB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type
SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type
SCHEMA_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type
SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type
SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
Processing object type
SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
Processing object type SCHEMA_EXPORT/VIEW/VIEW
Processing object type
SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/TRIGGER
Processing object type
SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "HR"."COUNTRIES"
6.085 KB 25 rows

Oracle Database 10g: Backup and Recovery B-74


Solutions for Practice 7-1: Use Tablespace Point-in-time Recovery
(continued)
. . exported "HR"."DEPARTMENTS"
6.632 KB 27 rows
. . exported "HR"."EMPLOYEES"
15.76 KB 107 rows
. . exported "HR"."JOBS"
6.609 KB 19 rows
. . exported "HR"."JOB_HISTORY"
6.585 KB 10 rows
. . exported "HR"."LOCATIONS"
7.710 KB 23 rows
. . exported "HR"."REGIONS"
5.289 KB 4 rows
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully

Oracle Internal & Oracle Academy Use Only


loaded/unloaded
**********************************************************
********************
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
/u01/app/oracle/product/10.2.0/db_1/rdbms/log/hrexp.dmp
Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed
at 13:03:44

2) Execute the lab_07_01_02_02.sql script to create a new tablespace and a new


user in your database.
Answer:
1. In your terminal window, log in to SQL*Plus as SYSDBA.
2. Execute the lab_07_01_02_02.sql script to create the HRTEST tablespace
and the HRTEST user.
SQL> @lab_07_01_02_02
SQL> SET TERMOUT ON
SQL> CONNECT / AS SYSDBA
Connected.
SQL> REM ***** Tablespace for the HR import *****
SQL> CREATE SMALLFILE TABLESPACE HRTEST
2 DATAFILE '/u01/app/oracle/oradata/orcl/hrtest01.dbf'
SIZE 10M
3 AUTOEXTEND ON NEXT 500K MAXSIZE UNLIMITED LOGGING
4 EXTENT MANAGEMENT LOCAL
5 SEGMENT SPACE MANAGEMENT AUTO;

Tablespace created.
SQL> REM ***** User/schema for the HR import *****
SQL> CREATE USER hrtest
2 PROFILE DEFAULT
3 IDENTIFIED BY hrtest
4 DEFAULT TABLESPACE hrtest
5 TEMPORARY TABLESPACE temp

Oracle Database 10g: Backup and Recovery B-75


Solutions for Practice 7-1: Use Tablespace Point-in-time Recovery
(continued)
6 QUOTA UNLIMITED ON hrtest
7 ACCOUNT UNLOCK
8 ;

User created.
SQL> GRANT connect, resource
2 TO hrtest;

Grant succeeded.

3) Execute the lab_07_01_03_01.sh script to populate the new tablespace with a


copy of the data from the HR schema.

Oracle Internal & Oracle Academy Use Only


Note: The import should complete successfully. You will receive error messages
because the import excludes the COUNTRIES, REGIONS, and LOCATIONS tables.
These messages can be ignored.
Answer:
1. In your terminal window at the operating system prompt, execute the
lab_07_01_03_01.sh script.

[oracle@edrsr10p1 labs]$ ./lab_07_01_03_01.sh

Import: Release 10.2.0.1.0 - Production on Friday, 14


April, 2006 7:08:42

Copyright (c) 2003, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition


Release 10.2.0.1.0 - Produn
With the Partitioning, OLAP and Data Mining options
Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully
loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_FULL_01": system/********
dumpfile=hrexp.dmp par
Processing object type SCHEMA_EXPORT/USER
ORA-31684: Object type USER:"HRTEST" already exists
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type
SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "HRTEST"."DEPARTMENTS"
6.632 KB 27 rows

Oracle Database 10g: Backup and Recovery B-76


Solutions for Practice 7-1: Use Tablespace Point-in-time Recovery
(continued)
. . imported "HRTEST"."EMPLOYEES"
15.76 KB 107 rows
. . imported "HRTEST"."JOBS"
6.609 KB 19 rows
. . imported "HRTEST"."JOB_HISTORY"
6.585 KB 10 rows
Processing object type
SCHEMA_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type
SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type
SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS

Oracle Internal & Oracle Academy Use Only


Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
Processing object type
SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
Processing object type SCHEMA_EXPORT/VIEW/VIEW
ORA-39082: Object type VIEW:"HRTEST"."EMP_DETAILS_VIEW"
created with compilatios
Processing object type
SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
ORA-39083: Object type REF_CONSTRAINT failed to create
with error:
ORA-00942: table or view does not exist
Failing sql is:
ALTER TABLE "HRTEST"."DEPARTMENTS" ADD CONSTRAINT
"DEPT_LOC_FK" FOREIGN KEY ("LE

Processing object type SCHEMA_EXPORT/TABLE/TRIGGER


Processing object type
SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "SYSTEM"."SYS_IMPORT_FULL_01" completed with 3
error(s) at 07:08:54

4) Create a backup of your database using RMAN.


Answer:
1. Invoke RMAN and connect to your target database.
2. Execute the BACKUP DATABASE command.
RMAN> backup database;

Starting backup at 14-APR-06


using target database control file instead of recovery
catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=127 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset

Oracle Database 10g: Backup and Recovery B-77


Solutions for Practice 7-1: Use Tablespace Point-in-time Recovery
(continued)
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001
name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile fno=00003
name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile fno=00005
name=/u01/app/oracle/oradata/orcl/example01.dbf
input datafile fno=00002
name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile fno=00004
name=/u01/app/oracle/oradata/orcl/users01.dbf
input datafile fno=00007
name=/u01/app/oracle/oradata/orcl/hrtest01.dbf

Oracle Internal & Oracle Academy Use Only


input datafile fno=00006
name=/u01/app/oracle/oradata/orcl/example02.dbf
channel ORA_DISK_1: starting piece 1 at 14-APR-06
channel ORA_DISK_1: finished piece 1 at 14-APR-06
piece
handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/
2006_04_14/o1_mE
channel ORA_DISK_1: backup set complete, elapsed time:
00:01:35
Finished backup at 14-APR-06

Starting Control File and SPFILE Autobackup at 14-APR-06


piece
handle=/u01/app/oracle/flash_recovery_area/ORCL/autobackup
/2006_04_14/o1_E
Finished Control File and SPFILE Autobackup at 14-APR-06

5) Record the current SCN: ____________


Answer:
1. Invoke SQL*Plus as SYSDBA.
2. Query the CURRENT_SCN column in V$DATABASE and record the current SCN.
SQL> select current_scn from V$database;

CURRENT_SCN
-----------
4725352
6) Record the current time.
Answer:
1. Execute the date command at the operating system prompt.
[oracle@edrsr10p1 labs]$ date
Fri Apr 14 13:07:57 PDT 2006

Oracle Database 10g: Backup and Recovery B-78


Solutions for Practice 7-1: Use Tablespace Point-in-time Recovery
(continued)
7) Execute the lab_07_01_07_01.sql script to query the HRTEST.EMPLOYEES
table and view information about employees in department 60.
Make note of the highest salary that is displayed: ________
Answer:
1. Execute the lab_07_01_07_01.sql script.
SQL> @lab_07_01_07_01
SQL> select employee_id, last_name, salary
2 from employees
3 where department_id = 60
4 /

Oracle Internal & Oracle Academy Use Only


EMPLOYEE_ID LAST_NAME SALARY
----------- ------------------------- ----------
103 Hunold 9000
104 Ernst 6000
105 Austin 4800
106 Pataballa 4800
107 Lorentz 4200

8) Execute the lab_07_01_08_01.sql script to update the salaries for the


employees in department 60 and note the highest salary displayed.
Highest salary: _____________
Answer:
1. Execute the lab_07_01_08_01.sql script.
SQL> @lab_07_01_08_01
SQL> update hrtest.employees
2 set salary = salary * 1.25
3 where department_id = 60
4 /

5 rows updated.
SQL> select employee_id, last_name, salary
2 from hrtest.employees
3 where department_id = 60
4 /

EMPLOYEE_ID LAST_NAME SALARY


----------- ------------------------- ----------
103 Hunold 11250
104 Ernst 7500
105 Austin 6000
106 Pataballa 6000
107 Lorentz 5250

Oracle Database 10g: Backup and Recovery B-79


Solutions for Practice 7-1: Use Tablespace Point-in-time Recovery
(continued)
9) You now want to perform TSPITR for the HRTEST tablespace to return it to the state
prior to the updates. Execute the lab_07_01_09_01.sql script to determine
whether there are any dependencies that will prevent the TSPITR operation.
Answer:
1. Execute the lab_07_01_09_01.sql script.
SQL> @lab_07_01_09_01
SQL> SELECT obj1_owner, obj1_name, obj1_type, ts1_name,
2 obj2_owner, obj2_name, obj2_type, ts2_name,
3 constraint_name, reason
4 FROM SYS.TS_PITR_CHECK
5 WHERE (TS1_NAME IN ('HRTEST')

Oracle Internal & Oracle Academy Use Only


6 AND TS2_NAME NOT IN ('HRTEST'))
7 OR (TS1_NAME NOT IN ('HRTEST')
8 AND TS2_NAME IN ('HRTEST'))
9 /

no rows selected
“No rows selected” indicates that there are no dependencies to any tablespaces
outside of the recovery set, so you can proceed with the tablespace point-in-time
recovery.
10) You can use Enterprise Manager Database Control or RMAN command line to
perform tablespace point-in-time recovery.
Answer:
The answer presents the solution using Enterprise Manager Database Control.
If you want to use RMAN command line, refer to the course notes for detailed
information and execute the RECOVER TABLESPACE command as follows:
RECOVER TABLESPACE hrtest UNTIL SCN <scn>
AUXILIARY DESTINATION ‘/u01/app/oracle/oradata/tspitr’;
1. Invoke Enterprise Manager Database Control and log in as SYS/ORACLE as
SYSDBA.
2. Select the Maintenance page.
3. Select Perform Recovery in the Backup/Recovery section.
4. Select Tablespaces in the Object Level Recovery section. The page refreshes.
Accept the default selection “Recover to current time or a previous point-in-time.”
Click Perform Object Level Recovery.

Oracle Database 10g: Backup and Recovery B-80


Solutions for Practice 7-1: Use Tablespace Point-in-time Recovery
(continued)

Oracle Internal & Oracle Academy Use Only


5. Select “Recover to a prior point-in-time” and specify the SCN you recorded
earlier. Click Next.

Oracle Database 10g: Backup and Recovery B-81


Solutions for Practice 7-1: Use Tablespace Point-in-time Recovery
(continued)
6. Specify the auxiliary instance location of
/u01/app/oracle/oradata/tspitr. Click Add to select the tablespace.

Oracle Internal & Oracle Academy Use Only


7. Select the HRTEST tablespace. Click Select.

Oracle Database 10g: Backup and Recovery B-82


Solutions for Practice 7-1: Use Tablespace Point-in-time Recovery
(continued)
8. Select the HRTEST tablespace and click Next.

Oracle Internal & Oracle Academy Use Only


9. Accept “No. Restore the files to the default location.” On the Perform Object
Level Recovery: Rename page. Click Next.

10. Review the information and click Submit.

Oracle Database 10g: Backup and Recovery B-83


Solutions for Practice 7-1: Use Tablespace Point-in-time Recovery
(continued)

Oracle Internal & Oracle Academy Use Only


11. The “Processing: Perform Object Level Recovery” page is displayed.
12. After the recovery completes, the “Perform Recovery: Result” page is displayed.
You can review the TSPITR operation by scrolling through the output window.

13. Click OK.

11) Verify that the HRTEST tablespace is online.


Answer:
1. In Enterprise Manager Database Control, navigate to the Administration page.

Oracle Database 10g: Backup and Recovery B-84


Solutions for Practice 7-1: Use Tablespace Point-in-time Recovery
(continued)
2. Select Tablespaces and view the status of the HRTEST tablespace.

Oracle Internal & Oracle Academy Use Only


12) Verify that the SALARY columns in HRTEST.EMPLOYEES for the employees in
department 60 contain the correct values.
Answer:
1. Invoke SQL*Plus and execute the lab_07_01_12_01.sql script.
SQL> @lab_07_01_12_01
SQL> select employee_id, last_name, salary
2 from hrtest.employees
3 where department_id = 60
4 /

EMPLOYEE_ID LAST_NAME SALARY


----------- ------------------------- ----------
103 Hunold 9000
104 Ernst 6000
105 Austin 4800
106 Pataballa 4800
107 Lorentz 4200
2. The highest salary value should be back to the original value you recorded in
step 7.
13) Execute the lab_07_01_13_02.sql script to add a constraint to the
HRTEST.DEPARTMENTS table.
Answer:
1. Invoke SQL*Plus and connect as SYSDBA.
2. Execute the lab_07_01_13_02.sql script.
SQL> @lab_07_01_13_02
SQL> connect / as sysdba
Connected.
SQL> GRANT references (location_id) on hr.locations to
hrtest
2 /

Oracle Database 10g: Backup and Recovery B-85


Solutions for Practice 7-1: Use Tablespace Point-in-time Recovery
(continued)

Grant succeeded.

SQL> connect hrtest/hrtest


Connected.
SQL> ALTER TABLE hrtest.departments
2 ADD CONSTRAINT dept_loc_id_fk FOREIGN KEY
(location_id)
3 REFERENCES hr.locations (location_id)
4 /

Table altered.

14) Assume you need to perform TSPITR on the HRTEST tablespace again. Execute the

Oracle Internal & Oracle Academy Use Only


lab_07_01_14_02.sql query to determine whether there are any dependencies
outside the recovery set.
Answer:
1. Invoke SQL*Plus and connect as SYSDBA.
2. Execute the lab_07_01_14_02.sql script.
SQL> @lab_07_01_14_02
SQL> set echo on
SQL> SELECT obj1_owner, obj1_name, obj1_type, ts1_name,
2 obj2_owner, obj2_name, obj2_type, ts2_name,
3 constraint_name, reason
4 FROM SYS.TS_PITR_CHECK
5 WHERE (TS1_NAME IN ('HRTEST')
6 AND TS2_NAME NOT IN ('HRTEST'))
7 OR (TS1_NAME NOT IN ('HRTEST')
8 AND TS2_NAME IN ('HRTEST'))
9 /
OBJ1_OWNER OBJ1_NAME OBJ1_TYPE TS1_NAME
---------------------------------------------------------
OBJ2_OWNER OBJ2_NAME OBJ2_TYPE TS2_NAME
------------------------------ --------------------------
CONSTRAINT_NAME REASON
------------------------------
HR LOCATIONS TABLE EXAMPLE
HRTEST DEPARTMENTS TABLE HRTEST
DEPT_LOC_ID_FK
constraint between tables not contained in recovery set

HR LOCATIONS TABLE EXAMPLE


HRTEST DEPARTMENTS TABLE HRTEST
DEPT_MGR_FK
constraint between tables not contained in recovery set

HR LOCATIONS TABLE EXAMPLE


HRTEST DEPARTMENTS TABLE HRTEST

Oracle Database 10g: Backup and Recovery B-86


Solutions for Practice 7-1: Use Tablespace Point-in-time Recovery
(continued)
DEPT_ID_PK
constraint between tables not contained in recovery set

HR LOCATIONS TABLE EXAMPLE


HRTEST DEPARTMENTS TABLE HRTEST
DEPT_NAME_NN
constraint between tables not contained in recovery set

15) If you wanted to complete the tablespace point-in-time recovery for the HRTEST
tablespace now, what would you need to do?

Note: You will not perform another tablespace point-in-recovery in this practice.

Oracle Internal & Oracle Academy Use Only


Answer:
You would need to disable the DEPT_LOC_ID_FK constraint that was added to your
HRTEST.DEPARTMENTS table or you would need to add the tablespace that
contains the HR.LOCATIONS table to your recovery set.

Oracle Database 10g: Backup and Recovery B-87


Practice Solutions for Lesson 8

In this practice, you create a recovery catalog in your instructor’s database and register
your database in the recovery catalog.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-88


Solutions for Practice 8-1: Create the Recovery Catalog and
Register the Database
The tablespace for the recovery catalog and the recovery catalog owner have been created
in the instructor database. The tablespaces are named RCTS01 – RCTS12. The users are
named RCUSER01 – RCUSER12.
1) Connect to the recovery catalog database (instructor’s database) with the appropriate
recovery catalog owner name (if you are using PC01, connect as RCUSER01) using
RMAN. Create the recovery catalog in your assigned tablespace. (If you are using
PC01, your assigned tablespace is RCTS01.) The service name is RCDB.
Answer: This example uses RCUSER10 as the username and password. Your
assigned username and password may differ from this example.
[oracle@edrsr10p1 oracle]$ rman catalog

Oracle Internal & Oracle Academy Use Only


rcuser10/rcuser10@rcdb

Recovery Manager: Release 10.2.0.1.0 - Production on Thu


Mar 16 13:58:52 2006

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to recovery catalog database

RMAN> create catalog

recovery catalog created

RMAN> exit

Recovery Manager complete.


2) Using RMAN, connect to your target database and the recovery catalog database.
Answer:
[oracle@edrsr10p1 oracle]$ rman target / catalog
rcuser10/rcuser10@rcdb

Recovery Manager: Release 10.2.0.1.0 - Production on Thu


Mar 16 14:22:04 2006

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: ORCL (DBID=1090770270)


connected to recovery catalog database

RMAN>
3) Using RMAN, execute the command to resynchronize the control file and recovery
catalog. What happens? Why?

Oracle Database 10g: Backup and Recovery B-89


Solutions for Practice 8-1: Create the Recovery Catalog and Register the
Database (continued)
Answer: The target database is not yet registered in the recovery catalog, so the
resync command fails.
RMAN> resync catalog;

RMAN-00571:
==========================================================
=
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS
===============
RMAN-00571:
==========================================================
=
RMAN-03002: failure of resync command at 03/16/2006

Oracle Internal & Oracle Academy Use Only


14:28:21
RMAN-06004: ORACLE error from recovery catalog database:
RMAN-20001: target datg
4) Register the target database in the recovery catalog. You can use RMAN command-
line or Enterprise Manager for this step.
Answer: Use RMAN command-line OR Enterprise Manager Database Control.
1. Using RMAN:
RMAN> register database;

database registered in recovery catalog


starting full resync of recovery catalog
full resync complete
RMAN>
2. Using Enterprise Manager:
Select Recovery Catalog Settings on the Maintenance Page. Select Add Recovery
Catalog on the Recovery Catalog Settings page.

Oracle Database 10g: Backup and Recovery B-90


Solutions for Practice 8-1: Create the Recovery Catalog and Register the
Database (continued)

Oracle Internal & Oracle Academy Use Only


The Add Recovery Catalog: Database page is displayed. On this page, enter the
information requested for the recovery catalog database. Click Next.

Review the information on the Add Recovery Catalog: Review page and click
Finish.
The Processing: Configure Catalog page is displayed. After processing completes,
you are returned to the Recovery Catalog Settings page. Select Use Recovery
Catalog and click OK.

Oracle Database 10g: Backup and Recovery B-91


Solutions for Practice 8-1: Create the Recovery Catalog and Register the
Database (continued)

Oracle Internal & Oracle Academy Use Only


The Processing: Register Database page is displayed. After the processing
completes, the Recovery Catalog Settings page is displayed indicating that the
database was successfully registered with the recovery catalog.

Oracle Database 10g: Backup and Recovery B-92


Solutions for Practice 8-1: Create the Recovery Catalog and Register the
Database (continued)

Oracle Internal & Oracle Academy Use Only


5) Create an RMAN script named whole_backup to make a whole database backup.
Do not execute the whole_backup script at this time.
Answer:
1. Using RMAN, connect to your target database and the recovery catalog.
[oracle@edrsr10p1 oracle]$ rman target / catalog
rcuser10/rcuser10@rcdb

Recovery Manager: Release 10.2.0.1.0 - Production on Mon


Mar 20 11:59:00 2006

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: ORCL (DBID=1090770270)


connected to recovery catalog database

2. Create the whole_backup script using the CREATE SCRIPT command.


RMAN> CREATE SCRIPT whole_backup
2> {
3> BACKUP DATABASE;
4> }

created script whole_backup

Oracle Database 10g: Backup and Recovery B-93


Solutions for Practice 8-1: Create the Recovery Catalog and Register the
Database (continued)
6) Use the PRINT command to query the recovery catalog and verify the creation of
your whole_backup script.
RMAN> PRINT SCRIPT whole_backup;

printing stored script: whole_backup


{BACKUP DATABASE;
}

RMAN>

7) In preparation for later practices, use RMAN to unregister your database from the
recovery catalog.
Answer:

Oracle Internal & Oracle Academy Use Only


1. Connect to your target database and the recovery catalog.
2. Execute the UNREGISTER DATABASE command.
RMAN> unregister database;

database name is "ORCL" and DBID is 1090770270

Do you really want to unregister the database (enter YES


or NO)? yes
database unregistered from the recovery catalog

Oracle Database 10g: Backup and Recovery B-94


Practice Solutions for Lesson 9

In this practice, you monitor the progress of your RMAN backup jobs.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-95


Solutions for Practice 9-1: Use SQL to Monitor the Progress of
RMAN Backups

1) Invoke RMAN and delete all obsolete backups.


Answer:
1. Invoke RMAN and connect to your target database.
2. Execute the DELETE OBSOLETE command.
RMAN> delete obsolete;

using target database control file instead of recovery


catalog
RMAN retention policy will be applied to the command

Oracle Internal & Oracle Academy Use Only


RMAN retention policy is set to redundancy 1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=133 devtype=DISK
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=158 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Oracle Secure Backup
Deleting the following obsolete backups and copies:
Type Key Completion Time
Filename/Handle
-------------------- ------ ------------------ -----------
---------
Backup Set 80 14-APR-06
Backup Piece 81 14-APR-06
/u01/app/oracle/flash_recovery_ap
Archive Log 76 14-APR-06
/u01/app/oracle/flash_recovery_ac

Backup Set 101 14-APR-06
Backup Piece 102 14-APR-06
/u01/app/oracle/flash_recovery_ap

Do you really want to delete the above objects (enter YES


or NO)? yes
eleted backup piece
backup piece
handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/
2006_04_8
deleted archive log
archive log
filename=/u01/app/oracle/flash_recovery_area/ORCL/archivel
og/2006_08

Deleted 18 objects

RMAN>

Oracle Database 10g: Backup and Recovery B-96


Solutions for Practice 9-1: Use SQL to Monitor the Progress of RMAN
Backups (continued)
2) Open a second terminal window. Change to the labs directory. Invoke SQL*Plus
and connect as SYSDBA. You will use this second session to monitor a database
backup.
3) Return to your first terminal window. In your RMAN session, begin a whole database
backup.
Answer:
1. Execute the RMAN BACKUP DATABASE command.
RMAN> backup database;

Starting backup at 17-APR-06

Oracle Internal & Oracle Academy Use Only


released channel: ORA_SBT_TAPE_1
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001
name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile fno=00003
name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile fno=00005
name=/u01/app/oracle/oradata/orcl/example01.dbf
input datafile fno=00002
name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile fno=00004
name=/u01/app/oracle/oradata/orcl/users01.dbf
input datafile fno=00007
name=/u01/app/oracle/oradata/orcl/hrtest01.dbf
input datafile fno=00006
name=/u01/app/oracle/oradata/orcl/example02.dbf
channel ORA_DISK_1: starting piece 1 at 17-APR-06

4) Use your SQL*Plus session to monitor the progress of the whole database backup by
querying the V$SESSION_LONGOPS view. By using this view you can determine
whether the backup is progressing normally or hanging. If the backup is progressing
normally, the TIME_REMAINING column should be decreasing. Execute the
lab_09_01_04_01.sql script to query V$SESSION_LONGOPS.
Answer:
1. Execute the lab_09_01_04_01.sql script.
SQL> @lab_09_01_04_01
SQL> SELECT sid,start_time,elapsed_seconds, time_remaining
2 FROM v$session_longops
3 /
SID START_TIM ELAPSED_SECONDS TIME_REMAINING
---------- --------- --------------- --------------
131 17-APR-06 0

Oracle Database 10g: Backup and Recovery B-97


Solutions for Practice 9-1: Use SQL to Monitor the Progress of RMAN
Backups (continued)
133 17-APR-06 9 58
133 17-APR-06 9

2. Execute the lab_09_01_04_01.sql script again. You should notice that the
value in the TIME_REMAINING column is decreasing.
SQL> /
SID START_TIM ELAPSED_SECONDS TIME_REMAINING
---------- --------- --------------- --------------
131 17-APR-06 0
133 17-APR-06 17 46
133 17-APR-06 17

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-98


Solutions for Practice 9-2: Use Enterprise Manager to Monitor
RMAN Jobs
You can easily monitor RMAN jobs in Enterprise Manager.
1) Start Enterprise Manager and log in as SYS/ORACLE as SYSDBA.
2) Delete obsolete backups.
Answer:
1. Navigate to the Maintenance page.
2. Select Manage Current Backups.
3. On the Manage Current Backups page, click Delete All Obsolete.
4. Click Submit Job.

Oracle Internal & Oracle Academy Use Only


5. The job is submitted. Click View Job to view the progress of the Delete All
Obsolete job.

Oracle Database 10g: Backup and Recovery B-99


Solutions for Practice 9-2: Use Enterprise Manager to Monitor RMAN Jobs
(continued)
6. You can view additional information by clicking the links in the Logs section.

Oracle Internal & Oracle Academy Use Only


7. Click the Database tab to return to the home page.
3) Start a whole database backup.
Answer:
1. Navigate to the Maintenance page.
2. Select Schedule Backup in the Backup/Recovery section.
3. Select Whole Database in the Customized Backup section. Click Schedule
Customized Backup.

Oracle Database 10g: Backup and Recovery B-100


Solutions for Practice 9-2: Use Enterprise Manager to Monitor RMAN Jobs
(continued)
4. Select Full Backup in the Backup Type section. Select Online Backup in the
Backup Mode section. Deselect “Also back up all archived logs on disk” in the
Advanced section. Select “Delete obsolete backups” in the Advanced section.
Click Next.

Oracle Internal & Oracle Academy Use Only


5. On the “Schedule Customized Backup: Settings” page, select Disk. Click Next.
6. Accept the default values on the “Schedule Customized Backup: Schedule” page.
Click Next.

Oracle Database 10g: Backup and Recovery B-101


Solutions for Practice 9-2: Use Enterprise Manager to Monitor RMAN Jobs
(continued)
7. Click Submit Job.

Oracle Internal & Oracle Academy Use Only


8. Click View Job.
9. Information about the job is displayed. Click the links in the Logs section to view
additional information.

Oracle Database 10g: Backup and Recovery B-102


Solutions for Practice 9-2: Use Enterprise Manager to Monitor RMAN Jobs
(continued)
10. You can view detailed information about each job step. Click the “Job Run” link
to return to the Job page.

Oracle Internal & Oracle Academy Use Only


11. Click the Database tab to return to the home page.

Oracle Database 10g: Backup and Recovery B-103


Practice Solutions for Lesson 10

There are no practices for Lesson 10.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-104


Practice Solutions for Lesson 11

In this practice, you perform the following tasks:


• Create your Oracle Secure Backup home directory.
• Install the Oracle Secure Backup software.
• Configure virtual test devices.
• View information about the configured devices.
• Connect to the EM Database Console application using your browser.
• Register your administrative server with EM.
• Insert four volumes into the tape library.
• Test connectivity to the tape drive.
• Define a new Oracle Secure Backup user.
• Configure preauthorization for this user.

Oracle Internal & Oracle Academy Use Only


THE VIRTUAL TEST DEVICES USED IN THIS LAB ARE FOR TRAINING
PURPOSES ONLY. THEY ARE NOT SUPPORTED FOR PRODUCTION USE.

Oracle Database 10g: Backup and Recovery B-105


Solutions for Practice 11-1: Install Oracle Secure Backup
In this practice, you perform the following tasks:
• Create your Oracle Secure Backup home directory.
• Install the Oracle Secure Backup software.
Unless specified otherwise during this practice, you should log in as the oracle user to
your terminal emulator session.

Use the following information to install the software:


• The Oracle Secure Backup software is staged on your server in the
/stage/osb/osb_10_1cdrom directory.
• Your Oracle Secure Backup home directory is
/usr/local/oracle/backup.
• During installation, you configure only the local machine as an administrative
server with no attached devices.

Oracle Internal & Oracle Academy Use Only


1) Log in as the root user and create /usr/local/oracle/backup as your
Oracle Secure Backup home directory. Change to that directory.
Answer:
[oracle@edrsr4p1 oracle]$ su
Password: oracle <<password not echoed >>
[root@edrsr4p1 oracle]# mkdir -p /usr/local/oracle/backup
[root@edrsr4p1 oracle]# cd /usr/local/oracle/backup
[root@edrsr4p1 backup]#

2) Continue as the root user. Start the installation of Oracle Secure Backup from the
staging directory. Begin with the setup program.
Answer:
Note: The output has been slightly formatted to reduce the number of space lines.
[root@edrsr4p1 backup]# /stage/osb/osb_10_1cdrom/setup
Welcome to Oracle's setup program for Oracle Secure
Backup. This program loads Oracle Secure Backup software
from the CD-ROM to a filesystem directory of your
choosing.

This CD-ROM contains Oracle Secure Backup version


10.1.060420.

Please wait a moment while I learn about this host...


done.

- - - - - - - - - - - - - - - - - - - -
You may load any of the following Oracle Secure Backup
packages:
1. linux32 (RH 2.1, RHEL 3, RHEL 4, SuSE 8, SuSE 9)
administrative server, media server, client
2. solaris64 (Solaris 2.8 and later, SPARC)
administrative server, media server, client

Oracle Database 10g: Backup and Recovery B-106


Solutions for Practice 11-1: Install Oracle Secure Backup
(continued)
Enter a space-separated list of packages you'd like to
load. To load all packages, enter 'all' [1]: 1

- - - - - - - - - - - - - - - - - - - -
Loading Oracle Secure Backup installation tools... done.
Loading linux32 administrative server, media server,
client... done.

- - - - - - - - - - - - - - - - - - - -
Loading of Oracle Secure Backup software from CD-ROM is
complete.
You may unmount and remove the CD-ROM.

Oracle Internal & Oracle Academy Use Only


Would you like to continue Oracle Secure Backup
installation with 'installob' now? (The Oracle Secure
Backup Installation Guide contains complete information
about installob.)
Please answer 'yes' or 'no' [yes]: yes

- - - - - - - - - - - - - - - - - - - -

Welcome to installob, Oracle Secure Backup's UNIX


installation program.

It installs Oracle Secure Backup onto one or more UNIX,


Linux, or other supported open-source systems on your
network. (Install Oracle Secure Backup for Windows using
the CD-ROM from which you loaded this software.)

For most questions, a default answer appears enclosed in


square brackets.
Press Enter to select this answer.

Please wait a few seconds while I learn about this


machine... done.

Have you already reviewed and customize


install/obparameters for your Oracle Secure Backup
installation [yes]? no
Would you like to do this now [yes]? no
- - - - - - - - - - - - - - - - - - - -

You can choose to install Oracle Secure Backup in one of


two ways:
(a) interactively, by answering questions asked by
this program, or
(b) in batch mode, by preparing a network description
file

Oracle Database 10g: Backup and Recovery B-107


Solutions for Practice 11-1: Install Oracle Secure Backup
(continued)
Use interactive mode to install Oracle Secure Backup on a
small number of hosts. Use batch mode to install Oracle
Secure Backup on any number of hosts.

Which installation method would you like to use (a or b)


[a]? a

- - - - - - - - - - - - - - - - - - - -

Oracle Secure Backup is not yet installed on this machine.

Oracle Secure Backup's Web server has been loaded, but is


not yet configured.

Oracle Internal & Oracle Academy Use Only


You can install this host one of three ways:
(a) administrative server
(the host will also be able to act as a media
server or client)
(b) media server
(the host will also be able to act as a client)
(c) client

If you are not sure which way to install, please refer to


the Oracle
Secure Backup Installation Guide. (a,b or c) [a]? a

Beginning the installation. This will take just a minute


and will produce several lines of informational output.

Installing Oracle Secure Backup on edrsr4p1 (Linux version


2.4.21-20.EL)

You must now enter a password for the Oracle Secure Backup
'admin' user.
Oracle suggests you choose a password of at least 8
characters in length,
containing a mixture of alphabetic and numeric characters.

Please enter the admin password: oracle <<not echoed>>


Re-type password for verification: oracle <<not echoed>>

generating links for admin installation with Web


server
updating /etc/ld.so.conf
checking Oracle Secure Backup's configuration file
(/etc/obconfig)
setting Oracle Secure Backup directory to
/usr/local/oracle/backup in /etc/obconfig
setting local database directory to /usr/etc/ob in
/etc/obconfig
setting temp directory to /usr/tmp in /etc/obconfig

Oracle Database 10g: Backup and Recovery B-108


Solutions for Practice 11-1: Install Oracle Secure Backup
(continued)
setting administrative directory to
/usr/local/oracle/backup/admin in /etc/obconfig
protecting the Oracle Secure Backup directory
removing /etc/rc.d/init.d/qrserviced
creating /etc/rc.d/init.d/observiced
activating observiced via chkconfig
initializing the administrative domain
creating default oracle user

Is edrsr4p1 connected to any tape libraries that you'd


like to use with Oracle Secure Backup [no]? no

Is edrsr4p1 connected to any tape drives that you'd like

Oracle Internal & Oracle Academy Use Only


to use with Oracle Secure Backup [no]? no

- - - - - - - - - - - - - - - - - - - -

Would you like to install Oracle Secure Backup on any


other machine [yes]? no
Installation summary:

Installation Host OS Driver OS Move Reboot


Mode Name Name Installed? Required? Required?

admin edrsr4p1 Linux no no no

Oracle Secure Backup is now ready for your use.

[root@edrsr4p1 backup]# exit


exit
[oracle@edrsr4p1 oracle}$

Oracle Database 10g: Backup and Recovery B-109


Solutions for Practice 11-2: Configure Devices for Oracle Secure
Backup
In this practice, you perform the following tasks:
• Configure a virtual test library and a virtual test drive.
• View information about the configured devices and the default media family via
the obtool interface.
1) In a terminal window, navigate to the /home/oracle/labs directory and execute
the ./lab_11_02_01.sh script to configure the vlib tape library directly attached
to your administrative server.
Answer:
[oracle@edrsr4p1 oracle]$ cd /home/oracle/labs
[oracle@edrsr4p1 labs]$ ./lab_11_02_01.sh

Oracle Internal & Oracle Academy Use Only


edrsr4p1
************************************************
Creating a library
************************************************
Info: added "mediaserver" role to host edrsr4p1.
[oracle@edrsr4p1 labs]$

2) In the /home/oracle/labs directory, execute the ./lab_11_02_02.sh script to


configure the vt tape drive for the library:
Answer:
[oracle@edrsr4p1 labs]$ ./lab_11_02_02.sh
edrsr4p1
************************************************
Creating a tape drive in the library
************************************************
[oracle@edrsr4p1 labs]$

3) Start the obtool as the admin user with the oracle password, and view the
currently configured devices.
(Hint: Use the lsdev command.)
Answer:
[oracle@edrsr4p1 labs]$ obtool
Oracle Secure Backup 10.1.0
login: admin
Password:oracle <<Password not echoed >>
ob> lsdev
library vlib in service
drive 1 vt in service

Note: If you receive the following, “Warning: auto-login failed – login


token has expired”, ignore it. It means that you have to enter the login username
and password as shown above. If you are within the time period of your login token,
you do not have to enter username and password.
4) View the RMAN-DEFAULT media family.

Oracle Database 10g: Backup and Recovery B-110


Solutions for Practice 11-2: Configure Devices for Oracle Secure Backup
(continued)
(Hint: Use the lsmf --long command, , and use the quit command to exit.)
Answer:
ob> lsmf --long
RMAN-DEFAULT:
Keep volume set: content manages reuse
Appendable: yes
Volume ID used: unique to this media family
Comment: Default RMAN backup media family
ob> quit
[oracle@edrsr4p1 oracle]$

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-111


Solutions for Practice 11-3: Register the Administrative Server
In this practice, you perform the following tasks:
• Connect to the EM Database Console application using your browser.
• Register your administrative server with EM.
• Insert four volumes into the virtual test library.
• Test connectivity to the virtual test drive.
Unless specified otherwise, you should log in as the oracle user to your terminal
emulator session, and as SYSDBA to your Database Control console and SQL*Plus
sessions.
1) With your browser, connect to Enterprise Manager Database Control using the IP
address or machine name for your host.
Answer:
1. Open your browser application.

Oracle Internal & Oracle Academy Use Only


2. Enter the URL, http://<machine name>:1158/em. You can use either the
name of your PC or its IP address. You can retrieve the host name for your
computer by calling the <OSB_Home>/bin/hostinfo script.
[oracle@edrsr4p1 labs]$
/usr/local/oracle/backup/bin/hostinfo
edrsr4p1.us.oracle.com

3. On the Database Login page, enter SYS as User Name, oracle as Password,
select SYSDBA from the Connect As drop-down list, and then click Login.

4. Because this is the first time you are connecting to EM Database Control as the
SYS user, the Oracle Database 10g Licensing Information page is displayed. At
the bottom of the page, click the “I agree” button.
2) In Enterprise Manager, register your administrative server.

Oracle Database 10g: Backup and Recovery B-112


Solutions for Practice 11-3: Register the Administrative Server (continued)
Answer:
1. On your Database home page, click the Maintenance tab.
2. On the Maintenance tabbed page, click the “Oracle Secure Backup Device and
Media” link in the Oracle Secure Backup section.
3. On the Add Administrative Server page, enter /usr/local/oracle/backup in
the Oracle Secure Backup Home field. Then, make sure that admin is set in the
Username field, enter oracle in the Password field, and then click the OK
button. (Click No, if the Password Manager offers to remember the password.)

Oracle Internal & Oracle Academy Use Only


4. On the Host Credentials page, enter oracle for both the Username and
Password fields. Select the “Save as Preferred Credential” check box. Then, click
the OK button. After clicking OK, the Administrative Server page is displayed.

3) Use Enterprise Manager to insert four volumes into the vlib test library. (An
unlabeled tape is synonymous with a blank tape within Oracle Secure Backup.)
Answer:
1. On the Administrative Server page, click the Manage link corresponding to the
Devices field.

Oracle Database 10g: Backup and Recovery B-113


Solutions for Practice 11-3: Register the Administrative Server (continued)

Oracle Internal & Oracle Academy Use Only


2. On the Devices page, the vlib virtual test library should be automatically
selected. In the Actions drop-down list, select the “Insert Volume” value. Then,
click Go.

3. On the Device Action: insertvol page, make sure that the “This is an unlabeled
tape” option is selected for Source, and for Destination, enter 1-4 in Storage
Element.

Oracle Database 10g: Backup and Recovery B-114


Solutions for Practice 11-3: Register the Administrative Server (continued)

Oracle Internal & Oracle Academy Use Only


4. Scroll down to the bottom of the page and click OK. The Processing page appears
for a short period of time.

5. When returned to the Devices page, click the plus sign (+) to the left of vlib to
see your device.

Oracle Database 10g: Backup and Recovery B-115


Solutions for Practice 11-3: Register the Administrative Server (continued)

Oracle Internal & Oracle Academy Use Only


4) Before taking any backups, you want to make sure you can access your tape drives.
On the Devices page, test the virtual tape drive access.
Answer:
1. Select “Verify Connectivity” from the list of Actions, and click Go.

2. An informational message regarding the accessibility of the selected device is


displayed.

Oracle Database 10g: Backup and Recovery B-116


Solutions for Practice 11-3: Register the Administrative Server (continued)

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-117


Solutions for Practice 11-4: Configure Oracle Secure Backup
User
In this practice, you perform the following tasks:
• Define a new Oracle Secure Backup user.
• Configure preauthorization for this user.
Unless specified otherwise, you should log on as the oracle user to your terminal
emulator session and as SYSDBA to your EM Database Control Console session.
If you are already in Enterprise Manager, you can use shortcuts, such as clicking the
Administrative Server link in the upper-left part of the Devices page. Then if you right-
click the “File System Backup and Restore” link (at the bottom of the page) and select the
“Open Link in New Window” or “Open Link in New Tab” option, you can have two
windows open, one for Enterprise Manager and the other for the Oracle Secure Backup
Web tool.

Oracle Internal & Oracle Academy Use Only


1) Use the Oracle Secure Backup Web tool to create the oracle Oracle Secure Backup
user with the following values: User oracle, Password: oracle, User class:
oracle, UNIX name: oracle, UNIX group: dba and NDMP server user: no.
Note: If you have an NDMP server, set the value to “yes”; but inside the regular
classrooms, an NDMP server is not available, so set the value to “no.”
Answer:
1. On your Database home page, click the Maintenance tab.
2. On the Maintenance tabbed page, click the “File System Backup and Restore”
link in the Oracle Secure Backup section.
3. If you receive the warning “Website Certified by an Unknown Authority”, accept
this certificate permanently and click OK in any security pop-up window.
4. You are now redirected to the Oracle Secure Backup Web tool application. On the
Oracle Secure Backup Login page, enter admin as User Name, oracle as
Password, and click Login.

Oracle Database 10g: Backup and Recovery B-118


Solutions for Practice 11-4: Configure Oracle Secure Backup User
(continued)
5. On the Oracle Secure Backup home page, click the Configure tab.

Oracle Internal & Oracle Academy Use Only


6. On the Configure page, click the Users link in the Basic section.

7. Click the Add button.

8. On the New Users page, enter or select the following values: User: oracle,
Password: oracle, User class: oracle, UNIX name: oracle, UNIX group:
dba, and NDMP server user: no. Click Apply.

Oracle Database 10g: Backup and Recovery B-119


Solutions for Practice 11-4: Configure Oracle Secure Backup User
(continued)

Oracle Internal & Oracle Academy Use Only


9. View the success message. The oracle user is created and the page is in edit
mode.

2) Configure the oracle Oracle Secure Backup user as a preauthorized RMAN and
command-line user with the following values: Hosts: all hosts, OS username: *,
Windows domain name: *, and Attributes: cmdline and rman.
Best Practice Tip: Limit preauthorized access to selected hosts.
Answer:
1. Click the Preauthorized Access button.

Oracle Database 10g: Backup and Recovery B-120


Solutions for Practice 11-4: Configure Oracle Secure Backup User
(continued)
2. On the Preauthorized Access page, select or enter the following values: Hosts: all
hosts, OS username: *, Windows domain name: *, and Attributes: cmdline and
rman. Click Add.

Oracle Internal & Oracle Academy Use Only


3. View the success message.

Oracle Database 10g: Backup and Recovery B-121


Practice Solutions for Lesson 12

In this practice, you perform the following tasks:


• Create a database backup storage selector for your database.
• Perform a backup of your Oracle database with the Oracle-Suggested Backup
strategy.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-122


Solutions for Practice 12-1: Create a Database Backup Storage
Selector
In this practice, you perform the following tasks:
• In SQL*Plus, verify that the database is in ARCHIVELOG mode.
• In Enterprise Manager, create a database backup storage selector for your Oracle
database.
• In Enterprise Manager, perform a test backup to verify that the Oracle Secure
Backup configuration is correct.
Unless specified otherwise, you should log on as the oracle user to your terminal
emulator session, and as SYSDBA to your Database Control Console and SQL*Plus
sessions.
1) First, verify that the database is in ARCHIVELOG mode. If your database is in
ARCHIVELOG mode, continue with the next step. If not, shut down the database,

Oracle Internal & Oracle Academy Use Only


enable archiving, and then restart the database.
Answer:
$ sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Wed May 10


13:51:01 2006

Copyright (c) 1982, 2005, Oracle. All rights reserved.

SQL> connect / as sysdba


Connected.
SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 9
Current log sequence 11
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 285212672 bytes


Fixed Size 1218992 bytes
Variable Size 100664912 bytes
Database Buffers 180355-72 bytes
Redo Buffers 2973696 bytes
Database mounted.
SQL> alter database archivelog;
Database altered.

SQL> alter database open;


Database altered.

Oracle Database 10g: Backup and Recovery B-123


Solutions for Practice 12-1: Create a Database Backup Storage Selector
(continued)
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 9
Next log sequence to archive 11
Current log sequence 11
SQL>
2) In Enterprise Manager, create a backup selector for your database with the following
specifications:
• Tape Drives: 1
• Host Credentials Username: oracle, Password: oracle, and “Save as

Oracle Internal & Oracle Academy Use Only


Preferred Credential”
• Database Backup Types: Archive log, Auto Backup, Full, and Incremental
Answer:
1. On your Database home page, click the Maintenance tab.
2. Under Backup/Recovery Settings, click Backup Settings.
3. On the Backup Settings page, enter 1 for Tape Drives in the Tape Settings
section.
4. Under Host Credentials, enter oracle as Username and Password. If these fields
are already filled in, make sure the supplied values are correct. Select “Save as
Preferred Credential,” and click OK.

Oracle Database 10g: Backup and Recovery B-124


Solutions for Practice 12-1: Create a Database Backup Storage Selector
(continued)
5. Reenter the Backup Settings page and click Configure in the Oracle Secure
Backup section.

6. On the Administrative Server Login page, make sure that your Administration
Server is selected from the list. Enter oracle/oracle for the host username
and password. If these fields are already filled in, make sure the supplied values
are correct. Select “Save as Preferred Credential” and click OK.

Oracle Internal & Oracle Academy Use Only


7. On the Backup Storage Selectors page, click Add to configure a Backup Storage
Selector for your database.

8. On the Add Backup Storage Selector page, under the heading “For These Types
of Backups,” select all check boxes (for Archive Logs, Auto Backup, Full, and
Incremental database backup types). Then, click OK.

Oracle Database 10g: Backup and Recovery B-125


Solutions for Practice 12-1: Create a Database Backup Storage Selector
(continued)

Oracle Internal & Oracle Academy Use Only


9. Your Backup Storage Selector has been created and is now displayed. Click
Return.

You return to the Backup Settings page.

Oracle Database 10g: Backup and Recovery B-126


Solutions for Practice 12-1: Create a Database Backup Storage Selector
(continued)
3) Test your tape backup.
Answer:
1. On the Backup Settings page, scroll down to see that the administrative server is
set. Make sure that your Host Credentials are correct, and then click “Test Tape
Backup” in the Tape Settings section in the middle of the page.

Oracle Internal & Oracle Academy Use Only

2. The progress window appears.


3. When your tape drive test is successful, click the Database Instance link to return
to the Maintenance page.

Oracle Database 10g: Backup and Recovery B-127


Solutions for Practice 12-1: Create a Database Backup Storage Selector
(continued)

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-128


Solutions for Practice 12-2: Perform Oracle-Suggested Backup
In Enterprise Manager, perform Oracle-Suggested Backup.
Unless specified otherwise, you should log on as the oracle user to your terminal emulator
session, and as SYSDBA to your Database Control Console and SQL*Plus sessions.
1) In Enterprise Manager, schedule Oracle-Suggested Backup with the following
specifications:
• Backup destination: both disk and tape
• Daily backup of archivelogs and incremental backup
• Tape Drives: 1
• Schedule daily backup within 5 minutes of your current date and time
Answer:
1. On the Database home page, click the Maintenance link.

Oracle Internal & Oracle Academy Use Only


2. On the Maintenance page, click the Schedule Backup link.
3. On the Schedule Backup page, make sure your Host Credentials are set correctly.
Then click the Schedule Oracle-Suggested Backup button

4. On the “Schedule Oracle-Suggested Backup: Destination” page, select “Both Disk


and Tape” and click Next.

Oracle Database 10g: Backup and Recovery B-129


Solutions for Practice 12-2: Perform Oracle-Suggested Backup (continued)

Oracle Internal & Oracle Academy Use Only


5. On the “Schedule Oracle-Suggested Backup: Setup” page, select “Archivelogs
and the Incremental Backup”, enter 1 for Tape Drives and click Next.

6. On the “Schedule Oracle-Suggested Backup: Schedule” page, select the daily


backup to run within 5 minutes of your current date and time, and then click Next.

Oracle Database 10g: Backup and Recovery B-130


Solutions for Practice 12-2: Perform Oracle-Suggested Backup (continued)

Oracle Internal & Oracle Academy Use Only


This specification first initiates a disk backup to the Flash Recovery Area, and then
the backup will be written to tape.
7. On the “Schedule Oracle-Suggested Backup: Review” page, review both the
Settings and RMAN Scripts and click Submit Job.

Oracle Database 10g: Backup and Recovery B-131


Solutions for Practice 12-2: Perform Oracle-Suggested Backup (continued)

Oracle Internal & Oracle Academy Use Only


8. You should see that the job has been successfully submitted.

2) Review your backup job. If this is your first scheduled backup, you should see a full
backup (otherwise an incremental one) first to the Flash Recovery Area, and then to
tape. Review the RMAN command, as well as the job execution.

Oracle Database 10g: Backup and Recovery B-132


Solutions for Practice 12-2: Perform Oracle-Suggested Backup (continued)
Answer:
1. At your specified backup time, click View Job.

Oracle Internal & Oracle Academy Use Only


The Job Execution page is displayed. The content of this screenshot may be different
from yours, due to different timing and previous tasks.
2. Click the Backup link under the Logs section. In the Output log, review how the
RMAN command allocates the disk and tape devices.

Oracle Database 10g: Backup and Recovery B-133


Solutions for Practice 12-2: Perform Oracle-Suggested Backup (continued)

Oracle Internal & Oracle Academy Use Only


3. Scroll down to review the execution of these commands.

This screenshot shows you the switch from disk to tape.


4. If you are interested only in a summary of the backup activities, you can select:
EM Maintenance > Backup Reports. Scroll down to see the Result area.

Oracle Database 10g: Backup and Recovery B-134


Solutions for Practice 12-2: Perform Oracle-Suggested Backup (continued)

Oracle Internal & Oracle Academy Use Only


Your screenshot will look different, but it should show both DISK and SBT_TAPE
under “Output Devices.”
3) Optionally, to reinforce this practice topic, you can view the
Oracle_Suggested_Strategy_viewlet_swf.html viewlet in the
/home/oracle/solutions/viewlets directory.
Answer:
1. Click the oracle’s Home icon on your desktop.
2. Navigate to the /home/oracle/solutions/viewlets directory.

3. Double-click the Oracle_Suggested_Strategy_viewlet_swf.html file


and view the presentation.

Oracle Database 10g: Backup and Recovery B-135


Solutions for Practice 12-2: Perform Oracle-Suggested Backup (continued)
4. When you have finished viewing the presentation, close your Web browser
window.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-136


Practice Solutions for Lesson 13

In this practice, you perform the following tasks:


• Create a dataset for a file-system backup.
• Schedule a backup of the dataset.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-137


Solutions for Practice 13-1: Back Up Your File System with
Oracle Secure Backup
Use the Oracle Secure Backup Web tool, which can be accessed from Enterprise
Manager for the tasks in this practice session.
Unless specified otherwise, access Enterprise Manager as SYDBA and the Oracle Secure
Backup Web tool as admin user. Both use oracle as password.
1) Create a new dataset called mylabs that you will use to back up your $HOME/labs
directory. The dataset should be of the form:
include host <hostname> {
include path /home/oracle/labs
}
Make sure that you replace <hostname> with the machine name of your student

Oracle Internal & Oracle Academy Use Only


computer.
Note: Do not back up the local root directory.
Answer:
1. From your Database home page, click the Maintenance tab.
2. On the Maintenance tabbed page, click the File System Backup and Restore link
in the Oracle Secure Backup section.
3. If you receive the warning “Website Certified by an Unknown Authority,” accept
this certificate permanently and click OK in any security pop-up window.
4. You are now redirected to the Oracle Secure Backup Web tool application. On the
Oracle Secure Backup Login page, enter admin as User Name and oracle as
Password, and click Login.
5. On the Oracle Secure Backup Web tool home page, click the Backup tab.
6. On the Backup page, click the Datasets link in the Settings section.

7. On the Datasets page, click Add.

Oracle Database 10g: Backup and Recovery B-138


Solutions for Practice 13-1: Back Up Your File System with Oracle Secure
Backup (continued)

8. On the New Datasets page, set the Name field to mylabs, and replace the given
template with the following:

Oracle Internal & Oracle Academy Use Only


include host <hostname> {
include path /home/oracle/labs
}

Make sure that you replace <hostname> with the machine name of your student
computer.
To not back up the local root directory, place comment signs (#) before the
relevant lines, or delete these lines.

9. After this is done, click Save.

Oracle Database 10g: Backup and Recovery B-139


Solutions for Practice 13-1: Back Up Your File System with Oracle Secure
Backup (continued)
10. Verify that the dataset was created successfully. On the Datasets page, select
mylabs, and click Check Dataset.

Oracle Internal & Oracle Academy Use Only


11. On the Dataset Errors page, you see that there were no errors. If there are any
errors, resolve them; then click Close.

2) Create a backup with your mylabs dataset. The backup should run immediately.
Answer:
1. On the Backup: Datasets page, click Backup Now on the bottom of the page.
2. On the Backup Now page, click the Add button.

3. On the Backup: Backup Now > Options page, select the mylabs dataset and
click OK.

Oracle Database 10g: Backup and Recovery B-140


Solutions for Practice 13-1: Back Up Your File System with Oracle Secure
Backup (continued)

Oracle Internal & Oracle Academy Use Only


4. When returned to the Backup Now page, select the mylabs dataset and click Go
to submit the job to the scheduler.

5. Review the result.

Oracle Secure Backup submits the backup request and assigns a job number.
3) View Oracle Secure Backup job information. Query the Manage: Jobs page for the
previously created and executed job.
Answer:
1. Click the Manage tab.
2. On the Manage page, click Jobs.

Oracle Database 10g: Backup and Recovery B-141


Solutions for Practice 13-1: Back Up Your File System with Oracle Secure
Backup (continued)

3. On the Jobs page, restrict the display to only Active, Complete, or Pending jobs
by selecting those options. In the Types box, select backup, then hold the [Ctrl]
key and select dataset and Oracle backup. Click Apply.

Oracle Internal & Oracle Academy Use Only


4. The updated display now shows the recent dataset backup as well as the previous
RMAN backup jobs. Click the Manage link to return to the Manage page.

Oracle Database 10g: Backup and Recovery B-142


Solutions for Practice 13-1: Back Up Your File System with Oracle Secure
Backup (continued)

Oracle Internal & Oracle Academy Use Only


4) Optionally, to reinforce this practice topic, you can view the
Scheduling_filesystem_backups_viewlet_swf.html viewlet in the
/home/oracle/solutions/viewlets directory.
Answer:
1. Click the oracle’s Home icon on your desktop.
2. Navigate to the /home/oracle/solutions/viewlets directory.
3. Double-click the Scheduling_filesystem_backups_viewlet_swf.html
file and view the presentation.
When you have finished viewing the presentation, close your Web browser window.

Oracle Database 10g: Backup and Recovery B-143


Practice Solutions for Lesson 14

In this practice, you perform the following tasks:


• Delete the contents of your labs directory.
• Restore the missing lab files.
• Verify that the files are recovered.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-144


Solutions for Practice 14-1: Restore File-System Data with
Oracle Secure Backup
In this practice, you first delete your lab files and then restore them from the backup
created in the previous practice.
Unless specified otherwise, you should log on as the oracle user to your terminal
emulator session, and as SYSDBA to your Database Control Console session.
For tasks 2 to 5, log in as admin user (with the oracle password) into the Oracle
Secure Backup Web tool, which can be accessed from Enterprise Manager.
1) From your terminal emulator session, remove all the files located in your
$HOME/labs directory.
Answer:
[oracle@edrsr4p1 labs]$ ls /home/oracle/labs

Oracle Internal & Oracle Academy Use Only


lab_04_01_02_01.sh lab_05_03_06_01.sql lab_07_01_12_01.sql
lab_04_02_02_01.sh lab_05_04_01_01.sql lab_07_01_13_02.sql
lab_04_03_02_01.sh lab_05_04_03_01.sql lab_07_01_14_02.sql
lab_05_02_03_02.sql lab_05_04_04_01.sql lab_09_01_04_01.sql
lab_05_02_04_01.sql lab_05_04_07_02.sql lab_11_02_01_in.sh
lab_05_02_05_01.sql lab_07_01_01_01.sh lab_11_02_01_out.sh
lab_05_02_07_01.sql lab_07_01_02_02.sql lab_11_02_01.sh
lab_05_03_01_01.sql lab_07_01_03_01.sh lab_11_02_02_in.sh
lab_05_03_02_01.sql lab_07_01_07_01.sql lab_11_02_02_out.sh
lab_05_03_03_01.sql lab_07_01_08_01.sql lab_11_02_02.sh
lab_05_03_04_01.sql lab_07_01_09_01.sql
[oracle@edrsr4p1 labs]$ mkdir
/home/oracle/solutions/labs_save
[oracle@edrsr4p1 labs]$ cp /home/oracle/labs/*
/home/oracle/solutions/labs_save
[oracle@edrsr4p1 labs]$ rm -f /home/oracle/labs/*
[oracle@edrsr4p1 labs]$ ls /home/oracle/labs
[oracle@edrsr4p1 labs]$

2) Restore your $HOME/labs directory contents by selecting the appropriate backup


from the Oracle Secure Backup catalog. Use the Browse Host button to locate the
desired backup.
Answer:
1. In the Oracle Secure Backup Web tool, click the Restore tab.
2. On the Restore page, click Backup Catalog.

Oracle Database 10g: Backup and Recovery B-145


Solutions for Practice 14-1: Restore File-System Data with Oracle Secure
Backup (continued)
3. On the Backup Catalog page, select your <Host Name> and latest, then
click Browse Host.

Oracle Internal & Oracle Academy Use Only


4. On the Browse Host page, click the link labeled home to view its contents.

5. Continue drilling down until you reach the labs directory. Select this directory,
and then click Add.

Oracle Database 10g: Backup and Recovery B-146


Solutions for Practice 14-1: Restore File-System Data with Oracle Secure
Backup (continued)
6. On the New Restore page, accept the default settings and click OK.

Oracle Internal & Oracle Academy Use Only


7. On the Backup Catalog page, click “Show restore list and browse options” to
view the items to be restored and the selection options for that data.

8. After viewing the information, click Go to submit the restore request to the
scheduler.

Oracle Database 10g: Backup and Recovery B-147


Solutions for Practice 14-1: Restore File-System Data with Oracle Secure
Backup (continued)

Oracle Internal & Oracle Academy Use Only


9. A message is displayed at the top of the screen to verify that the request was
submitted and to show the name of the created restore job.

3) Monitor the progress of the restore request.


Answer:
1. Click the Manage tab.
2. On the Manage page, click Jobs.
3. On the Jobs page, select Active, Complete, and Pending for the Viewing options,
and then select restore from the Types list. Click Apply.

4. Review the displayed job and verify that your restore job was successful.

Oracle Database 10g: Backup and Recovery B-148


Solutions for Practice 14-1: Restore File-System Data with Oracle Secure
Backup (continued)

Oracle Internal & Oracle Academy Use Only


4) In a terminal window, verify that your lab files are present.
Answer:
[oracle@edrsr4p1 labs]$ ls
lab_04_01_02_01.sh lab_05_03_06_01.sql lab_07_01_12_01.sql
lab_04_02_02_01.sh lab_05_04_01_01.sql lab_07_01_13_02.sql
lab_04_03_02_01.sh lab_05_04_03_01.sql lab_07_01_14_02.sql
lab_05_02_03_02.sql lab_05_04_04_01.sql lab_09_01_04_01.sql
lab_05_02_04_01.sql lab_05_04_07_02.sql lab_11_02_01_in.sh
lab_05_02_05_01.sql lab_07_01_01_01.sh lab_11_02_01_out.sh
lab_05_02_07_01.sql lab_07_01_02_02.sql lab_11_02_01.sh
lab_05_03_01_01.sql lab_07_01_03_01.sh lab_11_02_02_in.sh
lab_05_03_02_01.sql lab_07_01_07_01.sql lab_11_02_02_out.sh
lab_05_03_03_01.sql lab_07_01_08_01.sql lab_11_02_02.sh
lab_05_03_04_01.sql lab_07_01_09_01.sql
[oracle@edrsr4p1 labs]$

Oracle Database 10g: Backup and Recovery B-149


Practice Solutions for Lesson 15

In this practice, you perform the following tasks:


• Create an encrypted backup.
• Recover a tablespace from an encrypted backup.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-150


Solutions for Practice 15-1: Create an Encrypted Backup
In this practice, you perform the following tasks:
• Schedule a customized tape backup of the whole database.
• Edit the RMAN script to encrypt the backup using a password.
• After the backup operation completes, verify that the backup was encrypted.

Unless specified otherwise, you should log in as SYS user (with the oracle password)
and connect as SYSDBA to Enterprise Manager Database Control.
1) In Enterprise Manager, schedule a customized tape backup of the whole database
with the following specifications: full online backup with archive logs to tape. Start
the backup immediately.
Answer:
1. On your Database home page, click the Maintenance tab.

Oracle Internal & Oracle Academy Use Only


2. On the Maintenance tabbed page, click the “Schedule Backup” link in the
Backup/Recovery section.

3. If you completed the task to perform an Oracle Suggested backup, then you see
the following information:

4. Accept “Whole Database” under the Customized Backup section and click
Schedule Customized Backup.

Oracle Database 10g: Backup and Recovery B-151


Solutions for Practice 15-1: Create an Encrypted Backup (continued)

Oracle Internal & Oracle Academy Use Only


5. Retain the default values of the backup options: full, online backup with archive
logs and click Next.

6. Select the Tape setting and click Next.

Oracle Database 10g: Backup and Recovery B-152


Solutions for Practice 15-1: Create an Encrypted Backup (continued)

Oracle Internal & Oracle Academy Use Only


7. Make sure the Start Immediately option is selected, and then click Next.

2) Edit the RMAN script and include the command to encrypt the backup, specifying
demo as the password. The command syntax is:

SET ENCRYPTION ON IDENTIFIED BY demo ONLY;


Then submit the backup job.

Answer:
1. On the “Schedule Customized Backup: Review” page, click Edit RMAN Script.

Oracle Database 10g: Backup and Recovery B-153


Solutions for Practice 15-1: Create an Encrypted Backup (continued)

Oracle Internal & Oracle Academy Use Only


2. Enter SET ENCRYPTION ON IDENTIFIED BY demo ONLY; at the top of
the RMAN script, and then click Submit Job.

Note: Specifying “ONLY” in the command means decryption will require the demo
password, and no other encryption keys will exist for this backup.
3) Check the backup job status. Verify that the RMAN SET ENCRYPTION command is
successfully executed.
Answer:
1. Click View Job.

Oracle Database 10g: Backup and Recovery B-154


Solutions for Practice 15-1: Create an Encrypted Backup (continued)

2. Click the Backup link in the Name column of the table under the Logs section.

Oracle Internal & Oracle Academy Use Only


3. Notice the successful execution of the RMAN SET ENCRYPTION command.

Oracle Database 10g: Backup and Recovery B-155


Solutions for Practice 15-1: Create an Encrypted Backup (continued)

Oracle Internal & Oracle Academy Use Only


4) Verify the successful completion of your backup.
Answer:
Refresh the browser page until the backup completes.

5) Optionally, to reinforce this practice topic, you can view the


Backup_Encryption_viewlet_swf.html viewlet the
/home/oracle/solutions/viewlets directory.
Answer:
1. Click the oracle’s Home icon on your desktop.
2. Navigate to the /home/oracle/solutions/viewlets directory.

Oracle Database 10g: Backup and Recovery B-156


Solutions for Practice 15-1: Create an Encrypted Backup (continued)
3. Double-click the Backup_Encryption_viewlet_swf.html file and view the
presentation.
When you have finished viewing the presentation, close your Web browser window.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-157


Solutions for Practice 15-2: Recover a Tablespace from an
Encrypted Backup
In this practice, you perform the following tasks:
• Perform a tablespace recovery using the encrypted backup.
• Troubleshoot the recovery process.
• Edit the RMAN script to decrypt the backup.

Unless specified otherwise, you should log in as SYS user (with the oracle password)
and connect as SYSDBA to Enterprise Manager Database Control.
1) In Enterprise Manager, perform an object-level recovery of the EXAMPLE tablespace
to the current time or a previous point in time. Restore the files to the default location.
Answer:

Oracle Internal & Oracle Academy Use Only


1. On your Database home page, click the Maintenance tab.
2. On the Maintenance tabbed page, click the “Perform Recovery” link in the
Backup/Recovery section.

3. Select Tablespaces from the Object Type list, ensure that your Host Credentials
are correct, and click Perform Object Level Recovery.

Oracle Database 10g: Backup and Recovery B-158


Solutions for Practice 15-2: Recover a Tablespace from an Encrypted
Backup (continued)

Oracle Internal & Oracle Academy Use Only


4. Retain the default values for point-in-time recovery and click Next.

5. Click Add.

Oracle Database 10g: Backup and Recovery B-159


Solutions for Practice 15-2: Recover a Tablespace from an Encrypted
Backup (continued)

6. Select the EXAMPLE tablespace, and click the Select button.

Oracle Internal & Oracle Academy Use Only


7. Click Next.

8. Accept the “No. Restore the files to the default location” option and click Next.

Oracle Database 10g: Backup and Recovery B-160


Solutions for Practice 15-2: Recover a Tablespace from an Encrypted
Backup (continued)

Oracle Internal & Oracle Academy Use Only


9. Review your recovery request and click Submit.

2) The recovery operation fails. Why?


Answer:
1. Scroll down the output window on the Perform Recovery: Result window. Notice
the “ORA-19913: unable to decrypt backup” error. RMAN could not decrypt the
backup because it needs the password.

Oracle Database 10g: Backup and Recovery B-161


Solutions for Practice 15-2: Recover a Tablespace from an Encrypted
Backup (continued)

Oracle Internal & Oracle Academy Use Only


2. Click OK.
3) Troubleshoot the recovery process. What do you notice on the Perform Recovery
page?
Answer:
1. On the Maintenance tabbed page, click the “Perform Recovery” link in the
Backup/Recovery section.
2. What do you notice on the Perform Recovery page?

Notice that there is a tablespace offline and its datafile needs media recovery. This is
due to the failed tablespace recovery attempt.
4) Perform an object-level recovery of the EXAMPLE tablespace to the current time or a
previous point in time. Restore the files to the default location.
Answer:
1. Select Tablespaces from the Object Type list and click Perform Object Level
Recovery.

Oracle Database 10g: Backup and Recovery B-162


Solutions for Practice 15-2: Recover a Tablespace from an Encrypted
Backup (continued)

Oracle Internal & Oracle Academy Use Only


2. Retain the default values for point-in-time recovery and click Next.

3. On the “Perform Object Level Recovery: Tablespaces” page, make sure that the
EXAMPLE tablespace is displayed, and click Next.

Oracle Database 10g: Backup and Recovery B-163


Solutions for Practice 15-2: Recover a Tablespace from an Encrypted
Backup (continued)

Oracle Internal & Oracle Academy Use Only


4. Retain the “No. Restore the files to the default location” option and click Next.

5) Edit the RMAN script on the “Perform Object Level Recovery: Review” page.
Include the command to decrypt the backup, specifying demo as the password. The
command syntax is:

SET ENCRYPTION ON IDENTIFIED BY demo ONLY;


Then submit the backup job.
Answer:

Oracle Database 10g: Backup and Recovery B-164


Solutions for Practice 15-2: Recover a Tablespace from an Encrypted
Backup (continued)
1. Click Edit RMAN Script.

Oracle Internal & Oracle Academy Use Only


2. Enter SET DECRYPTION IDENTIFIED BY demo; at the top of the RMAN
script, and then click Submit.

6) View the Perform Recovery: Result page. Notice the successful execution of your
SET DECRYPTION command.
Answer:
1. Notice that the SET DECRYPTION command was executed.

Oracle Database 10g: Backup and Recovery B-165


Solutions for Practice 15-2: Recover a Tablespace from an Encrypted
Backup (continued)

Oracle Internal & Oracle Academy Use Only


2. Notice that the recovery completed successfully and the EXAMPLE tablespace was
brought back online.

3. When you finished reviewing the results, click OK.

Oracle Database 10g: Backup and Recovery B-166


Practice Solutions for Lesson 16

In this practice, you perform the following tasks:


• View Oracle Secure Backup information.
• Back up the Oracle Secure Backup catalog.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-167


Solutions for Practice 16-1: View Oracle Secure Backup
Information
In this practice, you view Oracle Secure Backup information: the catalog, volumes and
their content, jobs and job transcripts, and defaults and policies.
Unless specified otherwise, you should log in as the SYS user (with the oracle
password) and connect as SYSDBA to Enterprise Manager Database Control. To access
the Oracle Secure Backup Web tool, use admin as username and oracle as password.
1) The administrative server maintains a catalog in which it stores metadata relating to
backup and restore operations for the administrative domain. Use the Oracle Secure
Backup Web tool to browse the Oracle Secure Backup catalog to view what you have
backed up so far.
Answer:

Oracle Internal & Oracle Academy Use Only


1. On your Database home page, click the Maintenance tab.
2. Click File System Backup and Restore.
3. Click the Restore tab.
4. Click Backup Catalog.

5. Select your host name and click Browse Host.

6. Click the path link under Browse Host thrice.

Oracle Database 10g: Backup and Recovery B-168


Solutions for Practice 16-1: View Oracle Secure Backup Information
(continued)

7. Click until you see the files, which you backed up during a previous practice
session.

Oracle Internal & Oracle Academy Use Only


Note: The content of your /home/oracle/labs directory is different during
class.
2) View the volumes and their content.
Answer:
1. In the Oracle Secure Backup Web tool, click the Manage tab.
2. Click Volumes.

Oracle Database 10g: Backup and Recovery B-169


Solutions for Practice 16-1: View Oracle Secure Backup Information
(continued)

Oracle Internal & Oracle Academy Use Only


3. Select one of the volumes and click List Backup Sections.

4. Review the List Section Properties. The content of your Backup Sections will be
different from this screenshot. Then click Close.
3) View a category of jobs—for example, completed ones. Include a review of a job
transcript.
Answer:
1. In the Oracle Secure Backup Web tool, click the Home tab.

Oracle Database 10g: Backup and Recovery B-170


Solutions for Practice 16-1: View Oracle Secure Backup Information
(continued)

Oracle Internal & Oracle Academy Use Only


Most likely, you will not have any failed jobs to research; so look at completed ones.
2. Click the Completed Jobs link.
3. Select the archivelog backup job and click Show Transcript.

4. Scroll to the end of the job transcript and view the error rate. It should be 0%.

Oracle Database 10g: Backup and Recovery B-171


Solutions for Practice 16-1: View Oracle Secure Backup Information
(continued)

Oracle Internal & Oracle Academy Use Only


5. Click Close.
4) View the configuration of your security policies. What is the value of the “Login
token duration” policy?
Answer:
1. On your Database home page, click the Maintenance tab.
2. Click the File System Backup and Restore.
3. Click the Configure tab.
4. On the Configure page, click the Defaults and Policies link in the Advanced
section.

5. On the Configure: Defaults and Policies page, click the security Policy.

Oracle Database 10g: Backup and Recovery B-172


Solutions for Practice 16-1: View Oracle Secure Backup Information
(continued)

Oracle Internal & Oracle Academy Use Only


6. What is the value of the “Login token duration” policy?

The default value is 15 minutes, which means after 15 minutes of inactivity, you need
to repeat your Oracle Secure Backup login.

Oracle Database 10g: Backup and Recovery B-173


Solutions for Practice 16-2: Back Up the Oracle Secure Backup
Catalog

In this practice, you perform the following tasks using obtool:


• Create a dataset for the <OSB_HOME>/admin directory.
• Create a backup request.
• Submit the backup request to the scheduler.
• Verify that the backup completed successfully.
• Identify the volume that contains the backup data.
Previously, you used the Oracle Secure Backup Web tool for a file-system backup. Now
use the obtool utility with admin as username and oracle as password.
1) Create a media family to be used when backing up the Oracle Secure Backup catalog
files. Use the following command:

Oracle Internal & Oracle Academy Use Only


mkmf --vidunique --writewindow 7days --retain 28days
--noappend OSB_catalogs
Answer:
$ obtool –-user admin –-password oracle
ob> mkmf --vidunique --writewindow 7days --retain 28days -
-noappend OSB_catalogs

2) Create a backup set for the catalog data, using the commands listed here:
mkds --dir catalog_backup
mkds --input catback.ds

When prompted for input, supply the following dataset directives, where
<hostname> is the host name of your assigned computer:
include host <hostname> {
include path /etc/obconfig
include path /usr/etc/ob/xcr
include path /usr/local/oracle/backup/admin }
Answer:
ob> mkds --dir catalog_backup
ob> mkds --input catback.ds
Input the new dataset contents. Terminate with an EOF or
a line containing just a dot (".").
include host <hostname> {
include path /etc/obconfig
include path /usr/etc/ob/xcr
include path /usr/local/oracle/backup/admin }
.
Apply your changes [yes]?
ob>
3) Create a backup request for this dataset, and then submit the backup request.
To create the backup request using the following obtool command:
backup –l full –p 1 –r vt –g --dataset catback.ds

Oracle Database 10g: Backup and Recovery B-174


Solutions for Practice 16-2: Back Up the Oracle Secure Backup Catalog
(continued)
What does this command do?
Answer:
This command performs a full backup (-l full) of the files defined by the
dataset description catback.ds. (--dataset). All the files described are
backed up regardless of when the last backup was taken or what files have
changed. The backup is executed as the privileged root user (-g) and is given
the highest priority (-p 1). The backup is restricted to only the vt tape drive, so
the volume that contains the backup can be easily located.
ob> backup –l full –p 1 –r vt –g --dataset catback.ds
ob> backup --go
Info: backup request 1 (dataset catback.ds) submitted; job

Oracle Internal & Oracle Academy Use Only


id is admin/3.
ob>

4) Use the information from the message returned in the previous step to verify that the
backup completed successfully. (State should show “completed successfully”).
Answer:
ob> lsjob --long admin/3
admin/3:
Type: dataset catback.ds
Level: full
Family: OSB_catalogs
Scheduled time: none
State: completed successfully at
2006/05/19.21:51
Priority: 1
Privileged op: yes
Run on host: (administrative server)
Attempts: 1
ob>

5) Identify the volume that contains the backup.


Answer:
ob> lsvol --drive vt
ob> lsvol --drive vt
Inventory of library vlib:
* in 1: volume RMAN-DEFAULT-000002, barcode
69ed75c0c944102b985
00065b9621d0, 3463296 kb remaining, content manages reuse
* in 3: unlabeled, barcode
6a2ac70ec944102b98500065b9621d0
* in 4: unlabeled, barcode
6a409e76c944102b98500065b9621d0
in dte: volume VOL000001, barcode
6a156878c944102b98500065b9621
d0, 3462496 kb remaining, lastse 2

Oracle Database 10g: Backup and Recovery B-175


Solutions for Practice 16-2: Back Up the Oracle Secure Backup Catalog
(continued)
*: in use list
ob>
ob> exit

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery B-176


Oracle Secure Backup
Additional Installation Topics

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.
Topics

This appendix, together with the relevant lesson, should


assist you to:
• Install Oracle Secure Backup on Windows
• Locate and describe the Oracle Secure Backup
installed files
• Additional installation topics:

Oracle Internal & Oracle Academy Use Only


– Specifying installation parameters
– Client Installation: Example
– Media Server Installation: Example
• Uninstall Oracle Secure Backup

Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery C - 2


Windows Installation: Overview

Stop drivers

Run setup.exe

Answer customer information dialogs

Oracle Internal & Oracle Academy Use Only


Select the type of host from the
Oracle Secure Backup Setup screen

Install

Answer service startup dialogs

Answer service login dialogs

Copyright © 2006, Oracle. All rights reserved.

Windows Installation: Overview


Before beginning your installation, see documentation for platform-specific details, such as: on
Windows: disable drivers on Windows-based media servers, and how to configure firewalls.
Oracle Secure Backup supports configuring the administrative domain on a host running the
Windows operating system.
To support running an administrative server on Windows, the GNU SMTP implementation is
replaced with one developed by Oracle.
During the installation process, the Oracle Secure Backup Setup Wizard copies all Oracle Secure
Backup files to the local host and generates Windows Registry entries.
Note: Every installation of Oracle Secure Backup on Windows is a client installation, and can
additionally be a media server or administrative server installation.

Oracle Database 10g: Backup and Recovery C - 3


Stopping Tape Device Drivers

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Stopping Tape Device Drivers


Before you start an Oracle Secure Backup host installation on your Windows machine, you should
stop any currently running drivers that are controlling existing tape drives and libraries that you plan
to use with Oracle Secure Backup. This is necessary because Windows does not allow two device
drivers to simultaneously claim the same device.
To stop Windows drivers, perform the following steps:
1. From Control Panel, click System.
2. Click the Hardware tab.
3. Click the Device Manager button. The Device Manager window appears.
4. Expand the branch for Medium Changers (if any).
5. Right-click the icon that represents your tape library.
6. A pop-up menu appears. Select Disable to disable the medium changer driver.
7. Repeat steps 5 and 6 for each tape library or tape drive that you intend to use with Oracle
Secure Backup.
8. Expand the branch for Tape Drives. Installed drivers for tape drives appear.
9. Right-click the icon that represents your tape drive.
10. A pop-up menu appears. Select Disable to disable the tape drive driver.

Oracle Database 10g: Backup and Recovery C - 4


Stopping Tape Device Drivers (continued)
11. Repeat steps 9 and 10 for each tape library or tape drive that you intend to use with Oracle
Secure Backup.
12. Reboot your host.
Windows drivers claim devices to be used by Oracle Secure Backup. If not disabled, the Windows
drivers will preempt the Oracle Secure Backup device driver (ob) on the next reboot.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery C - 5


Oracle Secure Backup Setup

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Oracle Secure Backup Setup


1. Run the setup.exe program from the directory into which you originally downloaded the
software. The InstallShield Wizard is displayed.
2. Click Next to continue. The Readme Information dialog box is displayed.
3. Click Next to continue. The Customer Information dialog box is displayed.
4. Enter your name in the User Name box.
5. Enter the name of your company in the Organization box.
6. Select a target user for the application. Your choices are:
- Anyone who uses this computer (all users)
- Only for me (user)
7. Click Next to continue.
8. Choose the program features to configure:
a. To configure the Windows host as a media server, click the pull-down menu of the Media
Server icon. The options that are displayed are shown in the slide. Selecting the “This
feature will be installed on local hard drive.” option removes the X from the Media Server
icon and installs the media server software.

Oracle Database 10g: Backup and Recovery C - 6


Oracle Secure Backup Setup (continued)
b. To configure the Windows host as an administrative server, click the pull-down menu of
the Administrative Host icon and select “This feature will be installed on local hard drive.”
Again, selecting this option removes the X from the Administrative Host icon and installs
the administrative server software.
c. If you plan to perform Oracle database backups and restores, repeat this process for Create
“oracle” user. Doing so creates an Oracle Secure Backup user called oracle (with the
rights and privileges of the oracle class) whose purpose is to facilitate RMAN backup
and restores of Oracle databases.
9. Click Next to continue. The “Ready to Install the Program” window is displayed.
10. Click Install to start copying files. A progress bar appears. When the files are copied, the
InstallShield Completed screen is displayed.
11. Click Finish to continue.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery C - 7


Service Startup Dialogs

Continued:

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Service Startup Dialogs


The Service Startup dialog box is displayed.
12. Select a mode in which to start the Oracle Secure Backup service. Your choices are:
- Automatic: The Oracle Secure Backup service starts automatically when you reboot your
host.
- Manual: The Oracle Secure Backup service must be started manually by a user who is a
member of the Administrators group.
- Disabled: The Oracle Secure Backup service is disabled.
13. Click Next to continue.
Note: On the Windows operating system, the only daemon that runs as a Windows service is the
Oracle Secure Backup service (observiced).

Oracle Database 10g: Backup and Recovery C - 8


Service Login Dialog Box

Continued:

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Service Login Dialog Box


The Service Login dialog box appears.
14. Select one of the following options:
- If you plan to run the Oracle Secure Backup service daemon (and associated subordinate
daemons) with full privileges, click System Account.
- If you plan to run the Oracle Secure Backup service daemon (and associated subordinate
daemons) with the privilege set associated with an existing Windows user account, click
“This Account” and enter the Windows user account name and password. If you choose this
option, ensure that the account you select has enough backup and restore privileges. The
required privileges are listed in the Oracle Secure Backup Service Logon dialog box.
15. Click Finish to complete the installation.
16. Repeat this installation process for each Windows host in your administrative domain.

Oracle Database 10g: Backup and Recovery C - 9


Oracle Secure Backup Installed Files

<OSB_Home> directory

Oracle Internal & Oracle Academy Use Only


admin apache bin device help samples

• config • conf
• history • htdocs
• log • images
• state • logs
• modules
Configuration
Administrative server file

Copyright © 2006, Oracle. All rights reserved.

Oracle Secure Backup Installed Files


The Oracle Secure Backup home directory is created on every host where you install Oracle Secure
Backup, although the contents of the directory vary depending on the roles you assigned to the host.
The illustration in the slide shows the installed directories that are common to an administrative
server on any operating system. However, an administrative server configured on a Linux host will
have additional directories created.
In addition to containing the Oracle Secure Backup directory, each host on which Oracle Secure
Backup is installed contains a configuration file. The configuration file is called obconfig.txt in
the db subdirectory where you install Oracle Secure Backup on Windows, and it is called
obconfig in the /etc directory on UNIX and Linux systems.
These directories contain the following types of files:
• admin: Administrative and configuration data for the administrative domain, also the backup
catalog
• apache: Apache Web server files (used by Web tool)
• bin: Executables or links to executables
• device: Data on the tape drives and libraries that are supported by the Oracle Secure Backup
device driver

Oracle Database 10g: Backup and Recovery C - 10


Oracle Secure Backup Installed Files (continued)
• help: Help files (provides data for the help command in obtool)
• samples: Sample tools for writing scripts or programs that interact with Oracle Secure Backup
Note: The directory structure under the <OSB_Home> directory is the same for both Windows and
UNIX systems.
On a Windows host, an Oracle Secure Backup installation also includes the following file objects:
• db\xcr\: Transcripts for jobs that ran on this host
• temp\: The directory containing observiced and obndmpd log files and temporary files
A UNIX or Linux host has the following additional files:
• .bin.<operating_system>/: Executables for operating_system, where operating_system
is a derivative of the operating system name. For example, the directory for Sun Solaris is
.bin.solaris.
• .drv.<operating_system>/: Device drivers for operating_system

Oracle Internal & Oracle Academy Use Only


• etc/: Links that point to the <OSB_root>/.wrapper script for each Oracle Secure Backup
utility. This script is an architecture-specific executable selection tool for Oracle Secure Backup.
• .etc.<operating_system>/: Daemons and utility programs for operating_ system
• install/: Installation scripts
• lib/: Link to the architecture-independent shared library for the SBT interface
• .lib.<operating_system>/: Shared library for the SBT interface for operating_system,
where operating_system is a derivative of the operating system name. For example, the directory
for Sun Solaris is .lib.solaris.
• man/: Man pages for Oracle Secure Backup components
• man/man1: Man pages for Oracle Secure Backup executables
• man/man8: Man pages for daemons and maintenance tools
• tools.<operating_system>/: Maintenance tools
• /usr/etc/ob/.hostid: Information used for identifying this host
• /usr/etc/ob/xcr/: Transcripts for jobs that ran on this host
• /usr/tmp/: Log files for observiced and obndmpd and temporary files
• .wrapper: Shell program that selects an executable from a .bin.* or .etc.* directory,
based on the computer architecture of the host executing the command. Symbolic links and the
architecture-independent .wrapper shell program enable hosts to contain executables for
multiple computer architectures.

Oracle Database 10g: Backup and Recovery C - 11


Oracle Secure Backup Installed Files

<OSB_Home>
/usr/local/oracle/backup
directory

.drv.<OS> help bin device

Media server

Oracle Internal & Oracle Academy Use Only


<OSB_Home>
/usr/local/oracle/backup
directory

help bin device

Client

Copyright © 2006, Oracle. All rights reserved.

Oracle Secure Backup Installed Files (continued)


The slide illustrates the directories created for a media server or client. The bin and device
subdirectories are created on every machine, regardless of the operating system used. The other
directories shown in the slide are created for machines that use the Windows operating system.
For a UNIX or Linux host, the following files and directories are installed in addition to the bin and
device subdirectories:
• Media server:
- .bin.<operating_system>/
- .drv.<operating_system>/
- etc/
- .etc.<operating_system>/
- man/
- /usr/etc/ob/.hostid
- /usr/etc/ob/xcr/
- /usr/tmp/
- .wrapper

Oracle Database 10g: Backup and Recovery C - 12


Oracle Secure Backup Installed Files (continued)
• Client:
- .bin.<operating_system>/
- etc/
- .etc.<operating_system>/
- man/
- /usr/etc/ob/.hostid
- /usr/etc/ob/xcr/
- /usr/tmp/
- .wrapper

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery C - 13


Installed Files for Host Role:
Administrative Server

<OSB_Home> directory

Oracle Internal & Oracle Academy Use Only


admin apache bin device help samples

• config • conf
• history • htdocs
• log • images
• state • logs
• modules
Configuration
file

Copyright © 2006, Oracle. All rights reserved.

Installed Files for Host Role: Administrative Server


The Oracle Secure Backup home directory is created on every host where you install Oracle Secure
Backup, although the contents of the directory vary depending on the roles you assigned to the host.
The illustration in the slide shows the installed directories that are common to an administrative
server on any operating system. However, an administrative server configured on a Linux host will
have additional directories created.
In addition to containing the Oracle Secure Backup directory, each host on which Oracle Secure
Backup is installed contains a configuration file. The configuration file is called obconfig.txt in
the db subdirectory where you install Oracle Secure Backup on Windows, and it is called
obconfig in the /etc directory on UNIX and Linux systems.
These directories contain the following types of files:
• admin: Administrative and configuration data for the administrative domain, also the backup
catalog
• apache: Apache Web server files (used by Web tool)
• bin: Executables or links to executables
• device: Data on the tape drives and libraries that are supported by the Oracle Secure Backup
device driver

Oracle Database 10g: Backup and Recovery C - 14


Installed Files for Host Role: Administrative Server (continued)
Oracle Secure Backup Installed Files
• help: Help files (provides data for the help command in obtool)
• samples: Sample tools for writing scripts or programs that interact with Oracle Secure Backup
Note: The directory structure under the <OSB_Home> directory is the same for both Windows and
UNIX systems.
On a Windows host, an Oracle Secure Backup installation also includes the following file objects:
• db\xcr\: Transcripts for jobs that ran on this host
• temp\: The directory containing observiced and obndmpd log files and temporary files
A UNIX or Linux host has the following additional files:
• .bin.<operating_system>/: Executables for operating_system, where operating_system
is a derivative of the operating system name. For example, the directory for Sun Solaris is
.bin.solaris.

Oracle Internal & Oracle Academy Use Only


• .drv.<operating_system>/: Device drivers for operating_system
• etc/: Links that point to the <OSB_root>/.wrapper script for each Oracle Secure Backup
utility. This script is an architecture-specific executable selection tool for Oracle Secure Backup.
• .etc.<operating_system>/: Daemons and utility programs for operating_ system
• install/: Installation scripts
• lib/: Link to the architecture-independent shared library for the SBT interface
• .lib.<operating_system>/: Shared library for the SBT interface for operating_system,
where operating_system is a derivative of the operating system name. For example, the directory
for Sun Solaris is .lib.solaris.
• man/: Man pages for Oracle Secure Backup components
• man/man1: Man pages for Oracle Secure Backup executables
• man/man8: Man pages for daemons and maintenance tools
• tools.<operating_system>/: Maintenance tools
• /usr/etc/ob/.hostid: Information used for identifying this host
• /usr/etc/ob/xcr/: Transcripts for jobs that ran on this host
• /usr/tmp/: Log files for observiced and obndmpd and temporary files
• .wrapper: Shell program that selects an executable from a .bin.* or .etc.* directory,
based on the computer architecture of the host executing the command. Symbolic links and the
architecture-independent .wrapper shell program enable hosts to contain executables for
multiple computer architectures.

Oracle Database 10g: Backup and Recovery C - 15


Installed Files for Host Role:
Media Server

<OSB_Home>
/usr/local/oracle/backup
directory

.drv.<OS> help bin device

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Installed Files for Host Role: Media Server


The slide illustrates the directories created for a media server or client. The bin and device
subdirectories are created on every machine, regardless of the operating system used. The other
directories shown in the slide are created for machines that use the Windows operating system.
For a UNIX or Linux host, the following files and directories are installed in addition to the bin and
device subdirectories:
• Media server:
- .bin.<operating_system>/
- .drv.<operating_system>/
- etc/
- .etc.<operating_system>/
- man/
- /usr/etc/ob/.hostid
- /usr/etc/ob/xcr/
- /usr/tmp/
- .wrapper

Oracle Database 10g: Backup and Recovery C - 16


Installed Files for Host Role: Client

<OSB_Home>
/usr/local/oracle/backup
directory

help bin device

Oracle Internal & Oracle Academy Use Only


Copyright © 2006, Oracle. All rights reserved.

Installed Files for Host Role: Client


The slide illustrates the directories created for a media server or client. The bin and device
subdirectories are created on every machine, regardless of the operating system used. The other
directories shown in the slide are created for machines that use the Windows operating system.
• Client:
- .bin.<operating_system>/
- etc/
- .etc.<operating_system>/
- man/
- /usr/etc/ob/.hostid
- /usr/etc/ob/xcr/
- /usr/tmp/
- .wrapper

Oracle Database 10g: Backup and Recovery C - 17


Specifying Installation Parameters

# Once you've customized this obparameters file, change the


# following line to 'yes' to make installob less chatty.

customized obparameters: yes


# _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#
# D e f a u l t " o r a c l e " u s e r c r e a t i o n

Oracle Internal & Oracle Academy Use Only


# _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
# After the installation is successful and the
# administrative domain has been initialized, this option
# allows you to automatically create an Oracle Secure Backup
# user "oracle" which belongs to the "oracle" class and is
# pre-authorized to perform Oracle backup & restore
# operations.

create pre-authorized oracle user: yes

Copyright © 2006, Oracle. All rights reserved.

Specifying Installation Parameters


Oracle Secure Backup provides an obparameters file to help users customize their installations.
The obparameters file is located in the install subdirectory of your Oracle Secure Backup
home directory.
For a Linux installation, you can alter the behavior of Oracle Secure Backup by modifying the
following options in this file:
• customized obparameters: Indicates you no longer want to be prompted to review this
file during installation
• start daemons at boot: Indicates whether you want to automatically start Oracle Secure
Backup each time you boot the system
• identity certificate key size: 1024: Configures the level of security associated
with the host identity certificates issued by the administrative service daemon
• create pre-authorized oracle user: Instructs Oracle Secure Backup to create the
oracle Oracle Secure Backup user and configure it as a preauthorized user
• default UNIX user and default UNIX group: Is used to specify the UNIX or Linux
groups and usernames to which the oracle Oracle Secure Backup user will be mapped
• <OS type> ob dir: Identifies the name of the Oracle Secure Backup directory for each
platform type in your network. Currently, you can set directories for Solaris, HP-UX, AIX,
Linux, and Solaris64. The default value is the <OSB_Home> directory.

Oracle Database 10g: Backup and Recovery C - 18


Specifying Installation Parameters (continued)
• <OS type> db dir: Is used to alter the directory in which Oracle Secure Backup retains
host-specific information. This directory must be private to each machine; it cannot be shared
among multiple machines via NFS (or any other remote file system). The default value is
/usr/etc/ob.
• <OS type> temp dir: Is used to alter the location of the temp area. By default, Oracle
Secure Backup uses the /usr/tmp directory on each host for the storage of transient files
during installation. Oracle Secure Backup requires that the temp directory be able to contain
lockable files, which eliminates temp directories mounted as SunOS “tmpfs” file systems. You
can select a temp directory on a per-OS basis by modifying the appropriate line.
• <OS type> links: Indicates whether or not Oracle Secure Backup should create symbolic
links. Oracle Secure Backup by default creates symbolic links so that users of Oracle Secure
Backup do not need to change their search paths. You can choose not to create these links or to
modify the location of the created links. For example, on some systems, it may be more

Oracle Internal & Oracle Academy Use Only


appropriate to place links in /bin instead of /usr/bin, or in /usr/etc instead of /etc.
You can specify the behavior for each type of supporting operating system. Three link names
must be specified: the name of the directory in which to create the “bin” links, the name of the
directory in which to create the “etc” link (for daemons), and the name of the directory in which
to create the “lib” link (for library files). The default values are:
<OS type> links: /usr/bin /etc /lib
• ask about ob dir: Indicates whether or not Oracle Secure Backup should remind the user
during installation that a directory other than the recommended one has been chosen for the
software
• default protection: Is used to specify the file and directory permissions to be set after
the installation is complete. A list of the files and directories, along with the default permissions,
are listed. Here is a partial listing:
root.0 755 ./samples/*.sh
root.0 700 ./admin
root.0 700 ./admin/*
root.0 700 ./admin/config/*
root.0 755 ./.bin.*/*
root.0 4755 ./.bin.*/obtar
• run obopenssl: Indicates whether or not the Oracle Secure Backup installation tool should
prompt you to run obopenssl and create the certificates for the Apache Web server. The
default value is yes.
Note: If the obparameters file specifies a lib directory for the operating system type of the
current installation, then the installation software creates a libobk.so link in this directory. The
link text points to the actual libobk.so file that resides in the operating system–specific lib
directory (.lib.linux32, for example), which is a subdirectory of your <OSB_Home> directory.

Oracle Database 10g: Backup and Recovery C - 19


Client Installation: Example

Would you like to install Oracle Secure Backup on any other


machine [yes]? yes
Enter the name of a host onto which you'd like to install
Oracle Secure Backup: client_z
Just a moment while I learn about client_z...done.
Looking for an acceptable temporary work area on client_z...
Making sure target file system has enough space...
I'm ready to install Oracle Secure Backup on client_z as a
client. The work area on client_z to be used for temporary
install files is /tmp. OK to proceed [yes]? yes

Oracle Internal & Oracle Academy Use Only


Installing Oracle Secure Backup onto client_z (HP-UX
version 10.20)
packaging Oracle Secure Backup distribution for copy to
client_z
copying Oracle Secure Backup distribution to client_z
copying Oracle Secure Backup installation tools to client_z
completing installation on remote host
...
Oracle Secure Backup installed successfully onto client_z

Copyright © 2006, Oracle. All rights reserved.

Client Installation: Example


Assume in the example shown in the slide that you have just installed Oracle Secure Backup on the
administrative server, and you now want to install Oracle Secure Backup on a client named
“client_z.” When the installob script gives you the possibility to install Oracle Secure Backup
on another machine, you choose yes.
You need to specify the name of the machine and answer some basic questions, as shown. For
formatting reasons, the complete output is not shown in the slide.
Note: In this particular example, no choice is provided regarding the new machine’s role. This is
because the installob script determined that the target machine could not be configured as an
administrative or media server. Thus, a client installation is performed automatically.

Oracle Database 10g: Backup and Recovery C - 20


Media Server Installation: Example

Would you like to install Oracle Secure Backup on any other machine
[yes]?
Enter the name of a host onto which you'd like to install Oracle Secure
Backup: media_x
You can install this host one of three ways:
(a) an admin server, (b) a media server or,(c) a client
Which would you like (one of a b c; q to quit) [c]? b
Oracle Secure Backup's Web Server Interface software has been loaded.

Oracle Internal & Oracle Academy Use Only


Does media_x have any SCSI tape libraries that you'd like to use with
Oracle Secure Backup [no]? yes
How many Oracle Secure Backup tape drives are attached to media_x [1]?
Please describe each tape drive by answering the following questions.
Logical unit number [0]:
# cat /proc/scsi/scsi
SCSI bus address [0]:
Attached devices:
SCSI target ID [4]: 2 Host: scsi0 Channel: 00
SCSI lun 0-7 [0]: Id: 02 Lun: 00
Is the information you entered correct [yes]? Vendor: IBM Model: … : 4772
OK to proceed [yes]? Type: Sequential-Access…
Oracle Secure Backup successfully onto media_x

Copyright © 2006, Oracle. All rights reserved.

Media Server Installation: Example


This example demonstrates a media server installation.
First, specify the host name of the machine that you want to add as a media server. Then, you specify
that you want this new machine to be a media server. The setup program automatically installs
Oracle Secure Backup on the remote host and prompts for information about the devices attached to
the new media server.
In the example, it is assumed that the media server has only one SCSI tape drive attached.
Note: The procedure for configuring tape libraries or Fibre Channel devices is the same as the
process for configuring SCSI tape drives.
Before you can configure the tape drive, you need to obtain some physical SCSI information about
the device. For example, on a Linux platform, you can use the cat /proc/scsi/scsi
command to obtain the necessary information.
In addition to obtaining SCSI device information, you must also assign an Oracle Secure Backup
logical unit number. This is a number between 0 and 31 and is used to create unique file names for
the devices connected to the media server—for example, /dev/obt0, /dev/obt1, and so on.
Note: For formatting reasons, the complete output is not shown in the slide.

Oracle Database 10g: Backup and Recovery C - 21


Verifying Your Installation

Some examples:
• View Oracle Secure Backup processes in Linux:
ps -e | grep ob

• Use obtool commands to view Oracle Secure Backup


users and default media family:

Oracle Internal & Oracle Academy Use Only


ob> lsuser
ob> lsmf --long

Copyright © 2006, Oracle. All rights reserved.

Verifying Your Installation


In the slide are some examples of how you can verify your installation. To start the obtool utility,
execute the following:
$ obtool
Oracle Secure Backup 10.1.0
login: admin
Password: oracle << Password not echoed >>
ob> lsuser
admin admin
oracle oracle
ob> lsmf --long
RMAN-DEFAULT:
Keep volume set: content manages reuse
Appendable: yes
Volume ID used: unique to this media family
Comment: Default RMAN backup media family
ob> quit

Oracle Database 10g: Backup and Recovery C - 22


Uninstalling Oracle Secure Backup

• Have all users log out of Oracle Secure Backup


applications.
• Close all sessions of Web tool.
• Use the uninstallob script.
– You must be logged in as the root user.
– Call script from the parent directory of the Oracle Secure

Oracle Internal & Oracle Academy Use Only


Backup home directory.
• Choose whether you want to save or remove the:
– Oracle Secure Backup directory
– Administrative directory

Copyright © 2006, Oracle. All rights reserved.

Uninstalling Oracle Secure Backup


You can uninstall Oracle Secure Backup from a client or the administrative server. If you uninstall
Oracle Secure Backup from an administrative server, you are given the option of retaining the
administrative directory and its contents. This enables you to safely uninstall and reinstall the product
without deleting your administrative server data.
You must be logged in as the root user on UNIX or Linux systems to uninstall Oracle Secure
Backup completely. If you are not logged in as root when you uninstall the software, you may not
have the privileges needed to delete files and shut down the Oracle Secure Backup daemons.
Oracle Secure Backup–related processes such as the HTTP processes for Oracle Secure Backup Web
tool should be shut down before beginning the uninstallation process. To identify processes for
Oracle Secure Backup, you can use the following command:
# /bin/ps -ef |grep ob
You can then use kill -9 <pid> commands to kill each process in the list associated with
Oracle Secure Backup.
If you uninstall Oracle Secure Backup from the local machine, the uninstallob script removes
the Oracle Secure Backup home directory when the script completes. For this reason, you should call
the uninstallob script from the parent directory of the Oracle Secure Backup home directory.

Oracle Database 10g: Backup and Recovery C - 23


Uninstalling Oracle Secure Backup (continued)
If you encounter errors when uninstalling the Oracle Secure Backup software, or if the
uninstallob script fails to completely remove all the files for Oracle Secure Backup (assuming
you did not choose to save any files), correct the problem causing the error if possible, then run the
uninstallob script again until you see the following message:
Oracle Secure Backup has been successfully removed from <host>.

Oracle Internal & Oracle Academy Use Only

Oracle Database 10g: Backup and Recovery C - 24


Summary

This appendix provided assistance with the following


topics:
• Install Oracle Secure Backup on Windows
• Locate and describe the Oracle Secure Backup
installed files
• Additional installation topics:

Oracle Internal & Oracle Academy Use Only


– Specify installation parameters
– Install Client: Example
– Install Media Server: Example
• Verify your UNIX installation
• Uninstall Oracle Secure Backup

Copyright © 2006, Oracle. All rights reserved.

Oracle Database 10g: Backup and Recovery C - 25


Oracle Internal & Oracle Academy Use Only
________
________

Glossary
D

Oracle Internal & Oracle Academy Use Only


Term Definition
administrative domain A group of machines on your network that
you manage as a common unit to perform
backup and restore operations.
administrative server A host where you install Oracle Secure
Backup. This host stores configuration
information and the catalog files for client
hosts. There must be one and only one
administrative server for each
administrative domain at your site. One
administrative server can service all clients
on your network. The administrative server

Oracle Internal & Oracle Academy Use Only


runs the scheduling daemon, which starts
and monitors backups within the
administrative domain.
AIT Advanced Intelligent Tape, a magnetic tape
and drive system used for computer data
storage and archiving
Areal Density Important indicator of the performance of
the disk and drive that corresponds to the
number of magnetic bits per unit area
Apache Web server A public-domain Web server used by the
Oracle Secure Backup Web interface tool.
API application programming interface
attachment An attachment describes a data path
between a host and a storage device. Most
often, an attachment comprises the identity
of a host plus a UNIX device special file
name, a Windows device name, or an NAS
device name. A device must have at least
one attachment, and often has multiple
attachments, one for each host that can
directly access it.
authentication type Defines the way in which Oracle Secure
Backup authenticates itself to the NDMP
server. Typically, you should use the
negotiated default setting. Your choices
are:
• Default
• None
• Negotiated
• Text
• Md5

Oracle Database 10g: Backup and Recovery D-2


Auxiliary Storage/ Secondary Storage. All addressable data
External Storage/ storage that is not currently in the
computer’s main storage or memory.
Bit The smallest amount of information in a
binary digital system that can be used to
represent two states of information such as
YES or NO.
backup description file A text file you create that is used with
command-line interface backup operations.
It lists host names and directories that you
want to back up.
backup ID An integer identifier that uniquely

Oracle Internal & Oracle Academy Use Only


identifies a backup image section
backup image The product of an Oracle Secure Backup
backup operation. Basically it is the list of
files that are backed up in one operation. A
backup image can contain one or more
media families and volume sets.
backup image label The first block of a backup image. It
contains the backup image’s file and
section numbers and owner.
backup image section A portion of a backup image file that exists
on a single tape. One backup image can
contain multiple sections. Each backup
section is uniquely identified by a backup
ID.
backup job A backup operation that is scheduled to run
at a specific time. The time the job is
scheduled to run can be either immediately
or some time in the future.
backup level The level that defines the
comprehensiveness of the backup
operation. For example, a level 2 backup
operation backs up all data changed since
the previous level 1 or level 2 backup.
backup operation A process by which data is copied from
primary media to secondary media.
backup piece A binary file written in a proprietary format
by RMAN for storing backup data. One or
more backup pieces make up a backup set.
backup piece expiration time This expiration date is determined when
the backup piece is created, and
corresponds to its creation time plus its
expire duration.

Oracle Database 10g: Backup and Recovery D-3


backup schedule A description of when and how often
Oracle Secure Backup is to back up one or
more datasets. The backup schedule
contains the names of each such dataset
and the name of the media family to use.
backup sections Also referred to as archive sections. See
backup image section.
backup set A collection of Oracle Database data
backed up by RMAN.
Backup Storage Selectors See Database Backup Storage Selector.
backup trigger A calendar-based time at which a particular
scheduled backup becomes eligible to run
backup window Defines a time range within which Oracle

Oracle Internal & Oracle Academy Use Only


Secure Backup executes scheduled backup
jobs
barcode A symbol code that is physically applied to
volumes for identification purposes. Some
tape libraries have an automated means to
read barcodes, which Oracle Secure
Backup supports.
BDF See backup description file.
blocking factor Specifies how many 512-byte blocks to
include in each block of data written to
each tape drive. By default, Oracle Secure
Backup writes 64 K blocks to tape
(blocking factor 128). Because higher
blocking factors usually result in better
performance, you can try a blocking factor
larger than obtar’s default. If you pick a
value larger than is supported by the
operating system of the server, Oracle
Secure Backup fails with an error.
BSP Backup Solutions Program
bus A collection of wires through which data is
transmitted from one part of a computer to
another
byte Eight bits of information that can represent
256 different states—for example,
numbers, processor instructions, or a
combination of letters and numbers as in
ASCII code.
CA Certificate Authority
catalog A hierarchical collection of files that
contains all the information used to define
your Oracle Secure Backup administrative
domain configuration

Oracle Database 10g: Backup and Recovery D-4


catalog An index of the contents of a tape.
CDB command descriptor block
CIFS See Common Internet File System.
class Defines a set of rights that are granted to an
Oracle Backup user
CLI command-line interface
client Any machine to be backed up by Oracle
Secure Backup, including administrative
servers and media servers; also referred to
as a host
Common Internet File System CIFS is a protocol, used by Windows
clients to access data on this Network
Appliance filer.

Oracle Internal & Oracle Academy Use Only


daemon A process on UNIX and Linux that runs in
the background and performs an OSB task
for an application. Some daemons run
continually (for example, observided)
and others are started and stopped as
required (for example, obrobtd). This is
equivalent to a service on a Windows host.
DAFS Direct Access File System, a new file
access protocol designed to take advantage
of standard memory-to-memory
interconnect technologies
DAR See Direct Access Recovery.
data transfer element (DTE) Secondary storage device within a tape
library usually referred to by a number. In
libraries that contain multiple drives, each
DTE is sequentially numbered, starting
with 1.
dataset description file A file that contains the names of the hosts
and paths that you want Oracle Secure
Backup to back up.
DAS Direct Attached Storage; those parts of a
wide-area network in which the mass
storage devices are connected locally
DAT Digital audio tape; a type of 4-mm tape
Data Mover daemon An operating system process that writes the
data to tape
Database Backup Storage Selector These objects are configured to represent
backup and restore parameters that describe
an Oracle database. They act as a glue
layer between RMAN, which accesses the
database, and the Oracle Secure Backup
software, which manages the underlying
media.

Oracle Database 10g: Backup and Recovery D-5


dataset A textual description employing a
lightweight language that tells Oracle
Secure Backup what files to back up
DDS Digital data storage; a type of 4-mm tape
defaults and policies A set of configuration data that explains
how Oracle Secure Backup runs in an
administrative domain
device A tape drive or library identified by a user-
defined device name
device driver A routine or set of routines that implements
the device-specific aspects of generic I/O
operations. The operating system handles
the device-independent aspects of the I/O

Oracle Internal & Oracle Academy Use Only


operation but calls routines provided by the
driver for the device in question to
implement the device-specific functions.
Every device, whether it is a printer, disk
drive, or keyboard, must have a driver
program. Most devices have their drivers
installed when the device or product that
uses it is installed.
Direct Access Recovery (DAR) An optional capability of NDMP that
addresses the need to quickly restore a
single file from a stream of backup data
that might contain millions of individual
files. DAR relies on file history
information generated at the NAS device
during a backup operation.
direct-attached Located on the same host or server; also
referred to as local
DLT Digital Linear Tape technology; a form of
magnetic tape and drive system used for
computer data storage and archiving
DMA data management agent
DNS hostname Every UNIX system (also known as a host)
has a host name, whether it is connected to
a network or not. Any system attached to
the Internet or any large network conforms
to a more rigorous naming convention as
part of the Domain Name System (DNS).
In DNS, every host name is composed of a
host name and domain name. The DNS
host name is the host name of the computer
(does not include the domain), which is a
symbolic name used to reference a
particular system.

Oracle Database 10g: Backup and Recovery D-6


domain A group of machines and devices on a
network that are administered as a unit with
common rules and procedures. Within the
Internet, domains are defined by the IP
address. All devices sharing a common part
of the IP address are said to be in the same
domain.
EOD End-of data (EOD) label used to mark the
end of Oracle Secure Backup operations on
tape
EOV End-of-volume (EOV) label used to mark
the end of a volume within a backup image.
This label contains the volume ID of the

Oracle Internal & Oracle Academy Use Only


next volume in the set
exabyte A unit of storage equal to 1,024 x 1,024 x
1,024 x gigabytes or just over 1 billion
gigabytes
expiration date The time the volume set is first written +
the write window duration + the retention
duration
expiration policy A media family configuration setting that
determines when volumes are eligible to be
overwritten
expire duration The amount of time after a backup piece is
created during which Oracle Secure
Backup cannot overwrite the data
FC Fibre Channel, an interface standard for
connecting computers to mass storage
devices such as disk drives and tape
libraries
FDDI fiber distributed data interface
Fiber Distributed Data Interface A set of ANSI protocols for sending digital
data over fiber optic cable. FDDI networks
are token-passing networks, and support
data rates of up to 100 Mbps (100 million
bits per second). FDDI networks are
typically used as backbones for wide-area
networks.
Fibre Channel A high performance interface designed to
bring speed and flexibility to multiple disk-
drive storage systems. A Fibre Channel
configuration consists of a backplane, (an
external enclosure that houses a printed
circuit board (PCB) and multiple drive
receptacles) and a Fibre Channel host bus
adapter (HBA). The backplane allows

Oracle Database 10g: Backup and Recovery D-7


direct connection to the drives (no cable),
supplies power to the drives, and controls
the input and output of data on all drives
within the system. Fibre Channel, a one
and two gigabit interconnect technology,
allows concurrent communications among
workstations, mainframes, servers, data
storage systems, and other peripherals
using SCSI, IP and a wide range of other
protocols to meet the needs of the data
center.
file system dataset A collection of files backed up by Oracle
Secure Backup

Oracle Internal & Oracle Academy Use Only


filer An appliance attached to a computer
network that is used for data storage
firewall A system designed to prevent unauthorized
access to or from a private network
full backup An operation that backs up all the files
selected on a client. Files are backed up
whether or not they have changed since the
last backup.
GBIC GigaBit Interface Converter; an interface
module which converts the light stream
from a fibre channel cable into electronic
signals for use by a network interface card
gigabyte A unit of storage, abbreviated as G or GB,
equal to 1,024 megabytes
Gigabit Ethernet (GbE) A term describing various technologies for
implementing Ethernet networking at a
nominal speed of one gigabit per second
GUI graphical user interface
HBA Host bus adapter; an interface card that
plugs into the computer’s bus and connects
it to the network
host An addressable machine in a computer
network
host role A class of actions performed by a host.
You can have an administrative server, a
media server, or a client.
HTTP Hypertext Transfer Protocol (HTTP); the
set of rules for exchanging files (text,
graphic images, sound, video, and other
multimedia files) on the World Wide Web

Oracle Database 10g: Backup and Recovery D-8


HTTPS Hypertext Transfer Protocol Secure
(HTTPS) is a communications protocol
designed to transfer encrypted information
between computers over the World Wide
Web. HTTPS is HTTP using a Secure
Socket Layer (SSL).
import-export element (IEE) Used in tape libraries to move volumes into
and out of the library without opening the
door. It is sometimes called a mail slot, and
is physically present only on certain
libraries. Not all libraries have a discrete
import-export element. Some libraries do
have a media access port, but some require

Oracle Internal & Oracle Academy Use Only


manual action by the operator to open the
door and remove a tape from a slot in the
library.
incremental backup A process that captures data that was
changed since the level N backup
operation, where N is the level of
comprehensiveness of the backup operation
ISAM The Indexed Sequential Access Method
(ISAM) is a method for managing how a
computer accesses records and files stored
on a hard disk. While storing data
sequentially in a data file, ISAM provides
direct access to specific records through an
index. The combination of the data file and
its associated index file is called a
“database.” ISAM is implemented as a C
function library.
iSCSI Pronounced “eye-scuzzy,” an acronym for
Small Computer System Interface protocol
over IP network instead of a direct SCSI
compatible cable. iSCSI enables data
blocks to be read from or sent at high speed
to a storage device such as a disk or tape
drive.
JBOD Just a Bunch of Disks; a term used for a
storage enclosure that is supplied with
preintegrated disk drives
job summary A text file report produced by Oracle
Secure Backup that describes the status of
selected file system backup and restore jobs
job transcript A file that contains the standard output
from a particular backup job

Oracle Database 10g: Backup and Recovery D-9


kilobyte A unit of storage, abbreviated as K or KB,
equal to 1,024 bytes
label Data that Oracle Secure Backup uses to
identify a volume or a backup image
LAN local area network
library See tape library.
lights out backup An automated backup that does not require
user interaction and typically is performed
outside of normal working hours
logical unit number An internal mapping identifier used by
Oracle Secure Backup for a specific device.
LUNs make it possible for a number of
devices to share a single SCSI ID.

Oracle Internal & Oracle Academy Use Only


LTO Linear Tape-Open technology, developed
jointly by HP, IBM, and Seagate; an “open
format” technology, which means that
users will have multiple sources of product
and media
LUN See logical unit number.
magazine A collection of tapes or volumes
media family A classification of backup media that share
the same volume identification sequence.
Each media family identifies the amount of
time that data can be written to a tape, and
the amount of time the tape can remain in
storage before it can be overwritten. A
media family can contain one or more
volume sets and volumes.
media server A machine with one or more attached tape
drives or tape libraries. Backup data is sent
to and restored from volumes loaded in
these devices.
medium transport element (MTE) Moves a volume from a storage element to
another element within a tape library
megabyte A unit of storage abbreviated as M or MB;
equal to 1,024 x 1,024 or 1,048,576 bytes
MMV media management vendor
mount mode The mode indicates the way in which the
scheduling system can use a volume
physically loaded into a tape drive. Valid
values are read-only, write/append,
overwrite, and not-mounted.
multi-hosted tape library A library with multiple media servers
connected to it
NAS See Network Attached Storage.

Oracle Database 10g: Backup and Recovery D-10


NDMP The Network Data Management Protocol
(NDMP) is a network applications protocol
facilitating data backup and restore.
Layered atop TCP and the Berkeley socket
model, NDMP defines a set of related
service models, network messages, and
finite state automations that implement
them. The protocol provides a uniform
means to back up and restore data within
and between diverse kinds of storage
servers, open systems, Wintel platforms,
and closed operating system appliances.
NDMP is commonly used by NAS devices

Oracle Internal & Oracle Academy Use Only


(also known as filers) to facilitate backup
and restore operations without having to
install the backup agent (Oracle Backup,
for example) on the appliance. The NAS
appliance communicates with the backup
software using NDMP.
NDMP backup type The name of a backup method supported
by the NDMP Data Service running on a
host. Backup types are defined by each
Data Service provider.
NDMP Data Service One of three types of NDMP services. The
data service interfaces with the primary
storage device (such as a NAS device) and
interacts with the volume or file system
that is being either backed up or restored.
Network Attached Storage A computer on your network that hosts file
systems. The server exposes the file
systems to its clients through one or more
standard protocols, most commonly NFS
and CIFS.
network description file A text file that describes your network
configuration and is used to push software
across the network to designated machines
during installation
network drive A hard disk physically attached to a server
and accessible over a network
Network File System A client/server application that enables all
network users to access shared files stored
on computers of different types. NFS
provides access to shared files through an
interface called the Virtual File System
(VFS) that runs on top of TCP/IP. Users
can manipulate shared files as if they were

Oracle Database 10g: Backup and Recovery D-11


stored locally on the user’s own hard disk.
With NFS, computers connected to a
network operate as clients while accessing
remote files, and as servers while providing
remote users access to local shared files.
The NFS standards are publicly available
and widely used.
NFS See Network File System.
nibble A unit of information equal to 4 bits (or
half a byte)
NT File System One of the file systems for the Windows
operating system. NTFS has features to
improve reliability, such as transaction logs

Oracle Internal & Oracle Academy Use Only


to help restore from disk failures.
NTFS See NT File System.
object A data storage type used to store Oracle
Secure Backup catalog data. There are user,
class, and policy objects that hold attributes
and names. Internal names are named with
a UUID; external names are user assigned.
OCFS Oracle Cluster File System
offsite backup A backup that is equivalent to a full (level
0) backup except that Oracle Secure
Backup keeps a record of this backup in
such a manner that it does not affect the
full or incremental backup schedule. This is
useful when you want to create a backup
image for offsite storage without disturbing
your schedule of incremental backups.
operator A person who runs backup operations,
manages schedules, swaps tapes, and
checks for any errors
operator assistance request A request from Oracle Secure Backup that
asks for the operator to perform a task,
such as mounting a different volume during
a backup
Oracle Secure Backup scheduler A daemon that automatically starts backup
jobs on the specified day and time

Oracle Database 10g: Backup and Recovery D-12


Oracle Secure Backup user A user definition, distinct from the name
spaces of existing UNIX, Linux, and
Windows users, which allows Oracle
Secure Backup to maintain a consistent
user identity across the various hosts. It
also allows Oracle Secure Backup to
express a finer granularity of user rights
than are possible with existing user
definitions.
orphan A backup piece that exists in the Oracle
Secure Backup catalog but not in the
RMAN catalog
permissions Operating system file privileges that allow

Oracle Internal & Oracle Academy Use Only


different users to read, write, or execute
files
petabyte A unit of storage equal to 1,024 terabytes,
or just over a million gigabytes
PHP Hypertext Preprocessor (PHP) is an open
source, server-side HTML scripting
language used to create dynamic Web
pages. PHP is embedded within tags, so the
author can move between HTML and PHP
instead of using large amounts of code.
Because PHP is executed on the server, the
viewer cannot see the code. PHP can
perform the same tasks as a CGI program
and is compatible with many different
kinds of databases.
ping Stands for Packet Internet Grouper. A
utility to determine whether a specific IP
address is accessible. It works by sending a
packet to the specified address and waiting
for a reply. You can use ping hosts to
troubleshoot network connections.
PNI See Preferred Network Interface.
Preferred Network Interface A network can have multiple physical
connections between a client and the server
performing a backup or restore on behalf of
that client. For example, a network can
have both Ethernet and FDDI connections
between a pair of hosts. Using PNI, you
can specify, on a client-by-client basis,
which of the server’s network interfaces
should be used to transmit data to be
backed up or restored.
RAC Real Application Clusters

Oracle Database 10g: Backup and Recovery D-13


RAID Originally, an acronym for Redundant
Array of Inexpensive Disks to reflect the
data accessibility and cost advantages that
properly implemented arrays could
provide. The acronym has evolved to mean
Redundant Array of Independent Disks
emphasizing the technique’s potential data
availability advantages over conventional
disk storage systems.
recycling policies See expiration policy.
recycling volumes Overwriting data on volumes generated by
Oracle Secure Backup
restore operation Copies files from the tapes in a backup

Oracle Internal & Oracle Academy Use Only


device to the file system on a designated
host
restore operator list A list of operators to whom restore data
requests are e-mailed. This list is defined in
the obconfig file on the administrative
server.
retention duration See expiration policy.
RMAN Recovery Manager
RMAN preauthorization Used to determine the Oracle Secure
Backup user under which a specific RMAN
operation, such as backup or restore, is
performed. This allows for the use of
Oracle Secure Backup without going
through the normal Oracle Secure Backup
login requirements.
SAIT Super Advanced Intelligent Tape; a Small
Form Factor ½″ tape cartridge
SAN See Storage Area Network.
SBT System backup to tape; interface between
RMAN and storage media. RMAN
communicates with Oracle Secure Backup
through the SBT interface.
schedule A user-defined time period for executing
backup operations
SCSI Pronounced “scuzzy,” an acronym for
Small Computer System Interface. A
parallel I/O bus and protocol that permits
the connection of a variety of peripherals to
host computers with independence within a
class of devices (such as disk drives and
backup devices). Connection to the SCSI
bus is achieved through a host adapter and
a peripheral controller. Linux has a four-

Oracle Database 10g: Backup and Recovery D-14


level hierarchical addressing scheme for
SCSI devices:
• SCSI adapter number [host]
• Channel number [bus]
• ID number [target]
• Logical unit number [lun]
Each SCSI bus can have multiple SCSI
devices connected to it. In SCSI parlance,
the host bus adapter is called the “initiator”
and takes up one SCSI target ID number
(typically 7). The initiator talks to targets,
which are commonly known as SCSI
devices. Each SCSI device can contain

Oracle Internal & Oracle Academy Use Only


multiple Logical Unit Numbers (LUNs).
SCSI lun number The value used to identify a logical unit of
a SCSI device. In the SCSI-2 specification,
there may be up to eight logical units for
each SCSI device address. These logical
units are numbered from 0 through 7.
SCSI target ID The unique address of a SCSI device. 8-bit
SCSI can have up to eight IDs; 16-bit up to
sixteen IDs; and 32-bit up to 32 IDs. There
must be a minimum of one target and one
initiator on the bus. SCSI target IDs range
from 0 to 7 for 8-bit, 0 to 15 for 16-bit and
0 to 31 for 32 bit systems.
SDLT/SuperDLT Super Digital Linear Tape technology; a
variant of DLT technology that makes it
possible to store upwards of 100 GB on a
single cartridge and can transfer data at
speeds of up to 10 megabytes per second
section number A number that is recorded in the volume
label to indicate the order of the parts of a
backup image that spans multiple volumes
Secure Sockets Layer (SSL) An application layer protocol created by
Netscape for managing the security of
message transmissions in a network. SSL
uses the public-and-private key encryption
system from RSA (a public key algorithm,
named after its inventors: Rivest, Shamir,
and Adleman), which also includes the use
of a digital certificate.
sequence number A number that is recorded in the volume
label to indicate the order of volumes in a
volume set

Oracle Database 10g: Backup and Recovery D-15


service A process on Windows that runs in the
background and performs a task for an
application. Some services run continually
and others are started and stopped as
required.
services daemon The observiced daemon. It ensures that
tape resources are available and reserves
them for the backup job.
single-hosted tape library A tape library with only one media server
directly attached to it
SNIA Storage Networking Industry Association;
a non-profit trade organization,
incorporated in December 1997 whose

Oracle Internal & Oracle Academy Use Only


members are dedicated to “ensuring that
storage networks become complete and
trusted solutions across the IT community”
storage consolidation The concept of centralizing and sharing
storage resources among many application
servers
SSL See Secure Sockets Layer (SSL).
Storage Area Network A high-speed subnetwork of shared storage
devices, or machines that contains disks for
storing data. A SAN is designed to assign
data backup and restore functions to a
secondary network where they can perform
their tasks without interfering with the
functions and capabilities of the server.
storage element (se) A physical location within a tape library
where a volume can be stored and retrieved
by a tape library’s robotic mechanism
storage selector See Database Backup Storage Selector.
tape A data storage medium consisting of a
magnetizable oxide coating on a thin
plastic strip, commonly used for backup
and archiving. Popular for its ability to
store large amounts of data, and for its
portability. Tapes are also referred to as
removable media, or secondary storage.
tape file mark A marker written to tape by Oracle Secure
Backup that signals the end of a backup
image

Oracle Database 10g: Backup and Recovery D-16


tape library An automated tape-handling hardware
device that invariably house two or more
drives and from 10s to 100s of tapes. A
library accepts SCSI commands to move
media between storage locations and
drives. Tape libraries are designed for
continuous, unattended operation and allow
simultaneous reading and writing to
multiple drives. Tape libraries also offer
key features such as barcode readers to
scan labels on cartridges, and an I/O Port
for importing and exporting individual
tapes under application control. It is also

Oracle Internal & Oracle Academy Use Only


referred to as a robotic tape device,
autochanger, or medium changer.
terabyte A unit of storage, abbreviated as T or TB;
equal to 1,024 gigabytes
TCP/IP Transmission Control Protocol/Internet
Protocol. It is the suite of protocols used to
connect hosts for transmitting data over
networks.
trigger A user-defined period in time or sets of
times that causes a scheduled backup to run
URL The Uniform Resource Locator, or the
address of a resource available on the
Internet
UUID Universal Unique Identifier; used for
tagging objects across a network
virtualization The pooling of physical storage from
multiple network storage devices into what
appears to be a single storage device that is
managed from a central console.
volume A single unit of media such as an 8-mm
tape. A volume can contain one or more
backup images.
volume expiration time The date and time on which a volume
expires. Oracle Secure Backup computes
this by adding the write window duration,
if any, to the time at which it wrote backup
image file number 1 to a volume, then
adding the volume retention period.

Oracle Database 10g: Backup and Recovery D-17


volume ID A label that uniquely identifies the volume
and includes the backup image’s file
number and additional information, if the
backup image is contained on a multi-
volume set. Oracle Secure Backup begins
each backup image with a label that
uniquely identifies the backup image.
Volume IDs appear in volume labels and
backup image labels. For example,
VOL000001 appears in the volume
sequence file.
volume label The first block of the first backup image on
a volume. It contains the volume ID, owner

Oracle Internal & Oracle Academy Use Only


name, and date and time for the volume
creation.
volume sequence file A file that contains a unique volume ID to
assign when labeling a volume
volume set The volumes that comprise a backup image
volume set expiration time The date and time on which a volume set
expires, computed by adding the write
window duration, if any, to the time at
which the first backup image file was
written to the volume set, then adding the
volume set retention period
volume tag A field that is commonly used to hold the
barcode identifier for the volume. Each
Oracle Secure Backup volume has an
associated field called a volume tag. It is
another name for the barcode that can be
found in the volume label.
WAN Wide-area network, or a computer network
that spans a relatively large geographical
area. Typically, a WAN consists of two or
more local-area networks (LANs).
Computers connected to a wide-area
network are often connected through public
networks, such as the telephone system.
They can also be connected through leased
lines or satellites. The largest WAN in
existence is the Internet.

Oracle Database 10g: Backup and Recovery D-18


World Wide Names (WWNs) A unique identifier for devices on a storage
area network (SAN), similar to a media
access control (MAC) address for devices
connected via Ethernet. WWNs consist of
16 hexadecimal digits grouped as 8 pairs.
These are written with colon characters
separating each pair. The format of the
WWN is defined by the Institute of
Electrical and Electronics Engineers
(IEEE). It is also referred to as a WWPN
(Worldwide Port Name) or WWNN
(Worldwide Node Name).
WORM Write Once Read Many times; a class of

Oracle Internal & Oracle Academy Use Only


optical recording systems that allow
recording and adding data but not altering
recorded data
write date Defines the period of time, starting from
the volume’s first data write operation,
during which updates to the volume are
allowed
write-protect To mark a file or media so that its contents
cannot be modified or deleted. Write-
protected files and media can only be read;
you cannot write to them, edit them,
append data to them, or delete them.
write window The period of time for which a volume set
remains open for updates, usually by
appending additional backup images. The
write window opens at the time the volume
set is created, and closes after this specified
period has elapsed. After the write window
closes, Oracle Secure Backup does not
allow any further updates to the volume set
until it expires, or until it is relabeled,
reused, unlabeled, or forcibly overwritten.

Oracle Database 10g: Backup and Recovery D-19


Oracle Internal & Oracle Academy Use Only

You might also like