Oracle 11g r2資料泵的REMAP_TABLE功能

來源:互聯網
上載者:User

Oracle其實在11.1.0.6中已經推出了這個功能,不過11.1.0.6中還存在bug。這裡簡單介紹一下11.2中的REMAP_TABLE功能。

看一個簡單的例子:

SQL> select * from v$version;

BANNER

--------------------------------------------------------------------------------

Oracle Database11gEnterprise Edition Release11.2.0.1.0 - 64bit Production

PL/SQL Release 11.2.0.1.0 - Production

CORE    11.2.0.1.0      Production

TNS for Linux: Version 11.2.0.1.0 - Production

NLSRTL Version 11.2.0.1.0 - Production

SQL> create table t

2  (id number,

3  name varchar2(30));

表已建立。

SQL> insert into t

2  select rownum, tname

3  from tab;

已建立11行。

SQL> commit;

提交完成。

SQL> create index ind_t_id

2  on t (id);

索引已建立。

下面匯出T表:

SQL> host expdp yangtk/yangtk directory=d_output dumpfile=t.dp tables=t

Export: Release11.2.0.1.0 - Production on星期五6月4 23:31:50 2010

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

串連到: Oracle Database11gEnterprise Edition Release11.2.0.1.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

啟動"YANGTK"."SYS_EXPORT_TABLE_01":  yangtk/******** directory=d_output dumpfile=t.dp tables=t

正在使用BLOCKS方法進行估計...

處理物件類型TABLE_EXPORT/TABLE/TABLE_DATA

使用BLOCKS方法的總估計: 128 KB

處理物件類型TABLE_EXPORT/TABLE/TABLE

處理物件類型TABLE_EXPORT/TABLE/INDEX/INDEX

處理物件類型TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS

. .匯出了"YANGTK"."T"                                5.562 KB      11行

已成功載入/卸載了主表"YANGTK"."SYS_EXPORT_TABLE_01"

******************************************************************************

YANGTK.SYS_EXPORT_TABLE_01的轉儲檔案集為:

/home/oracle/t.dp

作業"YANGTK"."SYS_EXPORT_TABLE_01"已於23:31:59成功完成

利用REMAP_TABLE將匯入表重新對應到T_NEW表中:

SQL> host impdp yangtk/yangtk directory=d_output dumpfile=t.dp remap_table=t:t_new

Import: Release11.2.0.1.0 - Production on星期五6月4 23:32:19 2010

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

串連到: Oracle Database11gEnterprise Edition Release11.2.0.1.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

已成功載入/卸載了主表"YANGTK"."SYS_IMPORT_FULL_01"

啟動"YANGTK"."SYS_IMPORT_FULL_01":  yangtk/******** directory=d_output dumpfile=t.dp remap_table=t:t_new

處理物件類型TABLE_EXPORT/TABLE/TABLE

處理物件類型TABLE_EXPORT/TABLE/TABLE_DATA

. .匯入了"YANGTK"."T_NEW"                            5.562 KB      11行

處理物件類型TABLE_EXPORT/TABLE/INDEX/INDEX

ORA-31684:物件類型INDEX:"YANGTK"."IND_T_ID"已存在

處理物件類型TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS

ORA-39111:跳過從屬物件類型INDEX_STATISTICS,基本物件類型INDEX:"YANGTK"."IND_T_ID"已存在

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.