Configuring RMAN
Now is the time to configure our RMAN environment to allow us to run all RMAN scenarios.
Creating the target DB RMAN backup account
Have a look at the following command:
SQL> CREATE USER backup_admin IDENTIFIED BY bckpwd DEFAULT TABLESPACE users; SQL> GRANT sysbackup TO backup_admin; $ rman target=backup_admin/bckpwd@pdborcl
Configure RMAN using the configure command
Have a look at the following command:
RMAN> CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUSET; RMAN> CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAL '/data/pdborcl/backups /bck_orcl_%U'; RMAN> CONFIGURE CHANNEL 1 DEVICE TYPE DISK MAXPIECESIZE 200m MAXOPENFILES 8 RATE 150m; RMAN> CONFIGURE BACKUP OPTIMIZATION ON; RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON; RMAN> CONFIGURE CONROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/data/pdborcl/backups/controlfile/ctl_orcl_%F'; RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS; RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DISK;
Backup database
Have a look at the following command:
RMAN> BACKUP DATABASE PLUS ARCHIVELOG;
Checking and deleting obsolete backups
Have a look at the following command:
RMAN> REPORT OBSOLETE; RMAN> DELETE OBSOLETE;
Creating RMAN catalog user
Have a look at the following command:
SQL> CREATE TABLESPACE catalog_tbs DATAFILE '/data/pdborcl /catalog_01_tbs.dbf' SIZE 100m; SQL> CREATE USER catalog_bck IDENTIFIED BY rmancatalog DEFAULT TABLESPACE catalog_tbs QUOTA UNLIMITED ON catalog_tbs; SQL> GRANT connect, resource, recovery_catalog_owner TO catalog_bck;
Creating recovery catalog
Have a look at the following command:
$ rman target / catalog=catalog_bck/rmancatalog@pdborcl RMAN> CREATE CATALOG tablespace catalog_tbs;
Register your DB in the recovery catalog
Have a look at the following command:
$ rman target=backup_admin/bckpwd catalog=catalog_bck/rmancatalog@pdborcl RMAN> REGISTER DATABASE; RMAN> REPORT SCHEMA;
Creating a virtual private catalog
Have a look at the following command:
SQL> CREATE USER fmunoz IDENTIFIED BY alvarez DEFAULT TABLESPACE catalog_tbs; SQL> GRANT recovery_catalog_owner TO fmunoz; $ rman catalog=catalog_bck/rmancatalog@pdborcl RMAN> GRANT CATALOG FOR DATABASE pdborcl TO fmunoz; RMAN> GRANT REGISTER DATABASE TO fmunoz; rman catalog=fmunoz/alvarez@pdborcl RMAN> CREATE VIRTUAL CATALOG;
Enabling Block Change tracking
Have a look at the following command:
SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING; SQL> SELECT status FROM v$block_change_tracking;