Archivelog Mode: RMAN Architecture
Archivelog Mode: RMAN Architecture
Archivelog Mode: RMAN Architecture
RMAN can do everything a normal backup can do, however RMAN has its own backup catalog to
record the backups that took place. The database can be in two formats archivelog mode or
nonarchivelog mode
archivelog - Oracle saves the filled redo logs files, which means you can recovery the database
to any point in time using the archived logs
nonarchivelog - the redo logs are overwritten and not saved, but can only be recovery from the
last backup.
whole backup - you backup the database as a whole which includes the controlfiles and spfile
partial backup - you back only a part of the database such a tablespace, one data file
consistent - a consistent backup does not need to go through recover when being restored,
normally associated with a closed backup
inconsistent - a inconsistent backup always needs to be recovered
open - is backup taken when the database is running, also known as a hot, warm, online backup
closed - is a backup taken when the database is shutdown also know as a cold, offline backup
RMAN Architecture
RMAN operates via a server session connecting to the target database, it gets the metadata from the
target, this is called the RMAN repository. The repository will contain information on
RMAN will use the controlfile on the target database to store repository information regarding any
backups for that server, this information can also be stored in a recovery catalog (optional) which resides
on a rman server its own database (default size should be about 115MB) which should be dedicated to
RMAN, information is still written to controlfile even if a recovery catalog is used.
The information stored in the controlfile is stored in the reusable sections called circular reuse records
and non-circular reuse records. The circular reuse records have non-critical information that can be
overwritten if needed. Some of the non-circular re-useable sections consists of data files and redo log
information. RMAN can backup archive logs, controlfile, data files, spfile and tablespaces it does not
backup temporary tablespaces, redo logs, password file, init.ora.
The controlfile based repository will retain data for only the time specified by the instance parameter
CONTROL_FILE_RECORD_KEEP_TIME this defaults to seven days.
Useful View
V$CONTROLFILE_RECORD_SECTION displays information about the control file record sections
If you backup to tapes you require additional software called MML (media management layer) or media
manager. MML is a API that interfaces with different vendors tape libraries.
RMAN terminology
backup piece - operating system file containing the backup of a data file, controlfile, etc
backup set - logical structure that contains one or more backup pieces, all relevant backup pieces
are contained in a backup set
image copy - similar to operating system copies like cp or dd, they will contain all block if if not
used (disk only)
proxy copy - media manger is given control of the copying process
channel - Channel allocation is a method of connecting rman and the target database while also
specifying the type of backup i.e. disk or tape, they can created manually or automatically.
Connecting to RMAN
There are a number of ways to connect to RMAN and it depends on where the recovery catalog is
Channel Parameters/Options
The parameters/options are use to control the resources used by RMAN, there are many options
probably best to consult the oracle documentation.
channel device type - set default location of backups can be disk or sbt
channel rate - limits i/o bandwith KB, MB or GB
channel maxpiecesize - limits the size of the backup pieces
channel maxsetsize - limits the size of the backup sets
channel connect - instructs a specific instance to perform an operation
duration - controls time for backup job (hours/mins)
parms - send specific instructions to tape library
Backup Retention
Default is redundancy 1 which means always attempt to have one backup image or backupset of every
data file, archive log and controlfile
keep backups for 30 rman> configure retention policy to recover window of 30
days days;
keep aleast 2 copies rman> configure retention policy to redundancy 2;
reset back to 1 rman> configure retention policy clear;
(default)
extend the retention rman> change backupset tag monthly_backup keep until time
period ’01-dec-07’ logs;
Backup Tagging
Controlfile Backup
Tablespace Excludes
Creating Backups
rman> run {
allocate channel c1 type disk;
allocate channel c2 type disk;
backup
(datafile 1,2,3 channel c1)
(archivelog all channel c2);
}
rman> run {
allocate channel c1 type disk;
copy datafile 1 to
‘z:\orabackup\system01.dbf’, current
controlfile to ‘z:\orabackup\control01.ctl’;
Backup Images }
Note:
logical - perform logical check of the
backup files
duration - time limit to perform the
backup
minimize - perform the backup as fast as
it can
compressed - compress the backup set,
remember it will take longer to recovery
as it needs to uncompress
You can validate a backup set before you restore which ensures that backup files exist in the proper
locations and that they are readable and free from any logical and physical corruptions, you can also
crosscheck backup sets to make sure they are available and have not been deleted (backup sets can be
deleted from the operating system level).
Viewing backups
The v$ views information regarding backups is always located in the target database’s or target
database’s controlfile.
The list commands are used to determine files impacted by the change, crosscheck and delete
commands. The report command is accurate when the control and RMAN repository are synchronized
which can be performed by the change, crosscheck and delete commands
Deleting Backups
To removed old archive logs use "delete all" option, if all is missed only the archive logs in the primary
destination will be deleted.
Note:
obsolete - delete all backups no longer needed due to
retention levels
Catalog commands
The catalog command helps you identify and catalog any files that aren't recorded in RMAN's
repository and thus are known to RMAN
Block change tracking is used to backup very large databases,when you enable change block tracking a
new process CTWR is then started: