伯乐共勉

讨论。NET专区
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

批量生成设置跟踪语句的SQL

Posted on 2007-05-30 11:45  伯乐共勉  阅读(350)  评论(0编辑  收藏  举报

 

SQL> select 'exec dbms_system.set_ev(' || ses.sid || ',' || ses.serial# || ',10046,0,''oldboy'');'
2 from v$session ses,v$process pro
3 where pro.spid in(12864,12902,12848,12896,12844,22307,12860,12870,12904,12880,12914)
4 and ses.paddr=pro.addr
5 order by sid;

'EXECDBMS_SYSTEM.SET_EV('||SE
--------------------------------------------------------------------------------
exec dbms_system.set_ev(19,61947,10046,0,'oldboy');
exec dbms_system.set_ev(27,21537,10046,0,'oldboy');
exec dbms_system.set_ev(28,19880,10046,0,'oldboy');
exec dbms_system.set_ev(51,56810,10046,0,'oldboy');
exec dbms_system.set_ev(63,35607,10046,0,'oldboy');
exec dbms_system.set_ev(106,5877,10046,0,'oldboy');
exec dbms_system.set_ev(111,4709,10046,0,'oldboy');
exec dbms_system.set_ev(117,6638,10046,0,'oldboy');
exec dbms_system.set_ev(149,51080,10046,0,'oldboy');
exec dbms_system.set_ev(154,35103,10046,0,'oldboy');
exec dbms_system.set_ev(155,27443,10046,0,'oldboy');