Pages

Wednesday, July 3, 2019

RMAN Recovery Catalog

First create the RCATDB Database

Now after creating database create the tablespace and the user required for RECOVERY CATALOG : 

CREATE TABLESPACE "TBRCAT"
    LOGGING
    DATAFILE '/u01/app/oracle/oradata/RCATDB/RCAT001.ora' SIZE 30M
    EXTENT MANAGEMENT LOCAL UNIFORM SIZE 3M SEGMENT SPACE
    MANAGEMENT  AUTO;

ALTER DATABASE
    DATAFILE '/u01/app/oracle/oradata/RCATDB/RCAT001.ora' AUTOEXTEND
    ON NEXT  3M;

ALTER DATABASE
    DATAFILE '/u01/app/oracle/oradata/RCATDB/RCAT001.ora' AUTOEXTEND
    ON MAXSIZE UNLIMITED;

CREATE USER RCAT PROFILE DEFAULT
    IDENTIFIED BY RCAT DEFAULT TABLESPACE TBRCAT
    ACCOUNT UNLOCK;
GRANT CREATE SEQUENCE TO RCAT;
GRANT CREATE SESSION TO RCAT;
GRANT CREATE SYNONYM TO RCAT;
GRANT CREATE TABLE TO RCAT;
GRANT CREATE VIEW TO RCAT;
GRANT IMP_FULL_DATABASE TO RCAT;
GRANT EXP_FULL_DATABASE TO RCAT;
GRANT CONNECT TO RCAT;
GRANT RESOURCE TO RCAT;
GRANT recovery_catalog_owner TO RCAT;
- Create Recovery Catalog
$rman catalog RCAT/RCAT
RMAN> create catalog;
Exit;
rman target / catalog RCAT/RCAT@RCATDB
REGISTER DATABASE;

Now - Register the databases which will use this database as recovery catalog

Login to orcl and issue this command :
rman target sys/oracle@orcl catalog RCAT/RCAT@RCATDB;
Save this database :
RMAN> register database;

- Verify that the registration was successful by running REPORT SCHEMA
RMAN> report schema;

Check the oratab file and name of database ,it should have YES Entry in the end :
Cat /etc/oratab
oratst:/u01/app/oracle/product/11.2.0/db_1:Y




My RMAN Configuration :


[oracle@OEL-VM-109 ~]$ rman target sys/oracle@orcl catalog RCAT/RCAT@RCATDB;

Recovery Manager: Release 11.2.0.1.0 - Production on Thu Feb 2 15:38:37 2017

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL (DBID=146129700)
connected to recovery catalog database

RMAN> report schema;

Report of database schema for database with db_unique_name ORCL

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    690      SYSTEM               YES     /u01/app/oracle/oradata/orcl/system01.dbf
2    490      SYSAUX               NO      /u01/app/oracle/oradata/orcl/sysaux01.dbf
3    30       UNDOTBS1             YES     /u01/app/oracle/oradata/orcl/undotbs01.dbf
4    5        USERS                NO      /u01/app/oracle/oradata/orcl/users01.dbf
5    147      TBEHMS               NO      /u01/app/oracle/oradata/orcl/EHMS001.ora

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    20       TEMP                 32767       /u01/app/oracle/oradata/orcl/temp01.dbf

RMAN> show all;

RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u99/rman_backup/cf/cf_%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   '/u99/rman_backup/db_bkp_%t_%U_%T_%p';
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/product/11.2.0/dbhome_1/dbs/snapcf_orcl.f'; # default
NOTE : Before taking backup please verify proper permissions given to that rman backup folder that is used in configuration , in my case it’s /u99/rman_backup/cf

Since /u01, /u18 and /u99 are still owned by root, let us give the permission to oracle.
#For oracle user
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01 /u01/app/oracle /u18 /u99 /u99/rman_backup /u99/rman_backup_cf
  
2.  Grant proper permissions on directories to oracle user
chmod -R 775 /u01 /u18 /u99 /u99/rman_backup /u99/rman_backup/cf


Backup incremental level 0 database plus archivelog;

No comments:

Post a Comment