Solved

run the top resource consuming query

Posted on 2014-04-04
2
344 Views
Last Modified: 2014-04-07
SQL> select sql_text,
  2   username,
  3   disk_reads_per_exec,
  4   buffer_gets,
  5   disk_reads,
  6   parse_calls,
  7   sorts,
  8   executions,
  9   rows_processed,
 10   hit_ratio,
 11   first_load_time,
 12   sharable_mem,
 13   persistent_mem,
 14   runtime_mem,
 15   cpu_time,
 16   elapsed_time,
 17   address,
 18   hash_value
 19   from
 20   (select sql_text ,
 b.username ,
 round((a.disk_reads/decode(a.executions,0,1,
 a.executions)),2)
 21   22   23   24   disk_reads_per_exec,
 25   a.disk_reads ,
 26   a.buffer_gets ,
 27   a.parse_calls ,
 28   a.sorts ,
 29   a.executions ,
 30   a.rows_processed ,
 31   100 – round(100 *
 32   a.disk_reads/greatest(a.buffer_gets,1),2) hit_ratio,
 33   a.first_load_time ,
 34   sharable_mem ,
 35   persistent_mem ,
 36   runtime_mem,
 37   cpu_time,
 38   elapsed_time,
 39   address,
 40   hash_value
 41   from
 42   sys.v_$sqlarea a,
 43   sys.all_users b
 44   where
 a.parsing_user_id=b.user_id and
 45   46   b.username not in (‘sys’,'system’)
 47   order by 3 desc)
 48   where rownum < 11
 49   /
ERROR:
ORA-01756: quoted string not properly terminated

What can be the error
0
Comment
Question by:tonydba
2 Comments
 
LVL 34

Accepted Solution

by:
johnsone earned 500 total points
ID: 39978279
It appears that on this line:

b.username not in (‘sys’,'system’)

You have smartquotes.  Those are special characters and not actually quote characters.   The line should be:

b.username not in ('sys','system')
0
 

Author Closing Comment

by:tonydba
ID: 39984584
Thank you..
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

759 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now