Oracle Tablespace Transportation

Linux大全评论686 views阅读模式

前提:进行表空间传输需要用户有SYSDBA的系统权限,被移动的表空间是自包含的表空间,不应有依赖于表空间外部对象的对象存在。确定是否自包含可使用系统包DBMS_TTS中的TRANSPORT_SET_CHECK过程进行检查

例如要对表空间OLTP进行传输,

SQL> exec dbms_tts.transport_set_check('OLTP',true,true);

PL/SQL procedure successfully completed.

SQL> select * from transport_set_violations;

no rows selected

如果有违返自包含,则会在表TRANSPORT_TABLESPACE_SET_VIOLATIONS视图,如果没有则里面没有数据。no rows selected shows the oltp tablespace is not self-contained.

第一步:表空间变为只读

将源数据库中移动表空间设为只读状态

SQL> alter tablespace oltp read only;

第二步:源数据库进行导出操作

$expdp userid=system/Oracle directory=my_test dumpfile=oltp.dump transport_tablespaces='oltp'

第三步:把dump文件和表空间的数据库文件scp到目标主机上

第四步:目的数据库进行导入

$impdp  userid=system/oracle directory=my_test dumpfile=oltp.dump transport_datafiles='u01/app/oracle/oradata/OMS/oltp01.dbf'

第五步:将源、目的数据库的表空间状态由只读改为可读写

企鹅博客
  • 本文由 发表于 2019年9月9日 03:34:21
  • 转载请务必保留本文链接:https://www.qieseo.com/188111.html

发表评论