RMAN PresSheets by suchenfz


									     Welcome to my presentation of RMAN, the Recovery Manager.

   Recovery Manager (RMAN) is the component of the Oracle Database
    10g used to perform backup, restore and recovery operations.

   Recovery Manager has a command line interface.

   Oracle Enterprise Manager also provides a graphical user interface for
    the Recovery Manager to the most commonly used functionality.

Recovery Manager Features:

   Backup the database, tablespaces, data files, control files, and archived
    redo logs

   Manage backup and recovery tasks

   Perform incremental block-level backup and block-level media recovery

   Detect corrupted blocks during backup

   Use binary compression when creating backups
RMAN provides several features not available when you make user-managed backups with
operating system commands:

   Store frequently executed operations as scripts in the database.

   With block change tracking enabled in the database RMAN can limit incremental backups to
    recording only those blocks that have changed since the previous backup. This improves the
    performance of backups and may also reduce the time it takes to perform recovery operations in
    ARCHIVELOG mode.

   Manage the size of backup pieces and save time by parallelizing the backup operation.

   Recover an individual corrupt data block or set of data blocks within a data file rather than
    restoring and recovering the entire data file.

   RMAN operations can be integrated with the Oracle Database Scheduler to automate backup

Recovery Manager Components

   Enterprise Manager Database Control Console: Supplies a graphical interface to the most
    commonly used RMAN functionality.

   Server Session: The server process (UNIX) or threads (Windows NT/2000) invoked by RMAN
    connect to the target database to perform the backup, restore and recovery functions through a
    PL/SQL interface. These sessions read or write files to or from disk, tape or the Flash Recovery
    Area, a storage location specified as the default storage area for files related to database

   Target Database: Database for which backup and recovery operations are being performed
    using RMAN. The control file of the target database contains information about its physical
    structure, such as the size and location of data files, online and archived redo log files and
    control files. This information is used by the server sessions in backup and recovery operations.

   Auxiliary Database: Is used when creating a duplicate database or performing tablespace
    point-in-time recovery (TSPITR). Can reside on the same host as its parent or on a different
 Channel: Is a link to the database to perform and record backup and recovery operations. You
  can allocate channels manually or preconfigure channels using automatic channel allocation.

 RMAN Repository: Is to maintain metadata about the target database and its backup and
  recovery operations. Data is always stored in the control file of the target database.

 Recovery Catalog: RMAN repository data can optionally be kept in a recovery catalog which
  is a separate database that keeps historical data concerning backup activities much longer than
  the control file and preserves backup information if the control file is lost.

    A single recovery catalog can store information for multiple target databases. Can also hold
    RMAN stored scripts which are sequences of RMAN commands for common backup tasks.

    Usage of a separate recover catalog database is not recommended for small businesses where
    installation and administration of a separate recovery catalog database would be burdensome.

 Media Management Library: When writing to or reading from tapes. The additional media
  management software required for using the tape medium is provided by media and storage
  system vendors.

Using a Flash Recovery Area with RMAN

   The Flash Backup and Recovery feature simplifies managing disk space and files related to backup and
    recovery by managing all backup and recovery related files in the Flash Recovery Area.

   RMAN generates file names for the backup files automatically.

   RMAN automatically uses Oracle Managed Files (OMF) for the backup files.

   Each time RMAN creates a file in the Flash Recovery Area, the Oracle Database updates a list of files that are
    no longer required on disk. When file needs to be written and no space available then Oracle Database deletes a
    file that is on the obsolete files list and writes a notification to the alert log.

   When space pressure or low free space because there are no files that can be deleted then a warning is issued.
    To resolve problem you can add disk space, backup your files to a tertiary device, delete the files from the Flash
    Recovery Area using RMAN or change the RMAN retention policy.

   By default, RMAN automatically backups files into a Flash Recovery Area when you set the
    DB_RECOVERY_FILE_DEST initialization parameter.
Setting Parameters for RMAN

RMAN stores information about the target database and its backup and recovery
operations in the RMAN repository. The amount of information stored can increase
depending on the frequency of backups, the number of archived redo log files that are
generated and the retention period for RMAN records.

The CONTROL_FILE_RECORD_KEEP_TIME parameter specifies the minimum
number of days RMAN information is stored in the control file before being overwritten.
The default is seven days.

You can set the Flash Recovery Area size and location using the
initialization parameters. You can also specify a retention policy that dictates when
backups may be discarded.

The NLS_DATE_FORMAT and NLS_LANG environment variables determine the
format used for the time parameters in RMAN commands such as RESTORE,

Connection Types with RMAN

You can use Recovery Manager to connect to the following types of databases:

Target database: connected with SYSDBA privilege to perform typical RMAN

Recovery catalog database: optional database which is configured for the RMAN
repository. To retrieve information such as backup information or stored scripts.

Auxiliary database: created with the RMAN DUPLICATE command. Is a temporary
database that is used during tablespace point-in-time recovery (TSPITR). Is a standby
database or copy of the production database that can be used for disaster recovery.
Starting RMAN

  For local RMAN connection at an operating system
   prompt, enter following. If you do not specify a user ID
   or password when connecting to the target database
   then a forward slash establishes a connection as user
   SYS by using operating system authentication.

  To connect from another server remotely, use the
   Oracle Net service name for the target database.

Configuring Persistent Settings for RMAN

You can use the CONFIGURE command to configure
persistent settings for RMAN backup, restore,
duplication and maintenance jobs.

These settings are in effect for any RMAN session until the
configuration is cleared or changed.
Control File Autobackups

   To avoid losing a copy of the current control file, you should
    configure RMAN to take automatic backups of the control

   By default the control file autobackups are turned off.

Control file autobackups are stored in the Flash Recovery Area,
if configured.

Retention Policies

Recovery window: Establishes a period of time during which it
will be possible to discover logical errors and fix the affected
objects by doing a point-in-time recovery to just before the
error occurred. This policy is specified in number of days.

Redundancy: Establishes a fixed number of backups that must
be kept. Backups that are in excess of this can be deleted.
The value of the retention policy is set by the CONFIGURE
Managing Persistent Settings

The RMAN SHOW command allows you to view the
RMAN configuration settings.

You can return to the default value of any CONFIGURE
command by running the same command with the CLEAR

Channel Allocation

A channel represents one stream of data to a device type.

A channel must be allocated before you execute backup
and recovery commands.

Each allocated channel establishes a connection from the
RMAN executable to a target database instance.

An Oracle Database process for the target database is
created for every channel allocated.
Automatic and Manual Channel Allocation

The CONFIGURE command is used to preconfigure channels for use
in all RMAN sessions using automatic channel allocation. Automatic
channels apply to any RMAN job in which you do not manually
allocate channels.

The ALLOCATE CHANNEL command with a RUN command issued
at the RMAN prompt is used to allocate a channel manually.

Manual channel allocation overrides automatic allocation.

RMAN Command Overview

The typical RMAN commands that you run against the target database include:

    - BACKUP: a database, tablespace, data file (current or copy), control file (current or
      copy), SPFILE, archived log or backup set for a target or standby database. Backing
      up backup set is an easy way to move a backup from disk to tape.

    - DUPLICATE: to create a clone database or a standby database from backups
      (backup sets or image copies) of the target database.

    - FLASHBACK: to perform a Flashback Database operation, returning the database
    to (or to just before) a target time, as specified by time, SCN or log sequence
    RMAN reporting commands include:

    - LIST: querying the recovery catalog or control file and producing a list of the
      backups, copies, archived redo logs and database incarnations recorded there.

    - REPORT: for performing detailed analyses of the recovery catalog or control file.

    - RMAN provides the following command sets for catalog maintenance:

    - CROSSCHECK: checks the status of a backup or a copy on disk or tape.

    - DELETE EXPIRED: lists specified backup objects and prompts for confirmation
      to remove them.

    - CHANGE: is used to alter the status of backup objects in the repository.

    - LIST: shows what CROSSCHECK / DELETE EXPIRED will process.

RMAN Commands

RMAN has two basic types of commands: stand-alone and job commands.

Stand-alone commands are executed at the RMAN prompt and are generally self-

Job commands are usually grouped and executed sequentially inside of a command
block. If any command within the block fails, RMAN ceases processing; no further
commands within the block are executed.

There are some commands that can be issued either at the prompt or within a RUN
command block, such as BACKUP DATABASE.

Job Command: Example
Unlike stand-alone commands, job commands must appear within the brackets of a RUN
The Backup Command

   A backup is a copy of data from the database that can be used to reconstruct that
    data. The results of an backup created through RMAN can be either image copies
    or backup sets.

   An image copy is a bit-for-bit identical copy of a database file.

   RMAN can also store its backups in an RMAN-exclusive format called a backup
    set which is a collection of files called backup pieces.

   When performing a backup using RMAN, you can specify:

   The type of backup to be performed. You can perform backups of the entire
    database (FULL) or incremental backups (INCREMENTAL).

    automatically backs up the control file and the current server parameter file
    after BACKUP commands.

   What to backup. Valid values are database, datafile, tablespace, archivelog, current
    controlfile or spfile.

   Whether an image copy (AS COPY) or backup set (AS BACKUPSET) is created.

   The file name format and location for backup pieces (FORMAT).

   Which data files or archived redo logs should be excluded from the backup set

   A maximum size for a backup set (MAXSETSIZE).

   That the input files should be deleted upon the successful creation of the backup set
Compressed Backups

Compressed backups reduce the amount of space required for
storing backup sets. The compression applies only to backup sets, not
image copies.

RMAN can be configured to automatically make compressed backup
sets with the CONFIGURE DEVICE TYPE command. By default
compression is disabled.

The Parallelism means that RMAN parallelizes its operation and writes
multiple backup sets in parallel.

Image Copy

As mentioned before an image copy is a clone of a single file, archived redo log or
control file.

It can be created with the BACKUP AS COPY command or with an OS command.

An image copy has the following characteristics:

Can be written only to disk.

If files are stored on disk, they can be used immediately by using the SWITCH command
in Recovery Manager.

In an image copy all blocks are copied, whether they contain data or not.

Can be part of a full or incremental level 0 backup because a file copy always includes
all blocks.
Incremental Backups

An incremental backup is either a level 0 backup which includes every block in the data
files except blocks that have never been used or a level 1 backup which includes only
those blocks that have been changed since a previous backup was taken.

A level 0 incremental backup is physically identical to a full backup.

The only difference is that the level 0 backup can be used as the base for a level 1
backup, but a full backup cannot.

A cumulative level 1 incremental backup backs up all blocks changed after the most
recent backup at level 0.

A differential level 1 incremental backup , the default type of incremental backup,
backs up all the blocks changed after the most recent incremental backup at either level 1
or level 0.

To top