Simple Steps to Create/ Configure Oracle RMAN with DB Backups


RMAN is the component of the Oracle database that is used to perform backup and recovery operations. It can make consistent and inconsistent backups, perform incremental and full backups, and back up either the whole database or a portion of it.

RMAN uses its own powerful job control and scripting language, as well as a published API that interfaces RMAN with many popular backup software solutions.


RMAN can store backups on the disk for quick recovery or place them on the tape for long-term storage. For RMAN to store backups on the tape, you must either use Oracle Secure Backup or configure an interface to the tape device known as a Media Management Library (MML).

Enterprise Manager supplies a graphical interface to the most commonly used RMAN functionality. Advanced backup and recovery operations are accessible through RMAN’s command-line client. 



Now we talk about simple steps to create/ configure RMAN, database backups and archive log backups


Step1:  Enable the archive log in ORCL database.

Step2: Create the tablespace and user in catalog database to hold backup information.

Note: I created Catdb database for RMAN repository, you may create a new database or can use existing database too

SQL> CONNECT sys/password@catdb AS SYSDBA

SQL> CREATE TABLESPACE RMAN
 DATAFILE 'C:\ORACLE\PRODUCT\11.2.0\ORADATA\CATDB\RMAN01.DBF' SIZE 7208K REUSE
 AUTOEXTEND ON NEXT 64K MAXSIZE 32767M
 EXTENT MANAGEMENT LOCAL
 SEGMENT SPACE MANAGEMENT AUTO;

SQL> CREATE USER rman IDENTIFIED BY rman
TEMPORARY TABLESPACE temp
DEFAULT TABLESPACE rman
QUOTA UNLIMITED ON rman;

SQL> GRANT connect, resource, recovery_catalog_owner TO rman;

Step3: Create the recovery catalog in catalog database.

C:\>rman catalog=rman/rman@catdb

RMAN> create catalog tablespace "RMAN";

RMAN> exit

Step4: Register the database with Catalog database. Each database should be registered to catalog database to run RMAN backup.

C:\>rman catalog=rman/rman@catdb target=sys/password@orcl

RMAN> register database;

RMAN> exit


Step5: Configure the persistent parameters.


C:\>rman catalog=rman/rman@catdb target=sys/password@orcl

RMAN> configure retention policy to recovery window of 2 days;
RMAN> configure default device type to disk;
RMAN> configure controlfile autobackup on;
RMAN> configure channel device type disk format 'C:\oraclebackup\Backup%d_DB_%U_%S_%P';



Step 6: Take database full backup. The full database backup should be taken first time. Afterwards, archivelog backup will be taken.

C:\>rman catalog=rman/rman@catdb target=sys/password@orcl

RMAN> run{
backup database plus archivelog;
delete noprompt obsolete;
}

RMAN> exit


Now the RMAN setup is completed successfully. Here are the info about RMAN.


Primary DB = ORCL
Catalog DB = CATDB
RMAN Backup location = c:\oraclebackup.

Now take the full backup. everyday run the below script that backup the new archive log files. You may run through scheduler

C:\>rman catalog=rman/rman@catdb target=sys/password@orcl

RMAN> run{
delete noprompt obsolete;
backup archivelog all;
}
RMAN> exit


Here you go :-)