Oracle Performance Monitoring Basic
Lately few people have been requesting me to share something on Tuning Concepts . Basically we might know 100 of things but we must smartly know when to use them . Though i am still to explore more.. but it will surely help mid level dba's
I always prefer to OEM for everything .. It can be used for lot things we even think of .
If we talk about tuning . we can use OEM for checking concurrency , generating reports , checking fragmentation , ruing segment advisory, checking session details and its wait , historical performance etc.
Also its just lat year i realized the importance of using past performance .
If i have time i will share some of my important sql to share how to check, but in this topic let me share what needs to be checked and what should be your target areas
Its very crucial for us have all our scripts really handy . Have seen many Dba dying to search proper
script to monitor the very last moment .
Here are area where one should looks for as first steps. It depends whether you are targeting to
diagnose one session or whole database performance :
-- wait event , blocking , multiple plan hash value, check alert logs, check for recent generated trace files in dump area, last analyzed , stale stats ,
fragmentation of table and index , check sql plan for fts , check if table was initially analyzed that caused performance change , ofcource from O/S check resource utilization , O/S error logs, V$resource_limit ,
check if any backups are running hampering performance , check if any smon recovery / rollback is happening , check for hit ratios, check if session i/o is changing , session last et call , check for parallel
operations and long opps , check database temp and undo utilization - check highest consumer ,
check archive generation rate , ask application guys if any changes went in , check listener log ,
check defunct process on o/s , check sqlid historical excution : many time application guys just fool with you calming sql was running fine ,but it never did.. so check for historical sql performance using dba_hist_sqlstat , try generating session trace
-- check for database report... there are lot of reports which 90% dba dont even know of ..
ideally people just check awr report... but i prefer ash report.. specially ashrpti.sql .. to concentrate on one session or sqlid . some of reports that can help you are,, ash , ashrpti ,, awr sql report, awr compare report, addm , awr/statspack , sqldiag report-- check on metalink ,
When it comes for recommendation and fixes
-- if case of multiple plan: try creating profiles and baselines , gathering stats , creating missing index ,
sga recommendation based on hit ratios, flushing shared pool, purging sqlid , restoring old stats -- from 10g , try invalidating cursor ,
In case of Rac :
For checks :
-- check resource status , check cluster alert log, deamon logs , ocr and voting disk status , service status , check deamons status , check asm logs , o/s logs ,
1) CRS HOME :
CRS ALERT LOG : log/<hostname>/alert<nodename>.log
CRS logs :
log/<hostname>/crsd/ ---
> archived every 10mb
CSS logs : log/<hostname>/cssd/ -- > archived every 20mb
EVM logs : log/<hostname>/evmd+evm/log
OPMN logs – opmn/logs
resource specific logs –
log/<hostname>/racg/
cluster communication logs : log
2) ORACLE_home :
resource specific logs : log/<hostname>/racg
srvm logs --
log/<hostname>/client
alert and other trace files : bdump/cdump/udump
AWR/ statspack/ ash/ addm of each node
listener logs
.
3) ASM_logs :
alert logs and other trace files : oracle_home/rdbms/log/ bdump/udump/cdump
4) /etc/oracle/oprocd/ (node eviction)
*** Oprocd log locations:
In /etc/oracle/oprocd or /var/opt/oracle/oprocd depending on
version/platform.
Note that oprocd only runs when no vendor clusterware is
running or on Linux > 10.2.0.4
1) SRVM tracing : We enable srvm tracing by giving “ export
SRVM_TRACE=TRUE ” . By doing so we enable tracing for srvctl,cvu
,VIPCA and gsdctl .
srvctl config
srvpool
2) Debugging the resource as root user :
crsctl debug log module_name component:debugging_level
module_name = crs ,
css , evm
level = 1 to 5
component : “crsctl
lsmodules module_name”
3) Resource debugging : crsctl debug log res "ora.node1.vip:1"
4) ./crsctl get log css "all"
./crsctl set log css CSSD:4
5) To change amount
of ocr logging, edit the file
CRS_Home/srvm/admin/ocrlog.ini.
cluvfy -h
cluvfy stage -pre crsinst -n node_list
cluvfy stage -post crsinst -n node_list [-verbose]
cluvfy comp clu
cluvfy comp scan
-verbose
Cluvfy comp crs –n all –verbose
cluvfy comp ocr –n all (to verify ocr )
cluvfy comp ocr -n all -verbose
setenv MYNODES node1,node3,node5 ||
cluvfy comp nodecon -n $MYNODES [-verbose] ||
cluvfy comp nodecon -n node1,node2,node3 –i eth0 -verbose
cluvfy comp nodecon -n all -verbose
cluvfy comp nodecon -n rac1
STORAGE ::
cluvfy comp ssa -n
all -verbose ( to confirm if storage
is shared)
cluvfy comp ssa -n all
-s /dev/sda
cluvfy comp space -n
all -l /home/dbadmin/products –z 2G -verbose (to confirm free space . does not support
block or raw device)
cluvfy comp cfs -f /oradbshare –n all -verbose ( check intigrity of cluster filesystem )
. ./setSID_k +asm1
crs_stat | awk -F=
'/NAME=/{n=$2}/TYPE=/{t=$2}/TARGET=/{g=$2}/STATE=/{s=$2; printf("%-45s%-15s%-10s%-30s\n",
n,t,g,s)}'
crs_stat | awk -F=
'/NAME=/{n=$2}/TYPE=/{t=$2}/TARGET=/{g=$2}/STATE=/{s=$2;
printf("%-45s%-15s%-10s%-30s\n", n,t,g,s)}'
crs_stat -t –v
. $CRS_HOME/bin/crsstat
./crs_stat –t (status of all resources
) ( as oracle user)
. $CRS_HOME/bin/crsctl check crs ( to deamon
status ) ( as oracle user)
ps –ef | grep d.bin
./crsctl stop
crs ( to stop crs )
(with root user )
./crsctl
start crs ( to start crs) ( with root user )
crsctl start resource –all
crsctl stop has
crsctl start has
crsctl stop crs –f
crsctl enable
crs --> enable crs
on next startup
crsctl disable crs
It will disable crs from coming up after reboot (These
functions update the file /etc/oracle/scls_scr/node_name/root/crsstart that
contain the string enable or disable)
crsctl query crs softwareversion
crsctl query crs activeversion
crsctl check
daemon . (see infor of each
deamon )
crsctl stop cluster -all
crsctl check
cluster –all
crs_start ora.q-faykan.ons
crsctl stop resource
ora.QGISC.INS_WFC.QGISC2.srv
crsctl stop resource
ora.QGISC.QGISC_INS_FGEA.QGISC2.srv
crsctl stop resource
ora.QGISC.QGISC_INS_WFC.QGISC2.srv
crsctl stop resource
ora.QRDBC.DBR_SRVC.QRDBC2.srv
crsctl start resource
ora.QGISC.INS_WFC.QGISC2.srv
crsctl start resource
ora.QGISC.QGISC_INS_FGEA.QGISC2.srv
crsctl start resource
ora.QGISC.QGISC_INS_WFC.QGISC2.srv
crsctl start resource
ora.QRDBC.DBR_SRVC.QRDBC2.srv
export
ORACLE_SID=orcl1
ons debug (ons ip debuging)
olsnodes -s -t
/ olsnodes -n ( node information )
/runcluvfy.sh
stage -post crsinst -n node1,node2 -verbose
$ date; ssh q-feyd "date";ssh q-faykan
"date"
ps –fu oracle
--> to check resource started
by oracle
srvctl getenv database -d orcl
srvctl getenv instance -d orcl -i orcl1
Crs_getper
Crs_setperm
crs_profile
–print ( to see crs
profile .)
crsctl start
res -all
crsctl stop
resource ora.QRDBC.DBR_SRVC.QRDBC2.srv
crsctl stat
res -t -init
crsctl start
res ora.evmd -init
crsctl stop
res ora.evmd -init -f
crsctl modify
resource "ora.cssd" -attr "AUTO_START=1"
crsctl delete serverpool msinqprd -f
+QUEUE_IN_DATA/msinqprd/spfilemsinqprd.ora -n msinqprd -a
QUEUE_IN_DATA,QUEUE_IN_FLASHBACK
crsctl (check / start / stop ) cluster –all -- 11g
srvctl config network
srvctl
config nodeapps
srvctl modify database –dbname –y
automatic/manual (automatic start/stop
resource )
srvctl status database -d wwprd
srvctl status nodeapps -n wwprod3
srvctl status asm –n node_name
srvctl start
nodeapps -n green -4 ( starts ons, listener , gsd, vip )
srvctl start asm -n green –i asm1
srvctl start instance –d orcl –i orcl1
srvctl remove database -d databasename ( -f)
srvctl start database -d dctmdb
srvctl start listener -n node_name
srvctl stop database -d dctmdb -o immediate
srvctl start database -d dctmdb –i dctmdb1 –o mount
srvctl stop instance –d orcl –i orcl1
srvctl getenv database -d PBOKCC
srvctl setenv database -d PBOKCC -t
srvctl stop
asm -n green –i asm1 –o immediate
srvctl stop nodeapps -n green -4
srvctl remove instance -d DBM -i DBM8
srvctl remove database -d DBM
srvctl add database -d msinqprd -o /oracle/product/11.2.0/db
-p
srvctl add database -d BOSTON
–o /opt/oracle/product/10g_db_rac
srvctl add instance -d BOSTON
-i BOSTON1 -n boston_host1
srvctl add instance -d BOSTON
-i BOSTON2 -n boston_host2
srvctl add database -d tststby -o
srvctl add instance -d tststby -i tststby2 -n raclinux2
srvctl add instance -d tststby -i tststby1 -n raclinux1
srvctl add service -d tststby -s tststby_s -r tststby2 -a
tststby1
srvctl modify database -d tststby -p
’+DGDUP/spfiletststby.ora’
srvctl config database -d tststby
srvctl start instance -d orcl -i orcl1
srvctl status database –d ITDBSS
srvctl status service –d ITDBSS
srvctl status listener
srvctl status scan_listener
srvctl status scan
srvctl status nodeapps
srvctl remove/enable/disable/ asm -n node_name -i
instance_name
srvctl start asm -n node_nmae -i instance_name
srvctl stop diskgroup -g DATA
srvctl [*] diskgroup -n'
srvctl add database -d JIRAP2_sldn0833por -n JIRAP2 -o
/app/ora/local/product/11.2.0.2/db_1
srvctl disable database -d JIRAP2_sldn0833por
srvctl add listener -l LISTENER_JIRAP2 -o
/app/ora/local/product/11.2.0.2/db_1 -p TCP:1552 -s
srvctl disable listener -l LISTENER_JIRAP2
No comments:
Post a Comment