RMAN Configuration Demystified: A Practical Deep Dive for
DBAs – Part 1
rman TARGET
SYS/target_pwd@target_str |
Explanation:
- This
command starts RMAN and connects only to the target database, using
the credentials provided.
- Since
there's no CATALOG clause, this is a NOCATALOG mode
backup/restore operation.
- target_pwd
is the password of the SYS user, and target_str is the TNS alias (or
connection string) of the target database.
Use Case:
Used for RMAN operations without a recovery catalog. The
control file is used to store backup metadata.
rman TARGET /
CATALOG rman/rman@rcat |
Explanation:
- Connects
to the target database using OS authentication (TARGET /) —
assuming the user has SYSDBA privilege.
- Connects
to the recovery catalog database using the user rman with password rman
and TNS alias rcat.
Use Case:
Used when backup metadata is maintained in a Recovery
Catalog (preferred for environments with multiple databases or long backup
retention policies).
rman TARGET /
CATALOG rman/rman@rcat AUXILIARY sys/aux_pwd@aux_str |
First let’s crack what is TARGET , CATALOG and AUXILIARY
TARGET Database :
This is the main database you want to back up,
restore, or recover.
It is the primary subject of all RMAN operations.
You must always connect to a target database, even if using
a recovery catalog.
E.g.
rman TARGET sys/password@orcl
rman TARGET /
CATALOG Database(Recovery Catalog) :
The Recovery Catalog is an optional separate database schema
(often in a dedicated database) that stores RMAN metadata.
It offers more advanced reporting, longer metadata retention,
and can manage multiple target databases.
E.g.
rman TARGET / CATALOG rman/rman@rcat
rman/rman@rcat is the connection to the Recovery Catalog
stored in the rcat database.
AUXILIARY Database:
The AUXILIARY is a secondary or temporary database
used for specific RMAN operations
E.g.
rman TARGET / CATALOG rman/rman@rcat AUXILIARY
sys/aux_pwd@aux_str
Explanation:
- Connects
to:
- TARGET
database via OS authentication.
- CATALOG
database using rman user.
- AUXILIARY
database using SYS user with password aux_pwd and TNS alias aux_str.
Use Case:
Used for operations that involve a secondary (auxiliary)
database, such as:
- Duplicating
a database (cloning).
- Tablespace
point-in-time recovery (TSPITR).
- Database
point-in-time recovery (DBPITR).
- Restore
and recovery to an alternate location.
RMAN >CONFIGURE
CHANNEL DEVICE TYPE sbt CLEAR; |
- Clears
any custom channel configuration for SBT (tape) backups.
RMAN >CONFIGURE
RETENTION POLICY CLEAR; |
- Removes
the existing retention policy setting.
RMAN >CONFIGURE
CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK CLEAR; |
·
Clears the control file autobackup format
setting for disk.
RMAN >CONFIGURE
DEFAULT DEVICE TYPE TO DISK/SBT; |
·
Sets the default device for RMAN backups.
·
DISK: Backups go to file system.
·
SBT: Backups go to tape (e.g., via third-party
software like NetBackup).
RMAN >CONFIGURE
RETENTION POLICY TO REDUNDANCY 3; |
·
Redundancy in RMAN means how many
copies of a distinct backup RMAN should retain at minimum.
·
When you set REDUNDANCY 3, you're telling RMAN:
"Keep at least 3 full backups of each datafile.
If there are more than 3, the older ones can be marked obsolete."
RMAN >CONFIGURE
RETENTION POLICY TO RECOVERY WINDOW OF 4 DAYS; |
·
RMAN will retain all backup sets
(datafiles, control files, archived logs, etc.) that are required to perform a point-in-time
recovery to any time in the last 4 days.
·
Older backups beyond the 4-day window are
considered obsolete and can be deleted.
No comments:
Post a Comment