top statistics plugins for wordpress
top social plugins for wordpress
Tracefile analyzer tools: http://ba6.us/node/177 My notes on how to trace: https://sites.google.com/site/oraclemonitor/tracing Tom Kyte's Show Space Notes for JDBC connections over firewalls ORA-600 decoder ring
Wait Events
My favorite ASH query is aveactn.sql which shows the load on the database graphically like the performance page in OEM but the output is in ASCII. Here is a blog entry on an improved version ASH queries at Github SQL Execution times from ASH
OEM Performance page in ascii art MOATS.sql has some ASH collection as well
S-ASH is a plsql package that collects v$active_session_history on Oracle 7-11 and versions such as Standard Edition and best of all it runs without an additional Oracle licenses. ASHMONActive Session History can be difficult to browse and mine for data, but with graphics it becomes easy. ASHMON is a graphical program that reads ASH data (or SASH data) and visualizes it. ASHMON also reads data from v$sysstat and v$system_event and visualizes it. ASHMON is written by me and only reads ASH from the databsase but can use S-ASH. For tools that both collect and read ASH check out ASHVIEWER and LAB128. LAB128 is pay for but does more than just collect ASH and ASHViewer is free but only collects ASH and or views already collect ASH data. AWR diff'erI often have to compare to AWR reports and it can be time consuming, thus I wrote a script that will compare the data called udf.sh (the u stands for u in utlbstat/utlestat !) One problem though is AWR reports in HTML. My scripts are for TEXT. In the case of HTML I use http://www.nirsoft.net/utils/htmlastext.html to convert them to TEXT. SGA Direct Memory AttachI haven't worked on SGA access stuff in several years but it's one of those subjects that seems to fascinate people. For a good introduction, read Oracle Insights, Tales from the Oaktable. I wrote chapter 6 on how I got started working on SGA attach and how to get started yourself. statspack shell scriptBefore AWR came along, I disliked useing statspack and creating tables and inserting data into my monitored database, so I wrote a script that collected the data I want into flatfiles. That script is called "collect.sh" These scripts were originally hosted at http://oraperf.sourceforge.net/seminar/collect.html I dug up this script recently to do some monitoring and it's a work in progress: https://sites.google.com/site/oraclemonitor/collect-sh-system Mon.shThe script mon.sh is a shell script to provide a screen view of Oracle statistics like "top." I last touch this code about12 years ago, but it still seems like a good idea. ASH Report@?/rdbms/admin/ashrpt or
There are two ways to get AWR reports. The easiest is to connect with sqlplus as sys or system and run ?/rdbms/admin/awrrpt.sql :
The script will prompt you for input. Choose "TEXT" report - it's easier to parse with udf.sh. (Clive Bostock also has a AWR to CSV converter based on text format). If you won't be parsing AWR reports then the HTML version is easier to read and navigate. The awrrpt.sql will also prompt for the time period to cover. The time period could be a full day or if there are particular hours that have typical workload, then an hour report would be good. The constraint here is that the script "?/rdbms/admin/awrrpt.sql" is on the database machine. If you are not on the database machine and are connecting with SQL*Plus over SQL*Net, then you can run
The trick here is that you have to know the snapshot ids, which in this example are 124 and 125. To find out snapshot ids you can query
Check out the AWR formatter plugin for Chrome: http://tylermuth.wordpress.com/2011/04/20/awr-formatter/ AWR Diff'er
Set long 100000
select dbms_advisor.get_task_report(task_name)
from dba_advisor_tasks
where task_id = (
select max(t.task_id)
from dba_advisor_tasks t,
dba_advisor_log l
where t.task_id = l.task_id and
l.status = 'COMPLETED' and
l.execution_end < sysdate - 2/24 and -- time period
t.advisor_name = 'ADDM');
Autotrace
@?/rdbms/admin/utlxplan.sql -- run as system creates plustrace @?/sqlplus/admin/plustrce.sql grant plustrace to [user] set autotrace off set autotrace on -- explain and statistics set autotrace traceonly -- runs query, shows explain and stats but doesn't print query results set autotrace on explain set autotrace on statistics set autotrace traceonly explain -- doesn't run the query set autotrace traceonly statistics -- runs query but no results shown
NOTE: oradebug uses ospid (setospid) or pid (setorapid) which come from v$process More on 10046 http://www.dicka.eclipse.co.uk/oracle_trace_event_10046_notes.htm
Rather than using oradebug, you can use DBMS_MONITOR
DBMS_MONITOR can use client_id, but client_id has to be turned on and TRCSESS has to be use extract trace information from multiple trace files
On logon trigger can be use to trace a session from the beginning
Here is a process to trace the Oracle batch from a second process so the trace can be started and stopped without interfering with the batch, In the batch session, run SELECT sys_context('USERENV', 'SID') FROM DUAL; to get the sessions SID. After that the batch can be kicked off. In a second session as sysdba, run select
p.spid ospid -- oradebug setospid
from v$process p, v$session s
where s.sid = &1
and p.addr = s.paddr
/
inputting the sessions SID.
Now, with this return value of OSPID, tracing can be set on and off from another process:
oradebug setospid [ospid] oradebug unlimit oradebug event 10046 trace name context forever, level 12; -- let batch run for a while oradebug event 10046 trace name context off; oradebug tracefile_name after tracing try 10046.pl to parse the file Flushing buffer cache
needs level 6 snapshot statspack
NOTE: because ASH samples, these I/O sizes are skewed towards the larger end but that is not so bad as often I want to know what the largest read I/O sizes are. The skew is much more of a problem for timings, but for IO sizes this can be good information. The above query on I/O sizes is useful. The below query on I/O times is of questionable use (though I include it here as I have used it)
use /* + gather_plan_statistics */ hint go gather statistics and use ALLSTATS as last parameter
extracting bind variables is something I've meant to look into but not spent much time. See http://jonathanlewis.wordpress.com/2008/07/24/bind-capture/
alter session set events 'sql_trace [sql_id]'; --or alter session set events 'sql_trace [sql_id|sql_id]'; --example alter session set events 'sql_trace [707wu2umpfas7],wait=true,bind=true'; -- run query alter session set events 'sql_trace [707wu2umpfas7]'off;Rollback of a killed process see http://www.oracle-base.com/dba/Script.php?category=monitoring&file=session_undo.sql watch used_urec
see: ezconnect CONNECT username/password@[//]host[:port][/service_name] or long form sqlplus dbUser/dbPassword@'(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=remoteServer)(PORT=1521)))(CONNECT_DATA=(SID=dbSid)))' Tracking specific SQL in AWR (coloring SQL)exec dbms_workload_repository.add_colored_sql( sql_id ); see http://oracleprof.blogspot.com/2011/06/how-to-color-mark-sql-for-awr-snapshots.html Generating Dummy dataidea from Dion Cho
rman target / allocate channel for maintenance type disk; delete force noprompt copy of archivelog all completed before 'sysdate'; SQLPLUS / as sysdba archive log stop; archive log start; archive log all; for safer approach see: http://oracle-magician.blogspot.com/2011/11/how-to-fix-archive-stuck-error-with.html Oracle Inventory
Flashback query vs Total recal
create database link "SASHREPO" CONNECT TO "SASH" IDENTIFIED BY "SASH" USING '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=REPO_HOST)(PORT=1521)))(CONNECT_DATA=(SID=REPO_SID)))' / Documentation on v$ and DBA views:
XMLDB : http://www.idevelopment.info/data/Oracle/DBA_tips/xmldb/XMLDB_2.shtml dispatchers='(PROTOCOL=TCP) (SERVICE=<ORACLE_SID>XDB)'Jobs http://it.toolbox.com/blogs/database-solutions/killing-the-oracle-dbms_job-6498 |