RMAN - Configuration, Metadata and Catalogues
Control file
In this post I approach RMAN Configuration, Metadata, Catalogues
- RMAN always stores its metadata in the target database control file
- Whether you use or not the Recovery Catalog Oracle stores metadata into the targer database control file
- RMAN info on control file is is aged based on CONTROL_FILE_RECORD_KEEP_TIME
- Single point control ( control file)
- Does not required another DB
Recovery Catalog
- keep info for long time
- single point to store many databases
- RESYNC CATALOG, syncronize the control file metadata with the recover catalog
- Can store "RMAN backup scripts" in the catalog ... is not possible do it on the control file
- Recovery Catalog control views
- RC_*
- Allow history commands
- BACKUP .. KEEP UNTIL TIME - keep the backup until point that referrers the configured retention police
- BACKUP ... KEEP FOREVER - keep the backup forever, until manually removed
- REPORT SCHEMA ... AT - show the structure at specific time period
Create a RMAN Catalog
--1 create tablespace
SQL> create tablespace rman_ts datafile '/u01/app/oracle/oradata/orcl/rman_ts.bdf' size 125m autoextend on;
Tablespace created.
--2 create create user
SQL> create user rc_owner identified by rc_owner default tablespace rman quota unlimited on rman_ts;
User created.
--3 grant grant recovery_catalog_owner to user
SQL> grant recovery_catalog_owner to rc_owner;
Grant succeeded.
4 ) create catalog and (un)register a database
$ rman target / catalog rc_owner/rc_owner
Recovery Manager: Release 11.2.0.1.0 - Production on Sun Feb 3 18:38:16 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1272537938)
connected to recovery catalog database
RMAN> create catalog;
recovery catalog created
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN> unregister database;
database name is "ORCL" and DBID is 1272537938
Do you really want to unregister the database (enter YES or NO)? yes
database unregistered from the recovery catalog
Resync catalog
- sync the control file metadata with the catalog metadata
- Situations:
- backup failed because the catalog database is down, rman saves the metadata only into the control file
- backup system tablespace => automatic backup control file
RMAN> resync catalog;
starting full resync of recovery catalog
full resync complete
START WITH
To load/save the backups out of FRA you can use the start START WITH option.
# catalog start with '/path';
# catalog start with '+DATA2';
catalog start with '/u01/app/oracle/rman_backup';
Virtual Private Catalog
- delegate admin (traditional)
- each virtual private catalog is a logical partition of the base catalog
- each virtual private catalog owner relies on a separate Oracle oracle account and several views and
- synonyms in the recovery catalog
-- create user
SQL> create user v_priv_catalog1 identified by v_priv_catalog1
default tablespace users quota unlimited on users;
SQL> grant recovery_catalog_owner to v_priv_catalog1;
# give catalog grants
OS$ rman target / catalog rc_owner/rc_owner
RMAN> grant catalog for database orcl to v_priv_catalog1;
RMAN> grant register database to v_priv_catalog1;
#create virtual catalog
OS$ rman target / catalog v_priv_catalog1/v_priv_catalog1
RMAN> create virtual catalog;
found eligible base catalog owned by RMAN
created virtual catalog against base catalog owned by RMAN
RMAN> register database;
RMAN> list encarnation;
Reporting views
- rc_stored_script
- rc_rman_status
- rc_rman_configurations
- rc_database
Backup the catalog
It should include in the regular backup strategy
Retention Policy
- Setting to specify how long to keep backups
- Any backups that are not needed to support this recovery window are marked as OBSOLETE and are automatically removed by RMAN if you are using a flash recovery area, if you are no user FRA the deletion need to be done Manually
- Applies to full back up only (level 0) not to level 1
- Backups can be automatically retained and managed using one of two methods:
- Redundancy :
- X number of backups
- Default !!
- Recovery Window :
- X number of days
- Recommended by Oracle
- Redundancy :
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/Database/11.2.0/orcl/dbs/snapcf_orcl.f'; # default
RMAN> show retention policy;
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
RMAN> configure retention policy to recovery window of 10 days;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 10 DAYS;
new RMAN configuration parameters are successfully stored
RMAN> show retention policy;
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 10 DAYS;
Recommendations
- Don’t create the catalog on the target database
- Set the ARCHIVELOG mode
- Set RETENTION POLICY to REDUNDANCY grater then 1
- Backup the catalog to DISK and TAPE
- Use BACKUP DATABASE PLUS ARCHIVELOG
- Set CONFIGURE CONTROLFILE AUTOBACKUP ON
Comments