Wilfried Mausz Oracle Advanced Queueing. Wilfried Mausz Agenda Queues Models Requirements Creating and using a queue Live demos –Point-to-point queue.

Slides:



Advertisements
Similar presentations
From the eyes of an Administrator A general overview of e-CFunds Administrative Site, including navigation and exploring the features of this powerful.
Advertisements

Web 2.0 Programming 1 © Tongji University, Computer Science and Technology. Web Web Programming Technology 2012.
Focusing Your Oracle Database Tuning Efforts For PeopleSoft Applications Bobby Durrett U. S. Foodservice, Inc.
Wikispaces 101 Training Standards & Interoperability (S&I) Framework May 30, :00 - 5:00pm EDT 1.
SQL Gone Bad What to do when faulty SQL code corrupts your database Mary Louise Powers Tom Smull Lehigh University.
Refreshing Materialized Views
Podcasting What is a podcast? –Podcasting, a word formed by combining the name of Apple's "iPod" and "broadcasting", is a method of publishing files to.
Practical Uses for Web Services in Application Express
November 11, MCT, MCITP, MCTS, MCP SharePoint Architect for Planet Technologies. Working with SharePoint since – Administrator / Developer.
Prligence Empowering Intelligence Summary Management By Advanced Queues Paper # 419 Arup Nanda Proligence, Inc
Introduction to SQL Tuning Brown Bag Three essential concepts.
Overview of performance tuning strategies Oracle Performance Tuning Allan Young June 2008.
1.
9 Copyright © 2004, Oracle. All rights reserved. Using DDL Statements to Create and Manage Tables.
9 Creating and Managing Tables. Objectives After completing this lesson, you should be able to do the following: Describe the main database objects Create.
Oracle SQL Developer Data Modeler 3.0: Technical Overview March 2011.
Data Definition Language (DDL)
Creating Tables. 2 home back first prev next last What Will I Learn? List and provide an example of each of the number, character, and date data types.
Copyright Oracle Corporation, All rights reserved. 8 Database Publishing on the Web: An Overview.
Asynchronous Web Services Jaliya N. Ekanayake. Basics of Web Services.
2004 EBSCO Publishing Presentation on EBSCOadmin.
Tux2 Database The Architecture of Our System © Juhani Välimäki 2005.
Copyright © 2011 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are trademarks of Accenture. SQL Workshop Day 4.
Oracle Advanced Queuing: An Overview
Oracle Advanced Queuing Features Overview
Fundamentals, Design, and Implementation, 9/e COS 346 DAY 22.
1 How PL/SQL Applications Can Participate in a Service-Oriented Architecture Aino Andriessen AMIS.
2 Copyright © 2004, Oracle. All rights reserved. Creating Stored Functions.
Service Broker Lesson 11. Skills Matrix Service Broker Service Broker, provides a solution to common problems with message delivery and consistency that.
Chapter 13: Sharing Printers on Windows Server 2008 R2 Networks BAI617.
Overview What is SQL Server? Creating databases Administration Security Backup.
Jason Morrill NCOAUG Training Day February, 2008
Getting Started with Oracle11g Abeer bin humaid. Create database user You should create at least one database user that you will use to create database.
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 3 Administration of Users.
CS480 Computer Science Seminar Introduction to Microsoft Solutions Framework (MSF)
IS 221: DATABASE ADMINISTRATION Lecture 6:Create Users & Manage Users. Information Systems Department 1.
School of Computing and Information Systems CS 371 Web Application Programming PHP – Forms, Cookies, Sessions and Database.
16 Copyright © Oracle Corporation, All rights reserved. Managing Privileges.
Oracle 10g Database Administrator: Implementation and Administration Chapter 2 Tools and Architecture.
Oracle Data Integrator Procedures, Advanced Workflows.
Lecture 8 Creating Stored Functions. Objectives  After completing this lesson, you should be able to do the following:  What is Function?  Types of.
PRACTICE OVERVIEW PL/SQL Part Examine this package specification and body: Which statement about the V_TOTAL_BUDGET variable is true? A. It must.
Roles & privileges privilege A user privilege is a right to execute a particular type of SQL statement, or a right to access another user's object. The.
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Nitin Singh/AAO RTI ALLAHABAD1 DATABASE SECURITY DATABASE SECURITY.
Database Security. Multi-user database systems like Oracle include security to control how the database is accessed and used for example security Mechanisms:
IST 318 Database Administration Lecture 9 Database Security.
Chapter 13Introduction to Oracle9i: SQL1 Chapter 13 User Creation and Management.
Oracle 11g: SQL Chapter 7 User Creation and Management.
Database Security. Multi-user database systems like Oracle include security to control how the database is accessed and used for example security Mechanisms:
3 Copyright © 2007, Oracle. All rights reserved. Using the RMAN Recovery Catalog.
Lab 2 Writing PL/SQL Blocks CISB514 Advanced Database Systems.
Module 5: Managing Content. Overview Publishing Content Executing Reports Creating Cached Instances Creating Snapshots and Report History Creating Subscriptions.
C Copyright © 2006, Oracle. All rights reserved. Integrating with Oracle Streams.
8 Copyright © 2005, Oracle. All rights reserved. Managing Schema Objects.
Blog: R YOU READY FOR.
17 Copyright © 2006, Oracle. All rights reserved. Information Publisher.
2 Copyright © 2009, Oracle. All rights reserved. Managing Schema Objects.
15 Copyright © Oracle Corporation, All rights reserved. Managing Users.
Architecture Review 10/11/2004
Controlling User Access
Managing Privileges.
Managing Privileges.
Database Security.
Database Security.
OER- UNIT 3 Authorization
Database Security OER- Unit 1-Authentication
Session #, Speaker Name Database Privileges 11/29/2018.
Managing Privileges.
Presentation transcript:

Wilfried Mausz Oracle Advanced Queueing

Wilfried Mausz Agenda Queues Models Requirements Creating and using a queue Live demos –Point-to-point queue in PL/SQL –Publish-Subscribe –Accessing a queue from.net

Wilfried Mausz Queues Definition queue –Priority queue Definition enqueue and dequeue Feature list Scenarios for the use of queues Examples

Wilfried Mausz Queue A Queue can be visualized as a queue of people. People join the tail of the queue and wait until they reach the head. Queue

Wilfried Mausz Queue Definition: In providing services to people, and in computer science, transportation, and operations research a queue is a First- In-First-Out FIFO process — the first element in the queue will be the first one out. This is equivalent to the requirement that whenever an element is added, all elements that were added before have to be removed before the new element can be removed.

Wilfried Mausz Priority queue A priority queue is an abstract data type supporting the following two operations: –add an element to the queue with an associated priority –remove the element from the queue that has the highest priority, and return it

Wilfried Mausz Enqueue and dequeue Enqueue … writing message to queue Dequeue … reading (and removing) message from queue queue payload queue payload

Wilfried Mausz Features Asynchronous communication between database applications Integration of messaging and database Internet support (HTTP, , …) Message queueing is transactional Transformation of messages Priority queues Scheduled queues Interfaces to other systems (IBM MQSeries, Tibco, …)

Wilfried Mausz Features Overview Advanced Queues

Wilfried Mausz Scenarios Asynchronous import and export of data Asynchronous working on data Communication between different applications Scheduled operations on data E-business applications –Communication with trading partners Enterprise Application Integration (EAI) Example: Milestone Export Application

Wilfried Mausz Models Point-to-point queue Publish-Subscribe model

Wilfried Mausz Point-to-Point model Two systems using one ore more queues to communicate with each other One message just can be dequeued once Application Queues enqueuedequeue

Wilfried Mausz Publish-Subscribe model No connection between the applications More than one receiving applications (agents) Publisher applications put messages to the queue (topics) Messages are addressed for specific applications or received by all –Broadcast (like TV, radio) –Multicast (like newspaper) Application Queues publish / subscribe / receive subscribe / receive

Wilfried Mausz Requirements Oracle database (>8) Packages Permissions

Wilfried Mausz Packages DBMS_AQADM –Creating or dropping queue tables that contain one or more queues –Creating, dropping, and altering queues, which are stored in a queue table –Starting and stopping queues in accepting message creation or consumption DBMS_AQ –Creating a message to the specified queue –Consuming a message from the specified queue

Wilfried Mausz Permissions AQ administrator –Create queues –Owner of queues Queue users –Access queues

Wilfried Mausz Permissions CREATE ROLE my_aq_adm_role; GRANT CONNECT, RESOURCE, aq_administrator_role TO my_aq_adm_role; CREATE ROLE my_aq_user_role; GRANT CREATE SESSION, aq_user_role TO my_aq_user_role;

Wilfried Mausz Permissions EXEC DBMS_AQADM.GRANT_SYSTEM_PRIVILEGE( privilege => 'ENQUEUE_ANY', grantee => 'my_aq_user_role', admin_option => FALSE); EXEC DBMS_AQADM.GRANT_SYSTEM_PRIVILEGE( privilege => 'DEQUEUE_ANY', grantee => 'my_aq_user_role', admin_option => FALSE);

Wilfried Mausz Permission CREATE USER aqadm IDENTIFIED BY aqadm DEFAULT TABLESPACE tab TEMPORARY TABLESPACE temp; GRANT my_aq_adm_role TO aqadm; CREATE USER aquser IDENTIFIED BY aquser DEFAULT TABLESPACE tab TEMPORARY TABLESPACE temp; GRANT my_aq_user_role TO aquser;

Wilfried Mausz Creating a queue Payload Queue table Queue

Wilfried Mausz Payload New datatype (object) Execute permissions on that type CREATE TYPE queue_message_type AS OBJECT( no NUMBER, title VARCHAR2(30), text VARCHAR2(2000) ); GRANT EXECUTE ON queue_message_type TO my_aq_user_role;

Wilfried Mausz Create queue Create queue table EXEC DBMS_AQADM.CREATE_QUEUE_TABLE( queue_table => 'queue_message_table', queue_payload_type => aqadm.queue_message_type');

Wilfried Mausz Create queue Create queue on queue table Start queue EXEC DBMS_AQADM.CREATE_QUEUE( queue_name => 'message_queue', queue_table => 'queue_message_table'); EXEC DBMS_AQADM.START_QUEUE( queue_name => 'message_queue');

Wilfried Mausz Using the queue Create message Enqueue Dequeue

Wilfried Mausz Using the queue Connect as queue user Create message (payload type) Enqueue message Dequeue message queue payload enqueue dequeue

Wilfried Mausz Using the queue (write) DECLARE queue_options DBMS_AQ.ENQUEUE_OPTIONS_T; message_properties DBMS_AQ.MESSAGE_PROPERTIES_T; message_id RAW(16); my_message aqadm.queue_message_type; BEGIN my_message := aqadm.queue_message_type( 1, 'This is a sample message', 'This message has been posted on ' || TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS')); DBMS_AQ.ENQUEUE( queue_name => 'aqadm.message_queue', enqueue_options => queue_options, message_properties => message_properties, payload => my_message, msgid => message_id); COMMIT; END;

Wilfried Mausz Using the queue (read) SET SERVEROUTPUT ON; DECLARE queue_optionsDBMS_AQ.DEQUEUE_OPTIONS_T; message_propertiesDBMS_AQ.MESSAGE_PROPERTIES_T; message_idRAW(2000); my_messageaqadm.queue_message_type; BEGIN DBMS_AQ.DEQUEUE( queue_name => 'aqadm.message_queue', dequeue_options => queue_options, message_properties => message_properties, payload => my_message, msgid => message_id ); COMMIT; DBMS_OUTPUT.PUT_LINE('Dequeued no: ' || my_message.no); DBMS_OUTPUT.PUT_LINE('Dequeued title: ' || my_message.title); DBMS_OUTPUT.PUT_LINE('Dequeued text: ' || my_message.text); END;

Wilfried Mausz Timing message Change delay of the message property Delay in seconds BEGIN my_message := aqadm.queue_message_type( 1, 'This is a sample message', 'This message has been posted on ' || TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS')); message_properties.delay := 60; DBMS_AQ.ENQUEUE( queue_name => 'aqadm.message_queue', enqueue_options => queue_options, message_properties => message_properties, payload => my_message, msgid => message_id); queue payload ?

Wilfried Mausz Conclusion Powerful mechanism to transport messages inside the database, as well to external programs Reduces database lookups for data export Asynchronous processing of data (fire and forget) Timing and priority possible Availible in PL/SQL  useable in every programming environment

Wilfried Mausz Literature http:// g.html, http:// g.html http://en.wikipedia.org/wiki/Queue

Wilfried Mausz Table of images Queue, h19/ch19.html, h19/ch19.html Overview Advanced Queues 9i_overview.html, i_overview.html