oracle批量0update和0deleteOracle认证考试
文章作者 100test 发表时间 2009:12:19 11:26:06
来源 100Test.Com百考试题网
"mkhgigh">
下面一段示例说明了oracle的基本操作insert、0update、0delete产生的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>. 0select 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 0select rownum,rownum from dual connect by rownum<.=50.
50 rows inserted
SQL>.
SQL>. 0select 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 2
--0delete操作产生的undo条数取决于0delete操作本身影响的记录数SQL>. 0delete from a.
51 rows 0deleted
SQL>.
SQL>. 0select 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 53
SQL>. insert into a 0select rownum,rownum from dual connect by rownum<.=50.
50 rows inserted
SQL>.
SQL>. 0select 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