Overview
TheTrace_Message procedure is the primary interface for sending trace messages from PL/SQL code to OmniView. Messages are enqueued to the Oracle Advanced Queue and delivered asynchronously to registered subscribers.
Procedure Signature
Omni_Tracer.sql:258-270
Parameters
The message content to trace. Can be any text content, including JSON, XML, or plain text. Maximum size is limited by CLOB (4GB).
The severity level of the message. Common values include:
INFO: Informational messagesWARNING: Warning messagesERROR: Error messagesDEBUG: Debug messages
Log Levels
While the package doesn’t enforce specific log levels, the following conventions are recommended:INFO
INFO
Use for general informational messages about normal operations.
WARNING
WARNING
Use for potentially problematic situations that don’t prevent execution.
ERROR
ERROR
Use for error conditions that affected the operation.
DEBUG
DEBUG
Use for detailed debugging information.
Usage Examples
Basic Message
Message with Log Level
Tracing JSON Data
Exception Handling with Trace
Tracing in a Loop
How It Works
Message Enqueuing Flow
Create JSON message
The procedure constructs a JSON object containing the message metadata and payload.
Omni_Tracer.sql:218-223
Convert to BLOB
The JSON CLOB is converted to a BLOB for storage in the queue payload object.
Omni_Tracer.sql:225-227
Enqueue to AQ
The message is enqueued with IMMEDIATE visibility, making it available to subscribers without waiting for a commit.
Omni_Tracer.sql:216
Omni_Tracer.sql:229-235
Messages are enqueued with
DBMS_AQ.IMMEDIATE visibility, meaning they are available to subscribers immediately without waiting for the calling transaction to commit.Message Structure
Each traced message is automatically wrapped in a JSON structure:Automatically generated from
OMNI_TRACER_ID_SEQ.NEXTVALSet to “OMNI_TRACER_API” by default (currently not customizable)
The log level passed to the procedure
The exact message content provided
ISO 8601 formatted timestamp with timezone (e.g., “2026-03-03T10:30:45.123+00:00”)
Performance Considerations
Sharded Queue Architecture
TheOMNI_TRACER_QUEUE is configured as a sharded queue with 4 shards by default. This enables:
- Parallel enqueuing: Multiple sessions can enqueue messages simultaneously without contention
- Parallel dequeuing: Subscribers can process messages in parallel from different shards
- High throughput: Suitable for high-volume tracing scenarios
IMMEDIATE Visibility
Messages useIMMEDIATE visibility mode, which means:
- Messages are visible to subscribers instantly
- No need to wait for the enqueuing transaction to commit
- Ideal for real-time monitoring and debugging
Error Handling
The procedure includes comprehensive error handling:Omni_Tracer.sql:244-254
- Ensures temporary LOBs are freed even on error
- Re-raises the original exception for calling code to handle
OmniView Processing
Once messages are enqueued, OmniView’s TracerService processes them:Bulk dequeue
TracerService dequeues messages in batches using
Dequeue_Array_Events.tracer_service.go:78
Parse JSON
Each message is unmarshaled from JSON into a
QueueMessage domain object.tracer_service.go:88-92
Related Topics
OMNI_TRACER_API Package
Overview of the complete package
Subscriber Management
Learn how OmniView subscribes to messages