ORA-02354 ORA-01555 ORA-22924
問題描述
create table corrupted_lob_data (corrupted_rowid rowid, err_num number);
lob_column 表的欄位名(一般掃描blob、clob欄位)
table_owner 表的所有者
table_with_lob 表名
declare error_1578 exception; error_1555 exception; error_22922 exception; error_22924 exception; pragma exception_init(error_1578,-1578); pragma exception_init(error_1555,-1555); pragma exception_init(error_22922,-22922); pragma exception_init(error_22924,-22924); num number; begin for cursor_lob in (select rowid r, &lob_column from &table_owner.&table_with_lob) loop begin num := dbms_lob.instr (cursor_lob.&lob_column, hextoraw ('889911')) ; exception when error_1578 then insert into corrupted_lob_data values (cursor_lob.r,1578); commit; when error_1555 then insert into corrupted_lob_data values (cursor_lob.r,1555); commit; when error_22922 then insert into corrupted_lob_data values (cursor_lob.r,22922); commit; when error_22924 then insert into corrupted_lob_data values (cursor_lob.r,22924); commit; end; end loop; end; /
3、檢視是否有資料損壞:
select * from corrupted_lob_data;
select * from 有LOB段損壞的表名 where rowid in (select corrupted_rowid from corrupted_lob_data);
--如果更新的表的欄位型別為CLOB,則用以下指令碼修復: update 表名 set LOB欄位名=empty_clob() where rowid in (select corrupted_rowid from corrupted_lob_data); --如果更新的表的欄位型別為BLOB,則用以下指令碼修復: update 表名 set LOB欄位名=empty_blob() where rowid in (select corrupted_rowid from corrupted_lob_data); commit;
expdp \" / as sysdba \" directory=DATA_PUMP_DIR dumpfile=table_sys_xform_template_history.dump logfile=table_sys_xform_template_history_dump.log tables=xxxxxxx.SYS_XFORM_TEMPLATE_HISTORY CONTENT=DATA_ONLY QUERY=\"WHERE rowid NOT IN \(\'AAAtdvAAFAAOR1ZAAE\'\) \"
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70004783/viewspace-2990334/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- EXPDP 時報錯ORA-31693,ORA-02354,ORA-01555
- ORACLE 資料匯出LOB欄位報錯ORA-31693,ORA-02354,ORA-22924Oracle
- 資料泵expdp匯出遇到ORA-01555和ORA-22924問題的分析和處理
- 【ORA-01555】Oracle LOB欄位匯出 報錯 ORA-01555Oracle
- expdp匯出報ORA-31693、ORA-02354、ORA-01466
- [20230227][20230109]Oracle Global Temporary Table ORA-01555 and Undo Retention.tOracle
- 29、undo_2_1(事務槽、延遲塊清除、構造CR塊、ora-01555)