Grant
these additional privileges
using DBMS_AQADM and DBMS_RULE_ADM supplied PL/SQL packages for each Streams
administrator user logging in as the respective SYS user for the databases.
The
DBMS_AQADM package provides procedures to manage Advanced Queuing configuration
and administration information.
/* Grants the STRMADMIN user, privilege to ENQUEUE any message to any queues in the database */
BEGIN
DBMS_AQADM.GRANT_SYSTEM_PRIVILEGE(
privilege => 'ENQUEUE_ANY',
grantee => 'STRMADMIN',
admin_option => FALSE);
/* Grants STRMADMIN privilege to DEQUEUE any message from any queues in the database */
DBMS_AQADM.GRANT_SYSTEM_PRIVILEGE(
privilege => 'DEQUEUE_ANY',
grantee => 'STRMADMIN',
admin_option => FALSE);
/* Grants STRMADMIN privilege to run or execute DBMS_AQADM on any schemas in the database */
DBMS_AQADM.GRANT_SYSTEM_PRIVILEGE(
privilege => 'MANAGE_ANY',
grantee => 'STRMADMIN',
admin_option => TRUE);
/* Grants STRMADMIN access to AQ object types.
However, this procedure is obsolete from Oracle8.1.5.
Run this code statement below only if you receive the ORA-24048 error */
-- DBMS_AQADM.GRANT_TYPE_ACCESS(
-- user_name => 'STRMADMIN');
END;
/
The DBMS_RULE_ADM
package provides the administrative interface for creating and managing rules,
rule sets, and rule evaluation contexts.
BEGIN
/* Creates a new evaluation context in STRMADMIN's schema */
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_EVALUATION_CONTEXT_OBJ,
grantee => 'STRMADMIN',
grant_option => TRUE);
/* Creates a new rule set in STRMADMIN's schema */
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_RULE_SET_OBJ,
grantee => 'STRMADMIN',
grant_option => TRUE);
/* Creates a new rule in STRMADMIN's schema */
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE (
privilege => DBMS_RULE_ADM.CREATE_RULE_OBJ,
grantee => 'STRMADMIN',
grant_option => TRUE);
/* Grants STRMADMIN privilege to create a new rule set in any schema. */
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_ANY_RULE_SET,
grantee => 'STRMADMIN',
grant_option => TRUE);
/* Grants STRMADMIN privilege to alter any rule set owned by any user. */
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.ALTER_ANY_RULE_SET,
grantee => 'STRMADMIN',
grant_option => TRUE);
/* Grants STRMADMIN privilege to execute any rule set owned by any user. */
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.EXECUTE_ANY_RULE_SET,
grantee => 'STRMADMIN',
grant_option => TRUE);
/* Grants STRMADMIN privilege to create a new rule in any schema. */
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_ANY_RULE,
grantee => 'STRMADMIN',
grant_option => TRUE);
/* Grants STRMADMIN privilege to alter any rule owned by any user. */
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.ALTER_ANY_RULE,
grantee => 'STRMADMIN',
grant_option => TRUE);
/* Grants STRMADMIN privilege to execute any rule owned by any user. */
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.EXECUTE_ANY_RULE,
grantee => 'STRMADMIN',
grant_option => TRUE);
/* Grants STRMADMIN privilege to execute any evaluation context owned by any user. */
DBMS_RULE_ADM.GRANT_OBJECT_PRIVILEGE(
privilege => DBMS_RULE_ADM.EXECUTE_ON_EVALUATION_CONTEXT,
object_name => 'SYS.STREAMS$_EVALUATION_CONTEXT',
grantee => 'STRMADMIN',
grant_option => FALSE );
END;
/