Oracle ORA-0650 快照过旧实验


conn / as sysdba
create undo tablespace undotbs3 datafile 'd:\lx\undotbs03.dbf' size 2m;
alter system set undo_tablespace=undotbs3;


sess1:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drop table test_undo;
create table test_undo as select * from dba_objects where rownum<4001;


variable c refcursor;
declare
begin
  open  :c for select * from test_undo;
end;
/

--最后执行
print :c

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sess2:

begin
  for i in (select rowid from test_undo) loop
   update test_undo set object_id=1 where rowid=i.rowid;
  end loop;
  commit;
end;
/

update test_undo set object_id=11111;

select round(sum(bytes)/1024/1024,3) from dba_Free_space where tablespace_name='UNDOTBS3';

相关内容