작업 1: Oracle GoldenGate에 대한 소스 및 대상 데이터베이스 구성
소스 및 대상 Oracle GoldenGate 데이터베이스는 다음 권장 사항을 사용하여 구성해야 합니다.
다음 단계를 수행하여 이 작업을 완료합니다.
-
1.1단계 - 데이터베이스 구성
-
1.2단계 - 데이터베이스 복제 관리자 사용자 만들기
-
1.3단계 - 데이터베이스 서비스 생성
1.1단계 - 데이터베이스 구성
소스 및 대상 Oracle GoldenGate 데이터베이스는 다음 권장 사항을 사용하여 구성해야 합니다.
| 구성 | 범위 | 예제 |
|---|---|---|
| 아카이브 로그 모드 사용 | 출처 및 목표 | SQL> ARCHIVE LOG LIST Database log mode Archive Mode Automatic archival Enabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 110 Next log sequence to archive 113 Current log sequence 113 |
FORCE LOGGING 사용 |
출처 및 목표 | ALTER DATABASE FORCE LOGGING; |
ENABLE_GOLDENGATE_REPLICATION |
소스, 대상 및 대기 | ALTER SYSTEM SET ENABLE_GOLDENGATE_REPLICATION=TRUE SCOPE=BOTH SID='*'; |
| 보완 로깅 | 소스 복제 방향 바꾸기 시 대상에 필요 |
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA; |
| 복제된 객체에 대한 스키마 또는 테이블 레벨 로깅 추가 | 소스 복제 방향 바꾸기 시 대상에 필요 |
ADD SCHEMATRANDATA 또는 ADD TRANDATA |
STREAMS_POOL_SIZE |
소스 복제 방향 바꾸기 시 대상에 필요 |
예를 들어, 2개의 Extracts 및 2개의 통합된 Replicats가 있는 데이터베이스에서는 다음 작업을 수행합니다.
ALTER SYSTEM SET STREAMS_POOL_SIZE=5G SCOPE=BOTH SID='*'; |
Oracle GoldenGate용 데이터베이스 준비 단계는 Oracle GoldenGate용 데이터베이스 준비를 참조하십시오.
1.2단계 - 데이터베이스 복제 관리자 사용자 만들기
소스 및 대상 데이터베이스에는 다음과 같이 적절한 권한이 지정된 GoldenGate 관리자 사용자가 생성되어야 합니다.
-
CDB(다중 테넌트 컨테이너 데이터베이스)의 경우:
-
소스 데이터베이스인 GoldenGate Extract는 c##을 사용하여 루트 컨테이너 데이터베이스의 사용자에 접속하도록 구성되어야 합니다.
-
대상 데이터베이스, 각 PDB(플러거블 데이터베이스)에 대해 별도의 GoldenGate 관리자 사용자가 필요합니다.
-
Oracle Multitenant 데이터베이스에서 GoldenGate 관리자 생성에 대한 자세한 내용은 다중 테넌트 컨테이너 데이터베이스에서 Oracle GoldenGate 구성을 참조하십시오.
-
-
비CDB 데이터베이스의 경우 Oracle에 대한 데이터베이스 사용자 및 권한 준비를 참조하십시오.
소스 데이터베이스 시스템의 oracle OS 유저로 다음 SQL 지침을 실행하여 Oracle GoldenGate에 대한 데이터베이스 유저를 생성하고 필요한 권한을 할당합니다.
[opc@exadb1_node1 ~]$ sudo su - oracle
[oracle@exadb1_node1 ~]$ source dbName.env
[oracle@exadb1_node1 ~]$ sqlplus / as sysdba
# Source CDB
SQL>
alter session set container=cdb$root;
create user c##ggadmin identified by "ggadmin_password" container=all default tablespace USERS temporary tablespace temp;
alter user c##ggadmin quota unlimited on users;
grant set container to c##ggadmin container=all;
grant alter system to c##ggadmin container=all;
grant create session to c##ggadmin container=all;
grant alter any table to c##ggadmin container=all;
grant resource to c##ggadmin container=all;
exec dbms_goldengate_auth.grant_admin_privilege('c##ggadmin',container=>'all');
# Source PDB
SQL>
alter session set container=pdbName;
create user ggadmin identified by "ggadmin_password" container=current;
grant create session to ggadmin container=current;
grant alter any table to ggadmin container=current;
grant resource to ggadmin container=current;
exec dbms_goldengate_auth.grant_admin_privilege('ggadmin');
대상 시스템의 oracle OS 유저로 다음 SQL 지침을 실행하여 Oracle GoldenGate에 대한 데이터베이스 유저를 생성하고 필요한 권한을 할당합니다.
[opc@exadb2_node1 ~]$ sudo su - oracle
[oracle@exadb2_node1 ~]$ source dbName.env
[oracle@exadb2_node1 ~]$ sqlplus / as sysdba
# Target PDB
SQL>
alter session set container=pdbName;
create user ggadmin identified by "ggadmin_password" container=current;
grant alter system to ggadmin container=current;
grant create session to ggadmin container=current;
grant alter any table to ggadmin container=current;
grant resource to ggadmin container=current;
grant dv_goldengate_admin, dv_goldengate_redo_access to ggadmin container=current;
exec dbms_goldengate_auth.grant_admin_privilege('ggadmin');
1.3단계 - 데이터베이스 서비스 생성
소스 및 대상 데이터베이스가 Oracle Data Guard를 사용하는 Oracle RAC 클러스터에서 권장 구성을 실행 중인 경우 Extract 또는 Replicat 프로세스가 올바른 Data Guard 기본 데이터베이스 인스턴스에 접속할 수 있도록 허용하는 롤 기반 서비스를 생성해야 합니다.
소스 다중 테넌트 데이터베이스를 사용하는 경우 복제할 스키마를 포함하는 루트 CDB(컨테이너 데이터베이스) 및 PDB(플러거블 데이터베이스)에 대해 별도의 서비스가 필요합니다. 대상 다중 테넌트 데이터베이스의 경우 PDB에 대해 단일 서비스가 필요합니다.
primary database 시스템의 oracle OS 유저로 다음과 같이 dbaascli를 사용하여 CDB 및 PDB 이름을 찾습니다.
[opc@exadb1_node1 ~]$ sudo su - oracle
[oracle@exadb1_node1 ~]$ source dbName.env
[oracle@exadb1_node1 ~]$ dbaascli database getDetails
--dbname dbName |egrep 'dbName|pdbName'
"dbName" : "dbName",
"pdbName" : "pdbName",
primary 및 standby database 시스템의 oracle OS 유저로 다음 명령을 사용하여 CDB 데이터베이스 서비스를 생성하고 시작합니다.
[opc@exadb1_node1 ~]$ sudo su - oracle
[oracle@exadb1_node1 ~]$ source dbName.env
[oracle@exadb1_node1 ~]$ srvctl add service -db $ORACLE_UNQNAME
-service dbName.ggoraclevcn.com -preferred ORACLE_SID1
-available ORACLE_SID2 -role PRIMARY
기본 및 대기 데이터베이스 시스템의 oracle OS 사용자로 다음 명령을 사용하여 PDB 데이터베이스 서비스를 생성하고 시작합니다.
[oracle@exadb1_node1 ~]$ srvctl add service -db $ORACLE_UNQNAME
-service dbName.pdbName.ggoraclevcn.com -preferred ORACLE_SID1
-available ORACLE_SID2 -pdb pdbName -role PRIMARY
primary 및 standby database 시스템의 oracle OS 유저로 다음과 같이 서비스가 실행 중인지 확인하고 시작합니다.
[oracle@exadb1_node1 ~]$ srvctl start service -db $ORACLE_UNQNAME -role
[oracle@exadb1_node1 ~]$ srvctl status service -d $ORACLE_UNQNAME |grep goldengate
Service dbName.ggoraclevcn.com is running on instance(s) SID1
Service dbName.pdbName.ggoraclevcn.com is running on instance(s) SID1
주: 소스 및 대상 데이터베이스 시스템에서 1.3단계를 반복합니다.