不同版本間的資料庫匯入匯出

zhanglei_itput發表於2009-02-26

    今天終於把不同版本間的資料庫匯入匯出的問題搞清楚了,先前把自己繞進去了,呵呵。一直沒搞清楚這個問題,從2個客戶端,2個伺服器,2個版本的dmp檔案的角度來分析,排列組合也有2*2*2=8種了,真正把這8種情況做完試驗以後,其實就是兩個規則:

規則1.   低版本的exp/imp客戶端可以連線到高版本(或同版本)的資料庫伺服器,但高版本的exp/imp客戶端不能連線到低版本的資料庫伺服器。
規則2.   高版本exp出的dmp檔案,低版本無法imp(無法識別dmp檔案)

有了這兩個規則,8種試驗結果就變得很簡單了。
排除9iclient to 9iserver, 10gclient to 10gserver.兩種可能,剩下有6種可能
a. 9iclient + 9i dmp    => 10g server           yes 
b.10client + 9i dmp    =>    9i server           no(違反規則1)
c.10client + 9i dmp    => 10g server           yes
d. 9iclient + 10g dmp =>    9i server          no(違反規則2)
e. 9iclient + 10g dmp => 10g server         no(違反規則2)
f. 10client + 10g dmp =>    9i server          no(違反規則1)
附加:g:9i客戶端 exp 10g dmp檔案      yes
            h:10g客戶端 exp 9i dmp檔案      no(違反規則1)

詳細試驗情況如下:9i資料庫@test_9i   10g資料庫@test_10g
a. 9iclient + 9i dmp    => 10g server           yes 
C:\Documents and Settings\wgzx1>imp file=c:\9i.dmp fromuser=
ecc_view9 touser=ecc_view10
Import: Release 9.2.0.1.0 - Production on 星期四 2月 26 10:16:28 2009
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

連線到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production With the Partitioning, OLAP and Data Mining options
經由常規路徑匯出由EXPORT:V09.02.00建立的檔案
警告: 此物件由 ECC_VIEW9 匯出, 而不是當前使用者
已經完成ZHS16GBK字符集和AL16UTF16 NCHAR 字符集中的匯入
. . 正在匯入表                         "TEST1"      14113行被匯入
成功終止匯入,但出現警告。

b.10client + 9i dmp    =>    9i server           no(違反規則1)
[oracle@ntkdb ~]$ imp
file=./9i.dmp full=y
Import: Release 10.2.0.1.0 - Production on 星期四 2月 26 09:52:15 2009
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
IMP-00058: ORACLE error 6550 encountered
ORA-06550: 第 1 行, 第 33 列:
PLS-00302: 必須說明 'SET_NO_OUTLINES' 元件
ORA-06550: 第 1 行, 第 7 列:
PL/SQL: Statement ignored
IMP-00000: Import terminated unsuccessfully

c.10client + 9i dmp    => 10g server           yes
[oracle@ntkdb ~]$ imp
file=./9i.dmp full=y
Import: Release 10.2.0.1.0 - Production on 星期四 2月 26 09:57:58 2009
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Export file created by EXPORT:V09.02.00 via conventional path
Warning: the objects were exported by ECC_VIEW9, not by you
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
. importing ECC_VIEW9's objects into ECC_VIEW10
. importing ECC_VIEW9's objects into ECC_VIEW10
. . importing table                        "TEST1"      14113 rows imported
Import terminated successfully without warnings.

d. 9iclient + 10g dmp =>    9i server          no(違反規則2)
C:\Documents and Settings\wgzx1>imp
file=c:\10g.dmp full=y
Import: Release 9.2.0.1.0 - Production on 星期四 2月 26 10:51:59 2009
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
連線到: Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
IMP-00010: 不是有效的匯出檔案,標題驗證失敗
IMP-00000: 未成功終止匯入

e. 9iclient + 10g dmp => 10g server         no(違反規則2)
C:\Documents and Settings\wgzx1>imp file=c:\10g.dmp full=y
Import: Release 9.2.0.1.0 - Production on 星期四 2月 26 10:53:18 2009
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
連線到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production With the Partitioning, OLAP and Data Mining options
IMP-00010: 不是有效的匯出檔案,標題驗證失敗
IMP-00000: 未成功終止匯入

f. 10client + 10g dmp =>    9i server          no(違反規則1)
[oracle@ntkdb ~]$ imp
file=./10g.dmp full=y
Import: Release 10.2.0.1.0 - Production on 星期四 2月 26 10:25:20 2009
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
IMP-00058: ORACLE error 6550 encountered
ORA-06550: 第 1 行, 第 33 列:
PLS-00302: 必須說明 'SET_NO_OUTLINES' 元件
ORA-06550: 第 1 行, 第 7 列:
PL/SQL: Statement ignored
IMP-00000: Import terminated unsuccessfully

g:9i客戶端 exp 10g dmp檔案      yes
C:\Documents and Settings\wgzx1>exp
file=c:\10g2.dmp tables=test1
Export: Release 9.2.0.1.0 - Production on 星期四 2月 26 11:52:03 2009
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
連線到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production With the Partitioning, OLAP and Data Mining options
已匯出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
即將匯出指定的表透過常規路徑 ...
. . 正在匯出表                           TEST1      42329 行被匯出
在沒有警告的情況下成功終止匯出。

h:10g客戶端 exp 9i dmp檔案      no(違反規則1)
[oracle@ntkdb ~]$ exp
file=./9i2.dmp tables=test1
Export: Release 10.2.0.1.0 - Production on 星期四 2月 26 11:16:48 2009
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
EXP-00056: ORACLE error 6550 encountered
ORA-06550: 第 1 行, 第 41 列:
PLS-00302: 必須說明 'SET_NO_OUTLINES' 元件
ORA-06550: 第 1 行, 第 15 列:
PL/SQL: Statement ignored
EXP-00000: Export terminated unsuccessfully

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

相關文章