Skip to content

Database Pipes Monitor (vdbpipe.sql)

Database Pipes Monitor Script (vdbpipe.sql)

Section titled “Database Pipes Monitor Script (vdbpipe.sql)”

The vdbpipe.sql script provides comprehensive monitoring of Oracle database pipes (DBMS_PIPE), showing pipe ownership, types, and current sizes. This tool is essential for monitoring inter-session communication and debugging applications that use database pipes.

REM vdbpipe.sql
REM Checks for database pipes
REM
Column pipe_owner Format a20
Column pipe_name Format a30
Column pipe_type Format a10
Column pipe_size Format 9999999
TTITLE ' DATABASE PIPE STATUS '
SELECT
ownerid pipe_owner,
name pipe_name,
decode(type,1,'Private',2,'Public','Unknown') pipe_type,
pipe_size
FROM v$db_pipes
ORDER BY 1,2
/
  • Displays all active database pipes in the system
  • Shows pipe ownership for security and access control
  • Identifies pipe types (Private vs Public)
  • Reports current pipe size for capacity monitoring
  • Orders results by owner and pipe name for easy navigation
SQL> @vdbpipe.sql

This script requires no input parameters.

  • SELECT privilege on V$DB_PIPES
  • No special system privileges required
DATABASE PIPE STATUS
PIPE_OWNER PIPE_NAME PIPE_TYPE PIPE_SIZE
-------------------- ------------------------------ ---------- ---------
HR EMPLOYEE_SYNC_PIPE Private 4096
SCOTT DEBUG_PIPE Public 8192
SYSTEM JOB_QUEUE_PIPE Private 16384
SYSTEM ALERT_PIPE Public 2048
  • The schema that owns the database pipe
  • Important for security and access control
  • The name of the database pipe
  • Used to identify pipes in DBMS_PIPE calls
  • Private: Only accessible by the owner
  • Public: Accessible by any user with EXECUTE on DBMS_PIPE
  • Unknown: Pipe type cannot be determined
  • Current size of the pipe in bytes
  • Indicates how much data is currently in the pipe
  • Private pipes are secure and only accessible by the creating user
  • Public pipes can be accessed by any user with appropriate privileges
  • Choose pipe type based on security requirements
  • Large pipe sizes may indicate:
    • Slow consumer processes
    • Failed message processing
    • Application bottlenecks
  • Pipes have a maximum size limit (typically 1MB)
-- Check if application pipes exist
SQL> @vdbpipe.sql
-- Look for expected pipe names and verify ownership
  • Monitor pipe sizes over time
  • Identify pipes that consistently have large sizes
  • Detect potential message processing delays
  • Review all public pipes for security implications
  • Verify pipe ownership matches application design
  • Identify unexpected or unauthorized pipes

If you see consistently high pipe sizes:

  1. Check consumer process status
  2. Verify message processing speed
  3. Consider increasing consumer concurrency
  4. Review message size and frequency

Pipes are created on first use, so missing pipes may indicate:

  • Application not yet started
  • Configuration issues
  • Permission problems
  • No active pipes in the database
  • Pipes only exist while messages are present
  • Check if applications using DBMS_PIPE are running
ORA-00942: table or view does not exist
  • Grant SELECT on V$DB_PIPES to the user
  • Run as a privileged user (SYSDBA)
  • May indicate pipe cleanup issues
  • Review application pipe management
  • Consider implementing pipe expiration logic
  1. Regular Monitoring: Check pipe status during peak usage
  2. Size Alerts: Set up alerts for pipes exceeding size thresholds
  3. Security Review: Regularly audit public pipes
  4. Documentation: Document all production pipes and their purposes
  5. Cleanup: Implement proper pipe cleanup in applications
-- Check specific application pipes
SELECT * FROM v$db_pipes WHERE name LIKE 'APP_%';
-- Monitor pipe growth
SELECT name, pipe_size FROM v$db_pipes WHERE pipe_size > 50000;