Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

run the top resource consuming query

Posted on 2014-04-04
2
Medium Priority
?
365 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 2000 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
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.  …
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

618 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