Saturday , November 25 2017
Home / Oracle DBA / RMAN CONFIGURE IN CATALOG MODE

RMAN CONFIGURE IN CATALOG MODE

RMAN CONFIGURE IN CATALOGMODE : 

[root@dbcentre4 ~]# su – oracle
[oracle@dbcentre4 ~]$ ps -ef|grep smon
oracle 19559 19524 0 10:39 pts/1 00:00:00 grep smon
[oracle@dbcentre4 ~]$ ps -ef|grep pmon
oracle 19561 19524 0 10:39 pts/1 00:00:00 grep pmon

STEP 1:  CREATE  ONE DATABASE:
[oracle@dbcentre4 ~]$ export ORACLE_SID=catdb
[oracle@dbcentre4 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Wed Jul 5 10:40:21 2017

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

Connected to an idle instance.

SQL>startup
ORACLE instance started.

Total System Global Area 389189632 bytes
Fixed Size 1344392 bytes
Variable Size 142609528 bytes
Database Buffers 239075328 bytes
Redo Buffers 6160384 bytes
Database mounted.
Database opened.

SQL>select name,open_mode from v$database;

NAME OPEN_MODE
--------- --------------------
CATDB READ WRITE

STEP 2:CREATE ONE TABLESPACE:

SQL>select name from v$tablespace;

NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
USERS
TEMP
RMAN_TS

6 rows selected.

SQL>create tablespace rman_ts2
2 datafile '/u01/app/oracle/catdb/rman_ts02.dbf' size 10m autoextend on;

Tablespace created.

STEP 3: CREATE ONE USER & BASE TABLES:
SQL>create user cheysar identified by cheysar default tablespace rman_ts2;

User created.

GRANTEND PRIVILAGES TO USER:

SQL>grant connect,resource,recovery_catalog_owner to cheysar;

Grant succeeded.
SQL>conn cheysar/cheysar
Connected.
SQL>show user
USER is "CHEYSAR"
SQL>select count(*) from tab;

COUNT(*)
----------
0
SQL>

STEP 4: CONECT TO CATALOG DATABASE & EXECUTING ” CREATE CATALOG” COMMAND:-
SQL>show user
USER is "CHEYSAR"
SQL>host rman catalog cheysar/cheysar

Recovery Manager: Release 11.2.0.2.0 - Production on Wed Jul 5 11:01:22 2017

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

connected to recovery catalog database

RMAN>create catalog

recovery catalog created

RMAN>exit

Recovery Manager complete.
SQL>show user
USER is "CHEYSAR"
SQL>select count(*) from tab;

COUNT(*)
----------
142

SQL>exit

STEP 5: CONFIGURE LISTENER.ORA:
[root@dbcentre5 ~]# su – oracle
[oracle@dbcentre5 ~]$ export ORACLE_SID=dbc
[oracle@dbcentre5 ~]$ cd /u01/app/oracle/product/11.2.0/db_home/n
network/ nls/
[oracle@dbcentre5 ~]$ cd /u01/app/oracle/product/11.2.0/db_home/network/admin/
[oracle@dbcentre5 admin]$ ls
listener17070111AM1329.bak listener.ora shrept.lst
listener17070111AM1610.bak samples tnsnames.ora
[oracle@dbcentre5 admin]$ vi listener.ora
[root@dbcentre5 ~]# su – oracle
[oracle@dbcentre5 ~]$ cd /u01/app/oracle/product/11.2.0/db_home/network/admin/
[oracle@dbcentre5 admin]$ ls
listener17070111AM1329.bak listener.ora shrept.lst
listener17070111AM1610.bak samples tnsnames.ora
[oracle@dbcentre5 admin]$ vi listener.ora
[oracle@dbcentre5 admin]$ lsnrctl stop listener

LSNRCTL for Linux: Version 11.2.0.2.0 – Production on 05-JUL-2017 11:26:31

Copyright (c) 1991, 2010, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbcentre5.oracle.com)(PO RT=1521)))
The command completed successfully
[oracle@dbcentre5 admin]$ lsnrctl start listener

LSNRCTL for Linux: Version 11.2.0.2.0 – Production on 05-JUL-2017 11:26:45

Copyright (c) 1991, 2010, Oracle. All rights reserved.

Starting /u01/app/oracle/product/11.2.0/db_home/bin/tnslsnr: please wait…

TNSLSNR for Linux: Version 11.2.0.2.0 – Production
System parameter file is /u01/app/oracle/product/11.2.0/db_home/network/admin/li stener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/dbcentre5/listener/alert/lo g.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dbcentre5.oracle.com)(PO RT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbcentre5.oracle.com)(PO RT=1521)))
STATUS of the LISTENER
————————
Alias listener
Version TNSLSNR for Linux: Version 11.2.0.2.0 – Production
Start Date 05-JUL-2017 11:26:45
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/db_home/network/admin/l istener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/dbcentre5/listener/alert/ log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dbcentre5.oracle.com)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary…
Service “dbc” has 1 instance(s).
Instance “dbc”, status UNKNOWN, has 1 handler(s) for this service…
The command completed successfully.

STEP 6: CREATE ONE PASSWORD FILE:
[oracle@dbcentre5 admin]$ cd
[oracle@dbcentre5 ~]$ cd $ORACLE_HOME/dbs
[oracle@dbcentre5 dbs]$ ls
hc_cheysar.dat hc_DBUA0.dat init.ora orapwcheysar spfiledbc.ora
hc_chsr.dat initcheysardup.ora lkCHSR orapwchsr
hc_dbc.dat initchsr.ora lkDBC orapwdbc
[oracle@dbcentre5 dbs]$ orapwd file=orapwdbc password=rac entries=3 force=y
[oracle@dbcentre5 dbs]$ cd

[oracle@dbcentre5 ~]$ ps -ef|grep smon
oracle 19540 1 0 11:07 ? 00:00:01 ora_smon_dbc
oracle 19722 19449 0 11:21 pts/1 00:00:00 grep smon

[oracle@dbcentre5 ~]$ export ORACLE_SID=dbc
[oracle@dbcentre5 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Wed Jul 5 11:22:20 2017

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options.

STEP 7: CONFIGURE TNSNAMES.ORA:
[oracle@dbcentre4 ~]$ cd /u01/app/oracle/product/11.2.0/db_home/network/admin/
[oracle@dbcentre4 admin]$ ls
listener samples tnsnames.ora
listener17063012PM3339.bak shrept.lst
listener.ora tnsnames17063012PM3339.bak
[oracle@dbcentre4 admin]$ vi tnsnames.ora
You have new mail in /var/spool/mail/oracle
[oracle@dbcentre4 admin]$ tnsping to_dbc

TNS Ping Utility for Linux: Version 11.2.0.2.0 – Production on 05-JUL-2017 13:07:19

Copyright (c) 1997, 2010, Oracle. All rights reserved.

Used parameter files:

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = dbcentre5.oracle.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = dbc)))
OK (120 msec)
[oracle@dbcentre4 admin]$ cd

STEP 8: CONNECT TO TARGET DATBASE THROUGH CATALOG DATABASE &REGISTER THE DATABASE:
[oracle@dbcentre4 admin]$ cd
[oracle@dbcentre4 ~]$ rman catalog cheysar/cheysar target sys/rac@to_dbc

Recovery Manager: Release 11.2.0.2.0 – Production on Wed Jul 5 13:08:05 2017

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

connected to target database: DBC (DBID=1307993075)
connected to recovery catalog database

RMAN> list db_unique_name all;

RMAN> register database;

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

RMAN>
RMAN> list db_unique_name all;

RMAN>
RMAN> list db_unique_name all;

List of Databases
DB Key  DB Name   DB ID     Database Role     Db_unique_name
——-       ——-     —————– —————  ——————
1              DBC      1307993075             PRIMARY               DBC

*********** open 2nd terminal ***********
NOTE : CONNECT TO USER
[oracle@dbcentre4 ~]$ export ORACLE_SID=catdb
[oracle@dbcentre4 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Wed Jul 5 12:04:43 2017

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>conn cheysar
Enter password:
Connected.
SQL>show user
USER is "CHEYSAR"
SQL>select * from rc_database;

DB_KEY   DBINC_KEY   DBID           NAME      RESETLOGS_CHANGE#         RESETLOGS
———-   ———-          ———-      ——–               —————–                              ———
1                  2                1307993075       DBC                           770463                                 01-JUL-17

STEP 9: CONFIGURE RMAN CONFIGURATION PARAMETERS TAKE THE BACKUP:

RMAN> show all;

RMAN configuration parameters for database with db_unique_name DBC are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘%F’; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
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/db_home/dbs/snapcf_dbc.f’; # default

:wq!

RMAN> spool log to rman.log
RMAN> show all;
RMAN> spool off;
RMAN> exit
You have new mail in /var/spool/mail/oracle
[oracle@dbcentre4 ~]$

Recovery Manager complete.
You have new mail in /var/spool/mail/oracle

[oracle@dbcentre4 ~]$ vi rman.log

CONFIGURE RETENTION POLICY TO REDUNDANCY 2; # default
CONFIGURE BACKUP OPTIMIZATION ON; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘%F’; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
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/db_home/dbs/snapcf_dbc.f’; # default
CONFIGURE CHANNEL 1 DEVICE TYPE DISK CONNECT ‘sys/rac@to_dbc’;
CONFIGURE CHANNEL 2 DEVICE TYPE DISK CONNECT ‘sys/rac@to_dbc’;

~
~
:wq!

[oracle@dbcentre4 ~]$ rman catalog cheysar/cheysar target sys/rac@to_dbc

Recovery Manager: Release 11.2.0.2.0 – Production on Wed Jul 5 13:25:55 2017

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

connected to target database: DBC (DBID=1307993075)
connected to recovery catalog database

RMAN> @rman.log

RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete
# default
RMAN> CONFIGURE BACKUP OPTIMIZATION ON;
old RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete
# default
RMAN> CONFIGURE DEFAULT DEVICE TYPE TO DISK;
old RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
new RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete
# default
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete
# default

RMAN> CONFIGURE CHANNEL 1 DEVICE TYPE DISK CONNECT *;
new RMAN configuration parameters:
CONFIGURE CHANNEL 1 DEVICE TYPE DISK CONNECT ‘*’;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN> CONFIGURE CHANNEL 2 DEVICE TYPE DISK CONNECT *;
new RMAN configuration parameters:
CONFIGURE CHANNEL 2 DEVICE TYPE DISK CONNECT ‘*’;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN>
RMAN> **end-of-file**

RMAN> backup database plus archivelog;

Starting backup at 05-JUL-17
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=32 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=42 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=2 RECID=1 STAMP=948539314
channel ORA_DISK_1: starting piece 1 at 05-JUL-17
channel ORA_DISK_2: starting archived log backup set
channel ORA_DISK_2: specifying archived log(s) in backup set
input archived log thread=1 sequence=3 RECID=2 STAMP=948547939
channel ORA_DISK_2: starting piece 1 at 05-JUL-17
channel ORA_DISK_1: finished piece 1 at 05-JUL-17
piece handle=/u01/app/oracle/fast_recovery_area/DBC/backupset/2017_07_05/o1_mf_annnn_TAG20170705T133231_dos78trn_.bkp tag=TAG20170705T133231 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:42
channel ORA_DISK_2: finished piece 1 at 05-JUL-17
piece handle=/u01/app/oracle/fast_recovery_area/DBC/backupset/2017_07_05/o1_mf_annnn_TAG20170705T133231_dos78vht_.bkp tag=TAG20170705T133231 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:41
Finished backup at 05-JUL-17

Comments

comments

Check Also

How to perform RMAN cloning (Easy process to clone a database on different server)

Cloning is a process of making a separate copy from one database to another. Cloning …

Leave a Reply

Your email address will not be published. Required fields are marked *