In order to make a recovery catalog using a pluggable database as part of your container database you should follow these instructions
special notes
* PDB can act as a recovery catalog
* Recovery catalog is not supported when connected to pluggable database
* You must register the whole CDB agains the PDB catalog
Creating pluggable database for RMAN catalog
bash-4.2$ echo $ORACLE_SID
CDB
bash-4.2$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Thu Jul 28 15:38:17 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> create pluggable database rman admin user rman identified by rman;
SQL> alter session set container = rman;
Session altered.
SQL> alter database open;
Database altered.
Preparing specific tablespace
SQL> conn sys@RMAN as sysdba
Enter password:
Connected.
SQL> show CON_NAME
CON_NAME
------------------------------
RMAN
SQL> create tablespace CAT_TBS;
Tablespace created.
SQL> select tablespace_name,file_name from dba_data_files;
TABLESPACE_NAME
------------------------------
FILE_NAME
--------------------------------------------------------------------------------
SYSTEM
/oracle/CDB/38B26CEDFDCC341FE05329D3EC0AACAA/datafile/o1_mf_system_csmz8
3x6_.dbf
SYSAUX
/oracle/CDB/38B26CEDFDCC341FE05329D3EC0AACAA/datafile/o1_mf_sysaux_csmz8
3xg_.dbf
CAT_TBS
TABLESPACE_NAME
------------------------------
FILE_NAME
--------------------------------------------------------------------------------
/oracle/CDB/38B26CEDFDCC341FE05329D3EC0AACAA/datafile/o1_mf_cat_tbs_csv9
m99m_.dbf
Handle grants
SQL> grant recovery_catalog_owner to rman;
Grant succeeded.
SQL> alter user rman default tablespace cat_tbs;
User altered.
SQL> alter user rman quota unlimited on CAT_TBS;
User altered.
Simply creating the catalog
bash-4.2$ rman catalog rman/rman@RMAN
Recovery Manager: Release 12.1.0.2.0 - Production on Sun Jul 31 10:20:35 2016
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to recovery catalog database
RMAN> CREATE CATALOG;
recovery catalog created
Register the CDB in the catalog (it's not supported to connect to PDB as target as you can see:)
bash-4.2$ rman catalog rman@RMAN target sys@PDB1
Recovery Manager: Release 12.1.0.2.0 - Production on Sun Jul 31 10:30:27 2016
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
target database Password:
connected to target database: CDB (DBID=2034989396, not open)
recovery catalog database Password:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-01005: recovery catalog is not supported when connected to pluggable database
bash-4.2$
This is how you do it:
bash-4.2$ rman catalog rman@RMAN target sys@CDB
Recovery Manager: Release 12.1.0.2.0 - Production on Sun Jul 31 10:37:27 2016
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
target database Password:
connected to target database: CDB (DBID=2034989396)
recovery catalog database Password:
connected to recovery catalog database
RMAN>
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
special notes
* PDB can act as a recovery catalog
* Recovery catalog is not supported when connected to pluggable database
* You must register the whole CDB agains the PDB catalog
Creating pluggable database for RMAN catalog
bash-4.2$ echo $ORACLE_SID
CDB
bash-4.2$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Thu Jul 28 15:38:17 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> create pluggable database rman admin user rman identified by rman;
SQL> alter session set container = rman;
Session altered.
SQL> alter database open;
Database altered.
Preparing specific tablespace
SQL> conn sys@RMAN as sysdba
Enter password:
Connected.
SQL> show CON_NAME
CON_NAME
------------------------------
RMAN
SQL> create tablespace CAT_TBS;
Tablespace created.
SQL> select tablespace_name,file_name from dba_data_files;
TABLESPACE_NAME
------------------------------
FILE_NAME
--------------------------------------------------------------------------------
SYSTEM
/oracle/CDB/38B26CEDFDCC341FE05329D3EC0AACAA/datafile/o1_mf_system_csmz8
3x6_.dbf
SYSAUX
/oracle/CDB/38B26CEDFDCC341FE05329D3EC0AACAA/datafile/o1_mf_sysaux_csmz8
3xg_.dbf
CAT_TBS
TABLESPACE_NAME
------------------------------
FILE_NAME
--------------------------------------------------------------------------------
/oracle/CDB/38B26CEDFDCC341FE05329D3EC0AACAA/datafile/o1_mf_cat_tbs_csv9
m99m_.dbf
Handle grants
SQL> grant recovery_catalog_owner to rman;
Grant succeeded.
SQL> alter user rman default tablespace cat_tbs;
User altered.
SQL> alter user rman quota unlimited on CAT_TBS;
User altered.
Simply creating the catalog
bash-4.2$ rman catalog rman/rman@RMAN
Recovery Manager: Release 12.1.0.2.0 - Production on Sun Jul 31 10:20:35 2016
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to recovery catalog database
RMAN> CREATE CATALOG;
recovery catalog created
Register the CDB in the catalog (it's not supported to connect to PDB as target as you can see:)
bash-4.2$ rman catalog rman@RMAN target sys@PDB1
Recovery Manager: Release 12.1.0.2.0 - Production on Sun Jul 31 10:30:27 2016
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
target database Password:
connected to target database: CDB (DBID=2034989396, not open)
recovery catalog database Password:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-01005: recovery catalog is not supported when connected to pluggable database
bash-4.2$
This is how you do it:
bash-4.2$ rman catalog rman@RMAN target sys@CDB
Recovery Manager: Release 12.1.0.2.0 - Production on Sun Jul 31 10:37:27 2016
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
target database Password:
connected to target database: CDB (DBID=2034989396)
recovery catalog database Password:
connected to recovery catalog database
RMAN>
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
Comments
Post a Comment