Note_Tech

All technological notes.


Project maintained by simonangel-fong Hosted on GitHub Pages — Theme by mattgraham

Recovery - Catalog

Back


Recovery Catalog


diagram_recovery_catalog01


Pros and Cons

Benefits

Disadvantage of recovery catalog


Control File vs Catalog


Creating a Recovery Catalog

To create a recovery catalog, perform the following three steps:

  1. Configure the database in which you want to store the recovery catalog.
  2. Create the recovery catalog owner.
  3. Create the recovery catalog.

diagram_recovery_catalog02


Configuring the Recovery Catalog Database

-- request 15 MB for each database registered in the recovery catalog.
CREATE TABLESPACE rcat_ts DATAFILE <data file name> SIZE 15M;

Creating the Recovery Catalog Owner

CREATE USER rcowner IDENTIFIED BY rcpass
TEMPORARY TABLESPACE temp
DEFAULT TABLESPACE rcat_ts
QUOTA UNLIMITED ON rcat_ts;

GRANT recovery_catalog_owner TO rcowner;

Creating the Recovery Catalog

Note: As with any database, if the ORACLE_SID environment variable is set to the SID for the recovery catalog database, there is no need to supply the service name in the CONNECT statement.

-- Connect to the recovery catalog database as the catalog owner:
-- rman
CONNECT CATALOG username/password@net_service_name

-- Execute the CREATE CATALOG command:
CREATE CATALOG;

Lab: Create a Recovery Catalog

-- create a pdb as a rcat
CREATE PLUGGABLE DATABASE rcat
  ADMIN USER rcatadmin IDENTIFIED BY welcome
  ROLES = (dba)
  DEFAULT TABLESPACE users
  DATAFILE '/u01/app/oracle/oradata/ORCL/RCAT/users01.dbf'
  SIZE 250M
  AUTOEXTEND ON
  FILE_NAME_CONVERT = ('/u01/app/oracle/oradata/ORCL/pdbseed/',
                       '/u01/app/oracle/oradata/ORCL/RCAT/');

-- update tnsname
-- Connect to rcat
CONNECT sys@rcat as sysdba;

-- Create default tbsp for rcat
CREATE TABLESPACE rcat_ts
DATAFILE '/u01/app/oracle/oradata/ORCL/RCAT/rcat01.dbf'
SIZE 15M
REUSE;

-- create user
CREATE USER rcowner IDENTIFIED BY welcome
DEFAULT TABLESPACE rcat_ts
TEMPORARY TABLESPACE temp
QUOTA UNLIMITED ON rcat_ts;

-- grant role
GRANT recovery_catalog_owner TO rcowner;
-- connect with catalog
CONNECT CATALOG rcowner@rcat

-- build catalog
CREATE CATALOG;

lab_recovery_catalog

lab_recovery_catalog


Lab: Configuring the Recovery Catalog

-- Note: login using the rcat sid, not the target db sid
rman target sys

-- show current policy
show retention policy;

-- update policy
configure retention policy to redundancy 2;
-- Note: login using the rcat sid, not the target db sid
sqlplus / as sysdba

ALTER SYSTEM SET db_recovery_file_dest_size=12G SCOPE=BOTH;

Registering a Target Database

-- connect
rman TARGET / CATALOG rman/rman@reccatdb

-- register
REGISTER DATABASE;

Lab: Registering a Database

-- Connect
rman target "'/ as sysbackup'" catalog rcat_owner@rcat_service

-- register target database
register database;

-- list all of the data files associated with the target database that have registered in the recovery catalog.
REPORT SCHEMA;

lab_recovery_catalog

lab_recovery_catalog


Unregistering a Target Database

rman TARGET / CATALOG username/password@rcat_service
UNREGISTER DATABASE;

Recovery Catalog Resynchronization

diagram_recovery_catalog03



Manually Resynchronizing

RESYNC CATALOG;

Lab: Manually Resynchronizing

-- connect
rman TARGET / CATALOG username/password@rcat_service

-- resync
RESYNC CATALOG;
-- automatically full resync

lab


TOP