You are on page 1of 13

Database Performance-Time

Model

Chinar Aliyev
Chinar Aliyev
http://www.azeroug.org

AZEROUG
(Member of Azerbaijan Oracle Users Group)
OCE Performance Turning 11g
OCP Database 11g Administrator Certified Master
Bank of Azerbaijan

02.04.2018 Çinar Əliyev 2/33


Girish
http://www.azeroug.org

- When we facing Instance level performance issue


AWR/Statspack
ASH
Dynamic Performance views(f.e v$session_wait,v$active_session_history)
- When we facing session/s level performance issue
For this session/s trace(dbms_monitor,dbms_support,dbms_session and
etc)
ASH(for that session/s)
Tracking session activity using dynamic performance views.
- Problematic area or symptom
CPU, I/O, Memory, network

02.04.2018 Çinar Əliyev 3/33


http://www.azeroug.org

- Wasted time for every request (by foreground processes)


T = CPU Time + Wait Time
CPU Time – Indicate real working time(can call useful part of the work)
(CPU Time – also called Service Time)
Wait Time – Indicate DB server how much time waited(I/O,
Concurrency, network and etc)
- For certain [t1,t2] time period
if session s1 spent sT1, session s2 spent sT2 … session sn spent sTn
then sT1+sT2+…+sTn = ∑sTi = DB Time (1)
DB Time is sum of spent time of all active (non-Idle) foreground
processes. For certain time period, so
DB Time = CPU Time + Wait Time (2)
- What does indicate DB Time really?
02.04.2018 Çinar Əliyev 4/33
http://www.azeroug.org

- DB Time indicate your workload actually(f.e. is something happening


or not in the database?).

- Tuning purpose is minimizing DB Time(not just unplanned reducing).

02.04.2018 Çinar Əliyev 5/33


http://www.azeroug.org

- Which portion of “workload” are Service and Wait Time?

- Tuning purpose is minimizing CPU Time and Wait Time!

02.04.2018 Çinar Əliyev 6/33


http://www.azeroug.org

- v$sys_time_model
- v$sess_time_model
1) DB time(micro second)
2) DB CPU(micro second)
- v$sysmetric
- v$sysmetric_history
1) Database Time Per Sec(CentiSeconds Per Second )
2) CPU Usage Per Sec(CentiSeconds Per Second)
3) Average Active Sessions(does not have unit)
- dba_hist_sys_time_model
- dba_hist_sysmetric_history

02.04.2018 Çinar Əliyev 7/33


http://www.azeroug.org

v$sys_time_model:
DB time 10243370971213
sql execute elapsed time 9039558068160
DB CPU 6821836102157
PL/SQL execution elapsed time 3674195402029
parse time elapsed 839938569469
background elapsed time 576257723089
background cpu time 434910015055
hard parse elapsed time 404959307510
RMAN cpu time (backup/restore) 284305788976
hard parse (sharing criteria) elapsed time 272455179735
inbound PL/SQL rpc elapsed time 44186619046
PL/SQL compilation elapsed time 39167658642
Java execution elapsed time 37284614588
failed parse elapsed time 31241015118
hard parse (bind mismatch) elapsed time 5565222021
sequence load elapsed time 3335541360
connection management call elapsed time 2877425277
repeated bind elapsed time 1697311343
failed parse (out of shared memory) elapsed time
02.04.2018 Çinar Əliyev
0 8/33
http://www.azeroug.org

02.04.2018 Çinar Əliyev 9/33


http://www.azeroug.org

When interpreting AWR Report, Load Profile and Time Model

02.04.2018 Çinar Əliyev 10/33


http://www.azeroug.org

- Control of CPU utilization


- ∑sTi = DB Time t є [t1,t2] => ∑sTi/(t2-t1) = DB Time/(t2-
t1)=AAS(Average Active Sessions).
- If we consider ∆t = (t2-t1) then for this time period max available processor
Time is Max CPU Time= cpu count* ∆t. Therefore we can compare these
two times(DB Time and Max CPU Time). So
- DB Time ~ Max Cpu Time 
(DB Time/∆t ~ Max Cpu Time/∆t)  (AAS ~ cpu count)
- Alert and Metrics
- v$metric/_history , CPU Usage Per Sec, Average Active Sessions(11g)
- EM Performance Page(great!)( AAS ~ CPU count)

02.04.2018 Çinar Əliyev 11/33


http://www.azeroug.org

- AAS ~ CPU count. But where is DB Time ?

02.04.2018 Çinar Əliyev 12/33


http://www.azeroug.org

- AAS, CPU count, DB Time


- We know that AAS = DB Time/∆t, so now we can reduce ∆t to zero
- In this case we will get limit(functional limit of DB Time function)
- Limit ∆t->0, DB Time(t)/∆t = DB Time'(t).(differensial of DB Time )
- So AAS(t) = DB Time'(t)  DB Time(t) = ∫AOS(t)dt. For t in [t1 t2].
- Average Active Sessions indicate database workload at specific(certain) time
moment.
- Average Active Sessions indicate distribution of DB Time over time period.
- Time model and ADDM(self managing database architecture)

02.04.2018 Chinar Aliyev 13/33