Tuesday, June 21, 2016

Oracle: Duplicate RAC 1 Node Database to RAC 1 Node from Backup

Prepare Environment:

Grid Listener:


$ cd /usr2/app/grid/11.2.0.4/network/admin

$ cat listener.ora

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = QA)
      (ORACLE_HOME = /usr2/app/oracle/product/11.2.0.3)
      (SID_NAME = QA)
    )
  )

LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))            # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))))                # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON                # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON              # line added by Agent


Oracle init File:


$ cat initQA.ora
*.audit_file_dest='/usr2/app/oracle/admin/QA/adump'
*.compatible='11.2.0'
*.control_files='+DATA/QA/CONTROLFILE/control01.ctl','+DATA/QA/CONTROLFILE/control02.ctl'
*.db_block_size=8192
*.db_file_name_convert =("+DATA/PROD","+DATA/QA")
*.log_file_name_convert =("+DATA/PROD","+DATA/QA","+ARC","+ARC",)
*.db_name='QA'
*.db_unique_name='QA'
*.diagnostic_dest='/usr2/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=QAX)'
*.event=''
*.job_queue_processes=10
*.log_buffer=46579712# log buffer update
*.nls_date_format='DD-MON-YYYY'
*.O7_DICTIONARY_ACCESSIBILITY=TRUE
*.open_cursors=2500
*.optimizer_dynamic_sampling=2
*.optimizer_mode='ALL_ROWS'
*.pga_aggregate_target=3052M
*.plsql_warnings='DISABLE:ALL'# PL/SQL warnings at init.ora
*.processes=1000
*.query_rewrite_enabled='TRUE'
*.remote_login_passwordfile='EXCLUSIVE'
*.resource_manager_plan=''
*.result_cache_max_size=15744K
*.sec_case_sensitive_logon=FALSE
*.sessions=2048
*.sga_max_size=3840M# internally adjusted
*.sga_target=3G
*.skip_unusable_indexes=TRUE
*.timed_statistics=TRUE
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.utl_file_dir='/usr1/CSISII/LOGS','/tmp'


Mount the backup to the server used to duplicate database




Add auxiliary database into source database tnsname.ora



Start auxiliary database at nomount mode



Get last thread and sequence number of Source Database Backup


RMAN> list backupset;

Duplicate with RMAN

On destination node,
$ export NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"

$ rman target sys/xxxx@csis2:1521/prod auxiliary sys/xxxx@tcsqa

set echo on
run{
 allocate auxiliary channel C1 device type disk;
 SET UNTIL SEQUENCE 782 thread 1 ;
 duplicate target database to QA;
}

No comments:

Post a Comment