Skip to content

Queue Information (vqueue.sql)

This script provides Oracle queue monitoring information by:

  • Displaying all queue statistics from V$QUEUE
  • Showing dispatcher and shared server queue information
  • Monitoring queue wait times and throughput
  • Providing data for shared server configuration analysis
select * from v$queue
/
SQL> @vqueue.sql
  • SELECT on V$QUEUE
PADDR TYPE QUEUED WAIT TOTALQ
-------- --------- ------- ------- ----------
12AB34CD COMMON 0 0 125
56EF78GH DISPATCHER 2 15 543
9ABC12DE DISPATCHER 1 8 321
DEF45678 DISPATCHER 0 0 234
  • PADDR: Process address of the queue owner
  • TYPE: Type of queue (COMMON, DISPATCHER)
  • QUEUED: Current number of items in queue
  • WAIT: Current wait time in centiseconds
  • TOTALQ: Total number of items queued since startup
  • Purpose: Common queue for all dispatchers
  • Usage: Shared among multiple dispatcher processes
  • Monitoring: Watch for high queue depths
  • Purpose: Individual dispatcher process queues
  • Usage: Specific to each dispatcher process
  • Monitoring: Look for uneven load distribution
  • QUEUED = 0: Good performance, no queuing
  • QUEUED > 0: Potential bottleneck or high load
  • WAIT > 0: Active queuing occurring
  • High TOTALQ: Heavy historical usage
  • Compare TOTALQ across dispatchers
  • Identify overloaded dispatchers
  • Check for even workload distribution
  1. Shared Server Monitoring

    • Monitor dispatcher queue performance
    • Identify bottlenecks in shared server configuration
    • Analyze load distribution
  2. Performance Troubleshooting

    • Investigate connection delays
    • Analyze shared server efficiency
    • Check for queue saturation
  3. Capacity Planning

    • Monitor queue utilization trends
    • Plan dispatcher configuration
    • Size shared server pools
-- Show shared server parameters
SELECT name, value
FROM v$parameter
WHERE name LIKE '%shared_server%'
OR name LIKE '%dispatcher%'
OR name = 'max_shared_servers';
-- Current shared server processes
SELECT * FROM v$shared_server;
-- Dispatcher information
SELECT * FROM v$dispatcher;
-- Average queue wait time
SELECT type, AVG(wait) avg_wait_cs, MAX(wait) max_wait_cs
FROM v$queue
GROUP BY type;
-- Queue utilization by dispatcher
SELECT d.name dispatcher_name, q.queued, q.wait, q.totalq
FROM v$dispatcher d, v$queue q
WHERE d.paddr = q.paddr;

If QUEUED values are consistently > 0:

  1. Increase Dispatchers

    ALTER SYSTEM SET dispatchers='(PROTOCOL=TCP)(DISPATCHERS=4)';
  2. Increase Shared Servers

    ALTER SYSTEM SET shared_servers=10;
  3. Check Network Capacity

    • Verify network bandwidth
    • Check for network bottlenecks
    • Monitor connection patterns

If some dispatchers show much higher TOTALQ:

  1. Review Connection Load Balancing

    • Check TNS configuration
    • Verify client connection patterns
    • Consider connection pooling
  2. Dispatcher Redistribution

    • Restart dispatchers to redistribute load
    • Monitor over time for patterns
-- Monitor queue activity over time
SELECT TO_CHAR(SYSDATE, 'HH24:MI:SS') time,
type, queued, wait, totalq
FROM v$queue
WHERE queued > 0 OR wait > 0;
-- Create monitoring table
CREATE TABLE queue_history (
check_time DATE,
queue_type VARCHAR2(20),
queued NUMBER,
wait_time NUMBER,
total_queued NUMBER
);
-- Insert current values
INSERT INTO queue_history
SELECT SYSDATE, type, queued, wait, totalq
FROM v$queue;
  • Shared server not configured
  • All connections using dedicated servers
  • No dispatcher processes running
  • Insufficient shared server processes
  • Network bottlenecks
  • Heavy application load
  • Client connection patterns
  • Network routing issues
  • Dispatcher configuration problems
  • Memory Efficiency: Reduced memory per connection
  • Scalability: Support more concurrent users
  • Resource Sharing: Better resource utilization
  • Performance: Slight overhead for context switching
  • Complexity: More complex troubleshooting
  • Application Compatibility: Some applications require dedicated servers
  1. Regular Monitoring

    • Check queue depths during peak hours
    • Monitor wait times for user experience
    • Track total queue counts for trends
  2. Configuration Management

    • Size dispatchers based on connection patterns
    • Configure adequate shared servers
    • Balance between memory and performance
  3. Troubleshooting

    • Correlate queue activity with user complaints
    • Monitor during different workload periods
    • Keep baseline measurements