A lot of people have asked me whether there’s some sort of index or “table of contents” of my TPT scripts (there’s over 500 scripts in the tpt_public.zip file – http://tech.e2sn.com/oracle-scripts-and-tools )
I have planned to create such index for years, but never got to it. I probably never will :) So a good way to extract the descriptions of some scripts is this (run the command in the directory where you extracted my scripts to):
Note: the single and double-quotes may get messed up when the browser tries to be smart and replace them with nicer looking characters (which Unix doesn’t recognize then). When copying & pasting this command, make sure that the single & double-quotes are the regular ones Unix shell can accept):





That’s a perfect index !
and hence indextype grep-and-awk is sometimes superior than indextype CTXSYS.CONTEXT
a great work
Great job Tanel,
i’ve downloaded your scripts, i’m a great fan for ASH :-) and in your script asqlmon.sql there are sql_plan_line_id, sql_plan_operation, sql_plan_options columns but i think are only for 11G rel because i’ve a 10G and this script doesn’t work because in the v$active_session_history these columns don’t exist :-(…
@Alberto
Yes, this always-enabled plan line level monitoring in ASH is available since 11g only. The server processes need to “notify” the SGA about in which exec plan step the execution is, so that the ASH – MMNL process could read it. It can’t read other processes memory directly, so this info must be in SGA. And this SGA “notification” feature was introduced in 11g.
In 10g (and 9.2) the alternative is to selectively enable statistics_level = all for monitored sessions or add gather_plan_statistics hint to some queries. However this makes the query considerably slower (and consume more CPU due to extra instrumentation and timestamp syscalls) so you only should enable this for duration of your troubleshooting and to as few sessions as possible.
@Tanel Poder
Great explanation Tanel,
thanks a lot.
@Tanel Poder
Hi Tanel,
for check my sessions in 10G in real time like as ASH I’ve written this statement:
select V$SQL_PLAN.child_number,
V$SQL_PLAN.OPERATION,OBJECT_NAME,OPTIONS,
CARDINALITY as ROWS_,(bytes)/1024 as KByte,
COST,(V$SQL_PLAN.TIME) as TIME_SEC,
CPU_COST,io_cost,V$SQL_PLAN.PLAN_HASH_VALUE,
sid,serial#,status,osuser,machine, terminal, program,sql_text,executions,first_load_time,
COMMAND_TYPE,state,OPTIMIZER_MODE,OPTIMIZER_COST, event,buffer_gets,
logon_time, blocking_session_status
from v$session,v$sql,V$SQL_PLAN
where v$sql.sql_id = V$session.sql_id
and v$sql.CHILD_NUMBER=v$session.sql_child_number
and V$SQL_PLAN.SQL_ID = V$SQL.SQL_ID
order by SID;
Hi Tanel,
A great explanation panel at all. Like a reference book .