Home » RDBMS Server » Server Administration » Query
Query [message #371483] Fri, 27 October 2000 12:21 Go to next message
Luis Gabriel
Messages: 11
Registered: October 2000
Junior Member
Hi,

Somebody knows how can I check how many time a query spend when it is running or what query is spend a lot of resources on my database?.

tanks.
Re: Query-find that slow statement [message #371484 is a reply to message #371483] Fri, 27 October 2000 12:27 Go to previous messageGo to next message
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
Using a tool like TOAD, you can browse your SGA and look at all the cached statements. You may want to flush the shared pool to clear out the junk before looking at each statement. To do it the hard way, start a SQL Trace on the session you want to look at. When done, turn tracing off, run tkprof on the output and see the results. You may need to bounce Oracle with timed_statistics=true to get full timing info.
user trace file - user_dump_dest [message #371496 is a reply to message #371483] Mon, 30 October 2000 10:26 Go to previous messageGo to next message
Leo
Messages: 14
Registered: March 2000
Junior Member
How can I make the system to generate the user trace file with the read permission for other (644)?
The system always generate 640 permission for the user trace file:
-rw-r----- 1 oracle oinstall 1365 Oct 30 09:36 ora_5387_mhp1.trc
I want to make it
-rw-r--r-- 1 oracle oinstall 1365 Oct 30 09:36 ora_5387_mhp1.trc
Re: Query [message #371544 is a reply to message #371483] Fri, 03 November 2000 13:34 Go to previous message
Gopal
Messages: 23
Registered: June 1999
Junior Member
Use 'ALTER SYSTEM FLUSH SHARED POOL' for flushing the shared pool.
Use V$SQL to find all the cached SQLs at present, and that table has columns to give you the start and end time of the query. So, you can query this table and order the rows in decending order of diff between start and end time.

Let me know if you need more details.
Previous Topic: Need help - 3 questions pls.
Next Topic: PL/SQL Prompts
Goto Forum:
  


Current Time: Wed May 01 18:59:29 CDT 2024