不同版本資料庫的exp imp問題

2021-04-01 15:30:03 字數 1332 閱讀 2105

一般來說,從低版本匯入到高版本問題不大,麻煩的是將高版本的資料匯入到低版本中,在oracle9i之前,不同版本oracle之間的exp/imp可以通過下面的方法來解決:

1、在高版本資料庫上執行底版本的catexp.sql;

2、使用低版本的exp來匯出高版本的資料;

3、使用低版本的imp將資料庫匯入到底版本資料庫中;

4、在高版本資料庫上重新執行高版本的catexp.sql指令碼。

但在9i中,上面的方法並不能解決問題。如果直接使用底版本exp/imp會出現如下錯誤:

exp-00008: oracle error %lu encountered

ora-00904: invalid column name

這已經是乙個公布的bug,需要等到oracle10.0才能解決,bug號為2261722,你可以到metalink上去檢視有關此bug的詳細資訊。

bug歸bug,我們的工作還是要做,在沒有oracle的支援之前,我們就自己解決。在oracle9i中執行下面的sql重建exu81rls檢視即可。

sql>create or replace view exu81rls

(objown,objnam,policy,polown,polsch,polfun,stmts,chkopt,enabled,spolicy)

as select u.name, o.name, r.pname, r.pfschma, r.ppname, r.pfname,

decode(bitand(r.stmt_type,1), 0,'', 'select,')

|| decode(bitand(r.stmt_type,2), 0,'', 'insert,')

|| decode(bitand(r.stmt_type,4), 0,'', 'update,')

|| decode(bitand(r.stmt_type,8), 0,'', 'delete,'),

r.check_opt, r.enable_flag,

decode(bitand(r.stmt_type, 16), 0, 0, 1)

from user$ u, obj$ o, rls$ r

where u.user# = o.owner#

and r.obj# = o.obj#

and (uid = 0 or

uid = o.owner# or

exists ( select * from session_roles where role='select_catalog_role')

) ;sql>grant select on sys.exu81rls to public;

資料庫總結 exp,imp

emp 和 imp的使用 exp username username dbase file d tmp127.dmp tables tmp127 query where rownum 10 imp username username dbase file d tmp127.dmp tables tm...

exp imp資料庫遷移

源系統 雙機熱備 windows 2003 64位 oracle 10.2.0.1 目標系統 rac aix7.1 oracle 11.2.0.1 1 鎖定使用者 2 停止服務後再開啟 目的切斷所有使用者連線 shutdown 開啟服務 startup 4 exp 全庫匯出資料 5 目標庫執行建立表...

oracle 資料庫的exp imp

oracle 資料庫匯出匯入 匯出資料庫 c documents and settings administrator exp username password ip oracleinstance file d dmp owner usename buffer 640000 匯入資料庫 先要建立表...