How much space is used in the query


/*To see the query*/



SELECT /*+ ORDERED */ v.osuser,
         v.schemaname,
            Substr(Rpad(s.sql_text,64),1,64) sqltxt
FROM gv$session v,
             gv$sqltext_with_newlines s
WHERE --v.osuser = 'aates'
              s.address = v.sql_address
              AND s.hash_value = v.sql_hash_value
ORDER BY piece


/*How much space is used in the query*/



SELECT *
           FROM (SELECT Substr(a.sql_text,1,50) sql_text,
            Trunc(a.disk_reads / Decode(a.executions,0,1,a.executions)) reads_per_execution,
       a.buffer_gets,
       a.disk_reads,
       a.executions,
       a.sorts,
       a.address
       FROM gv$sqlarea a
               ORDER BY 2 DESC)
               WHERE ROWNUM <= 10;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: