Friday , July 21 2017
Home / Oracle DBA / RMAN CLONING IN NOCATALOG MODE

RMAN CLONING IN NOCATALOG MODE

CLONING : cloning is the process of duplicating entire data base from one environment to another environment.

RMAN CLONING IN NO CATALOGMODE:

[root@ssss4 ~]# su – oracle
[oracle@ssss4 ~]$ export ORACLE_SID=cheysar
[oracle@ssss4 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Thu Jun 29 13:29:56 2017

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

Connected to an idle instance.

SQL>startup
ORACLE instance started.

Total System Global Area 523108352 bytes
Fixed Size 1345288 bytes
Variable Size 327158008 bytes
Database Buffers 188743680 bytes
Redo Buffers 5861376 bytes
Database mounted.
Database opened.
SQL>select name,open_mode from v$database;

NAME      OPEN_MODE
--------- -------------------
CHEYSAR   READ WRITE
STEP1: CREATE PFILE FROM SPFILE & SEND IT TO TARGET LOCATION:
SQL>show parameter spfile;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string /u01/app/oracle/product/11.2.0
/db_home/dbs/spfilecheysar.ora
SQL> create pfile from spfile;

File created.

SQL>exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 – Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ssss4 ~

[oracle@ssss4 ~]$ cd $ORACLE_HOME/dbs
[oracle@ssss4 dbs]$ ls
hc_cheysar.dat initcheysardup.ora  init.ora orapwcheysar
hc_chsr.dat initcheysar.ora   lkCHEYSAR orapwchsr
hc_DBUA0.dat initchsr.ora   lkCHSR spfilecheysar.ora

[oracle@ssss4 dbs]$ scp initcheysar.ora ssss5:/home/oracle
The authenticity of host ‘ssss5 (172.16.128.151)’ can’t be established.
RSA key fingerprint is 12:20:52:14:65:ab:3f:09:d2:b8:e0:72:74:91:bb:2c.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘ssss5,172.16.128.151’ (RSA) to the list of known hosts.
Connection closed by UNKNOWN
lost connection
[oracle@ssss4 dbs]$ scp initcheysar.ora ssss5:/home/oracle
oracle@ssss5’s password:
initcheysar.ora 100% 972 1.0KB/s 00:00
[oracle@ssss4 dbs]$ cd
[oracle@ssss4 ~]$ ssh ssss5
oracle@ssss5’s password:
Permission denied, please try again.
oracle@ssss5’s password:
Last login: Thu Jun 29 14:14:18 2017 from ssss4.oracle.com
[oracle@ssss5 ~]$ su – oracle
Password:

su: incorrect password
[oracle@ssss5 ~]$
[oracle@ssss5 ~]$
[oracle@ssss5 ~]$ ppwd
-bash: ppwd: command not found
[oracle@ssss5 ~]$ pwd
/home/oracle
[oracle@ssss5 ~]$ ls
initcheysar.ora
[oracle@ssss5 ~]$ cp initcheysar.ora initchsr.ora
[oracle@ssss5 ~]$ mv initchsr.ora $ORACLE_HOME/dbs

STEP 2: EDIT PFILE & CREATE REQUIRED DIRECTORY STRUCTURE:
[oracle@ssss5 ~]$ cd $ORACLE_HOME/dbs
[oracle@ssss5 dbs]$ ls
hc_cheysar.dat hc_DBUA0.dat initchsr.ora lkCHSR orapwchsr
hc_chsr.dat initcheysardup.ora init.ora orapwcheysar
[oracle@ssss5 dbs]$ vi initchsr.ora

cheysar.__db_cache_size=201326592
cheysar.__java_pool_size=4194304
cheysar.__large_pool_size=4194304
cheysar.__oracle_base=’/u01/app/oracle’#ORACLE_BASE set from environment
cheysar.__pga_aggregate_target=209715200
cheysar.__sga_target=314572800
cheysar.__shared_io_pool_size=0
cheysar.__shared_pool_size=96468992
cheysar.__streams_pool_size=0
*.audit_file_dest=’/u03/app/oracle/admin/cheysar/adump’
*.audit_trail=’db’
*.compatible=’11.2.0.0.0′
*.control_files=’/u03/app/oracle//cheysar/control01.ctl’,’/u03/app/oracle/fast_recovery_area/cheysar/control02.ctl’
*.db_block_size=8192
*.db_domain=”
*.db_name=’chsr’
*.db_recovery_file_dest=’/u03/app/oracle/fast_recovery_area’
*.db_recovery_file_dest_size=4196401152
*.diagnostic_dest=’/u03/app/oracle’
*.dispatchers='(PROTOCOL=TCP) (SERVICE=cheysarXDB)’
*.log_archive_format=’%t_%s_%r.dbf’
*.memory_target=521142272
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile=’EXCLUSIVE’
*.undo_tablespace=’UNDOTBS1′
db_file_name_convert=(‘/u01/app/oracle/cheysar/’,’/u03/app/oracle/cheysar/’)
log_file_name_convert=(‘/u01/app/oracle/cheysar/’,’/u03/app/oracle/cheysar/’)
:wq!

CREATING DIRECTORY STRUCTURE:

[root@ssss5 ~]# mkdir -p /u03/app/oracle
[root@ssss5 ~]# mkdir -p /u03/app/oracle/cheysar
[root@ssss5 ~]# mkdir -p /u03/app/oracle/admin/cheysar/adump
[root@ssss5 ~]# mkdir -p /u03/app/oracle/fast_recovery_area/
[root@ssss5 ~]# mkdir -p /u03/app/oracle/fast_recovery_area/cheysar
[root@ssss5 ~]# chown -R oracle:oinstall /u03/app/oracle
[root@ssss5 ~]# chown -R oracle:oinstall /u03/app/oracle/cheysar
[root@ssss5 ~]# chown -R oracle:oinstall /u03/app/oracle/admin/cheysar/adump
[root@ssss5 ~]# chown -R oracle:oinstall /u03/app/oracle/fast_recovery_area/
[root@ssss5 ~]# chown -R oracle:oinstall /u03/app/oracle/fast_recovery_area/cheysar
[root@ssss5 ~]# chmod -R 775 /u03/app/oracle/
[root@ssss5 ~]# chmod -R 775 /u03/app/oracle/cheysar
[root@ssss5 ~]# chmod -R 775 /u03/app/oracle/admin/cheysar/adump
[root@ssss5 ~]# chmod -R 775 /u03/app/oracle/fast_recovery_area/
[root@ssss5 ~]# chmod -R 775 /u03/app/oracle/fast_recovery_area/cheysar
[root@ssss5 ~]#

STEP 3: CONFIGURE LISTENER.ORA
[root@ssss4 ~]# su – oracle
[oracle@ssss4 ~]$ cd /u01/app/oracle/product/11.2.0/db_home/network/admin/
[oracle@ssss4 admin]$ ls
listener.ora shrept.lst tnsnames17062911AM3953.bak
samples tnsnames17062911AM2832.bak tnsnames17062911AM5343.bak
[oracle@ssss4 admin]$ vi listener.ora

[oracle@ssss4 admin]$ lsnrctl stop listener

LSNRCTL for Linux: Version 11.2.0.2.0 – Production on 29-JUN-2017 14:34:42

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ssss4.oracle.com)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
[oracle@ssss4 admin]$ lsnrctl start listener

LSNRCTL for Linux: Version 11.2.0.2.0 – Production on 29-JUN-2017 14:35:04

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/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/ssss4/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ssss4.oracle.com)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ssss4.oracle.com)(PORT=1521)))
STATUS of the LISTENER
————————
Alias listener
Version TNSLSNR for Linux: Version 11.2.0.2.0 – Production
Start Date 29-JUN-2017 14:35:06
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/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/ssss4/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ssss4.oracle.com)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary…
Service “cheysar” has 1 instance(s).
Instance “cheysar”, status UNKNOWN, has 1 handler(s) for this service…
The command completed successfully
[oracle@ssss4 admin]$

 

and also tnsnames.ora  are once checking here.

 

[oracle@ssss5 admin]$ tnsping cheysar

TNS Ping Utility for Linux: Version 11.2.0.2.0 – Production on 01-JUL-2017 11:32:09

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

Used parameter files:

 

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = ssss4.oracle.com)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = cheysar)))
OK (50 msec)
[oracle@ssss5 admin]$

 

here also once check listener is run or not on  server side

 

STEP 4: CREATE PASSWORD FILE TO TARGET LOCATION:
[oracle@ssss5 ~]$ cd $ORACLE_HOME/dbs
[oracle@ssss5 dbs]$ ls
hc_cheysar.dat hc_DBUA0.dat initchsr.ora lkCHSR
hc_chsr.dat initcheysardup.ora init.ora orapwchsr
[oracle@ssss5 dbs]$ orapwd file=orapwchsr password=dba entries=3 force=y

STEP 5: START THE DATABASE IN NOMOUNT AT TARGET LOCATION:

[oracle@ssss5 ~]$ export ORACLE_SID=chsr
[oracle@ssss5 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Fri Jun 30 18:19:48 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>startup nomount
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL>shut immediate
ORA-01507: database not mounted
ORACLE instance shut down.

SQL> startup nomount
ORA-00845: MEMORY_TARGET not supported on this system

SQL>Startup nomount
ORACLE instance started.

Total System Global Area 523108352 bytes
Fixed Size 1345288 bytes
Variable Size 314575096 bytes
Database Buffers 201326592 bytes
Redo Buffers 5861376 bytes
SQL>

STEP 6: CREATE PASSWORD FILE TO SERVER LOCATION:
[root@ssss4 ~]# su – oracle
[oracle@ssss4 ~]$ cd $ORACLE_HOME/dbs
[oracle@ssss4 dbs]$ ls
hc_cheysar.dat initcheysardup.ora init.ora orapwcheysar
hc_DBUA0.dat initcheysar.ora lkCHEYSAR spfilecheysar.ora
[oracle@ssss4 dbs]$ orapwd file=orapwcheysar password=dba entries=3 force=y
[oracle@ssss4 dbs]$

STEP 7 : CONFIGURE TNSNAMES.ORA AT SERVER SIDE LOCATION:
[oracle@ssss4 admin]$ vi tnsnames.ora

 

[oracle@ssss4 admin]$ tnsping

TNS Ping Utility for Linux: Version 11.2.0.2.0 – Production on 01-JUL-2017 11:27:08

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

TNS-03502: Insufficient arguments. Usage: tnsping <address> [<count>] [oracle@ssss4 admin]$ tnsping chsr

TNS Ping Utility for Linux: Version 11.2.0.2.0 – Production on 01-JUL-2017 11:28:09

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

Used parameter files:

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = ssss5.oracle.com)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = chsr)))
OK (60 msec)
[oracle@ssss4 admin]$

 

STEP 8: ISSUE DUPLICATE COMMAND :
[oracle@ssss4 ~]$ rman target sys/dba auxiliary sys/dba@to_chsr

Recovery Manager: Release 11.2.0.2.0 – Production on Fri Jun 30 16:52:27 2017

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

connected to target database: CHEYSAR (DBID=1251988537)
connected to auxiliary database: CHSR (not mounted)

RMAN> duplicate target database to chsr from active database;

Starting Duplicate Db at 30-JUN-17
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=20 device type=DISK

contents of Memory Script:
{
sql clone “create spfile from memory”;

}
executing Memory Script

sql statement: create spfile from memory

contents of Memory Script:
{
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area 523108352 bytes

Fixed Size 1345288 bytes
Variable Size 318769400 bytes
Database Buffers 197132288 bytes
Redo Buffers 5861376 bytes

contents of Memory Script:
{
sql clone “alter system set db_name =
”CHEYSAR” comment=
”Modified by RMAN duplicate” scope=spfile”;
sql clone “alter system set db_unique_name =
”CHSR” comment=
”Modified by RMAN duplicate” scope=spfile”;
shutdown clone immediate;
startup clone force nomount
backup as copy current controlfile auxiliary format ‘/u03/app/oracle/cheysar/control01.ctl’;
restore clone controlfile to ‘/u03/app/oracle/fast_recovery_area/cheysar/control02.ctl’ from
‘/u03/app/oracle/cheysar/control01.ctl’;
alter clone database mount;
}
executing Memory Script

sql statement: alter system set db_name = ”CHEYSAR” comment= ”Modified by RMAN duplicate” scope=spfile

sql statement: alter system set db_unique_name = ”CHSR” comment= ”Modified by RMAN duplicate” scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area 523108352 bytes

Fixed Size 1345288 bytes
Variable Size 318769400 bytes
Database Buffers 197132288 bytes
Redo Buffers 5861376 bytes

Starting backup at 30-JUN-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=36 device type=DISK
channel ORA_DISK_1: starting datafile copy
copying current control file
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 06/30/2017 16:53:49
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 06/30/2017 16:53:49
ORA-17629: Cannot connect to the remote database server
ORA-17627: ORA-01017: invalid username/password; logon denied
ORA-17629: Cannot connect to the remote database server

RMAN>

 

Comments

comments

Check Also

DATA BASE LINKS

DATABASE LINKS: What are the db links? create a link from one database to another …

Leave a Reply

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