Professional Documents
Culture Documents
This is an excerpt from the bestselling book Oracle Grid & Real Application
Clusters. To get immediate access to the code depot of working RAC scripts, buy it
directly from the publisher and save more than 30%.
The service time for receiving a current block is calculated in a similar fashion
to the value for a cr block, except there is a pin time instead of a build time:
SELECT
a.inst_id "Instance",
(a.value+b.value+c.value)/d.value "Current Blk Service Time"
FROM
GV$SYSSTAT A,
GV$SYSSTAT B,
GV$SYSSTAT C,
GV$SYSSTAT D
WHERE
A.name = 'gc current block pin time' AND
B.name = 'gc current block flush time' AND
C.name = 'gc current block send time' AND
D.name = 'gc current blocks served' AND
B.inst_id=A.inst_id AND
C.inst_id=A.inst_id AND
D.inst_id=A.inst_id
ORDER BY
a.inst_id;
Instance two is requiring more time to service current blocks. How is the source
of the problem determined? The overall service time can be decomposed to determine
where the area of concern lies:
SELECT
A.inst_id "Instance",
(A.value/D.value) "Current Block Pin",
(B.value/D.value) "Log Flush Wait",
(C.value/D.value) "Send Time"
FROM
GV$SYSSTAT A,
GV$SYSSTAT B,
GV$SYSSTAT C,
GV$SYSSTAT D
WHERE
A.name = 'gc current block build time' AND
B.name = 'gc current block flush time' AND
C.name = 'gc current block send time' AND
D.name = 'gc current blocks served' AND
B.inst_id=a.inst_id AND
C.inst_id=a.inst_id AND
D.inst_id=a.inst_id
ORDER BY
A.inst_id;
In this case, most of the time difference comes from the pin time for the current
block in instance two. High pin times could indicate problems at the I/O interface
level.
A final set of statistics deals with the average global cache convert time and the
average global cache get times. The following SELECT can be used to get this
information from the RAC database:
select
a.inst_id "Instance",
a.value/b.value "Avg Cache Conv. Time",
c.value/d.value "Avg Cache Get Time",
e.value "GC Convert Timeouts"
from
GV$SYSSTAT A,
GV$SYSSTAT B,
GV$SYSSTAT C,
GV$SYSSTAT D,
GV$SYSSTAT E
where
a.name='gc convert time' and
b.name='gc converts' and
c.name='gc get time' and
d.name='gc gets' and
e.name='gc convert timeouts' and
b.inst_id=a.inst_id and
c.inst_id=a.inst_id and
d.inst_id=a.inst_id and
e.inst_id=a.inst_id
order by
a.inst_id;
Instance Avg Cache Conv. Time Avg Cache Get Time GC Convert Timeouts
--------- -------------------- ------------------ -------------------
1 1.85812072 .981296356 0
2 1.65947528 .627444273 0
For this database, instance one has the highest convert and get times, as expected,
since it is converting and getting from instance two, which is the slow instance.
None of the times are excessive, >10-20 ms.
* Large values or rapid increases in the gets, converts, or average times indicate
GCS contention.
* Latencies for resource operations may be high due to excessive system loads.
* The gv$system_event view can be used to review the time_waited statistics for
various GCS events if the get or convert times become significant. STATSPACK is
good for this.
* Values other than zero for the GC converts timeouts indicate system contention or
congestion. Timeouts should not occur and indicate a serious performance proble