1. DBMS_APPLICATION_INFO.SET_CLIENT_INFO
此过程为当前的会话提供附加信息,此信息保存在v$session表的client_info字段中;当退出此会话时,值会被清空.
2. DBMS_ALERT
通过下面过程来简单说明一下:
declare
l_msg long;
l_status number;
begin
--注册一个此会话中我们感兴趣的alert名称
dbms_alert.register( 'WAITING' );
for i in 1 .. 999999 loop
dbms_application_info.set_client_info( i );
--及时接受来自定义好的alert中的消息
dbms_alert.waitone( 'WAITING', l_msg, l_status, 0 );
if l_status = 0 then
dbms_output.put_line(l_msg);
exit;
end if;
for x in ( select * from big_table order by 1, 2, 3, 4 )
loop
null;
end loop;
end loop;
end;
/
--使用以下过程停止上面的过程;通常可以在trigger中使用dbms_alert.signal。
begin
--发送消息给已经注册好的alert.
dbms_alert.signal('WAITING','Hello World');
commit;
end;
/
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13129975/viewspace-627411/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/13129975/viewspace-627411/