Oracle8i Application Developer's Guide - Advanced Queuing Release 2 (8.1.6) Part Number A76938-01 |
|
Managing AQ, 3 of 8
Configuration information can be managed through procedures in the DBMS_AQADM
package. Initially, only SYS
and SYSTEM
have the execution privilege for the procedures in DBMS_AQADM
and DBMS_AQ
. Any users who have been granted the EXECUTE
rights to these two packages will be able to create, manage, and use queues in their own schema. The user would also need the MANAGE ANY QUEUE
privilege in order to create and manage queues in other schemas.
AQ administrators of an 8.1 database are allowed to create queues with 8.0 or 8.1 compatibility. All 8.1 security features are enabled for 8.1 compatible queues. However, please note that AQ 8.1 security features work only with 8.1 compatible queues; 8.0 compatible queues are protected by the 8.0 compatible security features.
To create queues in 8.1 that can make use of the new security features, the compatible parameter in DBMS_AQADM
.CREATE_QUEUE_TABLE
must be set to '8.1' or above. If you want to use the new security features on a queue originally created in an 8.0 database, the queue table must be converted to 8.1 compatibility by running DBMS_AQADM
.MIGRATE_QUEUE_TABLE
on the queue table.
If a database downgrade is necessary, all 8.1 compatible queue tables have to be either converted back to 8.0 compatibility or dropped before the database downgrade can be carried out. During the conversion, all 8.1 security features on the queues, like the object privileges, will be dropped. When a queue is converted to 8.0 compatibility, the 8.0 security model apply to the queue, and only 8.0 security features are supported.
The following table lists the AQ security features supported in each version of Oracle8 database and their equivalence privileges across different database version.
With Oracle 8.1, you can grant or revoke privileges at the object level on 8.1 compatible queues. You can also grant or revoke various system level privileges. The following table lists all common AQ operations, and the privileges need to perform these operations for an 8.1-compatible queue:
Access to AQ operations in Oracle 8.0 is granted to users through roles which provide execution privileges on the AQ procedures. The fact that there is no control at the database object level when using Oracle 8.0 means that in Oracle 8.0 a user with the AQ_USER_ROLE
can enqueue and dequeue to any queue in the system. Since Oracle 8.1 offers a finer-grained access control, the function of roles changes when you develop applications in the 8.1 context.
Oracle 8.1 continues to support the AQ_AQMISTRATOR_ROLE
. As in 8.0, the AQ_ADMINISTRATOR_ROLE
has been granted all the required privileges to administer queues. The privileges granted to the role let the grantee:
AQ_USER_ROLE
continues to work for queues that are created with 8.0 compatibility. However, you should avoid granting AQ_USER_ROLE
in Oracle 8.1 since this role will not provide sufficient privileges for enqueuing or dequeuing on 8.1 compatible queues.
Your database administrator has the option of granting the system privileges ENQUEUE
ANY
QUEUE
and DEQUEUE
ANY
QUEUE
, exercising DBMS_AQADM
.GRANT_SYSTEM_PRIVILEGE
and DBMS_AQADM
.REVOKE_SYSTEM_PRIVILEGE
directly to a database user, provided that you wish the user to have this level of control. You as the application developer give rights to a queue by granting and revoking privileges at the object level by exercising DBMS_AQADM
.GRANT_QUEUE_PRIVILEGE
and DBMS_AQADM
.REVOKE_QUEUE_PRIVILEGE
.
As a database user you do not need any explicit object level or system level privileges to enqueue or dequeue to queues in your own schema other than the execute right on DBMS_AQ
.
The procedure grant_type_access is made obsolete in release 8.1.5 for both 8.0-compatible and 8.1 compatible queues. All internal AQ objects are now accessible to PUBLIC.
For an OCI application to access an 8.0-compatible queue, the session user has to be granted the EXECUTE
rights of DBMS_AQ
. For an OCI application to access an 8.1-compatible queue, the session user has to be granted either the object privilege of the queue he intends to access or the ENQUEUE ANY QUEUE
and/or DEQUEUE ANY QUEUE
system privileges. The EXECUTE
right of DBMS_AQ
will not be checked against the session user's rights, if the queue he intends to access is an 8.1-compatible queue.
AQ propagates messages through database links. The propagation driver dequeues from the source queue as owner of the source queue; hence, no explicit access rights have to be granted on the source queue. At the destination, the login user in the database link should either be granted ENQUEUE ANY QUEUE
privilege or be granted the rights to enqueue to the destination queue. However, if the login user in the database link also owns the queue tables at the destination, no explicit AQ privileges need to be granted either.
To upgrade a 8.0-compatible queue table to an 8.1-compatible queue table or to downgrade a 8.1-compatible queue table to an 8.0-compatible queue table.
DBMS_AQADM.MIGRATE_QUEUE_TABLE( queue_table IN VARCHAR2, compatible IN VARCHAR2)
For the most current information regarding the interrelationship of different releases, please refer to "Compatibility" in Chapter 4, "Managing AQ".
EXECUTE DBMS_AQADM.MIGRATE_QUEUE_TABLE( queue_table => 'qtable1', compatible => '8.1');
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|