step by step rman active clone with same server, without catalog and without backup --oracle
target db_name auxiliary db_name
kk kfc2
STEP 1.tns &listener
cd $ORACLE_HOME/network/admin/
[oracle@serv2 admin]$ cat listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = serv2.localdomain)(PORT = 1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = kfc2)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
)
(SID_DESC =
(SID_NAME = kk)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
)
)
[oracle@serv2 admin]$ cat tnsnames.ora
kfc2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = serv2.localdomain)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = kfc2)
)
)
kk =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = serv2.localdomain)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = kk)
)
)
STEP 2.create auxiliary( clone) structure
mkdir kfc2
cd kfc2
mkdir admin oradata admin/create admin/diag admin/pfile oradata/control oradata/log oradata/data oradata/archive
STEP 3.edit the clone pfile only and not sourcedb pfile
SQL> create pfile='/home/oracle/kfc2/admin/pfile/initkfc2.ora' from spfile;
File created.
----------------------------------------------------------------
kk pfile(target)
db_name=kk
sga_target=800m
control_files='/home/oracle/kk/oradata/control/control01.ctl'
diagnostic_dest='/home/oracle/kk/admin/diag'
undo_tablespace='UNDOWW'
-----------------------------------------------------------------
Kfc2 pfile(auxilary) vi initkfc2.ora
control_files='/home/oracle/kfc2/oradata/control/control01.ctl'
db_name='kfc2'
diagnostic_dest='/home/oracle/kfc2/admin/diag'
sga_target=800m
db_file_name_convert='/home/oracle/kk/oradata/data','/home/oracle/kfc2/oradata/data'
log_file_name_convert='/home/oracle/kk/oradata/log','/home/oracle/kfc2/oradata/log' -----not necessary so remove this one may be ur choice
undo_tablespace='UNDOWW'
STEP 4. create password file
cd $ORACLE_HOME/dbs
export ORACLE_SID=kk
orapwd file=orapwkk password=sys force=y
cp orapwkk orapwkfc2
(or)
cd $ORACLE_HOME/dbs
export ORACLE_SID=kk
orapwd file=orapwkk password=sys force=y
export ORACLE_SID=kfc2
orapwd file=orapwkfc2 password=sys force=y
STEP 5.startup the auxiliary db untill nomount
export ORACLE_SID=kfc2
sqlplus / as sysdba
startup pfile='/home/oracle/kfc2/admin/pfile/initkfc2.ora' nomount;
STEP 5. connectthe rman to clone as well as auxiliary
AT SOURCE
[oracle@serv2 ~]$ rman target sys/sys@kk auxiliary sys/sys@kfc2
Recovery Manager: Release 11.2.0.1.0 - Production on Tue Jul 5 23:42:58 2016
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: KFC1 (DBID=1036556081)
connected to auxiliary database: KFC2 (not mounted)
STEP 6.execute last step
RMAN> duplicate target database to kfc2 from active database;
Starting Duplicate Db at 06-JUL-16
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=18 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 836976640 bytes
Fixed Size 1339740 bytes
Variable Size 234884772 bytes
Database Buffers 595591168 bytes
Redo Buffers 5160960 bytes
contents of Memory Script:
{
sql clone "alter system set db_name =
''KFC1'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name =
''KFC2'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
backup as copy current controlfile auxiliary format '/home/oracle/kfc2/oradata/control/control01.ctl';
alter clone database mount;
}
executing Memory Script
sql statement: alter system set db_name = ''KFC1'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set db_unique_name = ''KFC2'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 836976640 bytes
Fixed Size 1339740 bytes
Variable Size 234884772 bytes
Database Buffers 595591168 bytes
Redo Buffers 5160960 bytes
Starting backup at 06-JUL-16
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
output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_kfc1.f tag=TAG20160706T015825 RECID=6 STAMP=916451906
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 06-JUL-16
database mounted
Using previous duplicated file /home/oracle/kfc2/oradata/data/system01.dbf for datafile 1 with checkpoint SCN of 469772
Using previous duplicated file /home/oracle/kfc2/oradata/data/systemaux01.dbf for datafile 2 with checkpoint SCN of 469782
Using previous duplicated file /home/oracle/kfc2/oradata/data/undo01.dbf for datafile 3 with checkpoint SCN of 469790
Using previous duplicated file /home/oracle/kfc2/oradata/data/undoww.dbf for datafile 4 with checkpoint SCN of 469796
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 07/06/2016 01:58:32
RMAN-05501: aborting duplication of target database
RMAN-05001: auxiliary file name /home/oracle/kfc1/oradata/log/log02.log conflicts with a file used by the target database
RMAN-05001: auxiliary file name /home/oracle/kfc1/oradata/log/log01.log conflicts with a file used by the target database
step 7.check the db_name
SQL> select global_name from global_name;
GLOBAL_NAME
--------------------------------------------------------------------------------
KFC1
Comments
Post a Comment