Oracle Tablespace Transportation

來源:互聯網
上載者:User

前提:進行資料表空間傳輸需要使用者有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'

 

第五步:將源、目的資料庫的資料表空間狀態由唯讀改為可讀寫

ALTER
TABLESPACE OLTP READ WRITE;

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.