Create Users and Grant Permissions Create AQ Queue Tables

7-4 Configuring and Managing JMS for Oracle WebLogic Server

7.2.1.1 Create Users and Grant Permissions

Create users in the database and grant them AQ JMS permissions. Use a database user with administrator privileges to perform the following task: ■ Using the Oracle SQLPlus environment, log in with an administrator login. connect as sysdba; ■ Create the JMS user schema. For the following example, the user name is jmsuser and the password is jmsuserpwd. Grant connect, resource TO jmsuser IDENTIFIED BY jmsuserpwd; ■ Grant the AQ user role to jmsuser. Grant aq_user_role TO jmsuser; ■ Grant execute privileges to AQ packages. Grant execute ON sys.dbms_aqadm TO jmsuser; Grant execute ON sys.dbms_aq TO jmsuser; Grant execute ON sys.dbms_aqin TO jmsuser; Grant execute ON sys.dbms_aqjms TO jmsuser;

7.2.1.2 Create AQ Queue Tables

Each JMS queue or topic for AQ JMS is backed by an AQ queue table. Each queue table serves as a repository for JMS messages. A JMS queue or topic see Section 7.2.1.2, Create AQ Queue Tables is a logical reference to the underlying AQ queue table. AQ queue tables are created within individual JMS user schemas and can be defined using Oracle SQLPLUS. For example: connect jmsuser jmsuserpwd; Configuring an AQ queue table requires a minimum of three parameters: the name of the queue table, the payload type, and a flag for whether the AQ queue table accepts multiple consumers. For example: dbms_aqadm.create_queue_table queue_table=myQueueTable, queue_payload_type=sys.aq_jms_text_message, multiple_consumers=false ; where: ■ queue_table: The queue table name. Mixed case is supported if the database is 10.0 but the name must be enclosed in double quotes. Queue table names must not be longer than 24 characters. ■ queue_payload_type: The message type. Use sys.aq_jms_message to support all JMS message interface types. ■ multiple_consumers: Set false for queues; set true for topics. For more information on creating queue tables, see CREATE_QUEUE_TABLE Procedure in Oracle Database PLSQL Packages and Types Reference. Interoperating with Oracle AQ JMS 7-5

7.2.1.3 Create a JMS Queue or Topic