Home » RDBMS Server » Server Administration » how can I get the redo log of one session
how can I get the redo log of one session [message #435182] Tue, 15 December 2009 00:40 Go to next message
runbaobao88
Messages: 3
Registered: August 2009
Junior Member
I have two sessions.
Session1 did some SQLs. Session2 did some SQLs, Session2 is waitting for session1 to release locks of some objects.
If session1 does not execute any SQL now, then I can not get anything from v$sqlarea.
If I want to know what did the session1 do before, how can I get these infomations?
Re: how can I get the redo log of one session [message #435189 is a reply to message #435182] Tue, 15 December 2009 01:13 Go to previous messageGo to next message
Michel Cadot
Messages: 68665
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It depends on the Oracle version you didn't post.
In most versions, you can do nothing.

Regards
Michel
Re: how can I get the redo log of one session [message #435569 is a reply to message #435182] Wed, 16 December 2009 19:41 Go to previous messageGo to next message
runbaobao88
Messages: 3
Registered: August 2009
Junior Member
version: 11g
Re: how can I get the redo log of one session [message #435570 is a reply to message #435569] Wed, 16 December 2009 19:54 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Session1 did some SQLs.
If Session1 did DML & does not COMMIT, then you can see the SQL by doing below:

SELECT USERNAME, ss.sql_text
FROM v$session vv, v$sql ss
WHERE vv.TADDR IS NOT NULL
and vv.prev_sql_id = ss.sql_id
/

[Updated on: Wed, 16 December 2009 20:11]

Report message to a moderator

Re: how can I get the redo log of one session [message #435665 is a reply to message #435182] Thu, 17 December 2009 05:13 Go to previous messageGo to next message
runbaobao88
Messages: 3
Registered: August 2009
Junior Member
Thank you very much!
Re: how can I get the redo log of one session [message #435988 is a reply to message #435569] Sun, 20 December 2009 22:07 Go to previous messageGo to next message
spabolu
Messages: 7
Registered: December 2009
Junior Member
Hi BlackSwan,

But that returns only the last executed SQL statement. It may not return the SQL because of which the objects are locked.
Re: how can I get the redo log of one session [message #435989 is a reply to message #435988] Sun, 20 December 2009 22:29 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>But that returns only the last executed SQL statement.
>It may not return the SQL because of which the objects are locked.

How can we reproduce your results?

You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
Go to the URL above click the link "Posting Guidelines"
Go to the section labeled "Practice" & do as directed.

[Updated on: Sun, 20 December 2009 22:52]

Report message to a moderator

Re: how can I get the redo log of one session [message #436073 is a reply to message #435988] Mon, 21 December 2009 05:16 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Quote:
It may not return the SQL because of which the objects are locked.


It might not - but given that Oracle doesn't store the SQL that generates the locks, it's about as close as you're going to get.
Previous Topic: update remote database
Next Topic: Read text file on server.
Goto Forum:
  


Current Time: Mon Jul 01 00:50:56 CDT 2024