프린트 하기

내맘대로긍정이 알려주는

Oracle 23ai 신기능
무료 세미나 발표자료

다운로드 trending_flat
2024
10.12
14:00

OS환경 : Oracle Linux 7.6 (64bit)

 

DB 환경 : Oracle Database 19.10.0.0

 

방법 : 오라클 19c expdp가 ADG Standby db에서 동작하는지 확인

오라클에서 마이그레이션 시 이용하는 datapump를 active data guard 가 구성된 환경에서 사용할 때

운영 db인 primary db에 가해지는 부하를 줄이기 위해 standby에서 수행해보려고 시도해볼수 있음

이 방법이 가능한지 테스트해봄

 

 

primary db에서 directory 생성(standby db에도 존재하는 경로에 생성)

1
2
3
SQL> create or replace directory TEST20230706 as '/home/oracle/';
 
Directory created.

 

 

standby db에서 테이블 expdp 시도

1
2
3
$ expdp system/oracle directory=TEST20230706 dumpfile=expdp_test_20230706_1.dmp logfile=expdp_test_20230706_1.log 
tables=IMSI.TESTTBL compression=all cluster=N status=60 job_name=expdp_test_20230706_1
(에러 발생)

에러가 발생함 

 

 

primary db에서 테이블 expdp 시도

1
2
3
$ expdp system/oracle directory=TEST20230706 dumpfile=expdp_test_20230706_1.dmp logfile=expdp_test_20230706_1.log 
tables=IMSI.TESTTBL compression=all cluster=N status=60 job_name=expdp_test_20230706_1
(정상 동작)

 

 

expdp 중 job 확인

1
2
3
4
5
6
7
8
9
10
11
12
13
SQL> 
set lines 200 pages 1000
col owner_name for a10
col job_name for a30
col operation for a10
col job_mode for a10
col state for a20
select owner_name, job_name, operation, job_mode, state
from dba_datapump_jobs;
 
OWNER_NAME JOB_NAME                       OPERATION  JOB_MODE   STATE
---------- ------------------------------ ---------- ---------- --------------------
SYSTEM     EXPDP_TEST_20230706_1          EXPORT     TABLE      EXECUTING

 

 

expdp 중 시스템에 의해 만들어진 오브젝트 확인

1
2
3
4
5
6
7
8
9
10
11
12
SQL>
col owner for a10
col object_name for a30
col object_type for a10
col status for a10
select owner, object_name, object_type, status
from dba_objects
where object_name = 'EXPDP_TEST_20230706_1';
 
OWNER      OBJECT_NAME                    OBJECT_TYP STATUS
---------- ------------------------------ ---------- ----------
SYSTEM     EXPDP_TEST_20230706_1          TABLE      VALID

expdp 중 시스템에 의해 생성되는 테이블이 존재함

 

 

결론 :

datapump 시 오라클 내부적으로 생성하는 테이블들도 있기 때문에

읽기 전용인 standby database 에서는 datapump(expdp) 가 동작하지 않음

 

 

참조 : 

https://positivemh.tistory.com/371