04 newfeatures
date post
06-Jun-2015Category
Documents
view
532download
11
Embed Size (px)
Transcript of 04 newfeatures
10g New Performance Features Metrics AWR ( DBA_HIST_ ) Time Model Wait Classes1. 2. 3. 4.
#.1
MiscV$sqlstats Wait improvements Client_id ServicesCopyright 2006 Kyle Hailey
#.2
9iv$sqlV$sql includes stats V$sesstat
Waits v$system_eventV$system_event V$session_wait V$session_event
v$sysstat
v$session
Copyright 2006 Kyle Hailey
#.3
10gSQL WaitsV$sql V$session
Stats
Sessions
Includes some waits nowCopyright 2006 Kyle Hailey
#.4
Metrics rates and calculationsDBA_HIST_SQLSTAT
SQL Metrics Stats
Waits
V$eventmetric V$waitclassm etric
SessionsV$sysmetric
V$sessmetric
Copyright 2006 Kyle Hailey
#.5
MetricsWhat inspired Metrics?Old
statistics were cumulative Old statistics lacked history a new 10g feature to make our lives easier
What is the IO on the system right now?Copyright 2006 Kyle Hailey
#.6
First Tedious StepSelect value from v$sysstat where name=physical reads; VALUE --------------1,533,787
Not much help Why? Let see
Copyright 2006 Kyle Hailey
#.7
This tells you NothingGOOD BAD
1,533,78730 minutes
IOs
30 minutes
time
timeCopyright 2006 Kyle Hailey
#.8
YOU Need to do MATH to find Out Take value at time A Take value at time B Delta = (B-A) or Rate = (B-A)/elapsed time
Copyright 2006 Kyle Hailey
Methods Oracle 6 Utlbstat.sql/Utlestat.sql Creates
#.9
tables, inserts, deletes
Oracle 8 introduced Statspack Improvement,
but needs to be set up and administered (by guess who)
Oracle 10 introduces Metrics (and AWR & OEM)
Copyright 2006 Kyle Hailey
#.10
Performance Metric DeltasKinds of Metric Tables 2. Metric current deltas 3. Metric History deltas over last hourCurrent DeltasV$EVENTMETRIC V$FILEMETRIC V$SESSMETRIC V$SERVICEMETRIC V$SYSMETRIC V$SYSMETRIC_SUMMARY V$WAITCLASSMETRIC
Values over last hourV$FILEMETRIC_HISTORY V$SYSMETRIC_HISTORY V$SERVICEMETRIC_HISTORY V$WAITCLASSMETRIC_HISTORY
Copyright 2006 Kyle Hailey
Metrics Collected at Pre-Set intervals 15
#.11
Current Value for Deltas Rates
second 60 second 10 minutes 30 minutes
per second per transaction
Ratios Percentages
dependability at your fingertipsCopyright 2006 Kyle Hailey
Metric TablesWait Events
#.12
V$EVENTMETRIC (60 secs ) V$WAITCLASSMETRIC (60 secs)
Statistics
V$SESSMETRIC (15 secs Deltas) V$SYSMETRIC (15 and 60 secs deltas)
Files
V$FILEMETRIC ( 10 minutes)
SQL (the secret is out) x$kkssqlsta (30 Minutes) not a metric cumulates values up to 30 minutes, then snapshots it to dba_hist_sqlstat
Copyright 2006 Kyle Hailey
Answer at your fingertipsGOOD BAD
#.13
3 IO/sec30 minutes
1,533,787
X
513 IO/sec
IOs
30 minutes
time
timeCopyright 2006 Kyle Hailey
#.14
Now Whats the IO?Select VALUE , METRIC_UNIT from v$sysmetric where metric_name='Physical Reads Per Sec; VALUE METRIC_UNIT INTSIZE_CSEC
---------- ----------------- -----------654.6736 Reads Per Second 5959 134.9835 Reads Per Second 1515 Avg IO per sec for the last 15 and 60 secsCopyright 2006 Kyle Hailey
#.15
v$sysmetricdesc v$sysmetric BEGIN_TIME END_TIME INTSIZE_CSEC interval value in 1/100sec GROUP_ID METRIC_ID METRIC_NAME VALUE METRIC_UNIT
Attention: metric_names are different from v$sysstatCopyright 2006 Kyle Hailey
v$sysmetric 15 SecsBuffer Cache Hit Ratio Memory Sorts Ratio Execute Without Parse Ratio Soft Parse Ratio Database CPU Time Ratio Library Cache Hit Ratio Shared Pool Free % Txns Per Logon Per Sec and Per Transaction Physical Reads Physical Writes Physical Reads Direct Redo Generated Logons User Calls Logical Reads Redo Writes Total Table Scans Full Index Scans DB Block Gets Consistent Read Gets DB Block Changes Consistent Read Changes Executions
#.16
Per Sec User Transaction Per Sec
Copyright 2006 Kyle Hailey
v$sysmetric 60 SecBuffer Cache Hit Ratio Memory Sorts Ratio Redo Allocation Hit Ratio User Commits Percentage User Rollbacks Percentage Cursor Cache Hit Ratio Rows Per Sort Execute Without Parse Ratio Soft Parse Ratio User Calls Ratio Global Cache Average CR Get Time Global Cache Average Current Get Time Global Cache Blocks Corrupted Global Cache Blocks Lost Current Logons Count Current Open Cursors Count User Limit % SQL Service Response Time Database Wait Time Ratio Database CPU Time Ratio Row Cache Hit Ratio Row Cache Miss Ratio Library Cache Hit Ratio Library Cache Miss Ratio Shared Pool Free % PGA Cache Hit % Process Limit % Session Limit % Txns Per Logon
#.17
Copyright 2006 Kyle Hailey
v$sysmetric 60 SecPer Second and Transaction Per Sec User Commits User Rollbacks User Transaction DBWR Checkpoints Background Checkpoints Network Traffic Volume Per Transaction Response TimePhysical Reads Physical Writes Physical Reads Direct Physical Writes Direct Physical Reads Direct Lobs Physical Writes Direct Lobs Redo Generated Logons Open Cursors User Calls Recursive Calls Logical Reads Redo Writes Long Table Scans Total Table Scans Full Index Scans Total Index Scans Total Parse Count Hard Parse Count Parse Failure CountCopyright 2006 Kyle Hailey
#.18
Disk Sort Enqueue Timeouts Enqueue Waits Enqueue Deadlocks Enqueue Requests DB Block Gets Consistent Read Gets DB Block Changes Consistent Read Changes CPU Usage CR Blocks Created CR Undo Records Applied User Rollback Undo Records Applied Leaf Node Splits Branch Node Splits PX downgraded 1 to 25% PX downgraded 25 to 50% PX downgraded 50 to 75% PX downgraded 75 to 99% .
#.19
v$sessmetricdesc v$sessmetricBEGIN_TIME END_TIME INTSIZE_CSEC SESSION_ID SESSION_SERIAL_NUM CPU PHYSICAL_READS PGA_MEMORY HARD_PARSES SOFT_PARSES PHYSICAL_READ_PCT LOGICAL_READ_PCTCopyright 2006 Kyle Hailey
Only 15 second Delta
#.20
Desc v$eventmetricSQL> desc v$eventmetric Name ---------------------------------BEGIN_TIME END_TIME INTSIZE_CSEC EVENT# EVENT_ID NUM_SESS_WAITING TIME_WAITED WAIT_COUNT Type -----DATE DATE NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER
Copyright 2006 Kyle Hailey
#.21
Select from v$eventmetricSQL> select en.name name, num_sess_waiting WAITERS, time_waited, wait_count from v$eventmetric em, v$event_name en where wait_count > 0 and en.event# = em.event# /
Copyright 2006 Kyle Hailey
v$eventmetric results
#.22
NAME WAITERS TIME_WAITED WAIT_COUNT ------------------------------ ------- ----------- --------pmon timer 1 5875 20 process startup 0 13 1 rdbms ipc message 7 41104 168 control file sequential read 0 0 10 control file parallel write 0 2 20 log file parallel write 0 0 1 SQL*Net message to client 0 0 47 SQL*Net more data to client 0 1 4 SQL*Net message from client 4 14721 47 SQL*Net more data from client 0 0 1 queue messages 2 12012 24 Queue Monitor Wait 1 3000 1 Queue Monitor Task Wait 0 0 1
Copyright 2006 Kyle Hailey
#.23
Historical MetricsWe solved whats Happening now but What if your problem happened 10 minutes ago? How do we get History? What happened in the past? More work, Time and calculations by YOU
Copyright 2006 Kyle Hailey
#.24
Historical Metricsv$sysstat physical reads Low rate High rate Lots of IO Little IO
Copyright 2006 Kyle Hailey
#.25
Metric History Tables Last 60 minutes of history, in memoryv$sysstat physical readsdelta delta delta delta delta
delta delta
60 secs
60 secs
60 secs
60 secs
60 secs
60 secs
60 secs
Copyright 2006 Kyle Hailey
#.26
Metric History TablesLast hour of statistics at your fingertips :
Statistics
V$SYSMETRIC_HISTORY
60 seconds for an hour 3 minutes of 15 second
File IO
V$FILEMETRIC_HISTORY
10 minutes for an hour
Waits
V$WAITCLASSMETRIC_HISTORY
60 seconds for an hour
Copyright 2006 Kyle Hailey
v$sysmetric_history3 minutes of 15 second deltas
#.27
60 minutes of 1 minute deltas
Not saved to disk but summary is
Copyright 2006 Kyle Hailey
What was IO 30 minutes ago?Once again the answer is at your fingertipsSelect to_char(end_time,'DD-MON-YY HH24:MI'), VALUE , METRIC_UNIT from v$sysmetric_history where METRIC_NAME = 'Physical Reads Per Sec' and END_TIME < ( sysdate - (30/(24*60))) and END_TIME > ( sysdate - (35/(24*60))) TO_CHAR(END_TIM VALUE order by end_time;--------------08-JAN-08 11:38 08-JAN-08 11:39 08-JAN-08 11:40 08-JAN-08 11:41 08-JAN-08 11:42 ---------118.65 76.6166667 3.44770153 28.7 19.6166667
#.28
METRIC_UNIT ---------------Reads Per Second Reads Per Second Reads Per Second Reads Per Second Reads Per Second
Copyright 2006 Kyle Hailey
#.29
V$FILEMETRIC_HISTORYselect from BEGIN_TI BEGIN_TIME, FILE_ID, PHYSICAL_READS V$FILEMETRIC_HISTORY; FILE_ID PHYSICAL_READS
-------- ---------- -------------04:12:16 1 208 04:12:16 2 600 04:02:18 04:02:18 03:52:15 03:52:15 1 2 1 2 600 189 1922 2082
Physical Reads Broken down by file
Copyright 2006 Kyle Hailey
#.30
Metrics Family of TablesStats Raw V$sysstat Waits v$system_event v$event_histogram v$system_wait_class v$eventmetric v$waitclassmetric Files v$fileio SQL v$sqlstat
Deltas
V$sysmetric V$SYSMETRIC V$SYSMETRIC_SUMMARY V$SESSMETRIC V$sysmetric_history V$sysmetric_summary
v$filemetric
v$kkssqlsta
v$wai