Home » RDBMS Server » Server Administration » How to know the when the query was executed?
How to know the when the query was executed? [message #623421] Wed, 10 September 2014 04:57 Go to next message
haadiya
Messages: 10
Registered: September 2014
Junior Member
1)How to find when a query was executed.I ran a query couple of days ago,im not sure about the exact time, I want to know at what date and time the query was executed. Is it possible to get that information ?

2)How to check the server status when a query is running?
Re: How to know the when the query was executed? [message #623427 is a reply to message #623421] Wed, 10 September 2014 05:20 Go to previous messageGo to next message
gazzag
Messages: 1118
Registered: November 2010
Location: Bedwas, UK
Senior Member
Look into V$SQL and V$SQLAREA views.

HTH
-g
Re: How to know the when the query was executed? [message #623430 is a reply to message #623421] Wed, 10 September 2014 05:33 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

1) You cannot for sure but if you have bought the option you can have a look at DBA_HIST_ACTIVE_SESS_HISTORY.

2) What do you mean by "server status"? I bet the status was "UP".

Re: How to know the when the query was executed? [message #623434 is a reply to message #623430] Wed, 10 September 2014 05:38 Go to previous messageGo to next message
haadiya
Messages: 10
Registered: September 2014
Junior Member
Quote:
What do you mean by server status


A query is performing slow.I want to check the server status when the query is running,not sure how to check and what to check
Re: How to know the when the query was executed? [message #623439 is a reply to message #623434] Wed, 10 September 2014 05:41 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

You didn't say what you mean by "server status".

Re: How to know the when the query was executed? [message #623446 is a reply to message #623434] Wed, 10 September 2014 05:57 Go to previous messageGo to next message
gazzag
Messages: 1118
Registered: November 2010
Location: Bedwas, UK
Senior Member
What O/S?
Re: How to know the when the query was executed? [message #623452 is a reply to message #623446] Wed, 10 September 2014 06:06 Go to previous messageGo to next message
ashwanth77
Messages: 95
Registered: April 2013
Location: India
Member
@ OP dba_hist_active_sess_history should work for query 1

[Updated on: Wed, 10 September 2014 06:32]

Report message to a moderator

Re: How to know the when the query was executed? [message #623466 is a reply to message #623452] Wed, 10 September 2014 07:16 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Thanks to confirm what I said removing an important point.

[Updated on: Tue, 30 September 2014 01:22]

Report message to a moderator

Re: How to know the when the query was executed? [message #623573 is a reply to message #623466] Thu, 11 September 2014 09:46 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
Just to add some clarification to gazzag's above suggestion :

The v$sql would give the information only till a certain timeline until it exists in the shared_pool. As far as I have experienced, people usually look for first load time in v$sql. Therefore, I would go with Michel's suggestion.
Re: How to know the when the query was executed? [message #623578 is a reply to message #623573] Thu, 11 September 2014 10:32 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

v$sql does not give when the query was executed only when this occurrence of this statement in the SGA was first and last loaded.

Re: How to know the when the query was executed? [message #623580 is a reply to message #623578] Thu, 11 September 2014 10:37 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
Yes Michel, that was exactly my intention to clarify regarding v$sql as suggested above.
Re: How to know the when the query was executed? [message #623592 is a reply to message #623580] Thu, 11 September 2014 12:06 Go to previous message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

But your sentence "The v$sql would give the information only till a certain timeline until it exists in the shared_pool." is wrong regarding the question "How to know the when the query was executed?". The rest of your post is irrelevant to the question.

In addition, "loaded" does not mean "executed".

And about "Just to add some clarification to gazzag's above suggestion", I just think gazzag "thought" is answered the question and his answer is also wrong.

Previous Topic: Install database with dbca and response file.
Next Topic: questions on oracle
Goto Forum:
  


Current Time: Thu Mar 28 17:41:48 CDT 2024