Showing posts with label same name refresh. Show all posts
Showing posts with label same name refresh. Show all posts

Friday, October 6, 2017

10g oracle database refresh or clone to same name

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 = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = test)
    )
  )


On Source:

alter user sys identified by "password" account unlock;

orapwd file=orapwtest password=password entries=5


create pfile from spfile;


scp  orapwtest oracle@10.120.1.2:/opt/app/oracle/product/10.2.0/dbs/

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

Rman > CONFIGURE DEVICE TYPE DISK PARALLELISM 6 BACKUP TYPE TO BACKUPSET;


Take a fullbackup.


On TARGET

Edit pfile

*.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'
*.background_dump_dest='/opt/app/oracle/admin/test/bdump'
*.core_dump_dest='/opt/app/oracle/admin/test/cdump'
*.user_dump_dest='/opt/app/oracle/admin/test/udump'

Create directories

mkdir -p /opt/app/oracle/admin/test/adump
mkdir -p /opt/app/oracle/admin/test/bdump
mkdir -p /opt/app/oracle/admin/test/cdump
mkdir -p /opt/app/oracle/admin/test/udump


Make sure the backup from source db is accessible in the same location to standby

If not create directories and copy backup and archive logs to the target

scp -r /oracle/oradata1/backup/test oracle@10.120.1.2:/oracle/oradata1/backup/


Copy the archive logs from source to target

scp -r /oracle/oradata1/archive/test oracle@10.120.1.2:/oracle/oradata1/archive/


Target:

startup nomount

rman target sys/Password@test_old auxiliary /

DUPLICATE TARGET DATABASE TO test;


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...