0% found this document useful (0 votes)
14 views7 pages

1.understanding Rman

RMAN (Recovery Manager) is an Oracle tool used for backing up, restoring, and recovering databases, offering advantages over user-managed backups such as automated documentation and logical corruption detection. It supports both hot and cold backups, with hot backups being preferred for minimizing downtime, and can manage backup metadata within the database control file. RMAN also allows for advanced features like incremental backups, encryption, and duplexed backup sets, enhancing the efficiency and security of database management.

Uploaded by

subham pandey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views7 pages

1.understanding Rman

RMAN (Recovery Manager) is an Oracle tool used for backing up, restoring, and recovering databases, offering advantages over user-managed backups such as automated documentation and logical corruption detection. It supports both hot and cold backups, with hot backups being preferred for minimizing downtime, and can manage backup metadata within the database control file. RMAN also allows for advanced features like incremental backups, encryption, and duplexed backup sets, enhancing the efficiency and security of database management.

Uploaded by

subham pandey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

***********************

RMAN (Recovery Manager)


***********************

Is a tool to backup oracle database , restore oracle database and recovery oracle
database

So its backup recovery tool

--------------------------
1. Understanding rman tool
--------------------------

Under $ORACLE_HOME/bin

[oracle@rac1 ~]$ which rman


/u008/app/oracle/product/19.3.0/dbhome_1/bin/rman
[oracle@rac1 ~]$
[oracle@rac1 ~]$ rman

Recovery Manager: Release 19.0.0.0.0 - Production on Tue Aug 29 09:41:34 2023


Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.

RMAN>

So rman is a backup recovery tool in Oracle

------------------------------------------------
Benefits of rman backup over user managed backup
------------------------------------------------

i. Rman need not require any documentation for backup , user managed backup
requires manual documentation
ii. Rman stores the backup information in Database control file
iii. OS cp will copy whole 32gb file which doing backup , rman copy only formatted
blocks only , rman copies blocks below high water mark only
iv. rman can detect the logical corruption of block OS copy will not detect it
v. incremental backup is possible only through rman, it means backing up changed
blocks since last bakcup
vi. rman can backup data in encrypted manner , OS copy can not
vii. rman can devide copy content on different channels at a time , it is not
possible with OS cp command
viii. rman is free

------------------------
RMAN COLD and HOT backup
------------------------

Hot backup means database instance is up


COLD backup means database instance is in mount state

Rman needs to access the datafiles hence database needs to be in mount state
--------------------------
Which backup is preferred :
--------------------------

Hot bakcup/ online bakcup is preferred because it does not have downtime during
bakcup

-----------------------------------------
Consistant backup and Inconsistant backup
-----------------------------------------

--Cold backups are consistant in nature


If you restore the cold backup of database you dont need to apply recovery and
database can be opened

--Hot backups are inconsistant in nature

It needs recovery , as database was used by users while backup transactions has
happend on database
we need to apply all the archived redo logs since when we start the backup until
backup got finished

9 AM start backup
.
.
10 AM backup completed

-------------------------
2. How to connect to rman
-------------------------

a. Locally

. oranv
PROD

rman target /

b. Remotely

rman target=sys/oracle123@TNS entry

--------------------
RMAN backup metadata
--------------------

What is metadata ?
Data about data is called as metadata

Rman keeps the metadata about backup in target database control file
For each database its own controlfile will maintain the metadata of the backup
control_file_record_keep_time parameter will decide how long to maintain this
metadata
by default its 7 days , we can set it to 365 days max for the database

Note: Catalog database is used to store the backup information for longer time if
required
Catalog database can maintain the backup info for multiple databases
Types of backup

rman proprietary uncompressed backup


rman proprietary compressed backup
rman proprietary image copy backup

proprietary means : Rman multiplexed backup , it copies formatted blocks from all
datafiles and send it to output file
called as backuppiece

/u008/app/orabase/fast_recovery_area/PROD/backupset/2025_01_03/
o1_mf_nnndf_TAG20250103T095307_mqgskcws_.bkp

formatted blocks=used blocks having data in it

Internally rman uses packages

rman_rcvman
rman_rcvcat

We can take backup of

database
controlfile
archivelog
fra
spfile
tablespace

Note: FRA can only be backuped on tape


image copy only on disk

3. Consistent v Inconsistent rman backups

a. Consistent backup

Need to do in mount state

b. Inconsistent backup

We can take this when database is open

Backup Sets and Backup Pieces

RMAN can store backup data in a logical structure called a backup set, which is the
smallest unit of an RMAN backup.
A backup set contains the data from one or more datafiles, archived redo logs, or
control files or server parameter file.
Backup sets, which are only created and accessed through RMAN, are the only form in
which RMAN can write backups to media managers
such as tape drives and tape libraries.

A backup set contains one or more binary files in an RMAN-specific format. This
file is known as a backup piece. A backup set can contain multiple datafiles. For
example, you can back up ten datafiles into a single backup set consisting of a
single backup piece. In this case, RMAN creates one backup piece as output. The
backup set contains only this backup piece.

If you specify the SECTION SIZE parameter on the BACKUP command, then RMAN produces
a multisection backup. This is a backup of a single large file, produced by
multiple channels in parallel, each of which produces one backup piece. Each backup
piece contains one file section of the file being backed up.

Compression for Backup Sets


When backing up datafiles to backup sets, RMAN can use unused block compression to
skip datafile blocks. RMAN always skips blocks that have never been used. Under
certain conditions, which are listed in the BACKUP AS BACKUPSET entry in Oracle
Database Backup and Recovery Reference, RMAN also skips blocks that are not
currently used. Thus, datafile backup sets are typically smaller than datafile
copies and take less time to write. Unused block compression is fundamental to how
RMAN writes datafiles into backup pieces and cannot be disabled.

In backup undo optimization, RMAN excludes undo not needed for recovery of a
backup, that is, for transactions have already been committed. You can enable and
disable backup optimization, but backup undo optimization is built-in behavior.

Encryption for Backup Sets


RMAN supports backup encryption for backup sets. You can use wallet-based
transparent encryption, password-based encryption, or both. You can use the
CONFIGURE ENCRYPTION command to configure persistent transparent encryption. Use
the SET ENCRYPTION, command at the RMAN session level to specify password-based
encryption.

Filenames for Backup Pieces


You can either let RMAN determine a unique name for backup pieces or use the FORMAT
clause to specify a name. If you do not specify the FORMAT parameter, then RMAN
automatically generates a unique filename with the %U substitution variable in the
default backup location. An example of an SBT backup piece name generated by %U is
12i1nk47_1_1. An example of a backup piece on disk is as follows:

/d1/orcva/TEST/backupset/2007_12_12/o1_mf_nnndf_TAG20071212T162825_2qyl99jm_.bkp

Number and Size of Backup Pieces


By default a backup set contains one backup piece. To restrict the size of each
backup piece, specify the MAXPIECESIZE option of the CONFIGURE CHANNEL or ALLOCATE
CHANNEL commands. This option limits backup piece size to the specified number of
bytes. If the total size of the backup set is greater than the specified backup
piece size, then RMAN creates multiple physical pieces to hold the backup set
contents.

Note that if you specify the SECTION SIZE parameter on the BACKUP command, then
RMAN can create a multisection backup. In this case, a single backup set can
contain multiple backup pieces, each containing a file section. The purpose of
multisection backups is to enable multiple channels to back up a large file in
parallel.
Number and Size of Backup Sets
You use the backupSpec clause of the BACKUP command to specify the objects to be
backed up. Each backupSpec clause produces at least one backup set.

The total number and size of backup sets depends for the most part on an internal
RMAN algorithm. However, you can influence RMAN behavior with the MAXSETSIZE
parameter in the CONFIGURE or BACKUP command. By limiting the size of the backup
set, the parameter indirectly limits the number of files in the set and can
possibly force RMAN to create additional backup sets. Also, you can specify
BACKUP ... FILESPERSET to specify the maximum number of files in each backup set.

This number is the minimum of the FILESPERSET setting and the number of files read
by each channel. The FILESPERSET default is 64.

Image Copies
An image copy is an exact copy of a single datafile, archived redo log file, or
control file. Image copies are not stored in an RMAN-specific format. They are
identical to the results of copying a file with operating system commands. RMAN can
use image copies during RMAN restore and recover operations, and you can also use
image copies with non-RMAN restore and recovery techniques.

Duplexed Backup Sets


When backing up datafiles, archived redo log files, server parameter files, and
control files into backup pieces, RMAN can create a duplexed backup set, producing
up to four identical copies of each backup piece in the backup set on different
backup destinations with one BACKUP command. Duplexing is not supported for backup
operations that produce image copies.

You can use the COPIES parameter in the CONFIGURE, SET, or BACKUP commands to
specify duplexing of backup sets when using the BACKUP command. RMAN can duplex
backups to either disk or tape, but cannot duplex backups to tape and disk
simultaneously. When backing up to tape, ensure that the number of copies does not
exceed the number of available tape devices.

The FORMAT parameter of the BACKUP command specifies the destinations for duplexed
backups. The following example creates 3 copies of the backup of datafile 7:

BACKUP DEVICE TYPE DISK COPIES 3 DATAFILE 7


FORMAT '/disk1/%U','?/oradata/%U','?/%U';

==

Control File and Server Parameter File Autobackups


Having recent backups of your control file and server parameter file is extremely
valuable in many recovery situations. To increase the likelihood that you will have
such backups, the database supports control file and server parameter file
autobackups. The autobackup occurs independently of any backup of the current
control file explicitly requested as part of your BACKUP command.

When RMAN Performs Control File Autobackups


If CONFIGURE CONTROLFILE AUTOBACKUP is ON, then RMAN automatically backs up the
control file and the current server parameter file (if used to start up the
database) at the end of a successful BACKUP command. If the database runs in
ARCHIVELOG mode, RMAN makes control file autobackups when a structural change to
the database affects the contents of the control file.

######################
Rman Retention Policy
######################

RMAN>show all;

it will show all the parameters for rman config

there are two types of recovery window we can configure

recovery window of n days


redundancy to n copies

CONFIGURE RETENTION POLICY TO REDUNDANCY 1; maintain one good L0 bakup and all
previous L0 are marked as obsolete and can be deleted

CONFIGURE RETENTION POLICY TO recovery window of 7 days; means from today until
last 7 days we should be able to recover the database at any point

rman target /

report need backup;


report obsolete ;
delete obsolete;

Catalog backup

Rman format clause for backup location

run
{
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
format '/stage_software/rman/backup_%U';
backup database ;
}

RMAN architecture

Target database
Rman repository (control file)
recovery catalog ( to keep backup medatadata in separate database )
rman client
rman executable
server process
Backup optimization

backup tag

rman incremental backup

backup incremental level 0 database;

You might also like