Oracle SQL*Plus scripts
ash_xplan.sql
1 file(s) 20.68 KB
ash_xplan_output.txt
1 file(s) 54.80 KB
awr_evtrends.sql
1 file(s) 17.47 KB
awr_parm_changes.sql
1 file(s) 2.56 KB
awr_stattrends.sql
1 file(s) 5.44 KB
betwixt.sql
1 file(s) 2.20 KB
cbo_stats.sql
1 file(s) 7.46 KB
chk_obj_recompile.sql
1 file(s) 5.12 KB
dba_column_usage.sql
1 file(s) 3.14 KB
estimate_mttr.sql
1 file(s) 14.20 KB
exchpart.sql
1 file(s) 28.69 KB
gen_analyze_dd.sql
1 file(s) 1.86 KB
gen_rebuild_idx.sql
1 file(s) 1.38 KB
gen_recompile.sql
1 file(s) 1.48 KB
infinite_dual.sql
1 file(s) 1.71 KB
nondefparm.sql
1 file(s) 1.58 KB
rman_chk_catalog.sql
1 file(s) 12.96 KB
rman_chk_nocatalog.sql
1 file(s) 9.06 KB
rman_chk_test.sql
1 file(s) 0.73 KB
run_top_stmt5.sql
1 file(s) 1.39 KB
sqlhistory.sql
1 file(s) 8.87 KB
stdby_stats.sql
1 file(s) 10.56 KB
top_stmt5_10g.sql
1 file(s) 15.08 KB
tracetrg.sql
1 file(s) 1.57 KB
unparm.sql
1 file(s) 1.58 KB
wasted_spc.sql
1 file(s) 14.93 KB
who_is_using.sql
1 file(s) 3.00 KB
UNIX/Linux Shell scripts
fileprobe.sh
1 file(s) 22.68 KB
oraprobe.sh
1 file(s) 11.20 KB
rman_chk.sh
1 file(s) 9.92 KB
run_awr.sh
1 file(s) 11.87 KB
stdby_applylogs.sh
1 file(s) 8.55 KB
stdby_chk.sh
1 file(s) 9.47 KB
stdby_init.sh
1 file(s) 14.99 KB
stdby_ship.sh
1 file(s) 12.35 KB
tnsprobe.sh
1 file(s) 6.73 KB
DUMP_DATA package for dump to CSV
dump_data.sql
1 file(s) 12.12 KB
Hey Tim –
How are you doing? Long time. Hope all is well with you and family!
Glad to see your new site… miss the scripts I “borrow” from the site and looking forward to seeing them again! I am looking for the top 10 queries script you used to have for 11gr2. O’well dealing with a company with 2 node RAC with constant Cluster Reconfiguration… and yikes things take longer all the time so looking to identify and start tuning the top queries. Looking forward to your RMOUG 2013 presentations.
Regards,
Ravi
Ravi, Good to hear from you! Sorry my papers and scripts are off-line at the moment — I’m just doing a million things at once right now, including learning more about WordPress. I’ll try have the papers and scripts posted in a media-gallery widget over the next 2 weeks.
More soon…
About time you upgraded 🙂
I agree. Thanks Vie!
TIM, EXCELLENT POST ….. YOUR SCRIPTS ARE VERY USEFULL TO LEARN AND TO RESEARCH IN MY JOB.
I’M FROM ARGENTINA
BEST REGARDS AND THANKS A LOT!
NICOLAS
Hi,
Very informative and helpful scripts you have posted here.
I am looking for trigger referred in a post (http://www.evdbt.com/trclvl12.ddl) which is helpful to find the column name in case of ora-01438, but not able to find it. Can you please share it.
looking forward to hear from you soon.
Regards,
Sahir Nadeem
Sorry for breaking the link; I switched over from my old HTML-based website to the present one powered by WordPress back in November, and I’m slowly getting the new website re-constituted with all the stuff that was on the old. You should find the TRCLVL12 script available for download on this page now.
Thanks!!!
Perhaps it is too much to ask, but would be nice to have the scripts in one zip file 🙂
Hi Ravi,
Good collection of scripts !!! I have not gone through all but few of them. Wants to know do you have any script or data for statistics ? or else if you can guide me about what is the optimal way to look for statistics then good for me.
Thanks, Sonia
Sonia,
There is my bare-bones “cbo_stats.sql” script posted here, but if you want the complete picture on statistics used by and relevant for a specific SQL statement, look toward SQLT by Carlos Sierra of Oracle and available for download from http://support.oracle.com.
Hope this helps…
-Tim
Hi Tim,
Thanks for your reply. From your reply I try to find on metalink but did not find “cbo_Stat.sql” in their search tool. can you guide me with link?
Thanks again.
Sonia
Sonia,
“cbo_stats.sql” is my script, available on this page. SQLT (or SQLTXPLAIN) is a package available from Oracle Support on their website.
Sorry for the confusion…
-Tim
Hi Tim,
no issues. Thanks again. will try to understand and implement your script in my test database.
Hi!
Could you please add the sphistory.sql script? In the comments of sqlhistory.sql the script is mentioned.
The AWR script has been really useful for me!
-Jari
Jari,
Posted. Thanks!
-Tim
Hi Tim,
I am also looking for the sphistory.sql file, but I couldn’t find it. Can you please share the URL as I couldn’t find it in http://evdbt.com/scripts/.
Thanks.
Kwok
Hello Tim
Thank you for sharing useful scripts. I downloaded ash_xplan.sql and installed it successfully but i can’t get it working. Can you please help?
linux7-0vbox:SYS@GENP> select * from table(ash_xplan.display_cursor(‘3c1kubcdjnppq’,0,’TYPICAL’));
ERROR:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at “SYS.ASH_XPLAN”, line 17
ORA-06512: at “SYS.ASH_XPLAN”, line 375
ORA-06512: at line 1
no rows selected
————–
the sql_id exists in gv$active_session_history below is from plan_table_output
PLAN_TABLE_OUTPUT
————————————————————————————————————————————————————————————————————————————————————————————————————
SQL_ID 3c1kubcdjnppq, child number 0
————————————-
update sys.col_usage$ set equality_preds = equality_preds +
decode(bitand(:flag,1),0,0,1), equijoin_preds = equijoin_preds
+ decode(bitand(:flag,2),0,0,1), nonequijoin_preds =
nonequijoin_preds + decode(bitand(:flag,4),0,0,1), range_preds
= range_preds + decode(bitand(:flag,8),0,0,1), like_preds
= like_preds + decode(bitand(:flag,16),0,0,1), null_preds
= null_preds + decode(bitand(:flag,32),0,0,1), timestamp =
:time where obj# = :objn and intcol# = :coln
Plan hash value: 477378112
———————————————————————————–
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
———————————————————————————–
| 0 | UPDATE STATEMENT | | | | 1 (100)| |
| 1 | UPDATE | COL_USAGE$ | | | | |
|* 2 | INDEX UNIQUE SCAN| I_COL_USAGE$ | 1 | 30 | 1 (0)| 00:00:01 |
———————————————————————————–
Predicate Information (identified by operation id):
—————————————————
2 – access(“OBJ#”=:OBJN AND “INTCOL#”=:COLN)
Thank you.
Hi Tim
Thank you for sharing the useful scripts. I donwloaded ash_xplan.sql and successfully installed. However, I can’t get it working as expected. Below is the errors reported
linux7-0vbox:SYS@GENP> select * from table(ash_xplan.display_cursor(‘3c1kubcdjnppq’,0,’TYPICAL’));
ERROR:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at “SYS.ASH_XPLAN”, line 17
ORA-06512: at “SYS.ASH_XPLAN”, line 375
ORA-06512: at line 1
no rows selected
—–
The sql_id existed.
PLAN_TABLE_OUTPUT
————————————————————————————————————————————————————————————————————————————————————————————————————
SQL_ID 3c1kubcdjnppq, child number 0
————————————-
update sys.col_usage$ set equality_preds = equality_preds +
decode(bitand(:flag,1),0,0,1), equijoin_preds = equijoin_preds
+ decode(bitand(:flag,2),0,0,1), nonequijoin_preds =
nonequijoin_preds + decode(bitand(:flag,4),0,0,1), range_preds
= range_preds + decode(bitand(:flag,8),0,0,1), like_preds
= like_preds + decode(bitand(:flag,16),0,0,1), null_preds
= null_preds + decode(bitand(:flag,32),0,0,1), timestamp =
:time where obj# = :objn and intcol# = :coln
Plan hash value: 477378112
———————————————————————————–
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
———————————————————————————–
| 0 | UPDATE STATEMENT | | | | 1 (100)| |
| 1 | UPDATE | COL_USAGE$ | | | | |
|* 2 | INDEX UNIQUE SCAN| I_COL_USAGE$ | 1 | 30 | 1 (0)| 00:00:01 |
———————————————————————————–
Predicate Information (identified by operation id):
—————————————————
2 – access(“OBJ#”=:OBJN AND “INTCOL#”=:COLN)