Thursday, September 15, 2016

Creating the Recovery Catalog


Problem:
********

You are planning to use a recovery catalog so we will procceed with creating recovery catalog database and will create a recovery catalog in that database.

Solution:
*********

Therefore we are creating a database in silent mode. Creating the recovery catalog consists of two major steps. First, you must create the recovery catalog owner or schema in the database where you want to house the recovery catalog. Second, once you successfully create the recovery catalog schema, you must create the recovery catalog itself.

Step 1:
********

Creating a database in silent mode:
****************************************

We are procceeding to creating database (rmancatalog) on (dell) server in (RMAN_CATALOG) diskgroup.


[oracle@dell trace]$ dbca -silent \
>   -createDatabase \
>   -asmsnmpPassword asm \
>   -characterSet WE8MSWIN1252 \
>   -continueOnNonFatalErrors false \
>   -disableSecurityConfiguration ALL \
>   -diskGroupName RMAN_CATALOG \
>   -emConfiguration NONE \
>   -gdbName rmancatalog.local \
>   -listeners LISTENER \
>   -memoryPercentage 40 \
>   -recoveryAreaDestination RMAN_CATALOG \
>   -sid rmancatalog \
>   -SysPassword sys \
>   -SystemPassword sys \
>   -storageType ASM \
>   -sampleSchema true \
>   -templateName General_Purpose.dbc
Copying database files
1% complete
3% complete
10% complete
17% complete
24% complete
31% complete
35% complete
Creating and starting Oracle instance
37% complete
42% complete
47% complete
52% complete
53% complete
56% complete
58% complete
Registering database with Oracle Restart
64% complete
Completing Database Creation
68% complete
71% complete
75% complete
85% complete
96% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/rmancatalog/rmancata.log" for further details.

Step 2:
********


Creating the Recovery Catalog Owner:
********************************************

Follow these steps to create the recovery catalog owner:

1. Using SQL*Plus, connect as the user sys to the database where you want to create the recovery catalog. For example:

[oracle@dell trace]$ . oraenv
ORACLE_SID = [prod] ? rmancatalog
The Oracle base remains unchanged with value /u01/app/oracle

[oracle@dell trace]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Wed Sep 14 11:29:28 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

2. Create a default tablespace for the RMAN recovery catalog owner you’re about to create. Otherwise, the system tablespace may be used by default to hold the recovery catalog structures, and it’s not a smart idea to let that happen. This example creates a tablespace named RMAN_CATALOG_TABLESPACE:

SQL> create tablespace rman_catalog_tablespace datafile '+RMAN_CATALOG' size 500M;

    Tablespace created.

3. Create the recovery catalog owner. This example creates a user named rman to own the catalog:

SQL> create user rman identified by rmanpwd
temporary tablespace temp
default tablespace rman_catalog_tablespace
quota unlimited on rman_catalog_tablespace;  2    3    4

User created.

The default tablespace of the recovery catalog owner in this example is the RMAN_CATALOG_TABLESPACE tablespace, which was created in the previous step.

4. Once you create the recovery catalog owner, you must grant that user the recovery_catalog_owner privilege in order for that user to have the authority to work with the recovery catalog you’ll create in the next step. This recovery catalog owner is named rman, so grant the recovery_catalog_owner privilege to that user:

SQL> grant recovery_catalog_owner, connect, resource to rman;

Grant succeeded.

SQL> exit


Creating the Recovery Catalog:
************************************

Once you’ve created the recovery catalog schema, your next step is to create the recovery catalog. You must connect to the recovery catalog, but not to a target database, when you do this. Here are the steps you must follow to create he recovery catalog:

1. Connect to the RMAN catalog database. You must connect as the recovery catalog owner you created in the previous section.

2. Using the create catalog command, create the recovery catalog. RMAN will create the recovery catalog in the default tablespace of the recovery catalog owner (RMAN_CATALOG_TABLESPACE in our example here). For example:

[oracle@dell trace]$ echo $ORACLE_SID
rmancatalog

[oracle@dell trace]$ rman catalog rman/rmanpwd

Recovery Manager: Release 11.2.0.4.0 - Production on Wed Sep 14 12:02:14 2016

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

connected to recovery catalog database

RMAN> create catalog;

 recovery catalog created

You’re now ready to use RMAN with the recovery catalog, which will store RMAN’s backup and recovery metadata.


Registring Database in created Recovery Catalog:
*********************************************************

once you've done with creating recovery catalog then you can register multipel database with this recovery catalog like I am procceding to register prod database which is host on diffrent server [db01.localdomain (192.168.56.102)].

1. Create Listner on dell server where recovery catalog is hosted.

[grid@dell ~]$ cat /u01/app/grid/11.2.0/grid_home/network/admin/listener.ora
# listener.ora Network Configuration File: /u01/app/grid/11.2.0/grid_home/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = dell.localdomain)(PORT = 1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = rmancatalog)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1)
)
)
ADR_BASE_LISTENER = /u01/app/grid

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON              # line added by Agent


2. Create tnsname entry source database (which database want to register) here on dba01 server:

[oracle@db01 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.


LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.103)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rmancatalog.local)
)
)


3. Connect your prod database on db01 server with recovery catalog and Register.

[oracle@db01 admin]$ rman target sys/sys@prod catalog rman/rmanpwd@LISTENER

Recovery Manager: Release 11.2.0.4.0 - Production on Wed Sep 14 12:40:02 2016

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

connected to target database: PROD (DBID=326975078)
connected to recovery catalog database

RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

4. You can check what are table & views created to you recovery catalog when you hit create catalog in rmancatalog database.

[oracle@dell trace]$ echo $ORACLE_SID

rmancatalog
[oracle@dell trace]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Wed Sep 14 12:04:43 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
SQL> connect rman/rmanpwd
Connected.
SQL> select * from tab;

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
AL                             TABLE
AL_V                           VIEW
BCB                            TABLE
BCB_V                          VIEW
BCF                            TABLE
BCF_V                          VIEW
BCR                            TABLE
BCR_V                          VIEW
BDF                            TABLE
BDF_V                          VIEW
BP                             TABLE

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
BP_V                           VIEW
BRL                            TABLE
BRL_V                          VIEW
BS                             TABLE
BSF                            TABLE
BSF_V                          VIEW
BS_V                           VIEW
CCB                            TABLE
CCB_V                          VIEW
CCF                            TABLE
CCF_V                          VIEW

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
CDF                            TABLE
CDF_V                          VIEW
CFS                            TABLE
CFS_V                          VIEW
CKP                            TABLE
CKP_V                          VIEW
CONF                           TABLE
CONFIG                         TABLE
CONFIG_V                       VIEW
CONF_V                         VIEW
DB                             TABLE

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
DBINC                          TABLE
DBINC_V                        VIEW
DB_V                           VIEW
DF                             TABLE
DF_V                           VIEW
FB                             TABLE
FB_V                           VIEW
GRSP                           TABLE
GRSP_V                         VIEW
NODE                           TABLE
NODE_V                         VIEW

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
NRSP                           TABLE
NRSP_V                         VIEW
OFFR                           TABLE
OFFR_V                         VIEW
ORL                            TABLE
ORL_V                          VIEW
RCVER                          TABLE
RCVER_V                        VIEW
RC_ARCHIVED_LOG                VIEW
RC_BACKUP_ARCHIVELOG_DETAILS   VIEW
RC_BACKUP_ARCHIVELOG_SUMMARY   VIEW

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
RC_BACKUP_CONTROLFILE          VIEW
RC_BACKUP_CONTROLFILE_DETAILS  VIEW
RC_BACKUP_CONTROLFILE_SUMMARY  VIEW
RC_BACKUP_COPY_DETAILS         VIEW
RC_BACKUP_COPY_SUMMARY         VIEW
RC_BACKUP_CORRUPTION           VIEW
RC_BACKUP_DATAFILE             VIEW
RC_BACKUP_DATAFILE_DETAILS     VIEW
RC_BACKUP_DATAFILE_SUMMARY     VIEW
RC_BACKUP_FILES                VIEW
RC_BACKUP_PIECE                VIEW

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
RC_BACKUP_PIECE_DETAILS        VIEW
RC_BACKUP_REDOLOG              VIEW
RC_BACKUP_SET                  VIEW
RC_BACKUP_SET_DETAILS          VIEW
RC_BACKUP_SET_SUMMARY          VIEW
RC_BACKUP_SPFILE               VIEW
RC_BACKUP_SPFILE_DETAILS       VIEW
RC_BACKUP_SPFILE_SUMMARY       VIEW
RC_CHECKPOINT                  VIEW
RC_CONTROLFILE_COPY            VIEW
RC_COPY_CORRUPTION             VIEW

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
RC_DATABASE                    VIEW
RC_DATABASE_BLOCK_CORRUPTION   VIEW
RC_DATABASE_INCARNATION        VIEW
RC_DATAFILE                    VIEW
RC_DATAFILE_COPY               VIEW
RC_LOG_HISTORY                 VIEW
RC_OFFLINE_RANGE               VIEW
RC_PROXY_ARCHIVEDLOG           VIEW
RC_PROXY_ARCHIVELOG_DETAILS    VIEW
RC_PROXY_ARCHIVELOG_SUMMARY    VIEW
RC_PROXY_CONTROLFILE           VIEW

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
RC_PROXY_COPY_DETAILS          VIEW
RC_PROXY_COPY_SUMMARY          VIEW
RC_PROXY_DATAFILE              VIEW
RC_REDO_LOG                    VIEW
RC_REDO_THREAD                 VIEW
RC_RESTORE_POINT               VIEW
RC_RESYNC                      VIEW
RC_RMAN_BACKUP_JOB_DETAILS     VIEW
RC_RMAN_BACKUP_SUBJOB_DETAILS  VIEW
RC_RMAN_BACKUP_TYPE            VIEW
RC_RMAN_CONFIGURATION          VIEW

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
RC_RMAN_OUTPUT                 VIEW
RC_RMAN_STATUS                 VIEW
RC_SITE                        VIEW
RC_STORED_SCRIPT               VIEW
RC_STORED_SCRIPT_LINE          VIEW
RC_TABLESPACE                  VIEW
RC_TEMPFILE                    VIEW
RC_UNUSABLE_BACKUPFILE_DETAILS VIEW
RLH                            TABLE
RLH_V                          VIEW
ROUT                           TABLE

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
ROUT_V                         VIEW
RR                             TABLE
RR_V                           VIEW
RSR                            TABLE
RSR_V                          VIEW
RT                             TABLE
RT_V                           VIEW
SCR                            TABLE
SCRL                           TABLE
SCRL_V                         VIEW
SCR_V                          VIEW

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
SITE_DFATT                     TABLE
SITE_DFATT_V                   VIEW
SITE_TFATT                     TABLE
SITE_TFATT_V                   VIEW
TEMPRES                        TABLE
TF                             TABLE
TF_V                           VIEW
TS                             TABLE
TSATT                          TABLE
TSATT_V                        VIEW
TS_V                           VIEW

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
VPC_DATABASES                  TABLE
VPC_DATABASES_V                VIEW
VPC_USERS                      TABLE
VPC_USERS_V                    VIEW
XAL                            TABLE
XAL_V                          VIEW
XCF                            TABLE
XCF_V                          VIEW
XDF                            TABLE
XDF_V                          VIEW

142 rows selected.





#RMAN, #RECOVERY CATALOG, #BACKUP, #CATALOG, #ORACLE, #ORACLE 11G

No comments:

Post a Comment