Monday, December 24, 2007

Sql Scripts for knowing the transaction status

select * from v$transaction;

--All tranasactions + sid and username
select s.sid,s.username, t.start_time, t.used_ublk, t.used_urec
from v$transaction t, v$session s
where t.ses_addr=s.saddr;

--All tranasactions + sid and username + first 64 bytes of SQL
select s.sid,s.username, t.start_time, t.used_ublk, t.used_urec,sql.sql_text
from v$transaction t, v$session s, v$sql sql
where t.ses_addr=s.saddr
and s.sql_address=sql.address and s.sql_hash_value=sql.hash_value;

18 comments:

  1. Good dispatch and this mail helped me alot in my college assignement. Gratefulness you for your information.

    ReplyDelete
  2. Yes, well, just that the 3rd select is wrong.

    v$session only tracks the current and the previous executed sql statement and since 1 transaction <> 1 sql statement, the sql statement you will see, does not necessarily have anything in common with the transaction, besides of the fact, that it is executed within the same session, before the transaction initiated by this session, at some point in the past, was committed/rolled back.

    JK

    ReplyDelete
  3. A fascinating discussion is definitely worth comment. I do
    believe that you need to write more on this issue, it may not
    be a taboo subject but typically folks don't talk about these topics. To the next! All the best!!

    Here is my web blog :: waist to height calculator

    ReplyDelete
  4. I think the admin of this web page is truly working hard for his web page,
    for the reason that here every data is quality based stuff.


    my web site; Natural Cleanse

    ReplyDelete
  5. Appreciate the recommendation. Will try it out.

    my weblog - Natural Cleanse Weight Loss

    ReplyDelete
  6. Pretty nice post. I just stumbled upon your blog and wished to mention that I have
    truly loved surfing around your weblog posts.
    In any case I'll be subscribing on your feed and I am hoping you write again very soon!

    Also visit my page - NaturaCleanse Diets

    ReplyDelete
  7. Wow, marvelous blog layout! How long have you been blogging for?
    you made blogging look easy. The overall look of your website is excellent, as well as
    the content!

    My website Cambogia trim

    ReplyDelete
  8. I like what you guys are usually up too. This sort of clever work and coverage!
    Keep up the good works guys I've you guys to our blogroll.

    my page :: Ultra SLim Patch Review

    ReplyDelete
  9. Hello There. I found your blog using msn. This is a very well written article.
    I will make sure to bookmark it and come
    back to read more of your useful information. Thanks for the post.
    I'll certainly return.


    e-cig

    ReplyDelete
  10. I'm extremely impressed with your writing skills and also with the layout on your blog. Is this a paid theme or did you customize it yourself? Either way keep up the nice quality writing, it is rare to see a great blog like this one today.

    Look at my blog post Diet Patch Review

    ReplyDelete
  11. Your way of describing everything in this piece of writing is genuinely good, every one be able to easily know it, Thanks a lot.


    Look into my web site :: Anatomy X5 Reviews

    ReplyDelete