Last queries' execution stats.
--- a/oracle.rst Sat Feb 10 00:25:27 2018 +0200
+++ b/oracle.rst Sat Feb 10 00:55:50 2018 +0200
@@ -316,10 +316,14 @@
grant CREATE PROCEDURE, CREATE TRIGGER to BOB;
grant CREATE TABLE, CREATE SEQUENCE, CREATE VIEW, CREATE SYNONYM to BOB;
-Profiling.
-==========
+Profiling
+=========
-Timing info about last queries::
+Last queries' execution stats are available through ``v$sql`` view::
+
+ grant select on v_$sql to BOB;
+
+ select * from v$sql;
select LAST_LOAD_TIME, ELAPSED_TIME, MODULE, SQL_TEXT elasped from v$sql
order by LAST_LOAD_TIME desc
@@ -340,7 +344,7 @@
order by LAST_LOAD_TIME desc
) where ROWNUM <= 5;
-In SQL/Plus::
+In SQL/Plus query execution time (up to )::
SET TIMING ON;
-- do stuff
@@ -369,6 +373,13 @@
explain plan for ... SQL statement ...;
select time from plan_table where id = 0;
+.. note::
+ From docs:
+
+ PLAN_TABLE is automatically created as a global temporary table to hold the output of an EXPLAIN
+ PLAN statement for all users. PLAN_TABLE is the default sample output table into which the
+ EXPLAIN PLAN statement inserts rows describing execution plans.
+
See:
http://docs.oracle.com/cd/B19306_01/server.102/b14237/dynviews_2113.htm
@@ -452,3 +463,7 @@
show errors;
+Modify output format::
+
+ set pagesize 40;
+ set linesize 400;