이 절에서는 Sun Cluster Geographic Edition 제품에서 Oracle Data Guard 복제를 구성하기 위해 수행해야 하는 초기 단계에 대해 설명합니다.
Oracle 도구 및 명령(예: dgmgrl)을 설명하는 이 설명서의 단계는 설명만을 위한 것입니다. 사용자 환경의 특정 요구에 맞게 수행해야 하는 자세한 절차를 확인하려면 Oracle 설명서를 참조하십시오.
이 절의 보호 그룹 예인 sales-pg는 두 개의 (파트너) 클러스터인 cluster-paris 및 cluster-newyork으로 이루어진 파트너쉽에서 구성되었습니다. 각 클러스터의 개별 RAC 서버 프록시 자원 그룹에 의해 관리 및 모니터되는 Oracle RAC 데이터베이스는 mysales_com -rac-proxy-svr-shadow-rg 섀도우 RAC 서버 프록시 자원 그룹으로 섀도우됩니다. 응용 프로그램 데이터는 sales 데이터베이스에 포함되며, mysales.com Oracle Data Guard Broker 구성의 일부로 Oracle Data Guard에 의해 복제됩니다.
섀도우 RAC 서버 프록시 자원 그룹 mysales_com-rac-proxy-svr-shadow-rg와 Oracle Data Guard Broker 구성 mysales.com은 cluster-paris 및 cluster-newyork 클러스터에 모두 있습니다. 그러나 섀도우되는 RAC 서버 프록시 자원 그룹의 이름은 cluster-paris 및 cluster-newyork 클러스터에서 서로 다를 수 있습니다. sales-pg 보호 그룹은 cluster-paris 및 cluster-newyork 클러스터 간의 데이터 복제를 관리하여 응용 프로그램 데이터를 보호합니다.
이 절에서는 다음 내용을 설명합니다.
Oracle Data Guard Broker 구성을 정의하려면 다음 정보를 확인해야 합니다.
cluster-paris 및 cluster-newyork 클러스터 간에 복제되는 Oracle Data Guard Broker 구성의 이름. 예: mysales.com
복제에 참여하는 고유한 데이터베이스 이름. 예: sales(cluster-paris 클러스터) 및 salesdr(cluster-newyork 클러스터)
이러한 데이터베이스에 대한 Oracle 서비스 이름. 예: sales -svc(cluster-paris 클러스터) 및 salesdr-svc(tcluster-newyork 클러스터) 이러한 이름은 복제되는 Oracle 데이터베이스를 호스트하는 노드의 ${ORACLE_HOME}/network/admin 디렉토리나 Oracle 이름 지정 서비스 디렉토리에 있는 tnsnames.ora 파일에 저장되어 있습니다.
Oracle Data Guard Broker 구성에 대한 데이터베이스 대기 유형. physical 또는 logical로 설정합니다.
Oracle Data Guard Broker 구성에 대한 복제 모드. MaxPerformance, MaxAvailability 또는 MaxProtection으로 설정합니다.
기본 및 대기 데이터베이스 쌍 간에 Oracle Data Guard를 구성한 후 ${ORACLE_HOME}/bin/dgmgrl 명령을 통해 명명된 복제의 등록 정보를 정의하여 Oracle Data Guard Broker 구성을 작성합니다. 이 명령을 사용하여 이전에 나열된 Oracle Data Guard Broker 등록 정보를 설정하고 검색할 수 있습니다.
또한 각 클러스터의 Oracle RAC 데이터베이스를 관리하는 RAC 서버 프록시 자원 그룹의 이름을 확인해야 합니다. clsetup 명령을 통해 Data Service 구성 마법사를 사용하거나 Sun Cluster Data Service for Oracle RAC Guide for Solaris OS 의 부록 D, Command-Line Alternatives의 지침에 따라 이러한 이름을 구성합니다.
다음 표에 나열된 Oracle Data Guard Broker 구성 등록 정보 중에서 Protection Mode 등록 정보만 Sun Cluster Geographic Edition 소프트웨어를 사용하여 변경할 수 있습니다. Sun Cluster Geographic Edition 소프트웨어를 사용하여 DelayMins, MaxFailure, MaxConnections 및 NetTimeout 등록 정보와 같은 구성의 다른 Oracle Data Guard Broker 등록 정보를 수정할 수는 없습니다. Oracle Data Guard Broker 명령을 사용하거나 SQL*Plus를 통해 spfile 서버 매개 변수 파일이나 init${SID}.ora 파일에 저장된 해당 데이터베이스 매개 변수를 수정하여 수동으로 이러한 등록 정보를 조정해야 합니다.
등록 정보 |
허용되는 값 |
설명 |
---|---|---|
Protection Mode |
MaxPerformance, MaxAvailability 또는 MaxProtection |
비동기(MaxPerformance)에서 동기(MaxProtection)의 범위에 있는, Oracle에서 사용하는 데이터 복제 모드 |
Standby type |
physical 또는 logical |
수행되는 복제 유형으로, 기본 데이터베이스 정의의 일부로 유지되는 Redo Apply(physical) 또는 SQL Apply(logical) |
Configuration name |
기본 및 대기 데이터베이스로 이루어진 Oracle Data Guard Broker 구성의 이름 |
|
Primary database |
기본 데이터베이스 이름, 해당 네트워크 서비스 이름 및 대기 유형 |
|
Secondary database |
대기 데이터베이스 이름 및 해당 네트워크 서비스 이름 |
Sun Cluster Geographic Edition 소프트웨어는 전환 및 인계 조작 중에 Oracle Data Guard Broker 구성 역할 변경을 수정합니다.
Oracle Data Guard Broker 구성에 대한 자세한 내용은 Oracle Data Guard Broker 설명서를 참조하십시오.
다음 단계에서 기본 클러스터는 cluster-paris(노드 phys-paris-1 및 phys-paris-2)이고 대기 클러스터는 cluster-newyork(phys-newyork-1 및 phys-newyork-2)입니다. 접미사 -crs가 Oracle Clusterware 가상 IP 호스트 이름에 추가됩니다.
cluster-paris의 기본 데이터베이스는 sales이고 인스턴스 sales1과 sales2가 있습니다. cluster-newyork의 대기 데이터베이스는 salesdr이고 인스턴스 salesdr1과 salesdr2가 있습니다. 접미사 -svc가 각 데이터베이스 및 개별 인스턴스에 대한 각 네트워크 이름 지정 서비스 이름에 추가됩니다(예: sales-svc 또는 sales1 -svc).
Oracle 사용자 .profile 또는 .cshrc 파일을 편집하여 로컬 Oracle RAC 데이터베이스 인스턴스에 대해 올바른 Oracle SID, ORACLE_HOME 및 PATH 환경 변수를 설정했는지 확인합니다. 달리 명시되지 않은 경우 보호된 데이터베이스 인스턴스를 호스트하는 기본 클러스터의 노드에서만 명령을 실행해야 합니다.
모든 기본 및 대기 노드에서 Oracle Clusterware가 사용하는 Oracle 가상 IP 주소를 결정할 수 있는지 확인합니다.
phys-paris-1# getent hosts phys-paris-1-crs 10.11.112.41 phys-paris-1-crs … |
기본 클러스터에 데이터베이스를 작성합니다.
Oracle Database Configuration Assistant(dbca) 또는 SQL*Plus 유틸리티를 사용합니다.
기본 데이터베이스에 대한 Oracle 암호 파일이 존재하는지 확인합니다.
oracle (phys-paris-1)$ cd ${ORACLE_HOME}/dbs oracle (phys-paris-1)$ ls -l orapwsales1 lrwxrwxrwx 1 oracle oinstall 25 November 2 02:06 orapwsales1 -> /oradata/SALES/orapwsales |
Oracle Data Guard는 기본 및 대기 클러스터에 참여하는 모든 노드에 일관성 있는 Oracle 암호 파일이 있어야 합니다.
암호 파일이 없는 경우 다음과 같이 새로 작성합니다.
oracle (phys-paris-1)$ orapwd file=${ORACLE_HOME}/dbs/orapwsales1 \ password=sysdba_password |
그런 다음 이 파일을 공유 저장소의 한 위치로 이동하고 각 노드에서 해당 파일로의 심볼릭 링크를 작성합니다. 각 노드의 로컬 SID를 반영하여 파일 이름을 변경합니다. 나중에 이 파일을 대기 클러스터(cluster-newyork)로 복사할 것입니다.
sqlplus 명령을 사용하여 데이터베이스가 로깅 모드에 있는지 확인합니다.
oracle (phys-paris-1)$ sqlplus '/ as sysdba' SQL> alter database force logging; Database altered. |
Oracle Data Guard Broker 구성 파일 위치를 구성합니다.
다음과 같이 sqlplus 명령을 실행하고 두 개의 파일 이름을 구성에 맞는 이름으로 대체합니다. 이러한 파일이 모든 cluster-paris 노드에 표시되는 공유 저장소에 있는지 확인합니다.
oracle (phys-paris-1)$ sqlplus '/ as sysdba' SQL> alter system set dg_broker_config_file1='/oradata/SALES/dr1sales.dat' 2 scope=both sid='*'; System altered. SQL> alter system set dg_broker_config_file2='/oradata/SALES/dr2sales.dat' 2 scope=both sid='*'; System altered. |
모든 데이터베이스 인스턴스를 종료합니다.
기본 데이터베이스에서 단일 데이터베이스 인스턴스를 마운트하고 Oracle 데이터베이스 플래시백 기능을 사용 가능하게 합니다.
oracle (phys-paris-1)$ sqlplus '/ as sysdba' SQL> startup mount; ORACLE instance started. Total System Global Area 532676608 bytes Fixed Size 2031416 bytes Variable Size 276824264 bytes Database Buffers 247463936 bytes Redo Buffers 6356992 bytes Database mounted. System altered. SQL> alter database archivelog; Database altered. SQL> alter database flashback on; Database altered. SQL> alter database open; Database altered. |
다른 데이터베이스 인스턴스를 재시작합니다.
데이터베이스 대기 재실행 로그를 작성합니다.
구성에 따라 많은 대기 재실행 로그를 추가해야 할 수도 있습니다. 이러한 로그의 이름, 개수 및 크기는 OFA(Optimal Flexible Architecture) 사용 여부, 보유한 온라인 재실행 로그 파일 수 및 이러한 로그 파일의 크기를 비롯한 많은 요소에 따라 달라집니다. 다음 예에서는 OFA 이름 지정 체계가 사용되는 50MB 대기 재실행 로그 파일 한 개를 구성하는 방법을 보여줍니다. 두 개의 노드로 구성된 기본 Oracle RAC 데이터베이스에서는 대체로 6개 로그 파일을 추가해야 합니다.
oracle (phys-paris-1)$ sqlplus '/ as sysdba' SQL> alter database add standby logfile size 50m; Database altered. |
Oracle 로그 아카이빙 대상을 구성합니다.
구성에 따라 Oracle 로그 아카이브 대상 매개 변수를 한 개 이상 변경하거나 추가해야 할 수도 있습니다. 이러한 매개 변수에는 조정 가능한 많은 등록 정보가 있습니다. 자세한 내용은 Oracle 설명서를 참조하십시오. 다음 예에서는 OFA 이름 지정이 사용되는 두 개의 로그 아카이브 대상을 로컬 클러스터와 대기 클러스터에 대해 각각 하나씩 설정하는 방법을 보여줍니다.
oracle (phys-paris-1)$ sqlplus '/ as sysdba' SQL> alter system set log_archive_dest_1='location=use_db_recovery_file_dest 2 arch mandatory valid_for=(all_logfiles,all_roles) 3 db_unique_name=sales' scope=both sid='*'; System altered. SQL> alter system set log_archive_dest_2='service=salesdr-svc 2 lgwr sync affirm valid_for=(online_logfiles,primary_role) 3 db_unique_name=salesdr' scope=both sid='*'; System altered. SQL> alter system set log_archive_dest_10='location=use_db_recovery_file_dest' 2 scope=both sid='*'; System altered. SQL> alter system set standby_file_management='AUTO' scope=both sid='*'; System altered. |
FAL(Fetch Archive Log) 매개 변수를 구성합니다.
데이터베이스가 누락된 아카이브 재실행 로그를 가져올 서버 위치 및 이러한 로그를 보낼 클라이언트 위치를 알려면 FAL 시스템 등록 정보를 설정해야 합니다. 이러한 등록 정보는 소스 및 대상 데이터베이스의 네트워크 서비스 이름을 사용합니다. 다음 sqlplus 명령을 실행하여 매개 변수를 구성에 맞는 올바른 값으로 설정합니다.
oracle (phys-paris-1)$ sqlplus '/ as sysdba' SQL> alter system set fal_server='salesdr-svc' scope=both sid='*'; System altered. SQL> alter system set fal_client='sales-svc' scope=both sid='*'; System altered. |
Oracle Data Guard에 대한 정적 수신기를 작성합니다.
모든 cluster-paris 노드에서 이 단계를 수행합니다.
Oracle Data Guard를 사용하려면 정적 수신기를 구성해야 합니다. 다음 예에서는 ${ORACLE_HOME}=/oracle/oracle/product/10.2.0/db_1을 사용하고 ${ORACLE_HOME}/network/admin/listener.ora 파일에서 정적 수신기 항목을 추가할 위치를 보여줍니다. SID_LIST_LISTENER_PHYS-PARIS-1 및 (SID_NAME = sales1) 줄은 노드마다 다른 반면, (GLOBAL_DBNAME=sales_DGMGRL)은 cluster-newyork에서 다릅니다. 나중에 cluster-newyork 노드에 이러한 항목을 추가할 것입니다.
oracle (phys-paris-1)$ cat ${ORACLE_HOME}/network/admin/listener.ora SID_LIST_LISTENER_PHYS-PARIS-1 = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /oracle/oracle/product/10.2.0/db_1) (PROGRAM = extproc) ) (SID_DESC = (SID_NAME = sales1) (GLOBAL_DBNAME=sales_DGMGRL) (ORACLE_HOME = /oracle/oracle/product/10.2.0/db_1) ) ) oracle (phys-paris-1)$ |
수신기를 재시작합니다.
정적 항목을 사용 가능하게 하려면 cluster-paris의 각 노드에서 Oracle 수신기 프로세스를 재시작합니다.
oracle (phys-paris-1)$ lsnrctl stop LISTENER_PHYS_PHYS-PARIS-1 LSNRCTL for Solaris: Version 10.2.0.3.0 - Production on 29-OCT-2008 02:04:56 Copyright (c) 1991, 2006, Oracle. All rights reserved. Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) The command completed successfully oracle$ lsnrctl start LISTENER_PHYS_PHYS-PARIS-1 LSNRCTL for Solaris: Version 10.2.0.3.0 - Production on 29-OCT-2008 02:05:04 Copyright (c) 1991, 2006, Oracle. All rights reserved. Starting /oracle/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait... TNSLSNR for Solaris: Version 10.2.0.3.0 - Production … Services Summary... Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service... Service "sales" has 2 instance(s). Instance "sales1", status READY, has 2 handler(s) for this service... Instance "sales2", status READY, has 1 handler(s) for this service... Service "salesXDB" has 2 instance(s). Instance "sales1", status READY, has 1 handler(s) for this service... Instance "sales2", status READY, has 1 handler(s) for this service... Service "sales_DGB" has 2 instance(s). Instance "sales1", status READY, has 2 handler(s) for this service... Instance "sales2", status READY, has 1 handler(s) for this service... Service "sales_DGMGRL" has 1 instance(s). Instance "sales1", status UNKNOWN, has 1 handler(s) for this service... Service "sales_XPT" has 2 instance(s). Instance "sales1", status READY, has 2 handler(s) for this service... Instance "sales2", status READY, has 1 handler(s) for this service... The command completed successfully |
모든 데이터베이스 인스턴스에 대한 네트워크 서비스 이름 지정 항목을 확인합니다.
사용 중인 이름 지정 서비스 방법(tnsnames.ora 또는 디렉토리 서비스)에 모든 Oracle 데이터베이스 인스턴스에 대해 정의된 항목이 있는지 확인합니다. 다음 예에서는 cluster-paris 클러스터에만 포함하는 항목 유형을 보여줍니다. 또한 나중에 pfile 매개 변수 파일을 수정할 때 작성하는 대기(salesdr) 데이터베이스 인스턴스에 대한 항목을 추가합니다. 이 예에서 sales 데이터베이스는 sales의 서비스 이름을 수신기에 동적으로 등록합니다(데이터베이스 service_names 초기화 매개 변수 참조).
oracle (phys-paris-1)$ cat ${ORACLE_HOME}/network/admin/tnsnames.ora SALES1-SVC = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = phys-paris-1-crs)(PORT = 1521) (SEND_BUF_SIZE = 65535)(RECV_BUF_SIZE = 65535)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = sales) (INSTANCE_NAME = sales1) ) ) SALES2-SVC = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = phys-paris-2-crs)(PORT = 1521) (SEND_BUF_SIZE = 65535)(RECV_BUF_SIZE = 65535)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = sales) (INSTANCE_NAME = sales2) ) ) SALES-SVC = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = phys-paris-1-crs)(PORT = 1521) (SEND_BUF_SIZE = 65535)(RECV_BUF_SIZE = 65535)) (ADDRESS = (PROTOCOL = TCP)(HOST = phys-paris-2-crs)(PORT = 1521) (SEND_BUF_SIZE = 65535)(RECV_BUF_SIZE = 65535)) (LOAD_BALANCE = yes) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = sales) ) ) LISTENERS_SALES = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = phys-paris-1-crs)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = phys-paris-2-crs)(PORT = 1521)) ) |
기본 데이터베이스의 백업을 작성합니다.
다음 예에서는 Oracle RMAN(Recovery Manager) 유틸리티를 사용하여 대기 cluster-newyork 클러스터에서 복원할 수 있는 기본 데이터베이스의 복사본을 작성하는 방법을 보여줍니다. 또한 별도의 단계를 수행하지 않고 대기 데이터베이스에 대한 제어 파일을 작성하는 방법을 보여줍니다. 이 단계를 완료하는 옵션에 대한 자세한 내용은 Oracle 설명서를 참조하십시오.
oracle (phys-paris-1)$ rman RMAN> connect target sys/DBA_password@sales-svc; RMAN> connect auxiliary /; RMAN> backup device type disk tag 'mybkup' database include current 2> controlfile for standby; RMAN> backup device type disk tag 'mybkup' archivelog all not backed up; |
백업 파일을 대기 시스템에 복사합니다.
cluster-newyork 클러스터에 해당 디렉토리 계층을 작성하고 데이터베이스 백업을 이 클러스터에 복사합니다. 이 예에 표시된 파일에 대해 지정하는 실제 위치는 데이터베이스 구성 시의 특정 선택 사항에 따라 달라집니다.
oracle (phys-newyork-1)$ mkdir -p $ORACLE_BASE/admin/salesdr oracle (phys-newyork-1)$ cd $ORACLE_BASE/admin/salesdr oracle (phys-newyork-1)$ mkdir adump bdump cdump dpdump hdump pfile udump Make the directory for the database backup oracle (phys-newyork-1)$ mkdir -p /oradata/flash_recovery_area/SALES/backupset/date Copy over the files oracle (phys-newyork-1)$ cd /oradata/flash_recovery_area/SALES/backupset/date oracle (phys-newyork-1)$ scp oracle@phys-paris-1:`pwd`/\* . Make the base directory for new database files oracle (phys-newyork-1)$ mkdir -p /oradata/SALESDR |
pfile 매개 변수 파일을 작성합니다.
대기(salesdr) 데이터베이스에 적합한 서버 초기화 파일을 작성합니다. 이 파일을 작성하는 가장 쉬운 방법은 기본 데이터베이스에 대한 매개 변수를 복사하여 수정하는 것입니다. 다음 예에서는 pfile 매개 변수 파일을 작성하는 방법을 보여줍니다.
oracle (phys-paris-1)$ sqlplus '/ as sysdba' SQL> CREATE PFILE='/tmp/initpfile_for_salesdr.ora' FROM SPFILE; File created. SQL> quit |
pfile 매개 변수 파일을 수정합니다.
다음 예와 같이 기본 클러스터와 관련된 모든 항목을 대기 클러스터에 적합한 항목으로 변경합니다. 대기 데이터베이스 인스턴스 SID 이름(salesdr1 및 salesdr2)을 사용하도록 Oracle SID 접두사가 있는 항목(sales1 또는 sales2)을 수정합니다. 구성에 따라 추가 변경을 수행해야 할 수도 있습니다.
두 클러스터에서 모두 sales로 유지되어야 하므로 db_name 매개 변수는 변경하지 마십시오.
You created these directories previously *.audit_file_dest='/oracle/oracle/product/10.2.0/db_1/admin/salesdr/adump' *.background_dump_dest='/oracle/oracle/product/10.2.0/db_1/admin/salesdr/bdump' *.user_dump_dest='/oracle/oracle/product/10.2.0/db_1/admin/salesdr/udump' *.core_dump_dest='/oracle/oracle/product/10.2.0/db_1/admin/salesdr/cdump' Remove the following entry *.control_files='...list primary control files...' Add this entry *.db_unique_name='salesdr' *.dg_broker_config_file1='/oradata/SALESDR/dr1salesdr.dat' *.dg_broker_config_file2='/oradata/SALESDR/dr2salesdr.dat' *.dispatchers='(PROTOCOL=TCP) (SERVICE=salesdrXDB)' Switch the client and server entries around, as shown in the following entries *.fal_client='salesdr-svc' *.fal_server='sales-svc' *.remote_listener='LISTENERS_SALESDR' Switch the log archive destinations *.log_archive_dest_1='location=use_db_recovery_file_dest arch mandatory valid_for=(all_logfiles,all_roles) db_unique_name=salesdr' *.log_archive_dest_2='service=sales-svc lgwr sync affirm valid_for=(online_logfiles,primary_role) db_unique_name=sales'
pfile 매개 변수 파일을 대기 시스템에 복사합니다.
대기 데이터베이스를 시작하고 pfile 매개 변수 파일을 spfile 서버 매개 변수 파일로 변환합니다.
Oracle 사용자로 cluster-newyork 노드 중 하나에 로그인하고 pfile 매개 변수 파일을 spfile 서버 매개 변수 파일로 변환합니다.
oracle (phys-newyork-1)$ ORACLE_SID=salesdr1 export ORACLE_SID oracle (phys-newyork-1)$ sqlplus '/ as sysdba' SQL> startup nomount pfile='/tmp/initpfile_for_salesdr.ora'; SQL> create spfile='/oradata/SALESDR/spfilesalesdr.ora' 2> from pfile='/tmp/initpfile_for_salesdr.ora'; SQL> shutdown |
모든 cluster-newyork 노드에 ${ORACLE_HOME}/dbs/initsalesdr1.ora 파일을 작성하고 해당 파일에 다음 항목을 삽입합니다.
oracle (phys-newyork-1) cat ${ORACLE_HOME}/dbs/initsalesdr1.ora SPFILE='/oradata/SALESDR/spfilesalesdr.ora' |
한 노드에서만 데이터베이스를 재시작하여 백업된 기본 데이터베이스 복원을 준비합니다.
oracle (phys-newyork-1) sqlplus '/ as sysdba' You are now starting from the spfile SQL> startup nomount ORACLE instance started. Total System Global Area 532676608 bytes Fixed Size 2031416 bytes Variable Size 289407176 bytes Database Buffers 234881024 bytes Redo Buffers 6356992 bytes |
대기 데이터베이스에서 사용하기 위해 기본 데이터베이스에 대한 Oracle 암호 파일을 복사합니다.
cluster-paris 클러스터에서 작성한 Oracle 암호 파일을 복사하여 cluster-newyork 클러스터의 공유 저장소에 넣습니다. 그런 다음 각 cluster-newyork 노드에서 이 파일에 대한 링크를 작성하고 로컬 대기 노드의 Oracle SID를 반영하여 심볼릭 링크의 이름을 변경합니다.
Oracle Data Guard에 대한 정적 수신기를 작성합니다.
모든 cluster-newyork 노드에서 이 단계를 수행합니다.
Oracle Data Guard를 사용하려면 정적 수신기를 구성해야 합니다. 다음 예에서는 ${ORACLE_HOME}=/oracle/oracle/product/10.2.0/db_1을 사용하고 ${ORACLE_HOME}/network/admin/listener.ora 파일에서 정적 수신기 항목을 추가할 위치를 보여줍니다. SID_LIST_LISTENER_PHYS-NEWYORK-1 및 (SID_NAME = salesdr1) 줄은 노드마다 다른 반면, (GLOBAL_DBNAME=salesdr_DGMGRL)은 cluster-paris에서 다릅니다.
oracle (phys-newyork-1)$ cat ${ORACLE_HOME}/network/admin/listener.ora SID_LIST_LISTENER_PHYS-NEWYORK-1 = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /oracle/oracle/product/10.2.0/db_1) (PROGRAM = extproc) ) (SID_DESC = (SID_NAME = salesdr1) (GLOBAL_DBNAME=salesdr_DGMGRL) (ORACLE_HOME = /oracle/oracle/product/10.2.0/db_1) ) ) oracle (phys-newyork-1)$ |
수신기를 재시작합니다.
정적 항목을 사용 가능하게 하려면 cluster-newyork의 각 노드에서 Oracle 수신기 프로세스를 재시작합니다.
oracle (phys-newyork-1)$ lsnrctl stop LISTENER_PHYS_PHYS-NEWYORK-1 LSNRCTL for Solaris: Version 10.2.0.3.0 - Production on 29-OCT-2008 02:04:56 Copyright (c) 1991, 2006, Oracle. All rights reserved. Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) The command completed successfully oracle$ lsnrctl start LISTENER_PHYS_PHYS-NEWYORK-1 LSNRCTL for Solaris: Version 10.2.0.3.0 - Production on 29-OCT-2008 02:05:04 Copyright (c) 1991, 2006, Oracle. All rights reserved. Starting /oracle/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait... TNSLSNR for Solaris: Version 10.2.0.3.0 - Production … Services Summary... Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service... Service "salesdr" has 2 instance(s). Instance "salesdr1", status READY, has 2 handler(s) for this service... Instance "salesdr2", status READY, has 1 handler(s) for this service... Service "salesdrXDB" has 2 instance(s). Instance "salesdr1", status READY, has 1 handler(s) for this service... Instance "salesdr2", status READY, has 1 handler(s) for this service... Service "salesdr_DGB" has 2 instance(s). Instance "salesdr1", status READY, has 2 handler(s) for this service... Instance "salesdr2", status READY, has 1 handler(s) for this service... Service "salesdr_DGMGRL" has 1 instance(s). Instance "salesdr1", status UNKNOWN, has 1 handler(s) for this service... Service "salesdr_XPT" has 2 instance(s). Instance "salesdr1", status READY, has 2 handler(s) for this service... Instance "salesdr2", status READY, has 1 handler(s) for this service... The command completed successfully |
모든 데이터베이스 인스턴스에 대한 네트워크 서비스 이름 지정 항목을 확인합니다.
사용 중인 이름 지정 서비스 방법(tnsnames.ora 또는 디렉토리 서비스)에 모든 Oracle 데이터베이스 인스턴스에 대해 정의된 항목이 있는지 확인합니다. 다음 예에서는 cluster-newyork 클러스터에만 포함하는 항목 유형을 보여줍니다. 이 예에서 salesdr 데이터베이스는 salesdr의 서비스 이름을 수신기에 동적으로 등록합니다(데이터베이스 service_names 초기화 매개 변수 참조).
oracle (phys-newyork-1)$ cat ${ORACLE_HOME}/network/admin/tnsnames.ora SALESDR1-SVC = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = phys-newyork-1-crs)(PORT = 1521) (SEND_BUF_SIZE = 65535)(RECV_BUF_SIZE = 65535)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = salesdr) (INSTANCE_NAME = salesdr1) ) ) SALESDR2-SVC = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = phys-newyork-2>-crs)(PORT = 1521) (SEND_BUF_SIZE = 65535)(RECV_BUF_SIZE = 65535)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = salesdr) (INSTANCE_NAME = salesdr2) ) ) SALESDR-SVC = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = phys-newyork-1-crs)(PORT = 1521) (SEND_BUF_SIZE = 65535)(RECV_BUF_SIZE = 65535)) (ADDRESS = (PROTOCOL = TCP)(HOST = phys-newyork-2-crs)(PORT = 1521) (SEND_BUF_SIZE = 65535)(RECV_BUF_SIZE = 65535)) (LOAD_BALANCE = yes) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = salesdr) ) ) LISTENERS_SALESDR = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = phys-newyork-1-crs)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = phys-newyork-2-crs)(PORT = 1521)) ) |
대기 수신기 listener.ora 및 tnsnames.ora 파일에 올바른 항목이 있는지 확인하고 수신기 프로세스를 재시작합니다.
이러한 파일에 기본 및 대기 클러스터 데이터베이스 서비스에 대한 이름 지정 서비스 항목과 정적 Oracle Data Guard 수신기 항목이 포함되어 있는지 확인합니다. Oracle 디렉토리 이름 지정 서비스 조회를 사용하지 않는 경우 tnsnames.ora에 항목을 포함해야 합니다.
oracle (phys-newyork-1)$ lsnrctl stop LISTENER_PHYS-NEWYORK-1 LSNRCTL for Solaris: Version 10.2.0.3.0 - Production on 29-OCT-2008 02:04:56 Copyright (c) 1991, 2006, Oracle. All rights reserved. Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) The command completed successfully oracle$ lsnrctl start LISTENER_PHYS-NEWYORK-1 LSNRCTL for Solaris: Version 10.2.0.3.0 - Production on 29-OCT-2008 02:05:04 Copyright (c) 1991, 2006, Oracle. All rights reserved. Starting /oracle/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait... TNSLSNR for Solaris: Version 10.2.0.3.0 - Production … Services Summary... Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service... Service "salesdr_DGMGRL" has 1 instance(s). Instance "salesdr1", status UNKNOWN, has 1 handler(s) for this service... The command completed successfully |
데이터베이스 백업을 복원합니다.
cluster-newyork 클러스터에서 작업을 계속하여 이제 기본 데이터베이스 백업의 데이터를 대기 데이터베이스로 복원할 수 있습니다. 다음 예에서는 Oracle RMAN(Recovery Manager) 유틸리티의 사용 방법을 보여줍니다.
oracle (phys-newyork-1) rman RMAN> connect target sys/oracle@sales-svc; RMAN> connect auxiliary /; RMAN> duplicate target database for standby nofilenamecheck; … |
대기 데이터베이스에 대기 재실행 로그를 추가합니다.
충족해야 하는 정확한 요구 사항은 구성에 따라 다릅니다. 수행하는 단계는 기본 클러스터에 대해 수행한 단계와 동일합니다.
대기 데이터베이스에서 플래시백을 사용 가능하게 합니다.
oracle (phys-newyork-1)$ sqlplus '/ as sysdba' SQL> alter database flashback on; Datbase altered. SQL> shutdown immediate; SQL> startup mount; ORACLE instance started. … |
대기 데이터베이스를 복구합니다.
oracle (phys-newyork-1) sqlplus '/ as sysdba' SQL> alter database recover managed standby database using current logfile disconnect; |
로그 파일 전송이 작동하는지 확인합니다.
SQL> 프롬프트가 표시되면 cluster-paris 클러스터의 데이터베이스 인스턴스 중 하나에 로그인하고 몇 가지 로그 전환을 수행합니다.
oracle (phys-paris-1)$ sqlplus '/ as sysdba' SQL> alter system switch logfile; SQL> alter system switch logfile; |
${ORACLE_HOME}/admin/sales/bdump/alert_sales1.log에서 로그 아카이브를 차단했을 수 있는 문제가 있는지 확인합니다.
오류가 있으면 수정합니다. 이 프로세스에 시간이 걸릴 수도 있습니다. 다음 명령을 사용하여 네트워크 연결이 올바른지 확인할 수 있습니다.
oracle (phys-paris-1)$ tnsping salesdr-svc oracle (phys-newyork-1)$ tnsping sales-svc |
새 데이터베이스 및 인스턴스를 Oracle Clusterware에 등록합니다.
대기 데이터베이스를 Oracle Clusterware로 제어하고 Oracle Clusterware 시작 시 마운트되도록 구성합니다.
oracle (phys-newyork-1)$ srvctl add database -d salesdr \ -r PHYSICAL_STANDBY -o $ORACLE_HOME -s mount; oracle (phys-newyork-1)$ srvctl add instance -d salesdr \ -i salesdr1 -n $phys-newyork-1; oracle (phys-newyork-1)$ srvctl add instance -d salesdr \ -i salesdr2 -n $phys-newyork-2; |
Sun Cluster Oracle RAC 관리 가능성 자원을 구성합니다.
대기 데이터베이스를 Sun Cluster와 통합합니다. clsetup 유틸리티를 통해 사용 가능한 Data Service 구성 마법사나 브라우저 기반 Sun Cluster Manager를 사용할 수 있습니다. 대기 데이터베이스를 통합하여 장애 조치 또는 인계가 필요한 경우 기본 데이터베이스가 관리될 때 대기가 관리될 수 있도록 합니다.
작성한 자원 및 자원 그룹은 Sun Cluster Geographic Edition Oracle Data Guard 통합에서 사용됩니다.
기본 및 대기 데이터베이스에서 모두 Oracle Data Guard를 사용 가능하게 합니다.
각 클러스터(cluster-paris 및 cluster-newyork)의 한 노드에서만 다음 단계를 수행해야 합니다.
oracle (phys-newyork-1)$ sqlplus '/ as sysdba' SQL> alter system set dg_broker_start=true scope=both sid='*'; SQL> quit oracle (phys-paris-1)$ sqlplus '/ as sysdba' SQL> alter system set dg_broker_start=true scope=both sid='*'; SQL> quit |
Oracle Data Guard를 Sun Cluster Geographic Edition과 함께 사용하려면 Oracle Data Guard Broker 구성을 작성해야 합니다.
다음 절차 예에서 Oracle Data Guard Broker 구성은 mysales.com이라고 합니다. salesdr 데이터베이스는 sales 데이터베이스의 물리 복사본입니다.
기본 데이터베이스에 대한 Oracle Data Guard Broker 구성을 작성합니다.
dgmgrl 명령을 사용하여 Oracle Data Guard Broker 구성을 작성합니다. 작성할 Oracle Data Guard Broker 구성의 이름, 기본 데이터베이스의 이름 및 연결 시 사용할 네트워크 서비스 이름을 알고 있어야 합니다. Sun Cluster Geographic Edition에 구성을 지정할 때 다시 이러한 등록 정보를 알고 있어야 합니다.
oracle (phys-paris-1)$ dgmgrl sys/sysdba_password@sales-svc DGMGRL> create configuration mysales.com as primary DGMGRL> database is sales connect identifier is sales-svc; |
Oracle Data Guard Broker에 연결할 때 오류가 발생하는 경우 ${ORACLE_HOME}/admin/sales/bdump/alert_ prim_sid.log 파일을 확인합니다. 다음 명령을 사용하여 구성이 작성되었는지 확인할 수 있습니다.
oracle (phys-paris-1)$ dgmgrl sys/sysdba_password@sales-svc DGMGRL> show configuration; Configuration Name: mysales.com Enabled: NO Protection Mode: MaxPerformance Fast-Start Failover: DISABLED Databases: sales - Primary database Current status for "mysales.com": DISABLED |
Oracle Data Guard Broker 구성에 대기 데이터베이스를 추가합니다.
대기 데이터베이스의 이름, 연결 시 사용할 네트워크 서비스 이름 및 대기 유형(physical 또는 logical)을 알고 있어야 합니다.
oracle (phys-paris-1)$ dgmgrl sys/sysdba_password@sales-svc DGMGRL> add database salesdr as connect identifier is salesdr-svc maintained as 물리; |
대기 데이터베이스에 대한 적용 인스턴스를 구성합니다.
대기 데이터베이스가 다중 인스턴스 Oracle RAC 데이터베이스이기도 한 경우 전송된 아카이브 재실행 로그를 적용할 인스턴스를 지정할 수 있습니다. 구성을 사용 가능하게 하기 전에 다음 명령을 실행합니다.
oracle$ dgmgrl sys/sysdba_password@sales-svc DGMGRL> edit database salesdr set property PreferredApplyInstance='salesdr1'; |
Oracle Data Guard Broker 구성이 올바르게 작동하는지 확인하려면 구성을 사용 가능하게 합니다.
oracle (phys-paris-1)$ dgmgrl sys/sysdba_password@sales-svc DGMGRL> enable configuration; |
모든 단계를 성공적으로 수행한 경우 다음 명령을 사용하여 구성 상태를 확인할 수 있습니다.
oracle$ dgmgrl sys/sysdba_password@sales-svc DGMGRL> show configuration; Configuration Name: mysales.com Enabled: YES Protection Mode: MaxPerformance Fast-Start Failover: DISABLED Databases: sales - Primary database salesdr - 물리 대기 database Current status for "mysales.com": SUCCESS |
Oracle Data Guard Broker 구성이 전환될 수 있는지 확인합니다.
Sun Cluster Geographic Edition에 Oracle Data Guard Broker 구성을 추가하기 전에 데이터베이스를 기본에서 대기로 전환한 다음 다시 반대로 전환할 수 있는지 확인해야 합니다. 이 전환이 작동하지 않는 경우에는 Sun Cluster Geographic Edition에서 이 조작을 수행할 수 없습니다.
oracle (phys-paris-1)$ dgmgrl sys/sysdba_password@sales-svcDGMGRL> switchover to salesdr Performing switchover NOW, please wait... Operation requires shutdown of instance "sales1" on database "sales" Shutting down instance "sales1"... ORA-01109: database not open Database dismounted. ORACLE instance shut down. Operation requires shutdown of instance "salesdr1" on database "salesdr" Shutting down instance "salesdr1"... ORA-01109: database not open Database dismounted. ORACLE instance shut down. Operation requires startup of instance "sales1" on database "sales" Starting instance "sales1"... ORACLE instance started. Database mounted. Operation requires startup of instance "salesdr1" on database "salesdr" Starting instance "salesdr1"... ORACLE instance started. Database mounted. Switchover succeeded, new primary is "salesdr" DGMGRL switchover to sales; Performing switchover NOW, please wait... Operation requires shutdown of instance "salesdr1" on database "salesdr" Shutting down instance "salesdr1"... ORA-01109: database not open Database dismounted. ORACLE instance shut down. Operation requires shutdown of instance "sales1" on database "sales" Shutting down instance "sales1"... ORA-01109: database not open Database dismounted. ORACLE instance shut down. Operation requires startup of instance "salesdr1" on database "salesdr" Starting instance "salesdr1"... ORACLE instance started. Database mounted. Operation requires startup of instance "sales1" on database "sales" Starting instance "sales1"... ORACLE instance started. Database mounted. Switchover succeeded, new primary is "sales" |