將exp邏輯備份文件導(dǎo)入到備庫(kù)中時(shí)出現(xiàn)了錯(cuò)誤,相關(guān)錯(cuò)誤信息如下:
1.IMP-00017: 由于 Oracle 錯(cuò)誤 6550, 以下語(yǔ)句失敗:
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 錯(cuò)誤 6550
10.ORA-06550: 第 1 行, 第 4836 列:
11.PLS-00103: 出現(xiàn)符號(hào) "朒ag?"在需要下列之一時(shí):
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. <一個(gè)帶有字符集說(shuō)明的可帶引號(hào)的字符串文字>
20. <一個(gè)可帶引號(hào)的 SQL 字符串>
這是個(gè)很常見(jiàn)的導(dǎo)入警告,通常與數(shù)據(jù)庫(kù)/客戶(hù)端版本有關(guān)。比如這里,源數(shù)據(jù)庫(kù)和目標(biāo)數(shù)據(jù)庫(kù)版本都是10.2.0.4,但導(dǎo)出的時(shí)候使用了10.2.0.1的客戶(hù)端:
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.經(jīng)由常規(guī)路徑由 EXPORT:V10.02.01 創(chuàng)建的導(dǎo)出文件
在別的項(xiàng)目中,還遇到過(guò)從10.2.0.2數(shù)據(jù)庫(kù)中導(dǎo)入到10.2.0.4目標(biāo)庫(kù)時(shí)出現(xiàn)了同樣的問(wèn)題,不管imp/exp使用了什么版本。
解決辦法,就是在exp或imp時(shí)加上一個(gè)參數(shù)來(lái)禁用統(tǒng)計(jì)信息的導(dǎo)出/導(dǎo)入: statistics=none
那么,不導(dǎo)入統(tǒng)計(jì)信息會(huì)有什么影響呢。其實(shí)在Oracle 10g以后,默認(rèn)定時(shí)采集統(tǒng)計(jì)信息,可以在dba_scheduler_jobs視圖中查詢(xún)到該任務(wù):GATHER_STATS_JOB。并且可以在dba_scheduler_job_run_details中看到相應(yīng)的執(zhí)行情況。
手動(dòng)采集統(tǒng)計(jì)信息:在sys用戶(hù)中執(zhí)行dbms_scheduler.run_job('GATHER_STATS_JOB') 存儲(chǔ)過(guò)程(等價(jià)于執(zhí)行dbms_stats.gather_database_stats_job_proc);使用dbms_stats包中的gather_xxx_stats來(lái)采集。停用定時(shí)采集統(tǒng)計(jì)信息的任務(wù):DBMS_SCHEDULER.DISABLE('GATHER_STATS_JOB')
Oracle 10g中修改自動(dòng)采集統(tǒng)計(jì)信息的時(shí)間策略:通過(guò)sys用戶(hù)登錄執(zhí)行存儲(chǔ)過(guò)程dbms_scheduler.set_attribute來(lái)修改,例如
dbms_scheduler.set_attribute('GATHER_STATS_JOB','SCHEDULE_NAME','MAINTENANCE_WINDOW_GROUP')
dbms_scheduler.set_attribute('WEEKEND_WINDOW','DURATION','+000 05:00:00')
查詢(xún):
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;
本文出自:億恩科技【www.cmtents.com】
服務(wù)器租用/服務(wù)器托管中國(guó)五強(qiáng)!虛擬主機(jī)域名注冊(cè)頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]
|