oracle 10g 資料如何匯入到oracle 9i中?

來源:互聯網
上載者:User
一般來說,從低版本匯入到高版本問題不大,麻煩的是將高版本的資料匯入到低版本中,在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視圖即可。

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')

)

/

grant select on sys.exu81rls to public;

/

聯繫我們

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