Академический Документы
Профессиональный Документы
Культура Документы
Symantec
NetBackup 7.x for
Oracle for UNIX
200-002674
COURSE DEVELOPER
Lisa Childress
LEAD SUBJECT MATTER
EXPERTS
Geoff Bergren
Dustin Scharf
TECHNICAL
CONTRIBUTORS AND
REVIEWERS
John Gerhardson
Lisa Goldring
Table of Contents
Course Introduction ................................................................................... Intro-1
Lesson 1: Oracle Concepts
Oracle architecture ...................................................................................... 1-4
Oracle instance ......................................................................................... 1-22
Environment variables and functions ........................................................ 1-25
Database queries ...................................................................................... 1-39
Oracle alert log and trace files ................................................................... 1-41
Lesson 2: Database Backup and Restore Fundamentals
Database failures ......................................................................................... 2-4
Database backup types.............................................................................. 2-19
Protecting your databases ......................................................................... 2-26
Lesson 3: NetBackup Essentials
The NetBackup environment ....................................................................... 3-4
NetBackup concepts ................................................................................. 3-13
NetBackup notify scripts ............................................................................ 3-26
iii
Copyright 2011 Symantec Corporation. All rights reserved.
Appendix: Labs
Intro-1
Lesson introduction
This introduction provides a high-level abstract of the Symantec NetBackup 7.x
for Oracle course, including its intended audience and instructional objectives.
Importance
Before exploring the particulars of this course, you should understand for whom
it is intended and the tasks it addresses.
Intro-2
Course objectives
This course describes the proprietary backup functionality of Oracles RMAN,
how it is used to back up and restore Oracle database components, and how
NetBackup for Oracle enhances RMANs capabilities.
Importance
Intro-3
Intended audience
This course traditionally enrolls two distinct audiences:
Intro-4
Course prerequisites
This course builds on concepts introduced in the Symantec NetBackup 7.x
Administration for UNIX course.
Students attending as DBAs should be familiar with Oracle database
administration. Familiarity with NetBackup 7.x is expected.
Intro-5
10
Intro-6
11
1-1
Overview
This lesson describes the essential files and processes that comprise an Oracle
database and how Oracle uses them for data storage.
Importance
12
1-2
After completing this lesson, you will be able to describe the underlying
architecture of an Oracle database with an understanding of how it relates to the
backup and restore process. You will also be able to perform fundamental tasks
that are required as you move into backup and restore functions later in the
course.
13
1-3
After completing this topic, you will be able to identify the components of an
Oracle database.
14
1-4
Oracle architecture
A user interfaces to an Oracle database through a front-end application process
that communicates in a client/server relationship with an Oracle server process.
The Oracle server process executes the user or application requests upon the
database.
15
1-5
16
1-6
Every database has two or more redo log files. The complete set of redo log files
for a database is collectively known as the databases redo log. The primary
function of the redo log is to record all changes made to the database. If a
failure prevents modified data from being written permanently to a data file,
changes are still available from the redo log. Therefore, data is never lost.
17
The redo
Th
d llog iis critical
iti l iin protecting
t ti a d
database
t b
against
i t ffailure.
il
Th
The iinformation
f
ti
in the redo log is used only to recover the database from a system or media
failure that prevents data from being written to a databases data files. The
process of applying the redo log during a recovery operation is called rolling
forward.
Data is written to the redo log files sequentially. When one log file is filled, the
next one is used. After the last redo log is used, Oracle cycles back to the first
log file.
When a set of changes to the database is committed, Oracle generates a new
redo log record and assigns an SCN to the set of changes.
There are two categories of redo log files: online and archived.
1-7
Oracle generates online redo log files by default. These are simply another
name for the redo log files.
Archived redo log
g files
Archived redo log files contain redo entries and are copied to one or more
archive destinations before reuse.
If the database runs in ARCHIVELOG mode, online redo logs are archived
before reuse, and the database can be fully recovered from both application and
hardware failures. The database can also be backed up when it is open.
g are not archived, and
If the database is in NOARCHIVELOG mode, redo logs
the database can only be consistently backed up when it is closed after a clean
shutdown.
Maintaining archived redo log files is optional, but it is highly recommended.
Redo logs, together with archived redo logs, contain all committed transaction
information since the last backup. To perform a complete restore and recovery
of a database, first restore from backups; next recover from archived redo logs;
finally use the online redo logs used since the last backup
backup.
Redo log groups
Redo logs can be organized into groups. You can define one or more redo logs
as members within a group. Multiple members within a redo log group provide
for the mirroring of redo logs at the Oracle level. There must be at least two redo
log groups.
When a redo group is filled
filled, Oracle performs a checkpoint and then proceeds to
use the next group. A checkpoint causes all the modified contents of the buffer
cache to be flushed out to disk. When all redo log groups have been used,
Oracle cycles back to use the first group and overwrites the previous groups
contents.
Redo log members in each group should be spread across multiple disks,
preferably disks mounted under separate disk controllers. This prevents data
l
loss
if a di
disk
k containing
t i i th
the online
li redo
d llog groups ffails
il or if a di
disk
k controller
t ll
fails.
18
1-8
An undo record represents the before image of a block that is safely stored in
rollback segments before an application is allowed to change it. Undo records
are used to return blocks to a previous consistent state in the following
situations:
it ti
19
During database recovery, undo records are used to undo any uncommitted
transactions in progress at the time of the database failure.
1-9
20
1-10
21
Unlike a traditional PFILE, any changes made to the database using the ALTER
SYSTEM statement are automatically reflected in the SPFILE; therefore, manual
updates are not necessary for persistent changes
changes.
CONFIDENTIAL - NOT FOR DISTRIBUTION
1-11
To view parameter settings in the PFILE, use any text editor to open the file and
view it.
g an editor to view settings
g in the SPFILE is not recommended
However,, using
because of the danger of accidently corrupting the file. Because database
startup fails if the SPFILE is corrupted, it is recommended to use an alternate
method.
View parameter settings in the SPFILE using:
TYPE
VALUE
large_pool_size
Biginteger
8388608
NAME
TYPE
VALUE
shared_pool_size
Biginteger
33554432
22
NAME
VALUE
control_files
/oracle/oradata/CONTROL01.CTL,
/oracle/oradata/CONTROL02.CTL,
/oracle/oradata/CONTROL03.CTL
Note: You can also use the V$SPPARAMETER view to determine if you are
using a PFILE: if the "value" column is NULL for all parameters, you are using a
PFILE.
1-12
1. As the Oracle user, use the orapwd utility to create a password file, as
f ll
follows:
$orapwd file=filename password=password entries=max_users
23
The filename is the name of the password file. The path defaults to the current
directory unless a full path is specified in the command. The password is the
password for the SYS user of the database. The max_users value is the
number of users that can be granted SYSDBA or SYSOPER.
2 Edit th
2.
the parameter
t file
fil and
d ensure th
the remote_login_passwordfile
l i
dfil is
i
set to EXCLUSIVE. When this parameter is set to SHARED, the password
file can be used by multiple databases, but only the SYS user is recognized.
If this parameter is set to EXCLUSIVE, only one database can use the
password file, but multiple users can exist (in addition to SYS).
3. Add users and grant them SYSDBA or SYSOPER privileges. The information
is automatically added to the new password file.
CONFIDENTIAL - NOT FOR DISTRIBUTION
1-13
24
The server process reads data from the data files into the buffer cache within
the SGA where it performs transactions by modifying the contents of the buffer
cache.
cache
When changes are made to blocks within the buffer cache, Oracle copies the
original contents of the blocks into rollback segments (or tablespaces) before
applying the changes. This enables an incomplete transaction to be rolled back.
1-14
Blocks
Bl
k are modified
difi d iin th
the b
buffer
ff cache
h b
before
f
th
the changes
h
are written
itt tto th
the
datafiles on disk. Periodically, all the modified buffers are written to the datafiles
in system events called checkpoints.
25
Buffers are also written to disk between checkpoints if space is needed in the
buffer cache for new data blocks. When space is needed for new data blocks,
Oracle uses a least recently used (LRU) algorithm to manage the aging of data
buffers out of the buffer cache.
The size of the database buffer cache is initially determined by the database
block size parameter DB_BLOCK_SIZE and by the number of blocks cached in
memory, as indicated by the parameter DB_BLOCK_BUFFERS. However,
memory structures are dynamically tuneable as of Oracle 9i.
1-15
26
1-16
Redo log buffers improve database performance by reducing the I/O required to
maintain a consistent record of changes. However, redo log buffers are flushed
to the online redo logs during checkpoints and any time modified data buffers
are flushed
fl h d to
t the
th datafiles
d t fil on disk.
di k To
T ensure transaction
t
ti information
i f
ti is
i safely
f l
stored on disk in the event of database failure, the contents of the redo log
buffers are always flushed before the data buffers.
27
1-17
Circumstances that cause the DBWR process to write modified blocks include:
28
Performing a checkpoint
The DBWR process updates the datafile contents with committed
transactions within the redo log.
Online back
backup
p performed on a tablespace
1-18
Processes
The log file writer process (LGWR)
All changes made to data blocks in the database buffer cache are recorded in
the redo log buffer. At certain times, the LGWR process writes the transaction
information recorded in the redo log buffers to the online redo logs. Events that
force the redo log buffers to flush include:
29
Checkpoints
ARCH is an optional process that copies the contents of the online redo log to
an archive log file that you can then back up. In order to run ARCH, the
database must run in ARCHIVELOG mode.
CONFIDENTIAL - NOT FOR DISTRIBUTION
1-19
PMON monitors user processes accessing the database and cleans up after
abnormal termination of a user process.
30
1-20
Checkpoints
Checkpoints are critical Oracle system events that provide a point of database
consistency that is the basis for recovery operations.
31
The LOG_CHECKPOINT_TIMEOUT
LOG CHECKPOINT TIMEOUT parameter in the parameter file
1-21
After completing this topic, you will be able to describe an Oracle instance and
the basics of its operation from a storage perspective.
32
1-22
Usually, there is one instance per database. However, Oracle Real Application
Clusters (RAC) allow multiple instances per database. This enables higher
performance access to the database on loosely coupled computer architectures.
33
1-23
34
Data files
Control files
DBWR
SMON
PMON
CKPT
LGWR
ARCH
CONFIDENTIAL - NOT FOR DISTRIBUTION
1-24
35
1-25
Th ffollowing
The
ll i environment
i
t variables
i bl are critical:
iti l
36
ORACLE_BASE defines the path to the base directory for the Oracle
installation. An example is /opt/oracle.
ORACLE SID d
ORACLE_SID
defines
fi
th
the O
Oracle
l server system
t
id
identifier
tifi (SID).
(SID) Th
The SID
uniquely identifies a specific Oracle instance. For single instance databases,
the SID is probably the same as the database name.
1-26
Database administration
You perform database administration using SQL*DBA commands.
To perform database administration, connect to the database using a database
account that has database administrator (DBA) privileges.
By default, two database accounts with DBA privileges are created for each
database. These accounts are SYS and SYSTEM.
The SYS account owns all of the critical database tables, which are
automatically updated during database operation. Do not alter these tables
manually.
37
The SYSTEM account does not own any table by default. Use this account to
create tables and views that contain general database or user data.
1-27
Type the username/password pair directly on the command line when you invoke
SQL*Plus.
The following examples invoke SQL*Plus for a user system whose password is
manager:
38
Example 1
$> sqlplus
Enter user name: system
Enter password: manager
SQL>
Example 2
$> sqlplus system/manager
SQL>
1-28
39
The first example on the slide invokes SQL*Plus without starting the database,
connects to the database as user SYS with DBA privileges (using the remote
password change_on_install), and starts the database.
The second example on the slide shows a user connecting using OS
credentials.
1-29
To log on to a remote database instance, use SQL*Plus and provide the location
of the server as it is configured in the tnsnames.ora file.
40
1-30
41
1-31
$sqlplus lchildre23/mypassword@RMANCAT
42
1-32
43
Shutdown
All files are closed and the instance is not started.
Nomount
The instance is started,, but no files are opened.
p
Use startup
p nomount
when first creating the database or restoring the control file.
Mount
The instance is started and the control file is opened. No other files are open.
Use startup mount for DBA operations, such as recovery or changing
between archivelog mode and noarchivelog mode.
Open
Th instance
The
i t
is
i started,
t t d the
th control
t l file
fil is
i opened,
d and
d allll other
th fil
files are
opened. Use startup open for normal startup of a database. Open is the
default parameter to start up.
1-33
This diagram illustrates the processes Oracle undertakes when each of the
three startup commands runs.
44
1-34
45
Normal
Immediate
Transactional
Abort
The shutdown normal command waits for connected users to end their
sessions normally. This method also enables all running processes to terminate
normally. During a backup, the start of the backup may be delayed or blocked if
a user does not log off.
1-35
46
1-36
47
1-37
The slide on this page shows a summary of the shutdown modes that are
discussed in this topic.
48
1-38
After completing this topic, you will be able to query an Oracle database about
its structure.
49
1-39
50
1-40
After completing this topic, you will be able to use the Oracle alert log and
Oracle trace files when debugging an Oracle environment.
51
1-41
52
The alert log is continually updated with information about actions such as:
Recovery Actions
Log Switches
DDL statements
1-42
Trace files, such as the alert log, are not automatically purged and must be
managed by the DBA to prevent disk space problems.
53
1-43
Lesson summary
This lesson covered the basic architecture, functions, and processes of an
Oracle database. It also described the methods of starting and stopping an
Oracle database, how to query the database about its structure, and how to use
the Alert Log and trace files to debug errors.
Reference materials
54
Kevin Loney and Bob Bryla. Oracle Database 10g DBA Handbook.
Emeryville, CA: The McGraw-Hill Companies, Inc., 2005.
1-44
55
2-1
Lesson introduction
This lesson describes the fundamentals of backing up and recovering a
database.
Importance
56
2-2
After completing this lesson, you will be able to describe the most common
causes and corresponding consequences of database failure. With that
knowledge, you will be able to outline the different methods and types of
database backup, the strengths and weaknesses of each, and the necessary
components for each method.
57
2-3
58
2-4
Statement failure
59
Instance failure
An instance failure follows the failure of either the System Global Area (SGA)
or the background processes. Changes to the contents of the SGA buffer
cache may not be written to the data files.
CONFIDENTIAL - NOT FOR DISTRIBUTION
2-5
Media failure
Media failure is an external failure caused by the crash of the media or the
physical device containing the media that store the files that support the
database. An example of this type of failure is a hard drive crash that results
in the loss of data from a tablespace.
60
2-6
Note: For the purposes of this lesson, the terms restore and recover are defined
as follows (from the Oracle Backup and Recovery Guide):
61
D t fil
Datafiles
The Oracle datafiles contain your critical user data.
Control File
The control file is a binary file that contains information required to maintain
and verify database integrity. Every time an Oracle instance mounts a
database, the control file is read to locate data and redo log files. All control
fil are updated
files
d t d continuously
ti
l d
during
i d
database
t b
use.
CONFIDENTIAL - NOT FOR DISTRIBUTION
2-7
Parameter file
The parameter file contains all parameter settings for the Oracle database.
The Oracle directory structures containing the Oracle software and binaries
are also critical for successful recovery of a database in the event of
complete system failure.
62
2-8
Managing datafiles
Managing your datafiles requires thought and planning. Before you configure a
NetBackup policy to back up your Oracle databases, determine your backup
strategy:
63
Should you perform full backups only or full backups plus incremental
backups?
Full backups every time are ideal for fast, easy restores, but can be too timeconsuming to be practical. Larger databases usually require incremental
backups.
2-9
It is also recommended that you back up the control file after every change to
the physical structure of the database. Examples of commands that result in
structural changes are:
ALTER DATABASE [ADD|DROP] LOGFILE
64
2-10
Because the control file is open when the database is open, a normal file backup
is not possible while the database is up. However, Oracle provides two methods
for hot control file backups.
p
Because of this problem, backing up and restoring the control file from a
trace file is an action of last resort. Use it only when all other restore
attempts fail.
65
2-11
Configure at least three online redo log groups. If one redo log group fails,
you still have two groups to use for continuity. Oracle switches redo logs
when one group is full and performs a checkpoint operation.
66
2-12
67
2-13
Parameter Files
A PFILE, which is the traditional type of parameter file, must be backed up
with an ordinary file system backup. RMAN does not back up PFILEs. To
back up the Oracle directory structure containing the PFILE, perform a file
system backup with NetBackup.
SPFILEs are backed up automatically by RMAN as of Oracle version 9i.
Password files
68
2-14
69
2-15
The following table describes the roll forward types and their functions.
70
RollForwardType
Function
Timebased
Recoverdatauptoaspecifiedpointintime.
Changebasedrecovery
RecoveruntilthespecifiedSystemChangeNumber
(SCN)
L S
LogSequencerecovery
R
Recoveruntilthespecifiedlogsequencenumber.
til th
ifi d l
b
These options enable you to stop the roll forward process at a point that avoids
applying unwanted changes; for example, the inappropriate deletion of a table.
2-16
When the database is started and the data files do not reflect a current version
of the database (as can occur with an instance failure), Oracles SMON
automatically rolls the database forward by reapplying the changes recorded in
the redo log files (both archived and online).
71
2-17
72
2-18
After completing this topic, you will be able to identify the types of database
backups.
73
2-19
74
The choices you make when performing physical backups are determined by the
requirements and demands of your Oracle database. If you can take the
database offline with little or no impact on operations, then you can perform a
consistent backup (sometimes referred to as an offline or cold backup). If,
however, your database must operate 24 hours per day, seven days per week,
then the preferred method is to perform an inconsistent backup (sometimes
referred to as an online or hot backup).
2-20
A physical backup copies the underlying physical files that constitute the
database. Physical backups can be performed on all elements of the Oracle
database structure, ranging from a single data file to the complete database.
Physical
y
backups
p can be p
performed using
g NetBackup
p alone by
y shutting
g down
the Oracle instance and performing a consistent (cold) backup of the datafiles.
To perform inconsistent (hot) physical backups to tape, use RMAN and NBUO
together.
Copyright 2011 Symantec Corporation. All rights reserved.
Logical backup
75
A logical backup is one that copies a binary version of the database using the
database export utility. NetBackup for Oracle also supports XML format for
exports using the bporaexp utility.
utility
Note: Logical backups are not the subject of this course and are not discussed
in detail. This course deals primarily with physical backup and recovery
operations.
2-21
With a cold backup, recovery actions are not needed to restart the database
after a restore. Because the database was closed cleanly, the contents of the
control file and the data file headers are consistent.
76
2-22
With a hot backup, recovery actions are necessary before you can restart the
database after a restore.
77
2-23
D t b
Database
b
backup
k
When you conduct a database backup, all constituent files of the database
are backed up as a coherent whole. This includes all data files, the SPFILE
(as of Oracle9i), and the database control file.
78
T bl
Tablespace
B
Backup
k
An individual tablespace can be backed up independent of the remainder of
the database. Because tablespaces can consist of multiple data files,
backing up tablespaces is more common than backing up individual data
files.
Because tablespace backups can only be performed as hot backups, they
require the database to run in ARCHIVELOG mode
mode.
CONFIDENTIAL - NOT FOR DISTRIBUTION
2-24
79
2-25
After completing this topic, you will be able to explore the utilities and tools
available for protecting an Oracle database.
80
2-26
81
An Oracle database has an integrated safety mechanism that protects the data. This
mechanism is known as the ARCHIVELOG mode. When a database runs in
ARCHIVELOG mode, it automatically archives the online redo logs, which track all
changes made to the database.
A database must run in either ARCHIVELOG mode or NOARCHIVELOG mode. One of
the most important decisions you make as an Oracle DBA is whether to run your
databases in ARCHIVELOG mode
mode. You make certain tradeoffs when you decide to
operate in ARCHIVELOG mode.
Advantages
You can perform hot backups, and your database can remain online continuously.
If managed properly, you can recover completely from any type of failure.
You can back up individual tablespaces or datafiles.
You have more recovery options in ARCHIVELOG mode than in NOARCHIVELOG
mode.
d
Disadvantages
ARCHIVELOG mode requires more disk space and increases I/O traffic over
NOARCHIVELOG mode, due to the continual archiving of redo log files.
Increased management and administrative work is required. This work includes
maintaining adequate disk space, establishing target directories for the archived
redo log files, and verifying that archived log files are copied to tape.
2-27
Backup management
You can manage backup and recovery operations for an Oracle database using
Oracles RMAN utility, a third-party application such as Symantec NetBackup, or
a combination of the two.
RMAN
The Oracle Recovery Manager (RMAN), a utility included with Oracle8 and
higher, controls the backup processes for an Oracle database. RMAN is a
command-line based utility. GUI applications, such as the Oracle Enterprise
Manager (OEM), help simplify and automate many of RMANs functions and
processes.
82
2-28
Symantec NetBackup
Symantec NetBackup is an operating system (OS)-based file system backup
tool. NetBackup can independently back up an Oracle database without
integrating with RMAN. To do this, the database is shut down, and
NetBackup backs it up as if it were any other type of file. Use NetBackup
notify scripts to automate the process of shutting down, backing up, and
restarting a database.
Because NetBackup treats the closed database as an OS file, this type of
database backup is sometimes referred to as a file system backup or an OSlevel backup.
p Using
g NetBackup
p to p
perform OS-level backups
p is not a viable
option if your Oracle database must remain online continuously.
83
2-29
Lesson summary
This lesson covered the types of failure a database can experience and the
corresponding methods of recovering from those failures. It also outlined what is
required to prepare for backup and recovery operations. Finally, it described
tools and utilities you can use to back up and recover an Oracle database.
Reference materials
84
Kevin Loney and Bob Bryla. Oracle Database 10g DBA Handbook.
Emeryville, CA: The McGraw-Hill Companies, Inc., 2005.
2-30
85
3-1
Lesson introduction
This lesson serves as an introduction to the NetBackup product, explaining at a
high level what NetBackup is and how it works.
Importance
To effectively and efficiently use NetBackup, you must first be familiar with what
the product does
does, how it can be configured
configured, and the terminology you use as you
learn to administer a NetBackup environment.
86
3-2
87
3-3
After completing this topic, you will be able to identify the function of the
NetBackup master server, media server, EMM server, and clients.
88
3-4
89
Media servers
The Media server has some form of storage attached to iteither directly or
through the network. Media servers manage the writing and reading of data
to and from media. (Data management)
3-5
Clients
Clients are any machines that have data to back up and on which NetBackup
Client software has been installed.
Symantec OpsCenter
90
3-6
NetBackup Server
NetBackup Server is designed for UNIX and Windows platforms.
NetBackup Server can perform backup and restore operations, but you can
have only one media server, and it is the same machine as the master server
and the EMM server.
A NetBackup domain is defined as all of the media servers and clients owned by
one NetBackup master server. In a NetBackup Server environment, this
includes the master server because there are no separate media servers.
91
3-7
Generally, the EMM server and master server are the same machine.
92
3-8
As the data center gets larger, more media servers can be added to distribute
the load required for backing up clients and applications. Media servers may be
added due to increased data size, increased number of clients and applications,
or due to the distributed networks of client machines.
93
3-9
As you can see on the slide, you can have separate data centers that each have
their own master and EMM servers. Each master server manages its own media
servers. A media server can be owned by only one master server. The EMM
server manages media and devices in its location. Devices are not shared
between separate EMM servers.
94
In the diagram on this slide, there are two NetBackup domains. NetBackup
domain 1 is defined as all the media servers managed by the first master server.
NetBackup domain 2 is defined as all the media servers managed by the second
master server.
In addition, an OpsCenter server has been added to help centrally manage and
report on the multiple master servers and their NetBackup domains.
3-10
A SAN media server is a specialized media server that can only back up its own
data to devices managed by itself. Unlike traditional media servers, such as
Media 1 in this diagram, the SAN media server cannot back up data residing on
other clients.
95
The Oracle database server in the diagram on the slide has the NetBackup
media server software installed and is acting as a SAN media server to perform
backups of local data to shared tape devices on the SAN. The backups perform
better because data does not have to travel across the LAN to a remote media
server. Data travels directly from shared memory on the Oracle server (the SAN
media server) to the tape devices.
Backup devices used by SAN media servers can be SAN-attached as shown on
the slide or directly attached to the SAN media server itself. Deployment of
SAN-attached tape hardware is not a requirement.
3-11
NetBackup OpsCenter
OpsCenter is a Web-based software application that helps organizations by
providing visibility into their data protection environment. By using Symantec
OpsCenter, you can track the effectiveness of data backup and archive
operations by generating comprehensive reports.
96
3-12
97
3-13
The purpose of any backup software is to back up client and system data to a
safe place where it can be used, if needed, to restore that data. At this time,
NetBackup may be unfamiliar to you. By the end of this topic, you will
understand, at a very high level, all the components that enable backups.
98
3-14
NetBackup images
When a client sends its backup data to the media server, NetBackup
compresses it in GNU tar format and writes it to the backup media. This
compressed backup data is known as a NetBackup image, sometimes referred
to as a backup image or simply an image.
99
3-15
Storage units
A storage unit is a group of one or more storage devices of a specific type and
density that attach to a NetBackup server. The media can be removable (such
as tape) or a directory on a hard disk. Removable media can be in a robot or a
stand-alone drive. During a backup or archive, NetBackup stores the backup
data on the storage units that were specified during the policy configuration.
Storage units are logical entities within NetBackup that have several benefits,
such as:
100
NetBackup uses storage units rather than specific storage devices to help
ensure backup success. When configuring backups, you simply assign the
storage unit with the type of storage needed for a backup, as opposed to
selecting specific storage devices. This provides a virtual approach to
backup storage. If you need additional storage of a specific type, NetBackup
uses the
th configured
fi
dh
hardware
d
automatically.
t
ti ll
CONFIDENTIAL - NOT FOR DISTRIBUTION
3-16
Volumes
When a tape is configured into media manager, it is referred to as a volume and
assigned a unique media ID to identify it. An optical platter is actually two
volumes because it can be written on either side each side being defined as a
volume.
Media manager volumes are logical units of data storage or cleaning capability
on media (tapes or optical disks) that have been assigned media IDs and other
attributes, which are recorded in the EMM database.
101
3-17
Volume pools
A volume pool is a set of volumes from which NetBackup can draw when
performing backups. The volume pool identifies sets of volumes whose use can
be reserved for specific backup jobs. The following volume pools are preconfigured:
102
NetBackup
NetBackup is the default volume pool and is automatically used for all
backups unless the administrator over-rides the default setting in the backup
policy. The NetBackup volume pool must be used for cold NetBackup catalog
backups (unless the Vault option is used to perform catalog backups).
DataStore
The DataStore volume pool is provided for Symantec partners in conjunction
with the DataStore API to enable access to media manager library functions.
CatalogBackup
The CatalogBackup volume pool is used for hot NetBackup catalog backups
that became available with NetBackup version 6. You may also configure
additional volume pools for hot catalog backups if desired.
CONFIDENTIAL - NOT FOR DISTRIBUTION
3-18
None
The None volume pool is provided for non-backup activities. To enable
NetBackup to recognize tapes as cleaning tapes and use them to clean
drives,, place
p
them into the None p
pool.
Scratch pool
The Scratch pool is an optional volume pool that you can configure. If a
Scratch pool is configured, it can be used as a temporary holding area for
unassigned media. Media manager moves volumes from the Scratch pool to
other volume pools that do not have volumes available
available.
103
3-19
104
The Image database contains information about what has been backed up.
The NetBackup configuration files include flat files concerning policy and
schedule information.
The relational database includes the media and device configuration for the
environment, or the EMM database, as well as any other relational database
that has been configured for NetBackup, such as Oracle.
3-20
NetBackup policies
A NetBackup policy defines the rules that NetBackup follows when backing up
clients. A policy can contain one or more clients, and every client must belong to
at least one policy.
A policy is a template for the backup of a single client or a group of clients with
common attributes and a common file list. Policies determine:
105
What
Who
Where
When
How
3-21
Backup types
106
A full backup backs up all files specified in the backup selections list for the
policy, regardless of when the files were last modified or backed up.
A user backup is initiated by the user through the Backup, Archive and
Restore client interface. A user backup backs up all files the user specifies.
CONFIDENTIAL - NOT FOR DISTRIBUTION
3-22
107
A user archive archives all files that the user specifies. An archive is a
special type of backup that first backs up the file and then deletes it from the
local disk if the backup is successful. This frees local disk space while still
keeping a copy for future use.
3-23
Backing up data
The graphic on the slide presents a more detailed picture of how NetBackup
backs up data.
First, NetBackup backs up the data to a tar file image over the network to tape,
disk, or other storage devices, according to your policies. During the backup,
NetBackup keeps status information in its log files, enabling you to monitor or
report on the backup.
108
Then, NetBackup stores information about what has been backed up in the
Image database and information about the media and volumes used during the
backup in the EMM database.
3-24
Restoring data
You can perform a restore operation as an administrator from the master server
or users can request their own restore operation to occur. To restore data, use
the NetBackup Backup, Archive, and Restore interface.
Simply select the files to be restored. NetBackup uses the information in the
Image database, the NetBackup database, and the EMM database to identify
which files are available, where the backup images are located, and where they
should be restored. Because NetBackup maintains status information about
restores in its log files, you can monitor and report on restores just like backups.
109
3-25
After completing this topic, you will be familiar with NetBackup notify scripts and
how to use them to automate database shutdown and startup for cold Oracle file
system backups.
110
3-26
111
When using NetBackup to perform cold Oracle database backups without the
Oracle agent, you can incorporate the (unsupported) scripts included with the
NetBackup installation. These scripts enable simple integration with an Oracle
database in order to shut down or restart the database.
bpstart
p
_notify
y and bpend
p
_notify
y are the NetBackup
p scripts
p that can be
configured to respectively shut down or restart an Oracle database. You can
modify attributes related to these scripts (such as the timeout period) in the
bp.conf file located in /usr/openv/netbackup on the client, which is the
database server in this case.
You can customize the scripts so that they are only executed when a specific
policy is invoked by naming the script as follows:
bpstart_notify.policy_name
bpend_notify.policy_name
3-27
Additional logic can be added to the scripts as desired. For example, you may
want to include statements in the bpstart_notify script to check the Oracle
processes after issuing the shutdown immediate command.
112
3-28
Lesson summary
You are now familiar with the essential components of NetBackups environment
and possible configurations. Also, you are aware of terms that relate to
NetBackup and are familiar with the NetBackup catalogs. In addition, you were
introduced to NetBackup notify scripts, which provide a simple method of
automating database shutdown and startup for cold backups.
Reference materials
113
3-29
114
3-30
115
4-1
Lesson introduction
This lesson describes how RMAN performs database backups and how users
(DBAs) can configure, execute, and monitor backup operations through RMAN.
Importance
RMAN is the Oracle utility that Symantec NetBackup for Oracle (NBUO)
g in order to p
perform high-level
g
database backup
p operations.
p
It is
manages
necessary to learn configuration and execution of RMAN backups before
incorporating NBUO in an overall backup strategy.
116
4-2
After completing this lesson, you will be able to leverage your understanding of
RMANs structure and commands as they relate to backup and restore
functions. Specifically, you will configure RMAN and its components in
preparation for database backup.
117
4-3
118
4-4
119
4-5
Channels
120
4-6
You can create a recovery catalog within an existing database. It can hold
metadata pertaining to several different target databases, but it should not be
located within one of its own target databases.
121
4-7
Contents
The recovery catalog is a separate Oracle database that contains information
about the target databases structure. It also holds metadata pertaining to
backup, restore, and recovery operations that are performed upon the target
d t b
database.
The
Th information
i f
ti can be
b used
d to
t determine
d t
i how
h
backup
b k and
d
recovery operations are conducted.
The recovery catalog can also contain stored scripts, providing you with a
readily available repository for your regularly executed RMAN scripts.
Resynchronization
The recovery catalog metadata is obtained from the control file of the target
d t b
database.
In
I order
d to
t maintain
i t i concurrence between
b t
the
th two,
t
regularly
l l
resynchronize the contents of the recovery catalog with the control file.
Recovery catalog resynchronization is covered in more detail later in this
course.
Control file
Alternately, you can house the RMAN repository within the control file of the
target database
database. This method does not support stored scripts.
scripts This method
also introduces more risk than the use of a separate recovery catalog.
Because the repository cannot be used to recover a database after a control
file failure; the RMAN repository information is lost along with the control file.
122
4-8
123
4-9
You create
Y
t the
th PL/SQL packages
k
th
thatt manage th
the RMAN repository
it
when
h you
issue the create catalog command.
124
4-10
Stand-alone commands
Stand-alone commands function independently; they are not subcommands
within a run statement. Stand-alone commands are used to manage the
recovery catalog, backup data, metadata, and scripts. Examples of standalone
l
commands
d iinclude:
l d
catalog
change
create catalog, drop catalog, upgrade catalog
create script, delete script, replace script
crosscheck
h k
delete expired backupset
list
report
The list and report commands enable you to perform queries about
available backup
p sets. These two commands are described in a later lesson.
Job commands
Job commands cannot run independently; they are subcommands within a
run statement. Job commands within the run statement are executed
sequentially.
If a command within the statement fails, RMAN ceases processing the
statement; further commands do not execute. Job commands manage and
control
t l backup
b k and
d restore
t
operations.
ti
E
Examples
l off jjob
b commands
d iinclude:
l d
allocate channel
backup
copy
duplicate
recover
restore
switch
125
Both
Three commands can be executed independently or as a subcommand
within a run statement. These three commands are:
change
crosscheck
delete
4-11
RMAN has
h many command
d line
li parameters.
t
Th
The ffollowing
ll i ttable
bl d
describes
ib some
of the most commonly used parameters:
126
RMANcommandline
parameter
Parameterargument
type
Purpose
target
Charstring
Definestheusername,password,and
servicenameofthetargetdatabase
catalog
Charstring
Definestheusername,password,and
servicenameoftherecoverycatalog
nocatalog
Noarguments
Preventsarecoverycatalogfrombeing
used(default)
4-12
RMANcommandline
parameter
Parameterargument
type
Purpose
cmdfile
Charstring
Indicatesthenameofacommandfile
scripttoexecute
log
Charstring
CausestheRMANsessiontobelogged
Thelogfiletakesthenameofthe
argumenttothisparameter.This
parameteralsocausesallRMAN
messagestothescreen(exceptthe
RMAN prompt) to be suppressed
RMANprompt)tobesuppressed.
trace
Charstring
CausestheRMANsessiontobetraced
Thetracefiletakesthenameofthe
argumenttothisparameter.
append
Noarguments
Causesthelogfile(definedbythelog
parameter)tobeappended
parameter)
to be appended
debug
Variousarguments
CausesRMANtobestartedindebug
mode
msgno
Noarguments
CausestheRMANprefixtobeshown
witheacherrormessage
If thi
Ifthisoptionisnotspecified,somenon
ti i
t
ifi d
errormessagesdonotincludeamessage
number.
127
send
Charstring
Sendsthecharacterstringmessageto
themediamanagementlayer
pipe
String
InvokestheRMANpipeinterface
timeout
Integer
Indicatesthenumberofsecondstowait
forpipeinput
4-13
Interactive mode
In this mode, you enter commands directly at the RMAN command line
interface. This method limits you to entering one command at a time.
Batch mode
In batch mode, you create a script file containing the set of RMAN
commands to be executed. You execute the script by supplying it as a
parameter to an RMAN command at the RMAN command line.
128
Stored script
This mode is similar to the batch mode, except that the script files are stored
in the RMAN reco
recovery
er catalog and are executed
e ec ted from there.
there Yo
You can view
ie a
list of all available stored scripts by querying the view rc_stored_script:
SQL> SELECT * FROM rc_stored_script;
4-14
129
Th backup
The
b k or copy command
d iis iissued
d outside
t id a run bl
block.
k
A run block is used, but the last command is not backup or copy.
Use the configure command to specify default values for RMAN parameters,
such as those shown in the slide. These defaults are tracked in the control file
and recovery catalog (if used), and remain persistent unless you change them
again using the configure command.
In addition to the configure options shown in the slide, you can also specify other
defaults, such as the maximum size of a backup set or the default number of
channels to allocate when performing RMAN operations.
CONFIDENTIAL - NOT FOR DISTRIBUTION
4-15
RMAN>show maxsetsize;
130
4-16
For example:
131
4-17
CTRL+C
Press CTRL+C (or the equivalent attention key combination for your UNIX
system) at the RMAN command line. This is the preferred method. This
action terminates all allocated channels for the job unless they are waiting for
media management services, such as waiting for a tape to be mounted in the
tape drive.
132
4-18
133
4-19
134
I
Image
copy
An image copy (sometimes referred to as a data file copy) contains a single
file (data file, archive log, or control file) that you can use as is to perform
recovery. An image copy backup is similar to an OS copy of a single file,
except that it is produced by an Oracle server process, which performs
additional actions associated with the backup process. These actions include
validating the blocks in the file and registering the image copy in the control
file.
Backup set
A backup set contains one or more data files or archive logs. However, this
set cannot contain both data files and archive logs. A data file backup set can
also contain a control file backup.
A backup set is written in an Oracle-proprietary format (similar to an export
file). To extract a file from a backup set, perform an RMAN restore operation.
CONFIDENTIAL - NOT FOR DISTRIBUTION
4-20
Image copies
An image copy contains a single file (data file, archive log, or control file) that
you can use to replace the original file with no recovery operations required. It is
similar to an OS copy of a single file, except that it is produced by an Oracle
server process that performs additional actions associated with the backup
process. These actions include validating the data blocks in the file and
registering the image copy in the control file
file.
135
An image copy is created using the copy command. The following RMAN
command sequence creates an image copy of the data file df1.f, marking it as
a level 0 incremental backup:
RMAN> run {
2 allocate
2>
ll
t channel
h
l stream1
t
1 t
type di
disk;
k
3> copy datafile '$ORACLE_HOME/testdb/df1.f' to
'$ORACLE_HOME/testdb_copy/df1copy.f;
4> level 0;
5> }
CONFIDENTIAL - NOT FOR DISTRIBUTION
4-21
To replace the original file with the image copy, a switch command is provided to
point the control file at the copy and perform media recovery to make the copy
current. For example, the following command points the control file from df1.f
to df1copy.f:
RMAN> switch
it h d
datafile
t fil '$ORACLE
'$ORACLE_HOME/testdb/df1.f'
HOME/t tdb/df1 f' t
to
datafile copy '$ORACLE_HOME/testdb_copy/df1copy.f';
Image copies created by methods other than RMAN are supported. However,
before using such copies in a restore or switch, catalog them with the RMAN
recovery catalog database.
Oracle provides support for copying both closed and open files for users who
have other mechanisms for creating image copies of data files.
files For example
example,
some sites store their data files on mirrored disk volumes. This enables the
creation of image copies simply by breaking the mirrors. After the mirror is
broken, RMAN can be notified of the existence of the copy. You must notify
RMANs recovery catalog when the copy is no longer available.
136
4-22
Backup sets
137
If multiple output devices are available, you can partition backups so that
multiple backup sets are created in parallel. RMAN can also perform this backup
partitioning automatically.
A backup set is the complete set of backup pieces. It contains all of the data
from a full or incremental backup of the object specified in the backup command.
For example, the backup set created from a backup database command
contains all of the information that constitutes a full backup of the target
database.
RMAN does not combine data files and archive log files in a single backup set. If
you attempt to back up both data files and archive log files in a single backup
operation, RMAN creates a separate backup set for each.
CONFIDENTIAL - NOT FOR DISTRIBUTION
4-23
A backup set containing archived redo logs is called an archivelog backup set.
With the exception of an attached stand-alone tape drive, RMAN cannot archive
directly to tape. However, RMAN does allow you to back up archived logs from
disk to tape. During recovery, RMAN also automatically stages the required
archived logs from tape to disk.
disk
Backup set compression
The server session RMAN invokes does not write any data file blocks that have
never been used to a backup set.
RMAN groups data blocks within the data file into buffers. When RMAN reads a
used data block in the buffer, it writes only the used block to the backup set.
However, when RMAN finds four adjoining buffers of unused input blocks, it
writes a compression block to the backup set. The size of the compression block
is defined by the DB_BLOCK_SIZE parameter specified in the init.ora file.
Propriety format
Because backup set data is stored in an RMAN-specific format, you must use
RMAN to restore the data.
138
4-24
139
Backup types
Data file backup sets can be full or incremental.
Full backups
A full backup involves one or more data files and contains all of the data files
data blocks. Archive log backups and control file backups are always full
backups.
Incremental backups
An RMAN incremental backup copies only those data file blocks that have
changed since a previous backup. This saves space on the backup storage
media; however, because all the blocks in a data file must be read to
determine whether their contents have changed, this does not necessarily
save time in the backup process. RMAN determines if a block has changed
by comparing the SCN recorded within the block with the checkpoint SCN of
the parent backup.
There are two types of incremental backups, differential (noncumulative) and
cumulative. Both are based on the level indicator integer defined within the
backup set. A level 0 incremental backup copies all blocks containing data
and is the basis for subsequent incremental backups, whether cumulative or
differential. Levels can range from level 0 to level 4. if you specify an
incremental level higher than 0 and no level 0 exists for the object, RMAN
automatically performs a level 0 incremental.
CONFIDENTIAL - NOT FOR DISTRIBUTION
4-25
140
Consider the example in the table on the slide as a typical weekly backup
schedule. Because you want to conserve space on your backup media, you
decide to structure each days backup set as differential .
Differential incremental backups have the benefit of saving space on tape, but
can cause restores to be longer and more complex than cumulative backups.
For example, in the example on the slide, if a restore operation is required
between the Wednesday and Thursday incremental backups, it requires a
restore from the Sunday level 0, the Monday level 1, the Tuesday level 1 and
the Wednesday level 1 before applying any archived redo logs. If this were a
cumulative schedule, it would require only the Sunday and Wednesday
incremental backups before applying the logs.
CONFIDENTIAL - NOT FOR DISTRIBUTION
4-26
141
4-27
RMAN also does not back up standard operating system files. Back these up
using Symantec NetBackup.
142
Online redo logs are not normally backed up; they are stored as archived redo
logs using the archive process.
4-28
143
4-29
To shut down and start up the database, use the RMAN commands or the
SQL*Plus utility.
144
4-30
In the example on this slide, the run command provides a block structure for
executing complex operations.
145
There are two valid channel types: disk and a quoted string, such as
SBT_TAPE, which directs the backup to the media management API library.
Oracle version 9i enables you to simply specify type sbt instead of a
quoted string.
The format parameter is used to label the backup set pieces that are
written to disk or sent down a channel. This parameter can also be provided
to the allocate channel command, or as part of the backup
specification.
The level 0 incremental backup shown in the example performs the equivalent of
a full backup and provides a baseline for an incremental strategy.
4-31
It is important to ensure that each backup set piece has a unique name.
Formatting variables are listed in the following table:
Formatvariable
Function
%d
Specifiesthecurrentdatabasename
%n
Specifiesthedatabasename,paddedontherightwithxstoa
totallengthofeightcharacters
%t
Specifiesthebackupsetstimestamp
%s
%p
Specifiesthebackuppiecenumberwithinthebackupset
Thevalueofthisnumberstartsatoneandincrementsbyone
The
value of this number starts at one and increments by one
foreachbackuppiececreated.
%u
Specifiesaneightcharacternamecomprisedofashortened
versionofthebackupsetnumberandthetimethebackupset
wascreated
%c
Specifiesthecopynumberofthebackuppiecewithinasetof
d l db k
duplexedbackuppieces
%U
Identicalto%u_%p_%c
Ifnoothervariablesaredefined,bydefault,RMANuses%U.
Used together, %s, %p, and %t provide a unique ID for a backup set piece.
146
Note: It is recommended that you place the %t variable at the end of your
format string with no additional characters attached. On occasion, NetBackup
for Oracle attempts to determine a files timestamp based on the files name.
NBUO cannot do so if the timestamp is located in the middle of the format string
or if extra characters are attached to the %t (for example, t_%t).
4-32
BackupObjectList
Designates
Database
Alldatafiles,includingthecontrolfile
Tablespacename[,]
Alistofoneormoretablespaces
Datafilename[,]
Alistofoneormoredatafiles
A hi l
Archivelogall|specifier
ll |
ifi
A fil
Afilepatternthatcanthenbepipedthrougha
tt
th t
th b i d th
h
specifier
Thisspecifierdefinesthetimerangeorlog
sequencerangetobeusedtochoosewhicharchive
logstoincludeinthebackup.
C
Currentcontrolfile
t
t l fil
147
B k
Backsuponlythecurrentcontrolfile
l th
t
t l fil
4-33
148
The format parameter specifies a unique name for the backup piece using
substitution variables. In this case, RMAN creates a backup piece named
aatst_; the underscore is followed by the backup sets number, then the
backup piece number within the backup set, and finally the timestamp.
CONFIDENTIAL - NOT FOR DISTRIBUTION
4-34
To specify more than one datafile, separate the names with commas.
149
4-35
Because the control file is a relatively small file, it is not normally backed up
individually. The control file can be added to another backup script using the
include statement, as shown in the following example:
150
RMAN>run{
allocate channel stream1 type 'SBT_TAPE;
backup tablespace tablespace_name
include current controlfile;
}
SPFILE backup set
4-36
You can also specify ranges of archived redo log files to back up based on their
log sequence numbers or, more commonly, as a point-in-time backup based on
the log files timestamps.
151
After the archived redo log files are backed up, you can delete them to preserve
disk space.
4-37
IIn addition
dditi tto th
the allocate
ll
t channel
h
l command,
d parallel
ll l b
backup
k streams
t
require one of the following:
152
A backup object list that explicitly lists multiple objects (tablespaces or data
files) along with a filesperset parameter that forces the generation of
multiple backup sets
When employed
Wh
l
d th
thoughtfully,
htf ll parallel
ll l b
backup
k streams
t
are d
desirable
i bl b
because
they enable faster backups and less database downtime. They are also an
efficient method to control backup operations.
4-38
153
4-39
IIn the
th previous
i
example,
l RMAN uses b
both
th channels
h
l ffor b
backups.
k
Thi
This iis
because we have allocated multiple channels, and we have specified multiple
tablespaces (and multiple data files as a result).
154
4-40
155
4-41
RMAN needs to access packages at the target database that exist in the SYS
schema. RMAN also requires the privileges needed to start up and shut down
the target database. Therefore, RMAN connections to the target database are
always performed as a SYSDBA user. By default, you can use the SYS account
(as SYSDBA) to run RMAN commands, but this is not recommended. Rather,
set up a separate user account for RMAN operations and grant the new account
SYSDBA privileges.
156
4-42
Records that can be aged out or deleted from the control file are referred to as
circular reuse records. Records that are never deleted are called noncircular
reuse records.
d
157
RMAN records are circular reuse records and can be aged out of the control file
based on the CONTROL_FILE_RECORD_KEEP_TIME parameter in the
init.ora file. The default value is seven days. This means that information
about RMAN datafile and archived redo log backups can be deleted after seven
days if more space is needed for additional, newer circular reuse records. This
could be catastrophic if you choose to use the control file for your RMAN
repository. If your latest database backup is more than seven days old and has
been aged out of the control file, you can no longer use it for recovery!
Using the control file for the RMAN repository
If you choose to use the control file for your RMAN repository, set the
CONTROL_FILE_RECORD_KEEP_TIME to a value equal to, or greater than,
your backup retention period.
CONFIDENTIAL - NOT FOR DISTRIBUTION
4-43
If you choose to use a recovery catalog for your RMAN repository, the
CONTROL_FILE_RECORD_KEEP_TIME should not be an issue. All the RMAN
records are copied to the recovery catalog and synchronized with the control file.
As long as the recovery catalog is synchronized with the control file at least once
during the CONTROL_FILE_RECORD_KEEP_TIME interval, the records are
safe and are never aged out of the recovery catalog automatically.
158
4-44
After completing this topic, you will be able to configure the recovery catalog for
RMAN backups and restores.
159
4-45
After you select the database, create the RMAN user account and grant
privileges for CONNECT, RESOURCE, and RECOVERY_CATALOG_OWNER
t the
to
th new account.
t
160
4-46
RMAN>create catalog;
161
If you created a special tablespace for the recovery catalog schema objects,
specify that tablespace as follows:
RMAN> c
create
eate catalog
cata og tablespace
tab espace rmants;
a ts;
4-47
Resynchronization
162
The recovery catalog metadata is obtained from the control file of the target
database. In order to maintain concurrence between the two, regularly
resynchronize the contents of the recovery catalog with the control file.
Resynchronization can be either full or partial.
F ll res
Full
resynchronization
nchroni ation
Full resynchronization synchronizes all changed data, including metadata
about the target databases physical structure, including data files,
tablespaces, and online redo logs.
To execute a full resynchronization, use the resync catalog command.
4-48
Partial Resynchronization
Partial resynchronization synchronizes changed data in the control file but
does not resynchronize metadata about the physical structure or rollback
segments of the Oracle database.
switch
it h
copy
recover
crosscheck
list
deleteExpired
report
duplicate
T ensure a full
To
f ll resynchronization,
h i ti
connectt tto th
the recovery catalog
t l and
d run the
th
resync catalog command. Resynchronize manually after changes to the
database structure such as:
163
4-49
Lesson summary
This lesson covered the architecture, command functions, and execution modes
of Oracles resource manager (RMAN). It also introduced specific commands
and their use. Finally, the RMAN repository and recovery catalog were described
along with the process for registering a database with the RMAN recovery
catalog.
R f
Reference
materials
t i l
164
Kevin Loney and Bob Bryla. Oracle Database 10g DBA Handbook.
Emeryville, CA: The McGraw-Hill Companies, Inc., 2005.
4-50
165
5-1
Lesson introduction
This lesson details the procedures for configuring Symantec NetBackup for
Oracle and creating policies to perform database backups using RMAN and the
NetBackup for Oracle agent.
Importance
The configuration
g
of NetBackup
p for Operators
p
is a key
y component
p
of this course.
NetBackup for Operators automates backup tasks and functions as a media
manager to control tape storage devices. In addition, NetBackup for Operators
manages the backup and recovery of all parts of the Oracle database, including
archive redo logs and control files.
166
5-2
167
5-3
After completing this topic, you will be able to verify operating system and
platform compatibility for the NetBackup for Oracle software.
168
5-4
Pre-configuration requirements
The NetBackup for Oracle agent is embedded in the server and client software
with NetBackup 7.x. It no longer requires a separate installation.
However, normal configuration of the NetBackup environment is still required.
The standard NetBackup server software must already be installed on the
master server and media servers.
The machine hosting the target database must have the NetBackup server or
client software installed.
169
Finally, a valid NetBackup for Oracle license key must be added to the master
server. To add the license key, use the Help > License Keys menu option, the
get_license_key utility (UNIX/Linux), or the command line option.
Note: See the Symantec NetBackup System Administrators Guide for additional
iinformation
f
ti on adding
ddi lilicense kkeys.
5-5
170
Note: If you are installing NetBackup for Oracle on a server that is part of a
NetBackup cluster, see the Symantec NetBackup for Oracle Administrators
Guide for additional instructions.
5-6
After completing this topic, you will be able to integrate NetBackup for Oracle
with target Oracle databases.
171
5-7
172
Linking RMAN with the library provided by NetBackup for Oracle is the only
N tB k requirement.
NetBackup
i
t B
Before
f
writing
iti to
t sequential
ti l devices,
d i
such
h as ttape, th
the
Oracle server software must be linked with the media management API library
installed by NetBackup for Oracle on the client machine. The linking process is
only necessary for new installations of NetBackup for Oracle. It is not required
for upgrades of the NetBackup for Oracle software. (It is only necessary to
restart the Oracle instance for NetBackup for Oracle upgrades.)
The default location for the NetBackup API library is
/usr/openv/netbackup/bin. The name of the API library differs, depending
on your platform, as shown in the following table.
5-8
Platform
Oracle
LibraryName
AIX
64bit
libobk.a64
HPItanium
64bit
libobk.so
LinuxItanium
64bit
libobk.so
IBMpSeries
64bit
libobk.so
Solaris(SPARC)
64bit
libobk.so.64.1
Solaris(Opteron)
64bit
libobk.so.1
Linking methods
The automatic linking method is recommended; only use the manual method if
the automatic method fails or if you receive messages from Oracle indicating
that a manual relink is required.
The manual linking process is not consistent across hardware platforms and
Oracle server release levels. On some platforms (such as HP-UX), it is even
inconsistent across OS levels. Verify your client machines platform and OS
before performing the linking process. Consult the Symantec NetBackup for
Oracle Administrators Guide for step-by-step instructions for performing the
manual linking process.
173
5-9
174
If you encounter problems and are unable to link Oracle with NetBackup for
Oracle,
O
ac e, you ca
can roll
o bac
back. For
o e
example,
a p e, if tthe
eo
oracle
ac e_link sc
script
pt (or
(o you)
moved libobk.so to libobk.so.back during the linking process, enter the
following commands to roll back this change:
1. As the Oracle user, change to the $ORACLE_HOME/bin directory.
2. $cp oracle0 Oracle
3. $cd $ORACLE_HOME/lib (or lib64 if using 64-bit Oracle software)
4 $mv
4.
$
libobk.so.back
lib
bk
b k libobk.so
lib bk
CONFIDENTIAL - NOT FOR DISTRIBUTION
5-10
175
5-11
After completing this topic, you will be able to configure a policy that integrates
the NetBackup media manager with RMAN. Configuration of an Oracle policy
enables the administrator to automate RMAN backups to tape or disk.
176
5-12
RMAN can back up data to disk or a stand-alone tape drive under its own
control, but it requires the assistance of a third-party media manager to use a
robotic tape library for backups. NetBackup serves as this media manager. The
Oracle extension included with NetBackup (collectively known as NetBackup for
Oracle, or NBUO) integrates with RMAN to provide a complete backup and
recovery solution.
solution NBUO simplifies both backup and recovery of Oracle
databases and increases database availability.
177
The primary function of a media manager is to track all of the tapes used by
RMAN for backups and to manage the mounting and unmounting of those
tapes. NBUO performs these functions and many others. The Oracle server
process allocated for a channel invokes that API to open a data stream, and the
call is then serviced by NBUO, which then locates and mounts a tape.
The integration of RMAN and NetBackup for Oracle is a two step process:
1. Link an API published by Oracle and implemented by NBUO (covered in the
previous lesson).
2. Configure a NetBackup for Oracle policy.
5-13
A NetBackup for Oracle policy has special requirements that make it different
from a normal file system backup policy. The differences are discussed in detail
in this lesson.
178
5-14
If you have a specific storage unit you wish to assign to your RMAN backups,
you can specify
if it h
here. Y
You can also
l specify
if th
the storage
t
unit
it iin th
the application
li ti
backup schedule.
179
Note that many of the settings in the attributes component are disabled for
Oracle policy types. The Keyword phrase attribute, even though it is not
disabled, is ignored for Oracle policy types.
Note: The Oracle policy type is not displayed in the Policy type list unless a
valid NetBackup for Oracle license key has been installed on the master server
server.
5-15
Schedule window
The start window must encompass all of the periods during which RMAN is
able to start backup jobs. Typically, start windows in application backup
schedules are configured to be open 24 hours per day, seven days per week.
This ensures that your NBUO operations are never locked out due to a
closed window.
180
Multiple copies
The Multiple copies option enables you to configure multiple copies of
RMAN b
backups
k
tto diff
differentt d
destinations
ti ti
(diff
(differentt storage
t
units
it and
d volume
l
pools). It also enables you to configure a different retention period for each
copy. However, each storage unit selected must be managed by the same
NetBackup media server.
5-16
Backup retention
The Retention setting in the application backup schedule determines how
long your RMAN backups are to be maintained in the NetBackup catalogs.
When a backup image expires based on the retention period set here, it is
d l t d only
deleted
l ffrom th
the N
NetBackup
tB k catalogs:
t l
references
f
tto the
th backup
b k are nott
deleted from the RMAN repository. It is necessary to use RMAN commands
to delete references to the expired backups when enabling NetBackup to
manage backup expiration in this manner.
You may prefer to manage the expiration and deletion of backup images
through RMAN. When a request is issued to delete a backup file from an
RMAN repository, RMAN sends a request to NetBackup for Oracle to delete
the corresponding image from the NetBackup catalogs. To manage backup
images using RMAN repository commands, set the retention period in the
application backup schedule to infinity to prevent the expiration of backup
images from the NetBackup catalogs until commands are initiated through
RMAN utilities.
Multiplexing
181
5-17
182
5-18
183
Type of backup
This setting specifies the type of backup that this schedule controls. The
selection list shows only the backup types that apply to NBUO policies. The
type of backup (full, differential, or cumulative) is passed to the invoked script
so that different RMAN configurations are used based on which type of
schedule invoked the job.
Schedule method
You select
Y
l t th
the method
th d used
d tto iinitiate
iti t automatic
t
ti RMAN b
backups
k
iin th
the
automatic backup schedule. Select either a frequency-based schedule or a
calendar-based schedule.
Frequency-based schedule
Frequency specifies the period of time that elapses until the next backup
operation can begin on this schedule. For example, if the frequency is seven
days and a successful backup occurs on Wednesday,
Wednesday the next full backup
does not occur until the following Wednesday.
CONFIDENTIAL - NOT FOR DISTRIBUTION
5-19
Calendar-based schedule
The Calendar option enables you to schedule backup operations based on
specific dates, recurring week days, or recurring days of the month.
Start window
The Start window in the automatic backup schedule determines the day and
time that the backup is initiated. A start window is mandatory for both
frequency-based and calendar-based schedules. Automatic backups are not
initiated by the NetBackup scheduler without a start window.
Retention
As discussed previously, the retention period for an application backup
schedule refers to the length of time that NetBackup keeps backup images.
The retention period for an automatic backup schedule controls how long
NetBackup keeps records of when scheduled backups have occurred.
The NetBackup scheduler compares the latest record to the frequency to
determine whether a backup is due. This means that if you set the retention
period to expire the record too early, the scheduled backup frequency will be
unpredictable However,
unpredictable.
However if you set the retention period to be longer than
necessary, the NetBackup catalog will accumulate unnecessary records.
Therefore, set a retention period that is longer than the frequency setting for
the schedule.
Multiple copies
Multiple copies are not configured in an automatic backup schedule.
Multiplexing
184
5-20
Backup selections
The Backup selections list in an NBUO policy has a different meaning than the
backup selections list has for other policies. In a standard policy, you list files
and directories to be backed up. But, because you are now configuring a
database policy, you list templates or scripts.
All templates or scripts specified in the backup selections list are executed
d i manuall or automatic
during
t
ti b
backups.
k
N
NetBackup
tB k starts
t t b
backups
k
b
by running
i th
the
templates or scripts in the order that they appear in the backup selections list.
185
Shell scripts
When listing Oracle scripts, specify the full pathname. For example:
/oracle/scripts/cold_database_backup.sh.
Also ensure that the Oracle scripts listed here are installed on each client in
the client
th
li t lilist.
t
Templates
Because templates are stored in a known location on the master server, only
the template file name should be entered. For example:
weekly_full_backup.tpl.
5-21
In the client list in the NetBackup for Oracle policy, specify only the Oracle
clients to be backed up at the same time using the specified script or template in
the backup selections list.
186
5-22
Note that one of the active jobs has been initiated by an automatic backup
schedule named full_sched.
187
5-23
The Maximum jobs per client global attribute determines the maximum
number of parallel backup streams for every client in the NetBackup domain.
Because Oracle internally determines when and how many streams to run in
parallel
ll l in
i order
d to
t optimize
ti i performance,
f
the
th number
b off jobs
j b is
i difficult
diffi lt tto
determine for Oracle backups and restores. Set the maximum to a value greater
than one to gain any benefit from allocating multiple channels in your RMAN
script.
188
Tip: To avoid problems, enter a value of 99 for the Maximum jobs per client
global attribute .
Note: The Maximum number of concurrent backup streams allowed per
client property in the client attributes enables you to configure multiple data
streams on a per-client basis. You can find client attributes in the list of
properties for the master server.
The Allow multiple data streams option must also be selected in the policy
attributes.
5-24
After completing this topic, you will be able to manage the runtime environment.
189
5-25
The slide lists the order of precedence for the runtime configuration variable
settings.
190
5-26
These variables are used to perform conditional operations within the scripts.
They are set only if the backup is initiated from the master server, either
automatically
t
ti ll b
by th
the N
NetBackup
tB k scheduler
h d l or manually
ll th
through
h th
the N
NetBackup
tB k
Administration Console.
191
5-27
192
Specify the string variables in the RMAN script after all channels have been
allocated and before the backup command.
Use the send device type command to send the variables to all
channels of the specified type. Use the send channel command to send
the variables to specific channels.
See the Symantec NetBackup for Oracle Administrators Guide for more
information on Oracle 8.0.x and Oracle 8.1.x and the parms operand.
5-28
Users can initiate NBUO backups from the Oracle client in the following ways:
193
Use the NetBackup client interface (jbpSA) and initiate the backup as a
user-directed backup
5-29
A NetBackup for Oracle user can create a bp.conf file in the Oracle users
home directory on the client. When a NetBackup for Oracle operation is started,
the users bp.conf file is searched before the client bp.conf file in
/usr/openv/netbackup. Any option found at the user level takes precedence
over the same option in the client bp.conf file. The following table describes
the options that can be set in the users
user s bp.conf file.
194
Option
Description
BPBACKUP_POLICY
ThisoptionspecifiesthepolicytousefortheOracle
backup.
BPBACKUP_SCHED
Thisoptionspecifiesthenameoftheapplication
backupscheduletypetousefortheOraclebackup.
CLIENT_NAME
ThisoptionspecifiesthenameoftheOracleclient.It
isespeciallyusefulforaredirectedrestoreoperation.
CLIENT_READ_TIMEOUT
(optional)
Thisoptionspecifiesthenumberofsecondsthe
Oracleclientinitiallywaitsforaresponsefromthe
NetBackup server The default value is 900
NetBackupserver.Thedefaultvalueis900.
5-30
After completing this topic, you will be able to create backup shell scripts for
use with NetBackup for Oracle.
195
5-31
196
Sh ll scripts
Shell
i t
Shell scripts are written by the user and must conform to RMAN and UNIX
shell syntax. Sample backup and recovery shell scripts are installed on the
client with the NetBackup for Oracle agent. Modify these scripts to meet your
individual requirements.
Templates
Th NetBackup
The
N tB k for
f Oracle
O l backup
b k wizard
i d iis used
d tto create
t b
backup
k
templates. This wizard is initiated from the NetBackup Backup, Archive, and
Restore (BAR) interface. The NetBackup for Oracle backup wizard does not
support all of the RMAN commands and options provided by Oracle. Write a
customized shell script for situations where a template does not provide all of
the required functionality.
5-32
197
2. Modify each script (in the new location) for your specific environment.
The scripts have good commentary to provide guidance on which variables
and commands to modify.
3. Ensure the su command logs onto the correct user.
If you do not include an su user statement (where user is the Oracle
administrator
d i i t t account)
t) in
i th
the scripts,
i t they
th do
d nott run with
ith th
the proper
permissions and environment variables. This results in problems with your
database backups and restores.
4. The sample scripts write to an output files named scriptname.out. Use
these output files as your first tool when debugging failed backups.
5-33
The shell script excerpt in the slide shows a small segment of the
hot_database_backup.sh script. This shell script assumes the following:
198
You want to archive the current log and back up all the archive logs using
two channels, placing a maximum of 20 logs in a backup set, and deleting
them after the backup is complete.
The scripts explicitly back up the control file to ensure this current backup is
registered in a control file that has also been backed up. Because you are
specifying NOCATALOG by default, the control file backup that occurs
automatically as the result of backing up the system file is not sufficient; it does
not contain records for the backup that is currently in progress.
The format string is constructed to guarantee uniqueness.
CONFIDENTIAL - NOT FOR DISTRIBUTION
5-34
199
Use the NetBackup for Oracle backup wizard to perform immediate backups.
Create reusable templates that you can run as is or convert to shell scripts.
5-35
Because the login you use is the account accessing the target database to
perform the backup, log in to the interface as an Oracle user with
administrative privileges.
200
5-36
201
5-37
Creating backup templates using the NetBackup for Oracle backup wizard
The backup wizard displays configuration screens that correspond with the
steps in the table on the slide. Templates are saved on the master server.
1. Specify whether you wish to use OS or Oracle authentication.
If you specify Oracle authentication, specify the user and password of the
account. In the first configuration screen, indicate whether you wish to use a
recovery catalog.
t l
Th
The d
default
f lt is
i to
t use the
th control
t l file
fil ffor th
the repository
it
information.
2. If you opt to use a recovery catalog, fill in your recovery catalog credentials
and connection information.
202
5-38
6. Specify whether to perform the backup with the database open or closed.
If performing a tablespace or datafile backup, opt to shut down the database
before the backup.
7. Specify runtime parameters, such as the policy name, application-backup
schedule
h d l name, master
t server, and
d client
li t name .
8. Specify backup limits, such as maximum backup piece size, maximum
number of open files, and number of parallel streams (channels).
9. The summary screen offers you options to run the backup immediately and
save the template for later use.
203
5-39
To reuse saved templates from the wizard, select Actions > Administer
Templates from the BAR interface. This enables you to use the templates
without having to step through the first few configuration screens. You can run,
edit, or delete templates from this option.
204
5-40
205
-t template_name
This option identifies the template. Because bpdbsbora retrieves backup
templates from a known location on the master server, you only need to
specify the template name.
5-41
206
5-42
After you specify the correct policy type, the NetBackup scheduler initiates the
backup in accordance with any defined schedules. You can also perform a
manual backup of a configured Oracle policy, if necessary.
207
5-43
208
5-44
If you customize and use the sample scripts provided by NetBackup for
Oracle, start the troubleshooting process by viewing the output file the scripts
create in the local directory (directory where the script is initiated). This file
contains important trace information and RMAN message log output that will
help you identify where in the backup processing the failure occurred.
209
Note: The Oracle Alert Log and Trace files also contain useful details about
RMAN errors.
CONFIDENTIAL - NOT FOR DISTRIBUTION
5-45
The following client logs are useful when debugging NetBackup for Oracle
issues:
dbclient
The dbclient log contains debugging information and execution status for the
Oracle NetBackup client processes linked to the library program provided
with NetBackup for Oracle.
210
bphdb
bphdb logs have the format obk_stdout.mmddyy. NetBackup writes
NetBackup for Oracle template or shell script output to this file. bphdb is the
NetBackup
p database binary.
y It is used for Oracle template
p
or shell script
p
execution.
bpcd
The bpcd process handles server authentication when backups or restores
are started. The bpcd log is a useful tool for finding information about name
service issues and other communication problems.
CONFIDENTIAL - NOT FOR DISTRIBUTION
5-46
bpdbsbora
The bpdbsbora process is used when you use the NetBackup for Oracle
backup and recovery wizard and any time a template is run (automatically or
manually). The log file contains debug and status information when those
methods
th d are used
d tto perform
f
a backup
b k or a restore.
t
Log
L iinformation
f
ti iis also
l
generated when you use the bpdbsbora command line option.
Server logs
You can also use NetBackup server logs for NetBackup for Oracle
troubleshooting. nbpem, nbjm, nbrb, and bprd are good places to look for
communication or resource errors. nbpem, nbjm, and nbrb use unified logging
and must be viewed with the vxlogview utility.
211
5-47
212
Troubleshooting suggestions
1. If you receive errors backing up the target database the first time, test a
regular file system backup on the client using NetBackup. This is a good way
to troubleshoot standard communication problems and bp.conf
configuration errors. See the Symantec NetBackup Troubleshooting Guide
for more information on troubleshooting a standard backup.
If file system backups are successful, begin troubleshooting NetBackup for
O
Oracle
as follows:
f
2. Run an RMAN backup to disk from the command line to verify RMAN
functionality. Use the RMAN message log for troubleshooting help.
3. If RMAN works alone, troubleshoot RMAN with NetBackup for Oracle.
Create the NetBackup logs suggested on the previous pages and ensure the
logs have permissions set to 777.
4. Check for linking problems.
Run an RMAN backup to tape from the command line.
After the backup attempt, check for the existence of a dbclient log file.
If a log file exists it indicates that Oracle and NBUO are linked correctly
and the problem is not a linking problem.
If no log file exists, check the permissions on the dbclient log directory to
ensure they are set to 777. If the permissions are correct, the problem is
usually
y a linking
gp
problem.
CONFIDENTIAL - NOT FOR DISTRIBUTION
5-48
213
5-49
Lesson summary
This lesson provided in-depth information on how to integrate NetBackup for
Oracle and RMAN to configure RMAN backups to disk or tape. Through
thoughtful planning, scheduling, and the effective use of RMAN and NetBackup
for Oracle shell scripts, you are now able to establish a backup strategy that
suits your particular needs.
R f
Reference
materials
t i l
214
Symantec
y
NetBackup
p 7.x Database and Application
pp
Agent
g
Compatibility
p
y List
TechNote 158276: Is it necessary to shut down Oracle when upgrading thirdparty backup software such as the NetBackup for Oracle extension?
5-50
215
6-1
Lesson introduction
This lesson outlines the procedures for recovering a failed Oracle database.
This includes recovery of an entire database as well as recovery of component
parts of a database. This lesson also introduces scripts used to support basic
recovery operations.
Importance
216
Knowing the basics of Oracle database recovery helps you return a failed
database to full operation, keeping downtime to a minimum. This lesson also
serves as an introduction to more advanced restoration and recovery
operations, such as performing incomplete recoveries, managing the recovery
catalog effectively, and correcting failures caused by user errors.
6-2
After completing this lesson, you will be able to perform basic restorations of
complete Oracle databases, as well as restoration of individual components,
such as datafiles, tablespaces, control files, and archived redo logs. You will also
be able to use scripts to support basic recovery operations.
217
6-3
218
6-4
219
6-5
When you first notice that your Oracle database has failed, immediately back it
up. This gives you a fallback position in case your recovery efforts make a bad
situation worse. After the backup completes, focus on correcting the problem.
220
6-6
221
If the database was running in ARCHIVELOG mode before the failure, it should
be possible for you to recover the database to the point in time just before the
failure occurred. This is possible only if you have a complete set of archived log
files available. Assuming the recovery catalog is housed on a separate machine
and that machine has not failed, this is entirely possible.
If, however, the database was running in NOARCHIVELOG mode (or if the
recovery catalog or control file have also failed and are not recoverable), you are
only able to recover the database to the state it was in at the time of its last
complete cold database backup. In this case, it is not possible to roll the
database forward to the time when the failure occurred.
6-7
RMAN restores from full backups, level 0 incremental backups, and data file
copies. It does not restore from level 1 or higher incremental backups. These
l
levels
l are used
d tto rollll th
the d
database
t b
fforward
dd
during
i recovery.
222
The method you choose for restoration depends, in part, on how you have
performed your backups. With proper planning and execution of a backup
strategy, well planned backup sets, and readily available media, you can keep
database downtime to a minimum.
6-8
223
RMAN performs the actual recovery process, but NetBackup for Oracle is used
to manage restore and recovery operations. You can also use scripts to
automate some restore and recovery operations. Sample scripts are presented
later in this lesson.
6-9
224
All specifications
ifi ti
(f
(from_tag,
t
f
from_type,
t
and
d until_clause)
til l
) mustt be
b
satisfied before a backup set or file copy is selected for restoration. RMAN also
considers the device types (disk, SBT_TAPE) of the allocated channels when
performing automatic selection. If no available backup set or image copy in the
recovery catalog satisfies all of the specified criteria, RMAN returns an error
during compilation of the restore job.
6-10
If the database is in ARCHIVELOG mode, and the online redo logs are missing
or damaged, you can still recover the information available in the archived redo
logs. This scenario and point-in-time recovery are discussed in a later lesson.
225
If the database is in NOARCHIVELOG mode and the online redo logs are
missing, use options to recover without applying any redo records. Then use the
alter database open resetlogs; command to restart when the
database opens after the recovery.
recovery
6-11
226
6-12
After completing this topic, you will be able to create RMAN recovery shell
scripts and templates for use with NetBackup.
227
6-13
228
2. Modify each script (in the new location) for your specific environment.
The scripts contain useful commentary to provide guidance on which
variables and commands to modify.
3. Ensure the su command logs onto the correct user.
If you do not include an su - user statement (user is the Oracle
administrator account) in the scripts, they will not run with the proper
permissions and environment variables. This results in problems with your
database backups and restores.
4. To assist in debugging, ensure your scripts write to an output file.
6-14
The recovery wizard can be initiated from the server or client: be sure to specify
the database server (client) as the host when you log in.
229
Before launching the recovery wizard must perform the following steps in the
Backup, Archive and Restore interface to prepare for the recovery:
1. Start the NetBackup Backup, Archive, and Restore interface.
2. Click the Restore Files tab.
6-15
3. Select your Oracle client from the Source client for restores drop-down list
and select Oracle from the Policy type for restores drop-down list.
230
6-16
231
6-17
The NetBackup
Th
N tB k for
f Oracle
O l recovery wizard
i d saves a recovery ttemplate
l t locally
l
ll iin
a user-specified location on the NetBackup client. Recovery templates are not
stored on the server because recovery is always user directed, not scheduled.
232
6-18
233
6-19
Lesson summary
This lesson introduced the basic procedures for performing simple restoration
and recovery operations of an Oracle database.
Reference materials
234
Kevin Loney and Bob Bryla. Oracle Database 10g DBA Handbook.
Emeryville, CA: The McGraw-Hill Companies, Inc., 2005.
Darl Kuhn and Scott Schulze. Oracle RMAN Pocket Reference. Sebastopol,
CA: OReilly & Associates, Inc., 2002.
6-20
235
7-1
Lesson introduction
This lesson outlines management techniques for the RMAN recovery catalog.
Importance
Configuring RMAN with a recovery catalog enables you to use all of RMANs
command options. This is particularly beneficial when managing Oracle
p
across enterprise
p
networks,, either independently
p
y or
databases that are spread
as a distributed database system.
236
7-2
This module provides the tools used to deal with the following specific issues:
237
If the media manager marks tapes as expired, the RMAN repository may
contain outdated information. To ensure that data in the recovery catalog or
control file is synchronized with data in the media management catalog,
perform a cross check.
If you make any change to the physical structure of the target database, also
resynchronize the recovery catalog. The recovery catalog is not
automatically updated when a physical schema change is made.
7-3
238
7-4
Catalog resynchronization
239
7-5
M
Manually
ll resynchronizing
h
i i
the
h catalog
l
240
7-6
When you open a database using the alter database open resetlogs
command, Oracle discards all information in the online redo log file. Oracle then
picks one log (from the control file) for every enabled thread and marks it as the
current log. Also, Oracle updates the file headings of all online data files to the
new database checkpoint. In other words, a new version (or incarnation) of the
database has been created
created.
241
Before you use the recovery catalog again with a target database that has been
opened with the alter database open resetlogs command, notify
RMAN that the database incarnation has been reset. Otherwise, RMAN cannot
distinguish between the resetlogs command and an accidental restoration of
an old control file, and for this reason, it does not access the recovery catalog.
The reset database command tells RMAN to create a new database
incarnation record in the recovery catalog. This new incarnation record becomes
the current incarnation. All subsequent backups and log archiving performed by
the target database are associated with the new database incarnation.
You can also reset the database to a previous incarnation. Typically, you do this
if you are attempting to undo an unsuccessful incomplete recovery.
Note: After opening a database using the alter database open
resetlogs command and resetting the recovery catalog
catalog, immediately perform
a backup of the CONFIDENTIAL
database.
- NOT FOR DISTRIBUTION
7-7
242
7-8
After completing this topic, you will be able to store your RMAN scripts in the
recovery catalog.
243
7-9
You can print stored scripts using the print script command and delete
scripts from the recovery catalog with the delete script command.
244
Note: Back up a copy of your scripts to tape for safekeeping. Add the path to
your scripts to the same standard NetBackup policy you use to back up the
other Oracle files that RMAN does not manage, such as the Oracle directory
structure the PFILE and password files
structure,
files. If the recovery catalog fails
fails, taking your
stored scripts and other files with it, you still have copies that are available to
use.
7-10
After completing this topic, you will be able to use the list and report
commands to query the recovery catalog.
245
7-11
RMAN enables you to generate a number of reports relevant for backup and recovery
using the report and list commands. Use the report and list commands to
determine what you have backed up, as well as what you need to back up. The
information is available whether you use a recovery catalog. Use the report command
to answer questions, such as:
246
What was the physical schema of the database at some previous point in time?
The list command queries the recovery catalog and control file and produces a listing
of its contents. Use the list command to list:
Backup sets containing a backup of any data file that is a member of a specified list
of tablespaces
Backup sets containing a backup of any archive logs with a specified name and
within a specified range
7-12
list |
|copy
py | backupset
p
| incarnation of database |
tablespace name | datafile name |
archive_record_specifier[ tag tag | like file_pattern |
from time | until time | device_type_list ]
247
You can view details about the Oracle backups using the Status of Backups
report from the NetBackup interface.
Alternatively, use the NetBackup bplist command to browse Oracle backups.
Th resultlt off this
The
thi ttype off query iis a lilistt off allll b
backup
k fil
file names. Th
The ffollowing
ll i
example uses bplist to search all Oracle backups for a client named jupiter:
client# install_path/netbackup/bplist -C jupiter -t 4 -R /
The -t 4 in this command specifies the Oracle backups.The -R specifies the
default number of directory levels to search (999).
Refer to the bplist man page for more information on this command.
CONFIDENTIAL - NOT FOR DISTRIBUTION
7-13
248
7-14
After completing this topic, you will be able to manage the recovery catalog
repository.
249
7-15
250
7-16
251
If you are using RMAN without media manager software, the crosscheck
command checks to see if each backup piece or image copy is physically
present on disk.
When the crosscheck command is executed
executed, RMAN checks each specified
backup set or copy and determines if it is on the backup media. If it is not on the
backup media, each missing backup piece is marked as EXPIRED (X). If the
backup piece exists, it maintains an AVAILABLE (A) status. If a backup piece
was marked as EXPIRED and then becomes AVAILABLE again, the
crosscheck command resets the status to AVAILABLE. Examples of this is are
a failed drive that has since been recovered or a backup expired by NetBackup
and then later imported.
p
CONFIDENTIAL - NOT FOR DISTRIBUTION
7-17
RMAN automatically
y configures
g
a channel of type
yp DISK. If yyou used the
configure command to configure a default device type of SBT, you can run a
very simple crosscheck command to check the status of all backup sets on
tape and disk:
Copyright 2011 Symantec Corporation. All rights reserved.
RMAN>CROSSCHECK BACKUP;
252
If you have not configured a default device type of SBT with the configure
command, manually allocate a channel of type SBT before the crosscheck
can check back
backups
ps on tape
tape:
RMAN>ALLOCATE CHANNEL FOR MAINTENANCE TYPE sbt;
RMAN>CROSSCHECK BACKUP;
RMAN>RELEASE CHANNEL;
However, If you have preconfigured a default device type of SBT, the effect of
y allocating
g a channel of type
yp SBT for maintenance is a crosscheck of
manually
only backup sets stored on tape. Backup sets stored on disk are not checked.
CONFIDENTIAL - NOT FOR DISTRIBUTION
7-18
You can perform many other types of crosscheck commands. For example:
To check datafile backups:
RMAN>CROSSCHECK BACKUP OF DATAFILE 1;
To check tablespace backups:
RMAN>CROSSCHECK BACKUP OF TABLESPACE users;
To check control file backups:
RMAN>CROSSCHECK BACKUP OF CONTROLFILE;
To check SPFILE backups:
RMAN>CROSSCHECK BACKUP OF SPFILE;
There are many options you can use to check archive log backups. For
example:
To check all archive log backups:
RMAN>CROSSCHECK ARCHIVELOG ALL;
To check specific archive log backups:
RMAN>CROSSCHECK ARCHIVELOG
FROM TIME TO_DATE(10-01-2006,
(
, mm-dd-yyyy);
yyyy )
To check specific archive log backups using a sequence number:
RMAN>CROSSCHECK ARCHIVELOG FROM SEQUENCE 64;
253
7-19
By default, the delete command displays a list of the files to be deleted and
prompts you before deleting any file in the list. However, if you run the command
from a command file or specify the delete noprompt option, the files are
li t d b
listed
butt th
there iis no promptt ffor confirmation.
fi
ti
254
To use the delete command, ensure the target database instance is started.
Connect RMAN to the target database and the recovery catalog. A maintenance
channel is not required for disk-only files created by RMAN without NetBackup
for Oracle, A maintenance channel is required if the backups are stored on tape
and you did not used the configure command to specify a default device type
of SBT.
Example:
RMAN>allocate channel for maintenance of type sbt;
RMAN>delete expired;
RMAN>release channel;
7-20
255
7-21
256
7-22
Change the status of repository records for backup sets and pieces.
Delete backup pieces from disk media and remove associated records from
the target databases control files and recovery catalog.
257
Command
Description
CHANGEUNCATALOG
Thiscommandremovesreferencestodatafilecopiesor
archivedredologsfromtherecoverycatalogandupdates
recordsinthetargetcontrolfiletoDELETEDstatus.The
CHANGEUNCATALOG commanddoesnottouchphysical
backupsandcopies.UsethiscommandtonotifyRMANwhena
fileisdeletedbyOScommands.
CHANGEDELETE
Thiscommandremovesreferencestobackuppieces,datafile
copies,orarchivelogsfromthecontrolfileandrecovery
catalog.Thiscommandalsophysicallydeletesthosefilesfrom
theoperatingsystemormediamanager.
7-23
258
Command
Description
CHANGEVALIDATE
Thiscommandremovesreferencestobackuppieces,datafile
copies,orarchivelogsfromthecontrolfileandrecoverycatalog
whenthosefilesnolongerexistondisk.
CHANGEUNAVAILABLE
Thiscommandmarksbackuppieces,datafilecopies,orarchive
logsasUNAVAILABLE.
CHANGEAVAILABLE
Thiscommandmarksbackuppieces,datafilecopies,orarchive
logsasAVAILABLE.
CHANGECROSSCHECK
Thiscommandremovesreferencestobackuppieces,datafile
pp
,
copies,orarchivelogsfromthecontrolfileandtherecovery
catalogwhenthosefilesnolongerexist.
7-24
259
As with crosschecking, use the list command to determine which backup set
to validate. If you have used the configure command to specify a default
device type of SBT, it is unnecessary to configure a channel manually, as shown
in the following example:
RMAN> list backup;
RMAN> run {
2> allocate channel stream1 type 'SBT_TAPE';
3> validate backupset backupset_id;
4> }
CONFIDENTIAL - NOT FOR DISTRIBUTION
7-25
Restore validation
260
RMAN returns status messages, indicating its progress in the operation. RMAN
returns error messages if any of the specified backup sets are not available.
7-26
Using the restore validate command to test tablespaces and data files is
essentially the same operation as performing an entire database validation;
however, the target tablespaces or data files must first be taken offline. Use the
list command
d tto d
determine
t
i which
hi h b
backup
k sett tto validate.
lid t Th
Then specify
if th
the lilistt
key numbers within the restore validate command. For example:
RMAN> run {
2> allocate channel stream1 type 'SBT_TAPE';
3> restore tablespace 'tablespace_id' validate;
4> }
U i restore validate to
Using
t ttestt th
the control
t l file
fil
When using restore validate to test the target databases control file, the
database can be either open or closed.
In the following example, RMAN also tests all of the archive log files as well as
the system tablespace:
RMAN> run {
2> allocate channel stream1 type 'SBT_TAPE';
3> restore controlfile validate;
4> restore archivelog all validate;
5> restore tablespace 'system' validate;
6> }
261
7-27
After completing this topic, you will be able to back up and recover the recovery
catalog.
262
7-28
Another safeguard for protecting the recovery catalog is to create a logical copy
off it using
i th
the export
t command.
d Thi
This iis b
beneficial
fi i l b
because th
the recovery
catalog can then be restored to any other existing Oracle database. Refer to the
Oracle 10g Backup and Recovery Guide for more information on logical backups
and the export command.
263
7-29
It is recommended that you store the recovery catalog on separate media and in
a separate geographic location from the target databases it serves. However,
you do not necessarily need to create an additional database solely for use as a
recovery catalog. You can embed the recovery catalog within an existing
database. Also, remember that a single recovery catalog can store information
for multiple target databases
databases.
264
Back up the recovery catalog regularly. Because the recovery catalog resides in
an Oracle database, you can use RMAN to back it up by reversing the roles of
the recovery catalog database and a target database. In other words, the target
database becomes the recovery catalogs recovery catalog, and the original
recovery catalog is treated as the target database.
Restoring the recovery catalog
If you back up the recovery catalog using RMAN and NetBackup for Oracle,
restore and recover it as you would any other database covered in this course.
If you back up the recovery catalog as an OS file using NetBackup, restore it
using conventional NetBackup recovery methods.
If you export a logical copy of the recovery catalog, import it into another
database to recover it.
Refer to the Oracle 10g Backup and Recovery Guide for additional information.
CONFIDENTIAL - NOT FOR DISTRIBUTION
7-30
Lesson summary
This lesson outlined management techniques for the RMAN recovery catalog. It
also introduced advanced RMAN functions available when it is configured with a
recovery catalog.
Reference materials
265
Symantec
y
NetBackup
p for Oracle Administrators Guide
Kevin Loney and Bob Bryla. Oracle Database 10g DBA Handbook.
Emeryville, CA: The McGraw-Hill Companies, Inc., 2005.
7-31
266
7-32
267
8-1
Lesson introduction
As databases have become more intricate, the failures that can occur have
become proportionally more complex. But Oracles logical architecture enables
straightforward backup procedures, which result in straightforward recovery
procedures, regardless of the type of failure. This lesson provides an overview
of such complex failures and how to recover from them.
I
Importance
t
268
8-2
After completing this lesson, you will be able to leverage RMAN and NetBackup
for Oracle to recover from complex database failures. You will also learn to
perform incomplete recoveries, when all necessary elements for a complete
recovery are not available.
269
8-3
After completing this topic, you will be able to recover from the loss of critical
database files.
270
8-4
271
8-5
C
Connect
t to
t the
th target
t
t database
d t b
and
d the
th recovery catalog,
t l
if it is
i used.
d If you are
not using a recovery catalog or if the target DB_NAME is not unique in the
recovery catalog, specify the DBID before you start the restore.
RMAN>SET DBID <DBID>;
272
Shut down the instance and restart it in NOMOUNT mode. Because the server
parameter file is lost, RMAN starts the instance with a dummy parameter file.
T restore
To
t
the
th SPFILE from
f
an autobackup
t b k when
h using
i a recovery catalog:
t l
RMAN>RESTORE SPFILE;
To restore the SPFILE from an autobackup when not using a recovery catalog:
RMAN> RESTORE SPFILE FROM AUTOBACKUP;
8-6
If you are not using a recovery catalog and autobackup is not configured, omit
the FROM AUTOBACKUP clause and RMAN uses the control file to locate the
most current copy of the SPFILE.
If the control file is not available and you are not using a recovery catalog, the
simplest
i l t method
th d off restoring
t i th
the SPFILE is
i to
t restore
t
it from
f
a standard
t d d file
fil
system backup. For more information, see the Oracle Recovery Manager Users
Guide.
273
8-7
274
When restoring the control file, first connect to both the target database and the
recovery catalog from the RMAN prompt. Then start the database in NOMOUNT
mode.
mode
8-8
When restoring redo logs files, connect to the target database and the recovery
catalog (optional) and start the database in MOUNT mode.
275
The following example (for demonstration purposes only) restores some archive
logs to a temporary location on disk (/oracle/temp_location1) and then
restores another range of archive logs to a different temporary location on disk
(/oracle/temp_location2):
run {
set archivelog destination to '/oracle/temp_location1';
restore archivelog from sequence 1 until sequence 5;
set archivelog destination to '/oracle/temp_location2';
restore archivelog from sequence 6 until sequence 10;
8-9
After completing this topic, you will be able to perform incomplete recovery
operations.
276
8-10
Point-in-time recovery
277
If you perform
f
an incomplete
i
l t recovery on an active
ti database,
d t b
allll ttransactions
ti
made since the point in time to which you are recovering are erased. For
example, suppose that a tablespace is deleted from a database on a Tuesday,
and the last available state of the database is from Sunday. You can only
perform an incomplete recovery to restore the tablespace to its last available
state. All transactions involving that tablespace from Sunday to Tuesday are
lost.
8-11
When you perform a DBPITR, the target database is opened using the alter
database open resetlogs command. This command instructs the
d t b
database
nott tto inadvertently
i d t tl apply
l any redo
d th
thatt was skipped.
ki
d
278
8-12
In addition to the SET UNTIL TIME and SET UNTIL SEQUENCE clauses
shown in the slide, you can perform an incomplete recovery using the SET
UNTIL SEQUENCE clause to recover through a specific log sequence number:
For example:
279
RUN
{
SET UNTIL SEQUENCE 9302;
RESTORE DATABASE;
RECOVER DATABASE;
}
After finishing an incomplete recovery, open the database and reset the online
logs:
RMAN>ALTER DATABASE OPEN RESETLOGS;
8-13
The Auxiliary
y instance must reside on the same system
y
as the target
g database.
To prepare the Auxiliary instance:
Create the password file.
Copyright 2011 Symantec Corporation. All rights reserved.
280
8-14
ParameterName
Optional/Required
db_name
Optional
Samenameasthetargetdatabase
lock_name_space
Required
Auniquenameamongallother
databasesonthesystem
db_file_name_convert
or
db_file_name_convert_n
Optional
Defineasetoffilenamingconversion
patternsfordatafilesintheauxiliary
databaseastheyarerestoredby
RMAN
log_file_name_convert
or
log_file_name_convert_n
Optional
Defineasetoffilenaming
conversionpatternsforredolog
filesintheauxiliarydatabaseas
theyarerestoredbyRMAN
AnalternativetousingtheSET
NEWNAMERMANcommand
control_files
t l fil
R
Required
i d
D
Definesthenamesandlocations
fi
th
d l ti
oftheauxiliaryinstancecontrol
files
Thenamesshouldbeuniquein
namefromanyexistingcontrol
fileinthefilelocations.
remote_login_passwordfile
C
Compatible
tibl
db_block_size
281
Description
Optional/Required
EnablesRMANtoconnecttothe
auxiliarydatabaseusingOracle
ili d t b
i O l
Net.
Requiresthepresenceofacurrent
passwordfile.
Ifyouareconnectingtothe
auxiliarydatabaselocally,this
doesnotneedtobeset.
R
Required
i d
Mustbethesameastargetdatabase
M
b h
d b
setting
Optional/Required
Ifsetonthetargetdatabase,this
mustbesettothesamevalueinthe
auxiliarydatabase.
The easiest way to configure the parameter file is to make a copy of the target
instance parameter file and make the adjustments shown in the preceding table.
After the parameter file is ready, start the instance in NOMOUNT mode and
verify connectivity by connecting to it using Oracle Net.
8-15
After you have issued the recover command, Oracle restores the datafiles to
the auxiliary instance and enables it, recovering the tablespaces in the auxiliary
instance, and transporting the recovered tablespaces to the target database.
282
TSPITR is not supported for any tablespaces with replicated master tables.
TSPITR cannott be
b used
d to
t recover a dropped
d
d ttablespace.
bl
CONFIDENTIAL - NOT FOR DISTRIBUTION
8-16
283
8-17
After completing this topic, you will be able to manage common database
recovery challenges.
284
8-18
285
Because tablespace recovery does not require rolling the entire database
forward, it is faster than database recovery. However, for the recover
tablespace command to execute properly, the following are required:
A currentt control
t l file
fil
If you do not have default channels configured, allocate at least one channel
before issuing the restore command. The restore command automatically
releases the allocated channel.
8-19
286
8-20
3. Restores the control file to an alternate location and then replicates to the
target database.
287
8-21
After completing this topic, you will be able to redirect a restore to an alternate
client.
288
8-22
Ensure that the NetBackup master server is configured to enable an alternate client
restore. To remove restrictions for all clients, create the following file on the NetBackup
master server:
MASTER# install_path/netbackup/db/altnames/No.Restrictions
289
Alternately, to restrict clients to restore only from certain other clients, create and then
add client names to the following file:
MASTER# install_path/netbackup/db/altnames/client_name
install path/netbackup/db/altnames/client name
where client_name is the name of the client enabled to perform the alternate client
restore.
RMAN alternate client configuration and restore
Use the same user name (UNIX account) that was used for the Oracle database
backup for the alternate client restore.
Note: Ensure that server and user-directed regular file system backups work for the
client prior to debugging the Oracle RMAN backups.
CONFIDENTIAL - NOT FOR DISTRIBUTION
8-23
290
Redirecting a restore
This example (adapted from the Oracle Backup and Recovery Guide) illustrates
a typical alternate client restoration.
In this example, assume:
The original client is mars.
The alternate client is venus.
The master server is earth.
The ORACLE_SID is lab.
The UNIX user is oracle on both mars and venus.
To apply these values:
1. Create the install_path/netbackup/db/altnames/venus file on
earth and edit it to contain the name mars.
2. Log on to venus as oracle.
3. Set SERVER=earth in ${ORACLE_HOME}/bp.conf.
4. Modify the network tnsnames.ora file to enable the RMAN catalog
connection.
5. Set the environment variables ORACLE_SID to lab and NB_ORA_CLIENT
to mars.
CONFIDENTIAL - NOT FOR DISTRIBUTION
8-24
6. Verify that the directory exists and has appropriate access permissions.
The data files are restored to a directory path with the same name they had
when backed up.
p
file.
7. Create an spfilelab.ora
8. Start up the database as follows.
venus$ sqlplus /nolog
SQL> connect / as sysdba
SQL> startup nomount
...
SQL> exit
9 Run
9.
R an RMAN restore
t
script:
i t
venus$ rman rcvcat rmanowner/rmanowner@rmancat
RMAN> connect target
RMAN> @restore_database.rcv
where restore_database.rcv is the RMAN script containing the specific
restore commands.
N t See
Note:
S the
h Symantec
S
t NetBackup
N tB k for
f Oracle
O l Administrators
Ad i i t t Guide
G id and
d the
h
Oracle Database Backup and Recovery Advanced Users Guide for details.
291
8-25
After completing this topic, you will be able to clone the database using guided
application recovery (GAR).
292
8-26
293
8-27
GAR overview
The GAR process uses metadata gathered from a successful backup that had
metadata collection enabled. Metadata collection is enabled using one of the
following methods:
294
Metadata is retrieved from the EMM database when the user steps through the
GAR wizard during the cloning process. User selections are validated with the
Oracle RMAN catalog and Oracle control file and temporary recovery scripts are
created
t d and
d run b
by RMAN tto complete
l t th
the cloning
l i process.
8-28
Jobs 190 and 191 represent metadata collection for the completed database
backup. Jobs 194 and 195 represent metadata collection for the completed
archive log backups and job 197 represents metadata collection for the
completed
l t d control
t l fil
file b
backup.
k
295
8-29
After completing this topic, you will be able to perform cloning operations using
the guided application recovery wizard.
296
8-30
There are unlicensed and licensed versions of OpsCenter. GAR can be used
with either version. Supported browsers for the OpsCenter console include:
297
See the Symantec OpsCenter Administrators Guide for more information about
OpsCenter.
8-31
Specify the name of the master server and click Go to begin the GAR cloning
process.
298
8-32
Use the filters at the top of this screen to help you select the correct database to
be recovered. Select the database you wish to recover and click Next to
continue.
299
8-33
When the control file to be recovered is selected, there are three links available
for viewing details of the control file: View Database Schema, View Datafiles
Recovery Set, and View Archived Log Recovery Set. The link to view the
database schema was clicked in the screenshot shown in the slide.
300
8-34
Next, enter the login to use for OS authentication for the Oracle database. If the
clone is being recovered to a Windows server, enter a password and domain
name. If the recovery is being performed to a UNIX host, the password and
d
domain
i name fifields
ld are nott used.
d
301
8-35
Use the Database attributes tab to configure a new instance name, database
name, and database home if these are different for the selected host.
302
8-36
Changed paths are highlighted to give the user a visual reference. These
hi hli ht b
highlight
bars show
h
what
h th
has changed
h
d so ffar, which
hi h iis h
helpful
l f l when
h a llarge
number of changes are being made.
303
8-37
The left side of the table displays the tablespaces associated with the database.
This tab enables you to collectively or individually change the destination path of
all tablespaces.
304
8-38
The fourth tab is the Redo log paths tab. This tab enables you to change the
destination path of redo logs individually.
305
8-39
Select the appropriate links to view the recovery sets and archived log recovery
sets that will be used for the cloning operation.
306
8-40
307
8-41
Monitor the cloning process on the OpsCenter Monitor > Jobs screen or by
using the NetBackup Administration Console Activity Monitor.
308
8-42
Lesson summary
This lesson showed you how to recognize and recover from complex database
failures. It also outlined strategies for performing incomplete recovery operations
and safeguarding against user errors.
Reference materials
309
Symantec
y
NetBackup
p for Oracle Administrators Guide
Matthew Hart and Robert G. Freeman. Oracle Database 10g RMAN Backup
& Recovery. Berkeley, CA: The McGraw-Hill Companies, Inc., 2007.
Kevin Loney and Bob Bryla. Oracle Database 10g DBA Handbook.
Emeryville, CA: The McGraw-Hill Companies, Inc., 2005.
8-43
310
8-44
311
9-1
Lesson introduction
312
9-2
After completing this lesson, you will be more familiar with tuning methods for
RMAN backups, such as utilizing asynchronous I/O, multiplexing, and parallel
channels. You will also learn about RMAN views used to monitor performance of
RMAN backups using asynchronous I/O.
313
9-3
After completing this topic, you will be able to tune your RMAN backup and
restore environment to improve performance. This includes being able to:
Configure asynchronous I/O.
314
Configure multiplexing.
9-4
315
If you are backing up to disk using the native RMAN device type disk, RMAN
automatically uses asynchronous I/O if the operating system supports it (most
do). If your OS does not support asynchronous I/O, you can specify a non-zero
value for the DBWR_IO_SLAVES parameter, which starts multiple DBWR
processes during backups to simulate asynchronous I/O (experiment with values
to find a suitable setting).
CONFIDENTIAL - NOT FOR DISTRIBUTION
9-5
The tape buffer size is determined when the channel is configured. The default
value is operating system specific, but is typically 64K. To configure this value to
be higher (or lower), use the parms argument in the allocate channel
command. For most tape device types, a value of 256K provides good
performance. Experiment with different values to find a setting that provides
good overall performance in your environment
environment.
316
9-6
317
In the NetBackup Essentials lesson of this course, you learned about the
importance of configuring the NetBackup Max jobs per client global attribute
when using multiple RMAN channels. By default, NetBackup enables only one
active channel. If you plan to specify multiple RMAN channels, remember to
configure a Max jobs per client setting greater than one. Review the
NetBackup Essentials lesson for information on how to set this parameter.
9-7
318
With multiplexing, a single datafile can span more than one backupset piece.
This is because it is possible to specify a MAXPIECESIZE to a value smaller
than that of a single datafile. However, it does not span backupsets. Specify a
MAXSETSIZE greater than or equal to the size of the largest tablespace you
back up
up.
Because a datafile is only backed up through one channel, RMAN multiplexing
is not a benefit if you are trying to improve performance backing up a single
large datafile. Therefore, If you allocate two channels and you specify a single
large datafile for backup, the entire datafile is backed up through the same
channel, and the backup is not multiplexed.
9-8
319
If you run out of disk space during a restore, RMAN removes every file it
restored in the restore session before the failure. This will be painful if the
restore process took hours to complete. You will have wasted that much time
and have nothing to show for your trouble. However, if you used a partitioned
backup strategy, you can restore your database in more granular tablespace
restores (in parallel if you have multiple tape devices available) and the failure of
one restore session will not affect the others.
9-9
Tuning views (1 of 2)
320
9-10
Tuning views (2 of 2)
The V$BACKUP_ASYNC_IO and V$BACKUP_SYNC_IO views contain detailed
information about RMAN asynchronous and synchronous backup operations.
The views contain a row for each asynchronous or synchronous backup or
recovery operation, and they are cleared each time the database is shut down.
The sample query in the slide shows the effective transfer rate from the
database to the backup set, the name of the datafile that was backed up, and
the actual start and stop time of the backup.
321
9-11
Lesson summary
This lesson covered RMAN tuning techniques to help you improve backup and
restore performance.
Reference materials
322
9-12