暂无图片
XTTS示例,源端11.2.0.4,目标端19.6 PDB
最近更新:2022-03-11 14:21:05

参考MOS:11G - Reduce Transportable Tablespace Downtime using Cross Platform Incremental Backup (Doc ID 1389592.1)

源端获取USER和权限,根据具体情况改查询条件

--CREATE_USER_DDL
select to_char(dbms_metadata.get_ddl('USER',USERNAME)) CREATE_USER_DDL from dba_users where ACCOUNT_STATUS='OPEN' and USERNAME not in ('SYS','SYSTEM');
--GRANT_ROLE_DDL
select to_char(dbms_metadata.get_granted_ddl('ROLE_GRANT',GRANTEE)) GRANT_ROLE_DDL from dba_role_privs where GRANTEE in (select USERNAME from dba_users where ACCOUNT_STATUS='OPEN' and USERNAME not in ('SYS','SYSTEM'));
--default_tablespace
select 'alter user '||username||' default tablespace '||default_tablespace||';' from dba_users where ACCOUNT_STATUS='OPEN' and USERNAME not in ('SYS','SYSTEM');

建议源端清理并关闭回收站

select OWNER,TYPE,count(1) from dba_recyclebin group by OWNER,TYPE order by OWNER;
show parameter recyclebin
alter systemn set recyclebin='off' scope=both;
purge recyclebin;

源端自包含检查

execute sys.dbms_tts.transport_set_check('TBS,TEST,TEST2,GG_TBS,JJ_TBS,USERS', true);
select * from sys.transport_set_violations;

源端创建测试数据,可用于验证同步情况

create user xttst identified by xttst default tablespace USERS;
grant connect,resource to xttst;

create table xttst.xtts (aa date);
insert into xttst.xtts values (sysdate);
commit;
alter session set NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS';
select * from xttst.xtts;

源端解压XTTS

......