oracle 10g 傳輸表空間的測試

paulyibinyi發表於2008-06-02

第一:同一平臺傳輸表空間測試

F:\oracle\product\10.2.0\db_1\BIN>sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 6月 2 09:10:54 2008

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


連線到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> create tablespace paul datafile 'd:\paul01.dbf'  size 50M;

SQL> create user paul identified by paul default tablespace paul;

使用者已建立。

SQL> grant connect,resource,dba to paul;

授權成功。

SQL> conn paul/paul
已連線。

SQL> create table paultable (a int);

表已建立。

SQL> insert into paultable values(100);

已建立 1 行。

SQL> commit;

提交完成。

SQL> select * from paultable;

         A
----------
       100

SQL> alter tablespace paul read only;

表空間已更改。

SQL> exit
從 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options 斷開

匯出表空間

F:\oracle\product\10.2.0\db_1\BIN>exp userid='sys/abcdefg as sysdba' tablespaces
=paul transport_tablespace=y file=c:\exp_ts_paul.dmp

Export: Release 10.2.0.1.0 - Production on 星期一 6月 2 09:13:54 2008

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


連線到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
已匯出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
注: 將不匯出表資料 (行)
即將匯出可傳輸的表空間後設資料...
對於表空間 PAUL...
. 正在匯出簇定義
. 正在匯出表定義
. . 正在匯出表                       PAULTABLE
. 正在匯出引用完整性約束條件
. 正在匯出觸發器
. 結束匯出可傳輸的表空間後設資料
成功終止匯出, 沒有出現警告。

複製

exp_ts_paul.dmp和資料檔案paul01.dbf 到另外同平臺資料庫的D盤上

在另外同平臺伺服器進行傳輸表空間匯入:

C:\Documents and Settings\paul>imp userid='sys/abcdefg as sysdba' file='d:\exp_t
s_paul.dmp' transport_tablespace=y datafiles='d:\paul01.dbf'

Import: Release 10.2.0.1.0 - Production on 星期一 6月 2 09:44:08 2008

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


連線到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

經由常規路徑由 EXPORT:V10.02.01 建立的匯出檔案
即將匯入可傳輸的表空間後設資料...
已經完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的匯入
. 正在將 SYS 的物件匯入到 SYS
. 正在將 SYS 的物件匯入到 SYS
. 正在將 PAUL 的物件匯入到 PAUL
. . 正在匯入表                     "PAULTABLE"
. 正在將 SYS 的物件匯入到 SYS
成功終止匯入, 沒有出現警告。


SQL> select * from paultable;

         A
----------
       100

 

注意地方:

  1.只能新建個使用者預設所屬表空間為需要匯出的表空間 不能建立在sys或system使用者下

     例如 在sys或system使用者下 

    create table  paultable  (a int) tablespace paul;  會報以下錯誤

  F:\oracle\product\10.2.0\db_1\BIN>exp userid='sys/abcdefg as sysdba' tablespaces
=paul transport_tablespace=y file=c:\exp_ts_paul.dmp

Export: Release 10.2.0.1.0 - Production on 星期一 6月 2 09:09:47 2008

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


連線到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
已匯出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
注: 將不匯出表資料 (行)
即將匯出可傳輸的表空間後設資料...
EXP-00008: 遇到 ORACLE 錯誤 29341
ORA-29341: 可傳送集不是自包含的
ORA-06512: 在 "SYS.DBMS_PLUGTS", line 1387
ORA-06512: 在 line 1
EXP-00000: 匯出終止失敗

2.目標資料庫必須建立對應的使用者 要不匯入時會報對應使用者不存在 而導致匯入失敗

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-329596/,如需轉載,請註明出處,否則將追究法律責任。

相關文章