Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to know if a sql is stuck or it is running?

672680Aug 16 2010 — edited Aug 16 2010
I have a sql, as I do some separate select, it works fine and the database I am working on has no much data either.
but whenver, I runs the update, it stucks, I can`t tell if it is running or stuck.
So, for those sqls that take longer time to run, how can we tell if it is still running or dead?

also, could you take a look at sql below and tell me a way to optimize it? Rewritting is hugly encouraged :D
        UPDATE ims_alctn a
        set a.ssc_cstn_sfkp_acct =
          (select regexp_substr(d.CHNGE_DATA_1,'~'||350||'[^~]+~')
          FROM ims_alctn_hstry d
           WHERE  d.ims_trde_hstry_id in 
            (select max(ims_trde_hstry_id)
            from ims_alctn_hstry c
            where regexp_substr(c.chnge_data_1,'~'||350||'[^~]+~') is not null and c.ims_trde_oid in (
            select ims_trde_oid  from ims_trde  where service_type   ='IMS' and ims_trde.msg_typ = 'FX' and ims_trde.stlmt_dt >= sysdate-7) 
            group by  c.ims_alctn_oid));
Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 13 2010
Added on Aug 16 2010
6 comments
10,759 views