[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

v$sql output for a long running query.

Posted on 2007-10-20
4
Medium Priority
?
578 Views
Last Modified: 2013-12-19
I have a query running that is accessing 24 partitions.

It is expected to take a long time to run.

When query fetches data from one partition it takes half an hour to complete.

I have come the second day to find that the query has still not compelted.

I took a view of v$sql and here are the results.

Everything is 0. What does that mean.

Q1. Does it mean that the quer has not executed even once!
Q2. What are the other ways I can see if the query is running in the background or not?


Here is the query:

select sql_text,SORTS,
USERS_OPENING,
USERS_EXECUTING,
PARSE_CALLS,
DISK_READS,
BUFFER_GETS,
ROWS_PROCESSED
from v$sql
where lower(sql_text) like 'select r.pfizer_account_id, p.presc_num, spm.product_id, p.month, t.best_call_state%'
/

SQL_TEXT
--------------------------------------------------------------------------------
     SORTS USERS_OPENING USERS_EXECUTING PARSE_CALLS DISK_READS BUFFER_GETS
---------- ------------- --------------- ----------- ---------- -----------
ROWS_PROCESSED
--------------
select r.pfizer_account_id, p.presc_num, spm.product_id, p.month, t.best_call_st
ate, sum(p.trx_count) from ops$pyrcm.rlup_assigned_account r, adhoc.temp_presc_n
um_TEST t, retail.prescrip_retail partition (PRESC200705) p, sherlock.sherlock_p
roduct_mapping spm where spm.product_id like '056%' and spm.mds6 = p.product_id
and t.CLIENT_ID = p.presc_num and r.pfizer_account_id = p.payer_plan and t.best_
call_state = r.ST group by  p.presc_num, spm.product_id, p.month, t.best_call_st
ate
         0             0               0           0          0           0
             0


Elapsed: 00:00:01.05
0
Comment
Question by:gram77
  • 2
3 Comments
 
LVL 27

Expert Comment

by:sujith80
ID: 20114366
See the output of this query.

SELECT b.osuser, b.program, rows_processed,  a.first_load_time, sql_text,a.MODULE, sid, serial#
FROM v$sqlarea a , v$session b
WHERE a.address=b.SQL_ADDRESS
and a.SQL_TEXT like upper('%<first part of your query>%')
/
0
 

Author Comment

by:gram77
ID: 20114395
the output of your query is "no rows selected"
0
 
LVL 27

Accepted Solution

by:
sujith80 earned 2000 total points
ID: 20114430
change other parameters in the where clause like osuser/software to see what is running in the background. This query will tell you the completion status of your actual query.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Suggested Courses
Course of the Month11 days, 4 hours left to enroll

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question