使用19c,DBA可以更轻松地确定导出将花费多长时间,并发现 closure check 未报告的不可预见的问题。DataPump Export 的参数 TTS_CLOSURE_CHECK 可以用来指定在 transportable tablespace 时不设置tablespace为只读模式。产生的 dump 文件会被标记为 “无法导入”。
Transportable Tablespaces 的测试模式会在 Transportable Tablespaces/Full Transportable Export/Import时做只导出元数据的测试。它不需要把源库的 tablespace 设置为只读。普通的transportable tablespace 导出需要把 tablespace 置为只读模式,并对相关的 tablespaces 做 closure check。不过有时候在做 TTS 操作前我们需要确定:
- TTS 操作会花费多长时间
- 是否存在无法通过 closure check 发现的不可预见的问题
现在可以通过这个DataPump参数来减少把tablespace设置为只读的时间并预估 datapump transportable export 要花费的时间: TTS_CLOSURE_CHECK
TTS_CLOSURE_CHECK
目的: 指定 transportable export 的 closure check 的级别
语法以及描述
TTS_CLOSURE_CHECK = [ ON | OFF | FULL | TEST_MODE ]
ON – 开启 closure check 来确保 要导出的tablespace集里没有引用集合之外的对象
OFF – 关闭 closure check。用户自己确保要导出的tablespace集里没有引用集合之外的对象
FULL – 进行全面的多方向的 closure check 确保要导出的tablespace集里没有引用集合之外的对象,并且集合之外的对象也没有引用要导出的对象
TEST_MODE – 测试模式下不需要把 tablespaces 置为只读模式,来评估 transportable tablespace 导出花费的时间。导出的文件不能用于导入。
注意:
1/ ON, OFF, 以及 FULL 的选项是互斥的。 TEST_MODE 仅适用于导出。
2/ 使用 TTS_CLOSURE_CHECK TEST_MODE 不需要把 tablespaces 置为只读模式,并提供导出花费的时间。导出的文件不能用于导入。
3/ DataPump进行 closure check 所需的时间可能很长,有时甚至是不必要的,尤其是在已知要导出的tablespace集里没有引用集合之外的对象的情况下。
4/ 跳过 closure check 将减少 transportable export 完成的时间,从而增加可用性。 在 tablespace 处于 read-write 模式下即可获得导出时间的功能也提高了可用性。
5/ 可以通过procedure DBMS_DATAPUMP.SET_PARAMETER设置 TTS_CLOSURE_CHECK 参数。下面的例子关闭了 closure check 并启用了测试模式:
SYS.DBMS_DATAPUMP.SET_PARAMETER(jobhdl, 'TTS_CLOSURE_CHECK', DBMS_DATAPUMP.KU$_TTS_CLOSURE_CHECK_OFF+DBMS_DATAPUMP.KU$_TTS_CLOSURE_CHECK_TEST);
比如:
- 在tablespace是read-write模式下启用 TTS_CLOSURE_CHECK=test_mode:
SQL> select status,tablespace_name from dba_tablespaces where tablespace_name='USERS';
STATUS TABLESPACE_NAME
--------- ------------------------------
ONLINE USERS
> expdp system/<password> directory=dptest dumpfile=test_tts.dmp transport_tablespaces=users TTS_CLOSURE_CHECK=test_mode
Export: Release 19.0.0.0.0 - Development on Thu Oct 11 02:55:00 2018
Version 19.1.0.0.0
Copyright (c) 1982, 2018, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Development
Starting "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01": system/ ******** directory=dptest dumpfile=test_tts.dmp transport_tablespaces=users TTS_CLOSURE_CHECK=test_mode
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Master table "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_TRANSPORTABLE_01 is:
<path>/test_tts.dmp
Dump file set is unusable. TEST_MODE requested.
******************************************************************************
Datafiles required for transportable tablespace USERS:
<OS_path>/t_user1.f
Job "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully completed at Thu Oct 11 02:57:06 2018 elapsed 0 00:01:57
注意: 产生的日志文件会写明: "Dump file set is unusable. TEST_MODE requested."
参考:
19c DataPump New Features (Doc ID 2457955.1)




