Skip to content

Commit

Permalink
added ashmaster INDEX file
Browse files Browse the repository at this point in the history
  • Loading branch information
jkstill committed Jul 16, 2015
1 parent c29397d commit 1654640
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 0 deletions.
25 changes: 25 additions & 0 deletions INDEX.ashmasters
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ASH Masters http://ashmasters.com:

@setup.sql: calls other setup scripts
@set_dbid.sql: get current dbid into variables for other scripts
@set_date_format.sql: set the date format used for to_char(date)
@ash_bbw.sql: buffer busy wait analysis
@ash_enq.sql: enqueue wait analays
@ash_graph.sql: basic ASH load chart in ASCII art more for demo purposes
@ash_graph_waits.sql: basic ASH load chart in ASCII art with top 2 waits per bucket
@ash_graph_waits_histash.sql: ASH load chart from DBA_HIST_ACTIVE_SESS_HISTORY only
@ash_graph_histash_by_dbid.sql: ASH load chart from DBA_HIST_ACTIVE_SESS_HISTORY only, input DBID
@ash_graph_histash_by_dbid_program.sql: ASH load chart from DBA_HIST_ACTIVE_SESS_HISTORY only, input DBID and PROGRAM
@ash_graph_histash_by_dbid_sqlid.sql: ASH load chart from DBA_HIST_ACTIVE_SESS_HISTORY only, input DBID and a SQL_ID
@ash_io_sizes.sql: I/O sizes from ASH
@ash_sql_elapsed.sql: use ASH to find longest running SQL
@ash_sql_elapsed_hist.sql: use ASH to find longest running SQL, give histogram of execution times
@ash_sql_elapsed_hist_longestid.sql: use ASH to find longest running SQL, give histogram of execution times and execution id of longest running query
@ash_top_procedure.sql: top procedures and who they call
@ash_top_session.sql: top SESSION from ASH ordered by time broke into wait, I/O and CPU time
@ash_top_sql.sql: top SQL from ASH ordered by time broke into wait, I/O and CPU time
@ash_top_sql_w_top_obj.sql: top SQL from ASH ordered by time broke into wait, I/O and CPU time, include top object for I/O waits
@latency_eventmetric.sql: wait event latency from V$EVENTMETRIC, ie last 60 seconds
@latency_system_event.sql: wait event latency from DBA_HIST_SYSTEM_EVENT
@latency_waitclassmetric.sql: User I/O latency from V$WAITCLASSMETRIC, ie over last 60 seconds

79 changes: 79 additions & 0 deletions distribution.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
:

SQLDIR=/home/jkstill/oracle/admin/sql
TARFILE=~/ftp/sql_scripts_t12.tar
ZIPFILE=~/ftp/sql_scripts_t12_windows.zip

rm -f ${TARFILE}.gz

FILES=$(grep ^@ INDEX*| cut -f2 -d@ | cut -f1 -d:)

cd $SQLDIR

# maintain symlinks as needed

for f in $(grep ^@ INDEX.ashmasters| cut -f2 -d@ | cut -f1 -d:)
do
ln -s ../ashmasters/ashmasters/$f . 2>/dev/null
done

# get current version of snapper from Tanel Poder
wget http://blog.tanelpoder.com/files/scripts/snapper.sql
wget http://blog.tanelpoder.com/files/scripts/snapper4.sql
# remove old backup copies of snapper that were created by wget - keep one available
rm -f snapper.sql.[2-9]
rm -f snapper4.sql.[2-9]

# h dereferences symbolic links and gets the file instead of the link
tar chvf $TARFILE INDEX* $FILES
gzip $TARFILE

echo
TARFILE=${TARFILE}.gz
echo created ${TARFILE}
echo

TMPDIR=/tmp/sqldist.$$
mkdir $TMPDIR
cd $TMPDIR || {
echo Could not chdir to $TMPDIR
exit 1
}

tar xvfz $TARFILE

unix2dos *.sql
unix2dos INDEX
zip $ZIPFILE INDEX *.sql

rm -f $TMPDIR/INDEX*
rm -f $TMPDIR/*.sql
rm -f $TMPDIR/distribution.sh
cd
rmdir $TMPDIR

dropboxDir=/home/jkstill/Dropbox/Public/oracle/SQL-Library

echo
echo Copying files to Dropbox - $dropboxDir
echo Make sure Dropbox is running
echo Start as jkstill with 'nohup ~/.dropbox-dist/dropboxd &'
echo

[ -d "$dropboxDir" ] || {
echo
echo Cannot copy to dropbox - please start the dropbox daemon
echo
echo eg. ~/.dropbox-dist/dropboxd
echo
exit 1
}

cp $TARFILE $dropboxDir
cp $ZIPFILE $dropboxDir

echo Files:
echo " $TARFILE"
echo " $ZIPFILE"


0 comments on commit 1654640

Please sign in to comment.