Solved

run the top resource consuming query

Posted on 2014-04-04
2
362 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

738 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