imp匯入時出現imp-00017 ora-06550的解決辦法

來源:互聯網
上載者:User

將exp邏輯備份檔案匯入到備庫中時出現了錯誤,相關錯誤資訊如下:

  1. IMP-00017: 由於 Oracle 錯誤 6550, 以下語句失敗:  
  2.  "DECLARE  SREC DBMS_STATS.STATREC; BEGIN SREC.MINVAL := '00730068006F0075006"  
  3.  "C0075'; SREC.MAXVAL := '9F9A00200020514B'; SREC.EAVS := 4; SREC.CHVALS := D"  
  4.  "BMS_STATS.CHARARRAY(utl_raw.cast_to_varchar2('00730068006F0075006C0075'),'N"  
  5.  "fS[',utl_raw.cast_to_varchar2('4E5400200020664B'),utl_raw.cast_to_varchar2"  
  6.  "('4ED8002000204FCA'),'N貍*',utl_raw.cast_to_varchar2('4EFB002000205170'),'N"  
  7.  "鸒','O  
  8. ……  
  9. IMP-00003: 遇到 ORACLE 錯誤 6550  
  10. ORA-06550: 第 1 行, 第 4836 列:   
  11. PLS-00103: 出現符號 "朒ag?"在需要下列之一時:  
  12.  ( - + case mod new not  
  13.    null others <an identifier>  
  14.    <a double-quoted delimited-identifier> <a bind variable> avg  
  15.    count current exists max min prior sql stddev sum variance  
  16.    execute forall merge time timestamp interval date  
  17.    <a string literal with character set specification>  
  18.    <a number> <a single-quoted SQL string> pipe  
  19.    <一個帶有字元集說明的可帶引號的字串文字>  
  20.    <一個可帶引號的 SQL 字串>  

    這是個很常見的匯入警告,通常與資料庫/用戶端版本有關。比如這裡,來源資料庫和目標資料庫版本都是10.2.0.4,但匯出的時候使用了10.2.0.1的用戶端:

  1. 串連到: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production  
  2. With the Partitioning, Real Application Clusters, OLAP, Data Mining  
  3. and Real Application Testing options  
  4.   
  5.   
  6. 經由常規路徑由 EXPORT:V10.02.01 建立的匯出檔案  
    在別的項目中,還遇到過從10.2.0.2資料庫中匯入到10.2.0.4目標庫時出現了同樣的問題,不管imp/exp使用了什麼版本。


    解決辦法,就是在exp或imp時加上一個參數來禁用統計資訊的匯出/匯入:  statistics=none    

    那麼,不匯入統計資訊會有什麼影響呢。其實在oracle 10g以後,預設定時採集統計資訊,可以在dba_scheduler_jobs視圖中查詢到該任務:GATHER_STATS_JOB。並且可以在dba_scheduler_job_run_details中看到相應的執行情況。

    手動採集統計資訊:在sys使用者中執行dbms_scheduler.run_job('GATHER_STATS_JOB') 預存程序(等價於執行dbms_stats.gather_database_stats_job_proc);使用dbms_stats包中的gather_xxx_stats來採集。停用定時採集統計資訊的任務:DBMS_SCHEDULER.DISABLE('GATHER_STATS_JOB')

    oracle 10g中修改自動採集統計資訊的時間策略:通過sys使用者登入執行預存程序dbms_scheduler.set_attribute來修改,例如

dbms_scheduler.set_attribute('GATHER_STATS_JOB','SCHEDULE_NAME','MAINTENANCE_WINDOW_GROUP') 

dbms_scheduler.set_attribute('WEEKEND_WINDOW','DURATION','+000 05:00:00')

查詢:

  1. select d.window_name,d.repeat_interval,d.duration  
  2. from DBA_SCHEDULER_JOBS a,DBA_SCHEDULER_WINDOW_GROUPS b,DBA_SCHEDULER_WINGROUP_MEMBERS c,DBA_SCHEDULER_WINDOWS d  
  3. where a.job_name='GATHER_STATS_JOB'  
  4.   and a.schedule_name=b.window_group_name  
  5.   and b.window_group_name=c.window_group_name  
  6.   and c.window_name=d.window_name  
  7. union all  
  8. select d.window_name,d.repeat_interval,d.duration  
  9. from DBA_SCHEDULER_JOBS a,DBA_SCHEDULER_WINDOWS d  
  10. where a.job_name='GATHER_STATS_JOB'  
  11.   and a.schedule_name=d.window_name;  

聯繫我們

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