다음 단계에서 기본 클러스터는 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. |