Monitor the Performance of Oracle Parallel
Server
The following is a handy script for capturing DLM performance in
an OPS environment. It then places the output inside an Oracle
table for tracking. This script includes a sophisticated use
of the UNIX date function.
This script checks the OPS values for locks, resources and
processes using the UNIX Oracle lkdump command. Once these
values have been collected, they are directed to the $RPT_FILE UNIX
directory. They are also written to the STATSPACK extension
table stats$dlm_stats.
DAY_OF_WEEK=`date
+"%A"`
MACHINE_NAME=`hostname`
RPT_FILE=/u01/MYSID/reports/dlm_monitor.${MACHINE_NAME}.${DAY_OF_WEEK}.log
# \
#
Set up the file to log the lock to:
# /
TIMESTAMP=`date
+"%C%y.%m.%d-%H:%M:%S"`
DLM_RESOURCES=`/oracle/MYSID/bin/lkdump
-a res | head -2 | awk 'getline'`
DLM_LOCKS=`/oracle/MYSID/bin/lkdump -a lock | head -2 | awk
'getline' `
DLM_PROCESS=`/oracle/MYSID/bin/lkdump -a proc | head
-2 | awk 'getline'`
printf "$TIMESTAMP $DLM_RESOURCES
$DLM_LOCKS $DLM_PROCESS \n" >>
RPT_FILE
RES=`echo
$DLM_RESOURCES|cut -f2 -d '='`
LOC=`echo $DLM_LOCKS|cut -f2 -d
'='`
PRO=`echo $DLM_PROCESS|cut -f2 -d '='`
ORACLE_SID=MYSID;
export ORACLE_SID;
PATH=$PATH:/oracle/MYSID/bin; export PATH;
ORACLE_HOME=/oracle/MYSID; export ORACLE_HOME;
$ORACLE_HOME/bin/sqlplus
<<! >> /dev/null
connect system/manager;
insert into
perfstat.stats$dlm_stats
values (
SYSDATE,
$PRO,
$RES,
$LOC );
exit;
!
|
|
|
|
Guarantee your Success!
Oracle is the
world's most complex, robust and flexible database, considered
impossible to master without a mentor.
That's why all BC
Oracle trainers are working professionals, experts in Oracle who
share their tips and secrets. |
|
| |
|
Burleson is the American Team

Note:
This Oracle
documentation was created as a support and Oracle training reference for use by our
DBA performance tuning consulting professionals.
Feel free to ask questions on our
Oracle forum.
Verify
experience!
Anyone
considering using the services of an Oracle support expert should
independently investigate their credentials and experience, and not rely on
advertisements and self-proclaimed expertise. All legitimate Oracle experts
publish
their Oracle
qualifications.
Errata?
Oracle technology is changing and we
strive to update our BC Oracle support information. If you find an error
or have a suggestion for improving our content, we would appreciate your
feedback. Just
e-mail:
and include the URL for the page.
Copyright ? 1996 - 2012
All rights reserved.
Oracle ?
is the registered trademark of Oracle Corporation.
|
|