数据量过大,导致执行慢(上)

单独测试存储过程,定位执行在哪里卡死,test的过程中我执行了一下语句,下面的语句可以查找出:
select s.MACHINE, s.PROGRAM, s.event, s.STATUS, q.sql_text,s.SID
  from gv$session s, gv$sql q
where sid in (select distinct sid
                 from gv$lock
                where type in ('TX', 'TM')
                  and inst_id = s.inst_id)
   and nvl(s.sql_id, s.prev_sql_id) = q.sql_id
   and s.inst_id = q.inst_id;

你可能感兴趣的:(Oracle)