ORACLE/INSTALL2023. 6. 14. 17:43
반응형

-- /etc/hosts
192.168.219.59  ora19adg1
192.168.219.69  ora19adg2
192.168.219.51  ora19c
192.168.219.57  ora19c-ogg

192.168.56.108  radg1
192.168.56.103  radg2


#1

*.audit_file_dest='/u01/app/oracle/admin/ora19c/adump'
*.audit_trail='db'
*.compatible='19.0.0'
*.control_files='/oradata/ORA19C/control01.ctl','/oradata/ORA19C/control02.ctl'
*.db_block_size=8192
*.db_name='ora19c'
*.db_recovery_file_dest='/oradata'
*.db_recovery_file_dest_size=8256m
*.db_unique_name='primary'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ora19cXDB)'
*.local_listener='LISTENER1','LISTENER2'
*.log_archive_config='dg_config=(primary,standby)'
*.log_archive_dest_1='location=/arch'
*.log_archive_dest_2='service=standby lgwr async valid_for=(online_logfile,primary_role) db_unique_name=standby'
*.log_archive_dest_state_1='enable'
*.log_archive_dest_state_2='enable'
*.log_archive_format='%t_%s_%r.arc'
*.nls_language='KOREAN'
*.nls_territory='KOREA'
*.open_cursors=300
*.pga_aggregate_target=996m
*.processes=320
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=2986m
*.standby_file_management='auto'
*.undo_tablespace='UNDOTBS1'


#2
*.audit_file_dest='/u01/app/oracle/admin/standby/adump'
*.audit_trail='db'
*.compatible='19.0.0'
*.control_files='/oradata/STANDBY/control01.ctl','/oradata/STANDBY/control02.ctl'#Restore Controlfile
*.db_block_size=8192
*.db_file_name_convert='/oradata/ORA19C','/oradata/STANDBY'
*.db_name='ora19c'
*.db_recovery_file_dest='/oradata'
*.db_recovery_file_dest_size=8256m
*.db_unique_name='standby'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=standbyXDB)'
*.fal_client='primary'
*.fal_server='standby'
*.local_listener='LISTENER1','LISTENER2'
*.log_archive_config='dg_config=(primary,standby)'
*.log_archive_dest_1='location=/arch'
*.log_archive_dest_2='service=primary lgwr async valid_for=(online_logfile,primary_role) db_unique_name=primary'
*.log_archive_dest_state_1='enable'
*.log_archive_dest_state_2='enable'
*.log_archive_format='%t_%s_%r.arc'
*.log_file_name_convert='/oradata/ORA19C','/oradata/STANDBY'
*.nls_language='KOREAN'
*.nls_territory='KOR
*.open_cursors=300
*.pga_aggregate_target=996m
*.processes=320
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=2986m
*.standby_file_management='auto'
*.undo_tablespace='UNDOTBS1'



패스워드 파일 DR서버로 복사(SCP)
orapwora19c 복사

복제용 임시 리스너 설정
#2 서버에 적용 listener.ora 및 기동
SID_LIST_LISTENER_ADG =
   (SID_LIST =
     (SID_DESC =
       (SID_NAME = standby)
       (ORACLE_HOME = /u01/app/oracle/product/19c/db_1)
     )
   )



LISTENER_ADG =
   (DESCRIPTION =
     (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg2)(PORT = 21525))
      (CONNECT_DATA =
       (SERVER = DEDICATED)
       (SERVICE_NAME = standby)
     )
   )

lsnrctl start listener_adg
-- tnsnames.ora설정 #1,#2 서버 모두 설정

LISTENER_ORA19CADG =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg1)(PORT = 1521))


LISTENER_ADG =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg2)(PORT = 21525))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = standby)
    )
  )

STANDBY =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg2)(PORT = 21521))
      (FAIL_OVER = ON)
    )
    (CONNECT_DATA =
      (SERVICE_NAME = standby)
    )
  )

LISTENER_ADG1 =
  (ADDRESS = (PROTOCOL = TCP)(HOST = radg1)(PORT = 21521))
    )
    (CONNECT_DATA =
      (SID = primary)
    )
  )



primary =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg1)(PORT = 21521))
      (FAIL_OVER = ON)
    )
    (CONNECT_DATA =
      (SERVICE_NAME = primary)
    )
  )


복제
1) active 서버 에서 복제
nomount 모드로 기동

sqlplus / as sysdba
startup nomount

[ora19c:/u01/app/oracle/product/19c/db_1/network/admin]> rman target sys/oracle@primary auxiliary sys/oracle@standby

Recovery Manager: Release 19.0.0.0.0 - Production on Thu Jun 1 17:01:41 2023
Version 19.13.0.0.0

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

connected to target database: ORA19C (DBID=1191478324)
connected to auxiliary database: ORA19C (not mounted)

RMAN> run {
2> allocate channel prmy1 type disk;
3> allocate auxiliary channel stby1 type disk;
4> duplicate target database for standby from active database nofilenamecheck dorecover;
5>   }

using target database control file instead of recovery catalog
allocated channel: prmy1
channel prmy1: SID=23 device type=DISK

allocated channel: stby1
channel stby1: SID=10 device type=DISK

Starting Duplicate Db at 01-JUN-23
current log archived

contents of Memory Script:
{
   backup as copy reuse
   passwordfile auxiliary format  '/u01/app/oracle/product/19c/db_1/dbs/orapwstandby'   ;
}
executing Memory Script

Starting backup at 01-JUN-23
Finished backup at 01-JUN-23

contents of Memory Script:
{
   restore clone from service  'primary' standby controlfile;
}
executing Memory Script

Starting restore at 01-JUN-23

channel stby1: starting datafile backup set restore
channel stby1: using network backup set from service primary
channel stby1: restoring control file
channel stby1: restore complete, elapsed time: 00:00:01
output file name=/oradata/STANDBY/control01.ctl
output file name=/oradata/STANDBY/control02.ctl
Finished restore at 01-JUN-23

contents of Memory Script:
{
   sql clone 'alter database mount standby database';
}
executing Memory Script

sql statement: alter database mount standby database

contents of Memory Script:
{
   set newname for tempfile  1 to 
 "/oradata/STANDBY/temp01.dbf";
   switch clone tempfile all;
   set newname for datafile  1 to 
 "/oradata/STANDBY/system01.dbf";
   set newname for datafile  3 to 
 "/oradata/STANDBY/sysaux01.dbf";
   set newname for datafile  4 to 
 "/oradata/STANDBY/undotbs01.dbf";
   set newname for datafile  7 to 
 "/oradata/STANDBY/users01.dbf";
   restore
   from  nonsparse   from service 
 'primary'   clone database
   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /oradata/STANDBY/temp01.dbf in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 01-JUN-23

channel stby1: starting datafile backup set restore
channel stby1: using network backup set from service primary
channel stby1: specifying datafile(s) to restore from backup set
channel stby1: restoring datafile 00001 to /oradata/STANDBY/system01.dbf
channel stby1: restore complete, elapsed time: 00:00:25
channel stby1: starting datafile backup set restore
channel stby1: using network backup set from service primary
channel stby1: specifying datafile(s) to restore from backup set
channel stby1: restoring datafile 00003 to /oradata/STANDBY/sysaux01.dbf
channel stby1: restore complete, elapsed time: 00:00:15
channel stby1: starting datafile backup set restore
channel stby1: using network backup set from service primary
channel stby1: specifying datafile(s) to restore from backup set
channel stby1: restoring datafile 00004 to /oradata/STANDBY/undotbs01.dbf
channel stby1: restore complete, elapsed time: 00:00:01
channel stby1: starting datafile backup set restore
channel stby1: using network backup set from service primary
channel stby1: specifying datafile(s) to restore from backup set
channel stby1: restoring datafile 00007 to /oradata/STANDBY/users01.dbf
channel stby1: restore complete, elapsed time: 00:00:01
Finished restore at 01-JUN-23

sql statement: alter system archive log current
current log archived

contents of Memory Script:
{
   restore clone force from service  'primary' 
           archivelog from scn  2276859;
   switch clone datafile all;
}
executing Memory Script

Starting restore at 01-JUN-23

channel stby1: starting archived log restore to default destination
channel stby1: using network backup set from service primary
channel stby1: restoring archived log
archived log thread=1 sequence=13
channel stby1: restore complete, elapsed time: 00:00:01
channel stby1: starting archived log restore to default destination
channel stby1: using network backup set from service primary
channel stby1: restoring archived log
archived log thread=1 sequence=14
channel stby1: restore complete, elapsed time: 00:00:01
Finished restore at 01-JUN-23

datafile 1 switched to datafile copy
input datafile copy RECID=1 STAMP=1138381380 file name=/oradata/STANDBY/system01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=1138381380 file name=/oradata/STANDBY/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=1138381380 file name=/oradata/STANDBY/undotbs01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=1138381380 file name=/oradata/STANDBY/users01.dbf

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

executing command: SET until clause

Starting recover at 01-JUN-23

starting media recovery

archived log for thread 1 with sequence 13 is already on disk as file /arch/1_13_1138290295.arc
archived log for thread 1 with sequence 14 is already on disk as file /arch/1_14_1138290295.arc
archived log file name=/arch/1_13_1138290295.arc thread=1 sequence=13
archived log file name=/arch/1_14_1138290295.arc thread=1 sequence=14
media recovery complete, elapsed time: 00:00:01
Finished recover at 01-JUN-23

contents of Memory Script:
{
   delete clone force archivelog all;
}
executing Memory Script

deleted archived log
archived log file name=/arch/1_13_1138290295.arc RECID=1 STAMP=1138381378
deleted archived log
archived log file name=/arch/1_14_1138290295.arc RECID=2 STAMP=1138381379
Deleted 2 objects

Finished Duplicate Db at 01-JUN-23
released channel: prmy1
released channel: stby1

2) standby 서버에서 복제 실행

[standby:/oradata/STANDBY]> rman target sys/oracle@primary auxiliary sys/oracle@listener_adg

Recovery Manager: Release 19.0.0.0.0 - Production on Thu Jun 1 17:46:05 2023
Version 19.13.0.0.0

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

connected to target database: ORA19C (DBID=1191478324)
connected to auxiliary database: ORA19C (not mounted)

RMAN> duplicate target database for standby from active database nofilenamecheck dorecover;

Starting Duplicate Db at 01-JUN-23
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=379 device type=DISK
current log archived

contents of Memory Script:
{
   backup as copy reuse
   passwordfile auxiliary format  '/u01/app/oracle/product/19c/db_1/dbs/orapwstandby'   ;
}
executing Memory Script

Starting backup at 01-JUN-23
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK
Finished backup at 01-JUN-23

contents of Memory Script:
{
   restore clone from service  'primary' standby controlfile;
}
executing Memory Script

Starting restore at 01-JUN-23
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/oradata/STANDBY/control01.ctl
output file name=/oradata/STANDBY/control02.ctl
Finished restore at 01-JUN-23

contents of Memory Script:
{
   sql clone 'alter database mount standby database';
}
executing Memory Script

sql statement: alter database mount standby database

contents of Memory Script:
{
   set newname for tempfile  1 to 
 "/oradata/STANDBY/temp01.dbf";
   switch clone tempfile all;
   set newname for datafile  1 to 
 "/oradata/STANDBY/system01.dbf";
   set newname for datafile  3 to 
 "/oradata/STANDBY/sysaux01.dbf";
   set newname for datafile  4 to 
 "/oradata/STANDBY/undotbs01.dbf";
   set newname for datafile  7 to 
 "/oradata/STANDBY/users01.dbf";
   restore
   from  nonsparse   from service 
 'primary'   clone database
   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /oradata/STANDBY/temp01.dbf in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 01-JUN-23
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /oradata/STANDBY/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /oradata/STANDBY/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:08
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /oradata/STANDBY/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00007 to /oradata/STANDBY/users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 01-JUN-23

sql statement: alter system archive log current
current log archived

contents of Memory Script:
{
   restore clone force from service  'primary' 
           archivelog from scn  2283316;
   switch clone datafile all;
}
executing Memory Script

Starting restore at 01-JUN-23
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=21
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=22
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 01-JUN-23

datafile 1 switched to datafile copy
input datafile copy RECID=1 STAMP=1138384007 file name=/oradata/STANDBY/system01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=1138384007 file name=/oradata/STANDBY/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=1138384007 file name=/oradata/STANDBY/undotbs01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=1138384007 file name=/oradata/STANDBY/users01.dbf

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

executing command: SET until clause

Starting recover at 01-JUN-23
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 21 is already on disk as file /arch/1_21_1138290295.arc
archived log for thread 1 with sequence 22 is already on disk as file /arch/1_22_1138290295.arc
archived log file name=/arch/1_21_1138290295.arc thread=1 sequence=21
archived log file name=/arch/1_22_1138290295.arc thread=1 sequence=22
media recovery complete, elapsed time: 00:00:01
Finished recover at 01-JUN-23

contents of Memory Script:
{
   delete clone force archivelog all;
}
executing Memory Script

released channel: ORA_DISK_1
released channel: ORA_AUX_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK
deleted archived log
archived log file name=/arch/1_21_1138290295.arc RECID=1 STAMP=1138384004
deleted archived log
archived log file name=/arch/1_22_1138290295.arc RECID=2 STAMP=1138384006
Deleted 2 objects

Finished Duplicate Db at 01-JUN-23


 

오라클 single adg 네트워크 설정

#1.listener.ora ############################################################################# LISTENER1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg1)(PORT = 1529)) ) LISTENER2 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = radg1)(PORT

theone79.tistory.com

 

 

반응형
Posted by [PineTree]