To identify contention on a Shared Server configuration in Oracle 19c using the `V$DISPATCHER` view, follow these steps:
Purpose of `V$DISPATCHER`
The `V$DISPATCHER` view provides detailed runtime statistics about the dispatcher processes in a Shared Server architecture. These statistics help identify contention and performance issues.
Key Columns in `V$DISPATCHER`
Here are some important columns in `V$DISPATCHER` that can help analyze contention:
- NAME: Name of the dispatcher (e.g.,
D000
).
- NETWORK: Network protocol used by the dispatcher.
- BUSY: Time (in hundredths of a second) that the dispatcher was busy servicing requests.
- IDLE: Time (in hundredths of a second) that the dispatcher was idle.
- MESSAGES: Total number of messages processed by the dispatcher.
- BYTES: Total number of bytes processed by the dispatcher.
- QUEUED: Number of requests currently waiting in the dispatcher's queue.
- WAIT: Time spent waiting for requests.
Steps to Identify Contention
-
Check Dispatcher Queues:
- Use the
QUEUED
column to identify dispatchers with a high number of waiting requests.
- Example Query:
SELECT NAME, NETWORK, BUSY, IDLE, QUEUED, WAIT, MESSAGES, BYTES
FROM V$DISPATCHER
WHERE QUEUED > 0;
- A high value in the
QUEUED
column indicates that requests are waiting for dispatchers to process them, which suggests contention.
-
Calculate Dispatcher Load:
-
Analyze Wait Times:
- A high
WAIT
value for a dispatcher can indicate contention or slow responses to user requests.
-
Combine with
V$QUEUE
:
-
Correlate with User Sessions:
Actions Based on Observations
-
High Dispatcher Queue (
QUEUED
):
-
High Busy Percentage (
BUSY_PERCENTAGE
):
- Increase the number of Shared Servers using the
MAX_SHARED_SERVERS
parameter.
-
Persistent Waits (
WAIT
):
- Tune the database network or investigate specific user sessions causing excessive load.
By monitoring the `V$DISPATCHER` view alongside related views like `V$QUEUE` and `V$SESSION`, you can effectively diagnose and address contention issues in a Shared Server environment.
Contention is a term that is used to describe many resources that are competing for a single database resource. Contention for dispatcher processes may be reflected either in high busy rates for existing dispatcher processes or in a steady increase in response time in the response queues of existing dispatcher processes. The v$dispatcher
and v$queue
views can help track these conditions.
The v$ views collect information from the moment the system starts up.
Use this query to monitor these statistics while your application is running:
SELECT network "Protocol",
SUM(busy) / ( SUM(busy) + SUM(idle) ) "Total Busy Rate"
FROM
v$dispatcher
GROUP BY
network;
This query returns the total busy rate (the percentage of time the dispatcher processes of each protocol are busy) for the dispatcher processes of each protocol.
(The IDLE and BUSY columns reflect busy rates for dispatcher processes.) The result of this query might look like this:
This tells you that since database startup, the spx dispatcher processes have been busy 9 percent of the time and the TCP dispatcher processes have been busy 50 percent of the time.
By default, this table is available only to the user SYS and to other users who have SELECT ANY TABLE system privilege such as SYSTEM.
The next lesson examines the v$queue
view.