Вы находитесь на странице: 1из 34

4

=

+

-> max
=>
-> min
and

-> min


:
80% -

20% -

:
80% -

20% -


..
:











(PGA)


<-

<-
<-
<-

<-
<-

.

SQL.
SQL-,
.

:

, ,


http://docs.oracle.com/cd/E11882_01/server.112/e25513/stats002.htm#i375475

V$SYSSTAT -
V$SESSTAT -




V$SESSION_WAIT -
V$SYSTEM_EVENT -
V$SESSION_EVENT
http://docs.oracle.com/cd/E11882_01/server.112/e40402/waitevents.htm

.
Statspack

(snapshots)
:
exec perfstat.statspack.snap


:
$sqlplus perfstat @?/rdbms/admin/spreport

Statspack.
STATSPACK report for
Database
DB Id
Instance Inst Num Startup Time
Release
~~~~~~~~
----------- ---------- -------- --------------- ----------1081765470 xxx
1 26-Jan-12 14:48 10.2.0.4.0

Host Name: xxx.yyy.zzz Num CPUs: 4 Phys Memory (MB): 6,083


~~~~
Snapshot Snap Id Snap Time
Sessions Curs/Sess
~~~~~~~~ ---------- ------------------------- --------Begin Snap:
81
06-Feb-12 11:25:43
203
56.1
End
Snap:
83
06-Feb-12 11:27:53
197
56.9
Elapsed: 2.17 (mins)

.

Host CPU (CPUs: 4)

Load Average
User
System
Idle
WIO

Begin
10.25
37.85
5.12
56.36
36.34

End
6.98

% of total CPU for Instance: 47.48


% of busy CPU for Instance: 108.81

Instance Efficiency Percentages


Buffer Nowait %: 100.00
Redo NoWait %: 100.00
Buffer Hit %: 98.73
In-memory Sort %: 99.46
Library Hit %: 97.58
Latch Hit %: 99.98
Soft Parse %: 93.30
Execute to Parse %: 85.03
Parse CPU to Parse Elapsd %: 87.98
Non-Parse CPU %: 77.08

.
Load Profile
Per Second
Per Transaction
~~~~~~~~~~~~
--------------- --------------Redo size:
82,837.23
18,221.39
Logical reads:
97,557.53
21,459.36
Block changes:
4,733.31
1,041.17
Physical reads:
3,807.90
837.61
Physical writes:
2,305.89
507.22
User calls:
694.54
152.77

.
Load Profile
Per Second
Per Transaction
~~~~~~~~~~~~
--------------- --------------.
.
.
Parses:
155.21
34.14
Hard parses:
10.39
2.29
Sorts:
383.94
84.45
Logons:
2.74
0.60
Executes:
1,036.66
228.03
Transactions:
4.55 %
~~~~~~~~~~~~~~
Recursive Call %: 74.65
Rollback per transaction %: 0.00
Rows per Sort: 280.26

.
Top 5 Timed Events
~~~~~~~~~~~~~~~~~~
Event
Waits Time (s) Avg(ms) Time
----------------------------------------------------db file sequential read 73,139 224
3
44.8
CPU time
199
39.7
db file scattered read
7,557 32
4
6.3
log file sync
550 22
41
4.5
log file parallel write
603 19
32
3.9

DB Time
DB time 1,083.0
Statistic
Time (s)
% of DB time
----------------------------------- -------------------sql execute elapsed time
1,022.1
94.4
parse time elapsed
74.1
6.8
hard parse elapsed time
72.8
6.7
PL/SQL execution elapsed time
7.5
.7
PL/SQL compile
elapsed time
2.3
.2

.
CPU
CPU per
Time (s)
Executions
Exec (s)
----------------------------------11.83
2
5.91

Elapsed
%Total
Time (s)
-----------------------5.6
100.71
SELECT X.*,..

.
Physical
Reads per
Reads
Executions
Exec
----------------------------------90,387

%Total
Time (s)
-----------------------18.3
100.71
SELECT X.*,..

45,193.5

. I/O


Tablespace
Reads
Read/s (ms) Blocks
-----------------------------------------------TEMP
255,073
1,962
0.0
1.4
TS1
43,201
332
2.2
1.7
TS2
23,065
177
2.5
1.5

Tablespace
Writes Write/s
------------------------------TEMP
47,140
363
TS1
637
5
TS2
655
5

Automatic Workload Repository



:
(
)

:
html
,

Automatic Database Diagnostic


Monitor
AWR
BEGIN
DBMS_ADDM.ANALYZE_DB (
task_name IN OUT VARCHAR2,
begin_snapshot IN NUMBER,
end_snapshot IN NUMBER);
END;
/
BEGIN
DBMS_ADDM.GET_REPORT ( task_name IN VARCHAR2) RETURN
CLOB;
END;
/

Automatic Database Diagnostic


Monitor


,
, .

:
alter session set events '10046 trace name
context forever, level 12';

:
alter session set events '10046 trace name
context off';



:
begin
sys.dbms_system.set_ev(
sid, serial#, 10046, 12, '');
end;

:
begin
sys.dbms_system.set_ev(
sid, serial#, 10046, 0, '');
end;


:
0 - .
1 - .
4 -
.
8 -
.
12 -
, .


tkprof

select TRACE01.TYPE ,TRACE01.STATUS ,TRACE01.SEQUENCE into :b0,:b1,:b2


from TRACE TRACE01 where TRACE01.TYPE=NVL(RTRIM(:b3,' '),' ')
call
count
------- -----Parse
4
Execute 19012
Fetch
19012
------- -----total
38028

cpu
elapsed
disk
query
current
rows
-------- ---------- ---------- ---------- ---------- ---------0.01
0.00
0
0
0
0
3.10
3.56
0
0
0
0
1056.38
1517.15
0
43282981
76048
19012
-------- --------- ---------- ---------- ---------- ----------1059.49
1520.71
0
43282981
76048
19012

Оценить