ora-01555,ORA-22924解决

用户逻辑导出数据的时候,在检验图像结果这张表,报ora-01555错误提示,检验图像结果有lob对象,所以产生该问题,解决如下;

create table corrupt_lobs (corrupt_rowid rowid);

declare
error_1578 exception;
error_1555 exception;
error_22922 exception;
pragma exception_init(error_1578,-1578);
pragma exception_init(error_1555,-1555);
pragma exception_init(error_22922,-22922);
n number;
begin
  for cursor_lob in (select rowid r, 图像点  from 检验图像结果) loop
  begin
   n:=dbms_lob.instr(cursor_lob.图像点,hextoraw('889911'));
  exception
   when error_1578 then
    insert into corrupt_lobs values (cursor_lob.r);
    commit;
   when error_1555 then
    insert into corrupt_lobs values (cursor_lob.r);
    commit;
   when error_22922 then
    insert into corrupt_lobs values (cursor_lob.r);
    commit;
end;
end loop;
end;
/

select * from corrupt_lobs;


update 检验图像结果 set 图像点 = empty_blob()  where rowid in (select corrupt_rowid from corrupt_lobs);

你可能感兴趣的:(ora-01555,ORA-22924解决)