Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

step by step rman active clone diff server and without catalog and also withoutbackup.

                     
                               
        target  db_name                 auxiliary db_name
                 kfc                                 kfc3
            192.168.62.128                                          192.168.62.129

target >sourcedb
auxiliary>clonedb


STEP 1.tns &listener

AT 'SERV1'
cd $ORACLE_HOME/network/admin/
[oracle@serv1 admin]$ cat listener.ora
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.62.128)(PORT = 1521))
    )  
  )    
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = kfc)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
    )
 
  )
[oracle@serv1 admin]$ cat tnsnames.ora
kfc3  =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.62.129)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = kfc3)
    )
  )

kfc =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.62.128)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = kfc)
    )
  )

AT 'SERV2'
cd $ORACLE_HOME/network/admin/
[oracle@serv2 admin]$ cat listener.ora
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.62.129)(PORT = 1521))
    )  
  )    
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = kfc3)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
    )
 
  )
[oracle@serv2 admin]$ cat tnsnames.ora
kfc3  =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.62.129)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = kfc3)
    )
  )

kfc =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.62.128)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = kfc)
    )
  )

STEP 2.create auxiliary db structure
mkdir kfc3
cd kfc3
mkdir admin oradata admin/create admin/diag admin/pfile oradata/control oradata/log oradata/data oradata/archive


STEP 3.edit clone pfile only and  not tto source db
SQL> create pfile='/home/oracle/initkfc3.ora' from spfile;
File created.
[oracle@serv1 ~]$ scp /home/oracle/initkfc3.ora oracle@192.168.62.129:/home/oracle/kfc3/admin/pfile/

----------------------------------------------------------------
kfc pfile(target) 
db_name=kfc
sga_target=800m
control_files='/home/oracle/kfc/oradata/control/control01.ctl'
diagnostic_dest='/home/oracle/kfc/admin/diag'
undo_tablespace='UNDOWW'
-----------------------------------------------------------------

Kfc3 pfile(auxilary) vi initkfc3.ora
control_files='/home/oracle/kfc3/oradata/control/control01.ctl'
db_name='kfc3'
diagnostic_dest='/home/oracle/kfc3/admin/diag'
sga_target=800m
db_file_name_convert='/home/oracle/kfc/oradata/data','/home/oracle/kfc3/oradata/data'
log_file_name_convert='/home/oracle/kfc/oradata/log','/home/oracle/kfc3/oradata/log'    -----not necessary so remove this one may be ur choice
undo_tablespace='UNDOWW'


STEP 4. create password file
AT 'SERV1'
cd $ORACLE_HOME/dbs
export ORACLE_SID=kfc
orapwd file=orapwkfc password=sys force=y

AT 'SERV2'
cd $ORACLE_HOME/dbs
export ORACLE_SID=kfc3
orapwd file=orapwkfc3 password=sys force=y


STEP 5.startup auxiliary untill  nomount
export ORACLE_SID=kfc3
sqlplus / as sysdba
startup pfile='/home/oracle/kfc3/admin/pfile/initkfc3.ora' nomount;


STEP 5.connect rman to clone as well as targetdb
AT SOURCE
[oracle@serv1 dbs]$ rman target sys/sys@kfc auxiliary sys/sys@kfc3

Recovery Manager: Release 11.2.0.1.0 - Production on Thu Jul 7 11:04:23 2016

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

connected to target database: KFC (DBID=1036556081)
connected to auxiliary database: KFC3 (not mounted)




STEP 6.execute  last step
RMAN> duplicate target database to kfc3 from active database

error:-
RMAN-05001: auxiliary file name /u01/app/oracle/product/11.2.0/db_1/dbs/arch1_158_915559665.dbf conflicts
with a file used by the target database

solution:-
RMAN> duplicate target database to kfc3 from active database nofilenamecheck;

Starting Duplicate Db at 07-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 =
 ''KFC'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''KFC3'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   backup as copy current controlfile auxiliary format  '/home/oracle/kfc3/oradata/control/control01.ctl';
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''KFC'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''KFC3'' 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 07-JUL-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=38 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_kfc.f tag=TAG20160707T142628 RECID=3 STAMP=916583190
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 07-JUL-16

database mounted
Using previous duplicated file /home/oracle/kfc3/oradata/data/system01.dbf for datafile 1 with checkpoint SCN of 396194
Using previous duplicated file /home/oracle/kfc3/oradata/data/systemaux01.dbf for datafile 2 with checkpoint SCN of 397529
Using previous duplicated file /home/oracle/kfc3/oradata/data/undo01.dbf for datafile 3 with checkpoint SCN of 397555
Using previous duplicated file /home/oracle/kfc3/oradata/data/undoww.dbf for datafile 4 with checkpoint SCN of 397567

contents of Memory Script:
{
   sql 'alter system archive log current';
}
executing Memory Script

sql statement: alter system archive log current

contents of Memory Script:
{
   backup as copy reuse
   archivelog like  "/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_158_915559665.dbf" auxiliary format
 "/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_158_915559665.dbf"   archivelog like
 "/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_159_915559665.dbf" auxiliary format
 "/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_159_915559665.dbf"   ;
   catalog clone archivelog  "/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_158_915559665.dbf";
   catalog clone archivelog  "/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_159_915559665.dbf";
   catalog clone datafilecopy  "/home/oracle/kfc3/oradata/data/system01.dbf",
 "/home/oracle/kfc3/oradata/data/systemaux01.dbf",
 "/home/oracle/kfc3/oradata/data/undo01.dbf",
 "/home/oracle/kfc3/oradata/data/undoww.dbf";
   switch clone datafile  1 to datafilecopy
 "/home/oracle/kfc3/oradata/data/system01.dbf";
   switch clone datafile  2 to datafilecopy
 "/home/oracle/kfc3/oradata/data/systemaux01.dbf";
   switch clone datafile  3 to datafilecopy
 "/home/oracle/kfc3/oradata/data/undo01.dbf";
   switch clone datafile  4 to datafilecopy
 "/home/oracle/kfc3/oradata/data/undoww.dbf";
}
executing Memory Script

Starting backup at 07-JUL-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=158 RECID=5 STAMP=916572888
output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_158_915559665.dbf RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=159 RECID=6 STAMP=916583201
output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_159_915559665.dbf RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
Finished backup at 07-JUL-16

cataloged archived log
archived log file name=/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_158_915559665.dbf RECID=6 STAMP=916597500

cataloged archived log
archived log file name=/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_159_915559665.dbf RECID=7 STAMP=916597500

cataloged datafile copy
datafile copy file name=/home/oracle/kfc3/oradata/data/system01.dbf RECID=3 STAMP=916597501
cataloged datafile copy
datafile copy file name=/home/oracle/kfc3/oradata/data/systemaux01.dbf RECID=4 STAMP=916597501
cataloged datafile copy
datafile copy file name=/home/oracle/kfc3/oradata/data/undo01.dbf RECID=5 STAMP=916597501
cataloged datafile copy
datafile copy file name=/home/oracle/kfc3/oradata/data/undoww.dbf RECID=6 STAMP=916597501

datafile 1 switched to datafile copy
input datafile copy RECID=3 STAMP=916597501 file name=/home/oracle/kfc3/oradata/data/system01.dbf

datafile 2 switched to datafile copy
input datafile copy RECID=4 STAMP=916597501 file name=/home/oracle/kfc3/oradata/data/systemaux01.dbf

datafile 3 switched to datafile copy
input datafile copy RECID=5 STAMP=916597501 file name=/home/oracle/kfc3/oradata/data/undo01.dbf

datafile 4 switched to datafile copy
input datafile copy RECID=6 STAMP=916597501 file name=/home/oracle/kfc3/oradata/data/undoww.dbf

contents of Memory Script:
{
   set until scn  401697;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 07-JUL-16
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=19 device type=DISK

starting media recovery

archived log for thread 1 with sequence 158 is already on disk as file /u01/app/oracle/product/11.2.0/db_1/dbs/arch1_158_915559665.dbf
archived log for thread 1 with sequence 159 is already on disk as file /u01/app/oracle/product/11.2.0/db_1/dbs/arch1_159_915559665.dbf
archived log file name=/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_158_915559665.dbf thread=1 sequence=158
archived log file name=/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_159_915559665.dbf thread=1 sequence=159
media recovery complete, elapsed time: 00:00:06
Finished recover at 07-JUL-16

contents of Memory Script:
{
   shutdown clone immediate;
   startup clone nomount;
   sql clone "alter system set  db_name =
 ''KFC3'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

database dismounted
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

sql statement: alter system set  db_name =  ''KFC3'' comment= ''Reset to original value by RMAN'' scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile

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
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "KFC3" RESETLOGS ARCHIVELOG
  MAXLOGFILES     16
  MAXLOGMEMBERS      2
  MAXDATAFILES       30
  MAXINSTANCES     1
  MAXLOGHISTORY      292
 LOGFILE
  GROUP  1 ( '/home/oracle/kfc3/oradata/log/log01.log' ) SIZE 10 M  REUSE,
  GROUP  2 ( '/home/oracle/kfc3/oradata/log/log02.log' ) SIZE 10 M  REUSE
 DATAFILE
  '/home/oracle/kfc3/oradata/data/system01.dbf'
 CHARACTER SET US7ASCII


contents of Memory Script:
{
   set newname for tempfile  1 to
 "/home/oracle/kfc3/oradata/data/temp01.dbf";
   switch clone tempfile all;
   catalog clone datafilecopy  "/home/oracle/kfc3/oradata/data/systemaux01.dbf",
 "/home/oracle/kfc3/oradata/data/undo01.dbf",
 "/home/oracle/kfc3/oradata/data/undoww.dbf";
   switch clone datafile all;
   switch clone datafile  2 to datafilecopy
 "/home/oracle/kfc3/oradata/data/systemaux01.dbf";
   switch clone datafile  3 to datafilecopy
 "/home/oracle/kfc3/oradata/data/undo01.dbf";
   switch clone datafile  4 to datafilecopy
 "/home/oracle/kfc3/oradata/data/undoww.dbf";
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /home/oracle/kfc3/oradata/data/temp01.dbf in control file

cataloged datafile copy
datafile copy file name=/home/oracle/kfc3/oradata/data/systemaux01.dbf RECID=1 STAMP=916597532
cataloged datafile copy
datafile copy file name=/home/oracle/kfc3/oradata/data/undo01.dbf RECID=2 STAMP=916597532
cataloged datafile copy
datafile copy file name=/home/oracle/kfc3/oradata/data/undoww.dbf RECID=3 STAMP=916597532


datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=916597532 file name=/home/oracle/kfc3/oradata/data/systemaux01.dbf

datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=916597532 file name=/home/oracle/kfc3/oradata/data/undo01.dbf

datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=916597532 file name=/home/oracle/kfc3/oradata/data/undoww.dbf

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 07-JUL-16



STEP 7.CHECK the  DB
SQL> select open_mode,name from v$database;

OPEN_MODE            NAME
-------------------- ---------
READ WRITE           KFC3



Errors

RMAN> duplicate target database to kfc3 from active database

error:-
RMAN-05001: auxiliary file name /u01/app/oracle/product/11.2.0/db_1/dbs/arch1_158_915559665.dbf conflicts
with a file used by the target database

solution:-
RMAN> duplicate target database to kfc3 from active database nofilenamecheck;


Comments

Popular posts from this blog

How to Get Table Size, Database Size, Indexes Size, schema Size, Tablespace Size, column Size in PostgreSQL Database

PostgreSQL Pgbadger Installation On Linux

PostgreSQL pgBadger

How to configure Replication Manager (repmgr) ?

Migrating From Oracle to PostgreSQL using ora2pg open source tools