# 해당 팁은 DB 마이그레이션 시 유용하게 쓸 수 있습니다. 유저 및 Tablespace의 생성문 추출을 도와줍니다.
set pages 10000
set long 99999
set heading off
set linesize 200
set feedback off
col ddl format a200
1. User 생성문 추출
SELECT DBMS_METADATA.GET_GRANTED_DDL(‘ROLE_GRANT’,username ) from dba_users;
CREATE USER “DBSNMP” IDENTIFIED BY VALUES ‘S:6BFD54544426B96E4C4CB1C81DE86067752E0ABA27B060A9567AB78C21B3;FFF45BB2C0C327EC’
DEFAULT TABLESPACE “SYSAUX”
TEMPORARY TABLESPACE “TEMP”
PROFILE “MONITORING_PROFILE”
CREATE USER “SCOTT” IDENTIFIED BY VALUES ‘S:11881BD808FADF48F989F2EFF30E0E8274E82FBA61843388AA25DD951F67;F894844C34402B67’
DEFAULT TABLESPACE “USERS”
TEMPORARY TABLESPACE “TEMP”
CREATE USER “HR” IDENTIFIED BY VALUES ‘S:25D0899E13C6808D7DE80DE9C4D985A177DF8AAE78955FE47234CAE99C67;4C6D73C3E8B0F0DA’
DEFAULT TABLESPACE “USERS”
TEMPORARY TABLESPACE “TEMP”
CREATE USER “SYSMAN” IDENTIFIED BY VALUES ‘S:EFB80C2B3BB52B19E9F89632B415FFD6F0CDD3D3A06A3ACB6AB41DF8389F;2CA614501F09FCCC’
DEFAULT TABLESPACE “SYSAUX”
TEMPORARY TABLESPACE “TEMP”
….
2. User에 대한 권한 추출
STORAGE 부분 표시
exec dbms_metadata.set_transform_param(dbms_metadata.session_transform, ‘STORAGE’, true);
SEGMENT 관련 부분 표시
exec dbms_metadata.set_transform_param(dbms_metadata.session_transform, ‘SEGMENT_ATTRIBUTES’, true);