Showing posts with label 11g clone. Show all posts
Showing posts with label 11g clone. Show all posts

Friday, October 6, 2017

11g oracle database refresh or clone to different name

For 11g databases you need to create a temporary listener with a different port on the target server or else it will show blocked status when database is started at nomount

Source and Target :

test =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.120.1.1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = test)
    )
  )

testx =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.120.1.2)(PORT = 1525))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = testx)
    )
  )


Source:

create pfile from spfile;

alter user sys identified by "password" account unlock;

orapwd file=orapwtest password=password entries=5

scp  inittest.ora oracle@10.120.1.2:/opt/app/oracle/product/11.2.0/11.2.0.4/dbs/inittestx.ora

scp  orapwtest oracle@10.120.1.2:/opt/app/oracle/product/11.2.0/11.2.0.4/dbs/orapwtestx




Target:

Modify pfile

*.LOG_ARCHIVE_DEST_1='LOCATION=+REDO'
*.db_create_file_dest='+DATA'
*.db_create_online_log_dest_1='+REDO'
*.control_files='+DATA/testx/controlfile/control01.ctl','+REDO/testx/controlfile/control02.ctl'
*.audit_file_dest='/opt/app/oracle/admin/testx/adump'
*.diagnostic_dest='/opt/app/oracle'

create directories as per pfile

mkdir -p /opt/app/oracle/admin/testx/adump



 Target:

 startup nomount


 Source :

 rman target sys/password@test auxiliary sys/password@testx


 duplicate target database to testx from active database;



11g oracle database refresh or clone to same name

For 11g databases you need to create a temporary listener with a different port on the target server or else it will show blocked status when database is started at nomount

Source and Target :

test_old =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.120.1.1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = test)
    )
  )
 
test_new =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.120.1.2)(PORT = 1525))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = test)
    )
  )


Source:

create pfile from spfile;

alter user sys identified by "password" account unlock;

orapwd file=orapwtest password=password entries=5

scp  inittest.ora oracle@10.120.1.2:/opt/app/oracle/product/11.2.0/11.2.0.4/dbs/inittest.ora

scp  orapwtest oracle@10.120.1.2:/opt/app/oracle/product/11.2.0/11.2.0.4/dbs/orapwtest




Target:

Modify pfile

*.LOG_ARCHIVE_DEST_1='LOCATION=+REDO'
*.db_create_file_dest='+DATA'
*.db_create_online_log_dest_1='+REDO'
*.control_files='+DATA/test/controlfile/control01.ctl','+REDO/test/controlfile/control02.ctl'
*.audit_file_dest='/opt/app/oracle/admin/test/adump'
*.diagnostic_dest='/opt/app/oracle'

create directories as per pfile

mkdir -p /opt/app/oracle/admin/test/adump



 Target:

 startup nomount


 Source :
 
 rman target sys/password@test_old auxiliary sys/password@test_new


 duplicate target database to test from active database;



Featured Post

Apply Patch 22191577 latest GI PSU to RAC and DB homes using Opatch auto or manual steps

Patch 22191577: GRID INFRASTRUCTURE PATCH SET UPDATE 11.2.0.4.160119 (JAN2016) Unzip the patch 22191577 Unzip latest Opatch Version in or...