7.12.1 Required Privileges
Grant the required privileges to the database user to leverage the Oracle Transactional Event Queues (TEQ) feature.
- Database user must have the
ENQUEUE_ANY
andDEQUEUE_ANY
privileges to enqueue or dequeue messages through the existing database connection. - Database user must have
EXECUTE
privilege on theDBMS_AQIN
andDBMS_AQ
packages to use the Oracle JMS interfaces.
Sample Command
The following sample command demonstrates how the required privileges are granted to the Oracle Database user, department_teq
.
-- Oracle transaction event Queue(TEQ) related grants
GRANT EXECUTE ON DBMS_AQ TO department_teq;
GRANT EXECUTE ON DBMS_AQIN to department_teq;
EXECUTE DBMS_AQADM.CREATE_SHARDED_QUEUE (queue_name => 'department_teq.<queue_name>', multiple_consumers => true);
EXECUTE dbms_aqadm.grant_queue_privilege('ALL', 'department_teq.<queue_name>', 'department_teq');
EXECUTE dbms_aqadm.start_queue(queue_name => 'department_teq.<queue_name>');