下面一段示例说明了Oracle的基本操作insert、update、delete产生的undo的大小和记录条数。
--insert操作无论是1条或者多条,一次产生一条undo数据
SQL> create table a (b number, c varchar2(30));
Table created
SQL> insert into a values (1,'zhangsan');
1 row inserted
SQL>
SQL> select used_ublk,used_urec from v$session s, v$transaction t
2 where s.audsid=sys_context('userenv', 'sessionid') and s.taddr = t.addr;
USED_UBLK USED_UREC
---------- ----------
1 1
SQL> insert into a select rownum,rownum from dual connect by rownum
SQL> select used_ublk,used_urec from v$session s, v$transaction t
2 where s.audsid=sys_context('userenv', 'sessionid') and s.taddr = t.addr;
USED_UBLK USED_UREC
---------- ----------