SlideShare a Scribd company logo
1 of 7
Download to read offline
How To Install, Setup And Use The AQ Performance Monitor Package DBMS_AQ_MONITOR [ID 1163083.1]
   Modified: 22-Mar-2012   Type: BULLETIN   Status: PUBLISHED    Priority: 3


In this Document
 Purpose
 Scope and Application
 How To Install, Setup And Use The AQ Performance Monitor Package DBMS_AQ_MONITOR
    Purpose
    Overview
    Design Description
    Package Specification
    AQMonitor Files
    Usage
    Notes and Restrictions
    Plotting the Data Generated
    Sample Results


Applies to:
Oracle Server - Enterprise Edition - Version: 10.2.0.1 to 11.2.0.3 - Release: 10.2 to 11.2
Information in this document applies to any platform.

Purpose

The purpose of this document is to provide an overview of the dbms_aq_monitor package which can be used to monitor queue performance and provide statistics on Advanced Queueing (AQ) queue operations within a single instance or Real
Application Cluster (RAC) environment.

Scope and Application
This is intended for anyone who needs to monitor or tune performance in an Advanced Queueing database.

The procedure can be executed in a 10.2 database onwards but note this procedure will only gather detailed performance information on buffered queues in this version. In 11.1 onwards the procedure will gather detailed performance
information for persistent and buffered queues and this information is further enhanced in 11.2 to include notification and Queue Monitor statistics.

How To Install, Setup And Use The AQ Performance Monitor Package DBMS_AQ_MONITOR

Purpose

The purpose of the dbms_aq_monitor package is to provide a comprehensive overview of the AQ setup for specific AQ users within a database and to gather snapshot information in order to assist with tuning and performance issues within
customer systems.

Examples of typical problems would be

   1.   AQ queries/operations becoming more expensive over time.
   2.   Unable to scale up performance or unable to meet peak performance numbers.
   3.   Best-practices for tuning/improving an existing AQ setup.
   4.   RAC performance problems.

Overview

The PL/SQL package dbms_aq_monitor is designed to monitor AQ queue performance over a certain time duration. A user can define a start and end time during which specific queues can be monitored. The monitor can generate three types of
reports:

        A summary report for all queues: The report will display all queue configuration information (such as queue id, queue owner, etc.). It also gives a performance summary for each queue, and sorts queues with different metrics (e.g.,
        enqueue rate and dequeue rate).
        A detailed report for a certain queue: The report will show the performance of the queue in a time-series manner. It also gives information of other components related to the queue, such as queue monitor cache (11.2) and subscribers.
        Furthermore, it shows top SQL associated with the queues and segment usage related to the queue.
        In 11.2 onwards a report for subscription/registration statistics: The report will show subscription/registration statistics in a time-series manner.
Design Description

The monitor periodically collects statistics from the following AQ views

-   dba_queues, dba_queue_tables, dba_queue_subscribers
-   gv$persistent_queues, gv$persistent_subscribers, gv$persistent_qmn_cache
-   gv$buffered_queues, gv$buffered_subscribers
-   gv$subscr_registration_stats

It also collects statistics from the following additional views

-   dba_hist_sqlstat, dba_hist_sqltext, dba_hist_seg_stat_obj, dba_hist_seg_stat
-   dba_hist_snapshot, dba_hist_sys_time_model, dba_hist_system_event, dba_hist_sysstat
-   dba_tables, dba_tablespaces, dba_segments, dba_indexes, dba_lobs, dba_rules, dba_rule_set_rules
-   dba_subscr_registrations

The monitor creates 12 tables to store the statistics gathered from these views, in particular:

1. For persistent queues

-   aqmon_pqueues_tab
-   aqmon_pqueues_accum_tab
-   aqmon_psubscribers_tab
-   aqmon_pqmncache_tab

2. For buffered queues

- aqmon_bqueues_tab
- aqmon_bqueues_accum_tab
- aqmon_bsubscribers_tab

3. For notification

- aqmon_subreg_tab

4. General Information

-   aqmon_queue_config_tab
-   aqmon_subscriber_config_tab
-   aqmon_queue_owners_tab
-   aqmon_params_tab

Package Specification

Set/get Monitor Configuration Procedures


ADD_QUEUE_OWNER Procedure

This procedure adds a queue owner to the monitoring list. The owner name will be automatically capitalized. All queues belonging to that owner will be monitored.

dbms_aq_monitor.add_queue_owner(owner_name IN VARCHAR2 DEFAULT NULL);

add_queue_owner parameters

owner_name - The schema name of the AQ Queue owner.

REMOVE_QUEUE_OWNER Procedure

This procedure removes a queue owner from the monitoring list. The owner name will be automatically capitalized.
dbms_aq_monitor.remove_queue_owner(owner_name IN VARCHAR2 DEFAULT NULL);

add_queue_owner parameters

owner_name - The schema name of the AQ Queue owner.

SET_LOG_DIR Procedure

This procedure sets the directory for dumping log files

dbms_aq_monitor.set_log_dir(
dir_name IN VARCHAR2 DEFAULT NULL,
overwrite_file IN BOOLEAN DEFAULT FALSE);

set_log_dir parameters

dir_name - The location where the Monitor log files will be stored
overwrite_file - whether to overwrite existing file if log file 'aqmon_report.log' already exists in the log directory.

SET_MONITORING_PARAM Procedure

This procedure sets thet monitoring parameters

dbms_aq_monitor.set_monitoring_param(param_name IN VARCHAR2 DEFAULT NULL,
param_value IN PLS_INTEGER DEFAULT NULL);

set_monitoring_param parameters

 param_name                                                                            param_value (Default)              Usage

 CONFIG_COLLECT_FREQ                                                                   300(seconds)                       frequency for collecting queue configuration info

 RUNTIME_COLLECT_FREQ                                                                  60(seconds)                        frequency for collecting queue runtime stats

 AWR_DUMP_FREQ                                                                         300(seconds)                       frequency for generating AWR
                                                                                                                          report

 ACCUM_DUMP_FREQ                                                                       300(seconds)                       frequency for dumping
                                                                                                                          accumulative stats in log file

 FILE_PLOT                                                                             0                                  whether dump per-queue stats file
                                                                                                                          for gnuplot. Value could be 0 or 1.

 SHARED_SUBSQL_LENGTH                                                                  150                                AQ generated SQL which shares the same first SHARED_SUBSQL_LENGTH
                                                                                                                          characters and

 SHARED_MEMORY_BOUND                                                                   1                                  in total consume more
                                                                                                                          than SHARED_MEMORY_BOUND MBytes of memory



SHOW_CONFIG Procedure

The procedure displays the monitor configuration parameters

dbms_aq_monitor.show_config

Monitor Control Procedures


START_MONITOR Procedure
This procedure starts the Monitor. When started, the monitor will clear up all previously
collected statistics. It will also overwrite log files in the log directory.

dbms_aq_monitor.start_monitor
(start_time IN NUMBER DEFAULT 0);

start_monitor parameters

start_time - number of minutes after which the monitor will be started

STOP_MONITOR Procedure

This procedure stops all the statistics collecting processes associated with the Monitor. Existing statistics are still kept in database. The monitor will not stop until this procedure is executed.

dbms_aq_monitor.stop_monitor(stop_time IN NUMBER DEFAULT 0);

stop_monitor parameters

stop_time - number of minutes after which the monitor will be stopped

DESTROY_MONITOR Procedure

This procedure clears all the tables and data used by the monitor.

dbms_aq_monitor.destroy_monitor

CLEAR_SCHEDULE_JOB Procedure

This procedure clears the scheduled job. There are two types of scheduled jobs, 'start_monitor'
or 'stop_monitor'. Each type of job could be scheduled only once. If you want to re-schedule the job at a different time, you need to first clear the job and then re-execute the operation.

dbms_aq_monitor.clear_scheduled_job(job_name IN VARCHAR2 DEFAULT NULL);

clear_schedule_job parameters

job_name - can be either 'start_monitor' or 'stop_monitor'

GET_REPORT Procedure

This procedure generates a summary monitoring report for all queues on all instances. The
report file is named 'aqmon_report.log', in the log directory.

dbms_aq_monitor.get_report(final_collect IN BOOLEAN DEFAULT TRUE);

get_report parameters

final_collect - whether to collect one final snapshot before generating the report (only effective when the monitor is still running).

GET_QUEUE_REPORT Procedure

This procedure generates a detailed report for a specific queue on a specific instance.

dbms_aq_monitor.get_queue_report(queue_id IN NUMBER DEFAULT NULL,
inst_number IN NUMBER DEFAULT NULL,
final_collect IN BOOLEAN DEFAULT TRUE,
single_logfile IN BOOLEAN DEFAULT FALSE);

get_queue_report parameters
Parameter                                                                                                                    Description


 inst_number                                                                                                                  If inst_number is not specified (i.e., inst_number IS NULL), then automatically fetch the current instance number. If
                                                                                                                              inst_number = -1, then generate reports for the queue on all instances.
                                                                                                                              For other cases, inst_number should be >= 0.
                                                                                                                              In Oracle database 10.2, inst_number cannot be -1.

 final_collect                                                                                                                whether to collect one final snapshot before generating report (only effective when the monitor is still running).

 single_logfile                                                                                                               If set to true, then all output will be written to a
                                                                                                                              single logfile 'aqmon_all_queues.log'. Otherwise, each queue will have its own log file. The file is named
                                                                                                                              'aqmon_queue_ABC_XXYY.log', in the log directory, where ABC is the instance number and XXYY is the queue id. Note
                                                                                                                              that the 'aqmon_report.log' file contains all queue ids information.



GET_ALL_QUEUES_REPORTS Procedure

This procedure generates a detailed report for each of the monitored queues on the specified
instance. Each report name follows that in procedure get_queue_report.

dbms_aq_monitor.get_all_queues_reports(
inst_number IN NUMBER DEFAULT NULL,
final_collect IN BOOLEAN DEFAULT TRUE,
single_logfile IN BOOLEAN DEFAULT FALSE);


 Parameter                                                                                                                    Description

 inst_number                                                                                                                  If inst_number is not specified (i.e., inst_number IS NULL), then automatically fetch the current instance number. If
                                                                                                                              inst_number = -1, then generate reports for the queue on all instances.
                                                                                                                              For other cases, inst_number should be >= 0.
                                                                                                                              In Oracle database 10.2, inst_number cannot be -1

 final_collect                                                                                                                whether to collect one final snapshot before generating report (only effective when the monitor is still running).

 single_logfile                                                                                                               If set to true, then all output will be written to a
                                                                                                                              single logfile 'aqmon_all_queues.log'. Otherwise, each queue will have its own log file. The file is named
                                                                                                                              'aqmon_queue_ABC_XXYY.log', in the log directory, where ABC is the instance number and XXYY is the queue id. Note
                                                                                                                              that the 'aqmon_report.log' file contains all queue ids information.



GET_SUBREG_REPORT Procedure

This procedure will generate a report for subscription and registration statistics. The report file is named 'aqmon_subreg.log', in the log directory. This procedure is valid only for Oracle Database version 11.1 or 11.2.

dbms_aq_monitor.get_subreg_report(
final_collect IN BOOLEAN DEFAULT TRUE);

get_subreg_report parameters

final_collect - whether collect one snapshot before generating report (only effective when the monitor is still running)

AQMonitor Files

The Advanced Queueing Monitor files are located in $ORACLE_HOMErdbmsdemo from 11.2.0.2 onwards. The version contained within the zip file which can be downloaded from the following link AQMonitor contains the latest version.

Usage

Connect to the database and load the monitor package as follows

sqlplus /nolog
The dbms_aq_monitor package has dependencies on AWR views. If they do not exist then ORA-942 errors will be reported when loading the package. To resolve this run catawr.sql (11.1 onwards) or catsvrm.sql (10.2) as sys with sysdba
  privileges and then re-run @aqmonitor.




The script will create up a monitor user (which can be modified as required), create tables used to store AQ performance information and load the monitor package. After this has been completed connect as the monitor user. Add queue owners
to the monitoring list and set any monitoring parameters before starting the monitor. For example, if you are going to run the monitor for several days, you could set relatively large frequency values. In the following example the monitor sets the
log directory to /home/jerry/test (the oracle software owner will require read/write privileges on the directory). If the directory contains old log files, the monitor will overwrite them. The monitor will collect runtime statistics every 600 seconds
and queue configuration statistics every 3600 seconds. It will also dump an AWR report every 3000 seconds, and dump accumulative statistics in log files every 1800 seconds.

SQL> set serveroutput on
SQL> EXEC dbms_aq_monitor.add_queue_owners('A1');
SQL> EXEC dbms_aq_monitor.set_log_dir('/home/jerry/test', TRUE);
SQL> EXEC dbms_aq_monitor.set_monitoring_param('config_collect_freq',3600);
SQL> EXEC dbms_aq_monitor.set_monitoring_param('runtime_collect_freq',600);
SQL> EXEC dbms_aq_monitor.set_monitoring_param('awr_dump_freq', 3000);
SQL> EXEC dbms_aq_monitor.set_monitoring_param('accum_dump_freq', 1800);
SQL> EXEC dbms_aq_monitor.show_config;
SQL> EXEC dbms_aq_monitor.start_monitor

The final step immediately starts the monitor jobs in the background, and all the queues belonging to the user A1 are monitored. You can stop the monitor after a set period of time

SQL > exec dbms_aq_monitor.stop_monitor(60);

The monitor will be automatically stopped after 60 minutes. Alternatively, you could run "exec dbms_aq_monitor.stop_monitor" at any time when you want to stop the monitor.

At any time after the monitor has been started, you can run the following commands to generate reports. You do not need to stop the monitor in order to generate reports.

SQL> exec dbms_aq_monitor.get_report;
SQL> exec dbms_aq_monitor.get_all_queues_reports;

The above commands generate the summary report for all queues, and generate detailed reports for all queues on the current instance.


  NOTE: It is recommended to use set serveroutput on when using the above APIs. They will print execution information to the screen.


Notes and Restrictions

   1.   The queue owner must be added before the monitor is started. Otherwise statistics for new owners will not be collected.
   2.   Once a monitor is started, all previously collected statistics will be cleared. When the monitor is stopped, collected statistics will not be cleared.
   3.   At most one monitor instance is allowed at all time. It means that, if start_monitor procedure is successfully executed (in any session), a new monitor instance will be started and all previous monitoring results will be cleared.
   4.   The monitor instance works across multiple sessions. For example, you could start the monitor in one session, and stop it in another session. A monitor operation can be executed in any session and will have the same effect.
   5.   Reports could be generated without stopping the monitor. Generating reports doesn't affect ongoing monitoring.

Plotting the Data Generated

If the file_plot parameter is set

SQL > exec dbms_aq_monitor.set_monitoring_param('file_plot', 1);

Then, for each of the queues that detailed queue reports are generated, there is an additional data file. The data file is named 'aqmon_queue_ABC_XXYY.S.T.gnuplot', where ABC stands for the instance number, XXYY stands for the queue id, S
could be '11.1' or '11.2' (depending on the database version), and T could be 'persistent' or 'buffered' (depending on the queue type).

The shell script 'aqmon.plot' can be used to plot monitoring results based on above data files. In order to do this put all the data files into the directory which contains the shell script, and then run the shell script. The script will generate one plot
file for each of the data files. The name of a plot file is the name of the corresponding data file appended by '.png'. Alternatively the data can be loaded into spreadsheet software for further analysis.

Sample Results

Here is a sample plot generated by gnuplot
The same data could be imported in a spreadsheet package as an alternative to gnuplot.

Still have questions ?


  To discuss this information further with Oracle experts and industry peers, we encourage you to review, join or start a discussion in the My Oracle Support Streams and Distributed Database Community.

  The goal of this community is to exchange knowledge and concepts about Oracle Streams Advanced Queuing (AQ) and distributed databases, with special consideration for the components listed below:
    - Distributed Databases
    - Streams Replication and Advanced Queuing
    - Advanced Replication
    - XA


To provide feedback on this note, click on the "Rate this document" link above.

More Related Content

What's hot

Obiee logfiles 11.1.1.5
Obiee logfiles 11.1.1.5Obiee logfiles 11.1.1.5
Obiee logfiles 11.1.1.5Amit Sharma
 
Basic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition PresentationBasic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition PresentationN/A
 
FIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11GFIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11GN/A
 
12c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.412c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.4uzzal basak
 
Reorganizing AQ tables in APPS_TS_QUEUES in ebs r12.1/r12.2
Reorganizing AQ tables in  APPS_TS_QUEUES in ebs r12.1/r12.2Reorganizing AQ tables in  APPS_TS_QUEUES in ebs r12.1/r12.2
Reorganizing AQ tables in APPS_TS_QUEUES in ebs r12.1/r12.2maaz khan
 
Rman workshop short
Rman workshop shortRman workshop short
Rman workshop shortNabi Abdul
 
Oracle Flashback Query 3
Oracle Flashback Query 3Oracle Flashback Query 3
Oracle Flashback Query 3grogers1124
 
Linea de comandos bioface zem800
Linea de comandos bioface zem800Linea de comandos bioface zem800
Linea de comandos bioface zem800thomaswarnerherrera
 
Oracle SQL AND PL/SQL
Oracle SQL AND PL/SQLOracle SQL AND PL/SQL
Oracle SQL AND PL/SQLsuriyae1
 

What's hot (15)

Jcl faqs
Jcl faqsJcl faqs
Jcl faqs
 
Db health check
Db health checkDb health check
Db health check
 
Obiee logfiles 11.1.1.5
Obiee logfiles 11.1.1.5Obiee logfiles 11.1.1.5
Obiee logfiles 11.1.1.5
 
Basic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition PresentationBasic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition Presentation
 
FIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11GFIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11G
 
DB2UDB_the_Basics
DB2UDB_the_BasicsDB2UDB_the_Basics
DB2UDB_the_Basics
 
12c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.412c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.4
 
Reorganizing AQ tables in APPS_TS_QUEUES in ebs r12.1/r12.2
Reorganizing AQ tables in  APPS_TS_QUEUES in ebs r12.1/r12.2Reorganizing AQ tables in  APPS_TS_QUEUES in ebs r12.1/r12.2
Reorganizing AQ tables in APPS_TS_QUEUES in ebs r12.1/r12.2
 
Rman workshop short
Rman workshop shortRman workshop short
Rman workshop short
 
Oracle Flashback Query 3
Oracle Flashback Query 3Oracle Flashback Query 3
Oracle Flashback Query 3
 
Linea de comandos bioface zem800
Linea de comandos bioface zem800Linea de comandos bioface zem800
Linea de comandos bioface zem800
 
Build Generation
Build GenerationBuild Generation
Build Generation
 
Linux
LinuxLinux
Linux
 
Oracle SQL AND PL/SQL
Oracle SQL AND PL/SQLOracle SQL AND PL/SQL
Oracle SQL AND PL/SQL
 
Sqlplus
SqlplusSqlplus
Sqlplus
 

Viewers also liked

社会化数字音乐服务设计研究 ——以Last.fm的用户标签行为数据分析为例
社会化数字音乐服务设计研究 ——以Last.fm的用户标签行为数据分析为例 社会化数字音乐服务设计研究 ——以Last.fm的用户标签行为数据分析为例
社会化数字音乐服务设计研究 ——以Last.fm的用户标签行为数据分析为例 dasiyjun
 
WordCampEDU Scriblio 2009-02-02
WordCampEDU Scriblio 2009-02-02WordCampEDU Scriblio 2009-02-02
WordCampEDU Scriblio 2009-02-02Casey Bisson
 
Saanich Parks & Recreation, Dec 8, 2011
Saanich Parks & Recreation, Dec 8, 2011Saanich Parks & Recreation, Dec 8, 2011
Saanich Parks & Recreation, Dec 8, 2011BWEST Interactive
 
Vinci2011会议演讲PPT
Vinci2011会议演讲PPTVinci2011会议演讲PPT
Vinci2011会议演讲PPTdasiyjun
 
C Lub Presentation August
C Lub Presentation AugustC Lub Presentation August
C Lub Presentation AugustHao_ha
 
The Hollinters Go Camping
The Hollinters Go CampingThe Hollinters Go Camping
The Hollinters Go CampingHeather B.
 
The Advisor - Winter 2009
The Advisor - Winter 2009The Advisor - Winter 2009
The Advisor - Winter 2009Cohen & Company
 
emotikon - english - french
emotikon - english - frenchemotikon - english - french
emotikon - english - frenchadosteatroa
 
Smart Building Solutions
Smart Building SolutionsSmart Building Solutions
Smart Building SolutionsYamin Malik
 
Genesis Resource Group Sequencing
Genesis Resource Group SequencingGenesis Resource Group Sequencing
Genesis Resource Group Sequencingguest84a9722
 
Marion Hughes Resume 3 11 2011
Marion Hughes Resume 3 11 2011Marion Hughes Resume 3 11 2011
Marion Hughes Resume 3 11 2011Marion Roger
 
Manuel Landa, Urban 360
Manuel Landa, Urban 360Manuel Landa, Urban 360
Manuel Landa, Urban 360IAB México
 
ACH 216 Lecture 10 (Materials Mgmt & Quality Assurance)
ACH 216 Lecture 10 (Materials Mgmt & Quality Assurance)ACH 216 Lecture 10 (Materials Mgmt & Quality Assurance)
ACH 216 Lecture 10 (Materials Mgmt & Quality Assurance)Anne Arundel Community College
 

Viewers also liked (20)

社会化数字音乐服务设计研究 ——以Last.fm的用户标签行为数据分析为例
社会化数字音乐服务设计研究 ——以Last.fm的用户标签行为数据分析为例 社会化数字音乐服务设计研究 ——以Last.fm的用户标签行为数据分析为例
社会化数字音乐服务设计研究 ——以Last.fm的用户标签行为数据分析为例
 
WordCampEDU Scriblio 2009-02-02
WordCampEDU Scriblio 2009-02-02WordCampEDU Scriblio 2009-02-02
WordCampEDU Scriblio 2009-02-02
 
Saanich Parks & Recreation, Dec 8, 2011
Saanich Parks & Recreation, Dec 8, 2011Saanich Parks & Recreation, Dec 8, 2011
Saanich Parks & Recreation, Dec 8, 2011
 
Vinci2011会议演讲PPT
Vinci2011会议演讲PPTVinci2011会议演讲PPT
Vinci2011会议演讲PPT
 
C Lub Presentation August
C Lub Presentation AugustC Lub Presentation August
C Lub Presentation August
 
Corporate Brochure
Corporate BrochureCorporate Brochure
Corporate Brochure
 
The Hollinters Go Camping
The Hollinters Go CampingThe Hollinters Go Camping
The Hollinters Go Camping
 
The Advisor - Winter 2009
The Advisor - Winter 2009The Advisor - Winter 2009
The Advisor - Winter 2009
 
emotikon - english - french
emotikon - english - frenchemotikon - english - french
emotikon - english - french
 
Smart Building Solutions
Smart Building SolutionsSmart Building Solutions
Smart Building Solutions
 
SAMANTHALI.COM
SAMANTHALI.COMSAMANTHALI.COM
SAMANTHALI.COM
 
New York
New YorkNew York
New York
 
Genesis Resource Group Sequencing
Genesis Resource Group SequencingGenesis Resource Group Sequencing
Genesis Resource Group Sequencing
 
Marion Hughes Resume 3 11 2011
Marion Hughes Resume 3 11 2011Marion Hughes Resume 3 11 2011
Marion Hughes Resume 3 11 2011
 
The Message
The MessageThe Message
The Message
 
777
777777
777
 
Manuel Landa, Urban 360
Manuel Landa, Urban 360Manuel Landa, Urban 360
Manuel Landa, Urban 360
 
Tam Gaz Social Media
Tam Gaz Social MediaTam Gaz Social Media
Tam Gaz Social Media
 
ACH 216 Lecture 10 (Materials Mgmt & Quality Assurance)
ACH 216 Lecture 10 (Materials Mgmt & Quality Assurance)ACH 216 Lecture 10 (Materials Mgmt & Quality Assurance)
ACH 216 Lecture 10 (Materials Mgmt & Quality Assurance)
 
Hasil Kelompok I
Hasil Kelompok IHasil Kelompok I
Hasil Kelompok I
 

Similar to How to install setup-use the aq performance monitor package dbms aq-monitor [id 1163083.1]

Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and AdvisorsYour tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and AdvisorsJohn Kanagaraj
 
Ajuste (tuning) del rendimiento de SQL Server 2008
Ajuste (tuning) del rendimiento de SQL Server 2008Ajuste (tuning) del rendimiento de SQL Server 2008
Ajuste (tuning) del rendimiento de SQL Server 2008Eduardo Castro
 
SQL Server Performance Analysis
SQL Server Performance AnalysisSQL Server Performance Analysis
SQL Server Performance AnalysisEduardo Castro
 
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu   (obscure) tools of the trade for tuning oracle sq lsTony Jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu (obscure) tools of the trade for tuning oracle sq lsInSync Conference
 
Introduction to Parallel Execution
Introduction to Parallel ExecutionIntroduction to Parallel Execution
Introduction to Parallel ExecutionDoug Burns
 
2011 Collaborate IOUG Presentation
2011 Collaborate IOUG Presentation2011 Collaborate IOUG Presentation
2011 Collaborate IOUG PresentationBiju Thomas
 
2713897 oracle-unix-oracle
2713897 oracle-unix-oracle2713897 oracle-unix-oracle
2713897 oracle-unix-oraclesivacse09
 
Docker Security Paradigm
Docker Security ParadigmDocker Security Paradigm
Docker Security ParadigmAnis LARGUEM
 
2013 Collaborate - OAUG - Presentation
2013 Collaborate - OAUG - Presentation2013 Collaborate - OAUG - Presentation
2013 Collaborate - OAUG - PresentationBiju Thomas
 
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
Tony jambu   (obscure) tools of the trade for tuning oracle sq lsTony jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony jambu (obscure) tools of the trade for tuning oracle sq lsInSync Conference
 
Troubleshooting Apache Cloudstack
Troubleshooting Apache CloudstackTroubleshooting Apache Cloudstack
Troubleshooting Apache CloudstackRadhika Puthiyetath
 
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And WhatPerformance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And Whatudaymoogala
 
Kp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan userKp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan userDesty Yani
 
Oracle database 12.2 new features
Oracle database 12.2 new featuresOracle database 12.2 new features
Oracle database 12.2 new featuresAlfredo Krieg
 
EvolveExecutionPlans.pdf
EvolveExecutionPlans.pdfEvolveExecutionPlans.pdf
EvolveExecutionPlans.pdfPraveenPolu1
 
Trouble shooting apachecloudstack
Trouble shooting apachecloudstackTrouble shooting apachecloudstack
Trouble shooting apachecloudstackSailaja Sunil
 
Understanding Query Optimization with ‘regular’ and ‘Exadata’ Oracle
Understanding Query Optimization with ‘regular’ and ‘Exadata’ OracleUnderstanding Query Optimization with ‘regular’ and ‘Exadata’ Oracle
Understanding Query Optimization with ‘regular’ and ‘Exadata’ OracleGuatemala User Group
 
OTech magazine article - Principle of Least Privilege
OTech magazine article - Principle of Least PrivilegeOTech magazine article - Principle of Least Privilege
OTech magazine article - Principle of Least PrivilegeBiju Thomas
 

Similar to How to install setup-use the aq performance monitor package dbms aq-monitor [id 1163083.1] (20)

Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and AdvisorsYour tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
 
Aspects of 10 Tuning
Aspects of 10 TuningAspects of 10 Tuning
Aspects of 10 Tuning
 
Ajuste (tuning) del rendimiento de SQL Server 2008
Ajuste (tuning) del rendimiento de SQL Server 2008Ajuste (tuning) del rendimiento de SQL Server 2008
Ajuste (tuning) del rendimiento de SQL Server 2008
 
SQL Server Performance Analysis
SQL Server Performance AnalysisSQL Server Performance Analysis
SQL Server Performance Analysis
 
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu   (obscure) tools of the trade for tuning oracle sq lsTony Jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
 
Introduction to Parallel Execution
Introduction to Parallel ExecutionIntroduction to Parallel Execution
Introduction to Parallel Execution
 
2011 Collaborate IOUG Presentation
2011 Collaborate IOUG Presentation2011 Collaborate IOUG Presentation
2011 Collaborate IOUG Presentation
 
Struts by l n rao
Struts by l n raoStruts by l n rao
Struts by l n rao
 
2713897 oracle-unix-oracle
2713897 oracle-unix-oracle2713897 oracle-unix-oracle
2713897 oracle-unix-oracle
 
Docker Security Paradigm
Docker Security ParadigmDocker Security Paradigm
Docker Security Paradigm
 
2013 Collaborate - OAUG - Presentation
2013 Collaborate - OAUG - Presentation2013 Collaborate - OAUG - Presentation
2013 Collaborate - OAUG - Presentation
 
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
Tony jambu   (obscure) tools of the trade for tuning oracle sq lsTony jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
 
Troubleshooting Apache Cloudstack
Troubleshooting Apache CloudstackTroubleshooting Apache Cloudstack
Troubleshooting Apache Cloudstack
 
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And WhatPerformance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
 
Kp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan userKp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan user
 
Oracle database 12.2 new features
Oracle database 12.2 new featuresOracle database 12.2 new features
Oracle database 12.2 new features
 
EvolveExecutionPlans.pdf
EvolveExecutionPlans.pdfEvolveExecutionPlans.pdf
EvolveExecutionPlans.pdf
 
Trouble shooting apachecloudstack
Trouble shooting apachecloudstackTrouble shooting apachecloudstack
Trouble shooting apachecloudstack
 
Understanding Query Optimization with ‘regular’ and ‘Exadata’ Oracle
Understanding Query Optimization with ‘regular’ and ‘Exadata’ OracleUnderstanding Query Optimization with ‘regular’ and ‘Exadata’ Oracle
Understanding Query Optimization with ‘regular’ and ‘Exadata’ Oracle
 
OTech magazine article - Principle of Least Privilege
OTech magazine article - Principle of Least PrivilegeOTech magazine article - Principle of Least Privilege
OTech magazine article - Principle of Least Privilege
 

How to install setup-use the aq performance monitor package dbms aq-monitor [id 1163083.1]

  • 1. How To Install, Setup And Use The AQ Performance Monitor Package DBMS_AQ_MONITOR [ID 1163083.1] Modified: 22-Mar-2012 Type: BULLETIN Status: PUBLISHED Priority: 3 In this Document Purpose Scope and Application How To Install, Setup And Use The AQ Performance Monitor Package DBMS_AQ_MONITOR Purpose Overview Design Description Package Specification AQMonitor Files Usage Notes and Restrictions Plotting the Data Generated Sample Results Applies to: Oracle Server - Enterprise Edition - Version: 10.2.0.1 to 11.2.0.3 - Release: 10.2 to 11.2 Information in this document applies to any platform. Purpose The purpose of this document is to provide an overview of the dbms_aq_monitor package which can be used to monitor queue performance and provide statistics on Advanced Queueing (AQ) queue operations within a single instance or Real Application Cluster (RAC) environment. Scope and Application This is intended for anyone who needs to monitor or tune performance in an Advanced Queueing database. The procedure can be executed in a 10.2 database onwards but note this procedure will only gather detailed performance information on buffered queues in this version. In 11.1 onwards the procedure will gather detailed performance information for persistent and buffered queues and this information is further enhanced in 11.2 to include notification and Queue Monitor statistics. How To Install, Setup And Use The AQ Performance Monitor Package DBMS_AQ_MONITOR Purpose The purpose of the dbms_aq_monitor package is to provide a comprehensive overview of the AQ setup for specific AQ users within a database and to gather snapshot information in order to assist with tuning and performance issues within customer systems. Examples of typical problems would be 1. AQ queries/operations becoming more expensive over time. 2. Unable to scale up performance or unable to meet peak performance numbers. 3. Best-practices for tuning/improving an existing AQ setup. 4. RAC performance problems. Overview The PL/SQL package dbms_aq_monitor is designed to monitor AQ queue performance over a certain time duration. A user can define a start and end time during which specific queues can be monitored. The monitor can generate three types of reports: A summary report for all queues: The report will display all queue configuration information (such as queue id, queue owner, etc.). It also gives a performance summary for each queue, and sorts queues with different metrics (e.g., enqueue rate and dequeue rate). A detailed report for a certain queue: The report will show the performance of the queue in a time-series manner. It also gives information of other components related to the queue, such as queue monitor cache (11.2) and subscribers. Furthermore, it shows top SQL associated with the queues and segment usage related to the queue. In 11.2 onwards a report for subscription/registration statistics: The report will show subscription/registration statistics in a time-series manner.
  • 2. Design Description The monitor periodically collects statistics from the following AQ views - dba_queues, dba_queue_tables, dba_queue_subscribers - gv$persistent_queues, gv$persistent_subscribers, gv$persistent_qmn_cache - gv$buffered_queues, gv$buffered_subscribers - gv$subscr_registration_stats It also collects statistics from the following additional views - dba_hist_sqlstat, dba_hist_sqltext, dba_hist_seg_stat_obj, dba_hist_seg_stat - dba_hist_snapshot, dba_hist_sys_time_model, dba_hist_system_event, dba_hist_sysstat - dba_tables, dba_tablespaces, dba_segments, dba_indexes, dba_lobs, dba_rules, dba_rule_set_rules - dba_subscr_registrations The monitor creates 12 tables to store the statistics gathered from these views, in particular: 1. For persistent queues - aqmon_pqueues_tab - aqmon_pqueues_accum_tab - aqmon_psubscribers_tab - aqmon_pqmncache_tab 2. For buffered queues - aqmon_bqueues_tab - aqmon_bqueues_accum_tab - aqmon_bsubscribers_tab 3. For notification - aqmon_subreg_tab 4. General Information - aqmon_queue_config_tab - aqmon_subscriber_config_tab - aqmon_queue_owners_tab - aqmon_params_tab Package Specification Set/get Monitor Configuration Procedures ADD_QUEUE_OWNER Procedure This procedure adds a queue owner to the monitoring list. The owner name will be automatically capitalized. All queues belonging to that owner will be monitored. dbms_aq_monitor.add_queue_owner(owner_name IN VARCHAR2 DEFAULT NULL); add_queue_owner parameters owner_name - The schema name of the AQ Queue owner. REMOVE_QUEUE_OWNER Procedure This procedure removes a queue owner from the monitoring list. The owner name will be automatically capitalized.
  • 3. dbms_aq_monitor.remove_queue_owner(owner_name IN VARCHAR2 DEFAULT NULL); add_queue_owner parameters owner_name - The schema name of the AQ Queue owner. SET_LOG_DIR Procedure This procedure sets the directory for dumping log files dbms_aq_monitor.set_log_dir( dir_name IN VARCHAR2 DEFAULT NULL, overwrite_file IN BOOLEAN DEFAULT FALSE); set_log_dir parameters dir_name - The location where the Monitor log files will be stored overwrite_file - whether to overwrite existing file if log file 'aqmon_report.log' already exists in the log directory. SET_MONITORING_PARAM Procedure This procedure sets thet monitoring parameters dbms_aq_monitor.set_monitoring_param(param_name IN VARCHAR2 DEFAULT NULL, param_value IN PLS_INTEGER DEFAULT NULL); set_monitoring_param parameters param_name param_value (Default) Usage CONFIG_COLLECT_FREQ 300(seconds) frequency for collecting queue configuration info RUNTIME_COLLECT_FREQ 60(seconds) frequency for collecting queue runtime stats AWR_DUMP_FREQ 300(seconds) frequency for generating AWR report ACCUM_DUMP_FREQ 300(seconds) frequency for dumping accumulative stats in log file FILE_PLOT 0 whether dump per-queue stats file for gnuplot. Value could be 0 or 1. SHARED_SUBSQL_LENGTH 150 AQ generated SQL which shares the same first SHARED_SUBSQL_LENGTH characters and SHARED_MEMORY_BOUND 1 in total consume more than SHARED_MEMORY_BOUND MBytes of memory SHOW_CONFIG Procedure The procedure displays the monitor configuration parameters dbms_aq_monitor.show_config Monitor Control Procedures START_MONITOR Procedure
  • 4. This procedure starts the Monitor. When started, the monitor will clear up all previously collected statistics. It will also overwrite log files in the log directory. dbms_aq_monitor.start_monitor (start_time IN NUMBER DEFAULT 0); start_monitor parameters start_time - number of minutes after which the monitor will be started STOP_MONITOR Procedure This procedure stops all the statistics collecting processes associated with the Monitor. Existing statistics are still kept in database. The monitor will not stop until this procedure is executed. dbms_aq_monitor.stop_monitor(stop_time IN NUMBER DEFAULT 0); stop_monitor parameters stop_time - number of minutes after which the monitor will be stopped DESTROY_MONITOR Procedure This procedure clears all the tables and data used by the monitor. dbms_aq_monitor.destroy_monitor CLEAR_SCHEDULE_JOB Procedure This procedure clears the scheduled job. There are two types of scheduled jobs, 'start_monitor' or 'stop_monitor'. Each type of job could be scheduled only once. If you want to re-schedule the job at a different time, you need to first clear the job and then re-execute the operation. dbms_aq_monitor.clear_scheduled_job(job_name IN VARCHAR2 DEFAULT NULL); clear_schedule_job parameters job_name - can be either 'start_monitor' or 'stop_monitor' GET_REPORT Procedure This procedure generates a summary monitoring report for all queues on all instances. The report file is named 'aqmon_report.log', in the log directory. dbms_aq_monitor.get_report(final_collect IN BOOLEAN DEFAULT TRUE); get_report parameters final_collect - whether to collect one final snapshot before generating the report (only effective when the monitor is still running). GET_QUEUE_REPORT Procedure This procedure generates a detailed report for a specific queue on a specific instance. dbms_aq_monitor.get_queue_report(queue_id IN NUMBER DEFAULT NULL, inst_number IN NUMBER DEFAULT NULL, final_collect IN BOOLEAN DEFAULT TRUE, single_logfile IN BOOLEAN DEFAULT FALSE); get_queue_report parameters
  • 5. Parameter Description inst_number If inst_number is not specified (i.e., inst_number IS NULL), then automatically fetch the current instance number. If inst_number = -1, then generate reports for the queue on all instances. For other cases, inst_number should be >= 0. In Oracle database 10.2, inst_number cannot be -1. final_collect whether to collect one final snapshot before generating report (only effective when the monitor is still running). single_logfile If set to true, then all output will be written to a single logfile 'aqmon_all_queues.log'. Otherwise, each queue will have its own log file. The file is named 'aqmon_queue_ABC_XXYY.log', in the log directory, where ABC is the instance number and XXYY is the queue id. Note that the 'aqmon_report.log' file contains all queue ids information. GET_ALL_QUEUES_REPORTS Procedure This procedure generates a detailed report for each of the monitored queues on the specified instance. Each report name follows that in procedure get_queue_report. dbms_aq_monitor.get_all_queues_reports( inst_number IN NUMBER DEFAULT NULL, final_collect IN BOOLEAN DEFAULT TRUE, single_logfile IN BOOLEAN DEFAULT FALSE); Parameter Description inst_number If inst_number is not specified (i.e., inst_number IS NULL), then automatically fetch the current instance number. If inst_number = -1, then generate reports for the queue on all instances. For other cases, inst_number should be >= 0. In Oracle database 10.2, inst_number cannot be -1 final_collect whether to collect one final snapshot before generating report (only effective when the monitor is still running). single_logfile If set to true, then all output will be written to a single logfile 'aqmon_all_queues.log'. Otherwise, each queue will have its own log file. The file is named 'aqmon_queue_ABC_XXYY.log', in the log directory, where ABC is the instance number and XXYY is the queue id. Note that the 'aqmon_report.log' file contains all queue ids information. GET_SUBREG_REPORT Procedure This procedure will generate a report for subscription and registration statistics. The report file is named 'aqmon_subreg.log', in the log directory. This procedure is valid only for Oracle Database version 11.1 or 11.2. dbms_aq_monitor.get_subreg_report( final_collect IN BOOLEAN DEFAULT TRUE); get_subreg_report parameters final_collect - whether collect one snapshot before generating report (only effective when the monitor is still running) AQMonitor Files The Advanced Queueing Monitor files are located in $ORACLE_HOMErdbmsdemo from 11.2.0.2 onwards. The version contained within the zip file which can be downloaded from the following link AQMonitor contains the latest version. Usage Connect to the database and load the monitor package as follows sqlplus /nolog
  • 6. The dbms_aq_monitor package has dependencies on AWR views. If they do not exist then ORA-942 errors will be reported when loading the package. To resolve this run catawr.sql (11.1 onwards) or catsvrm.sql (10.2) as sys with sysdba privileges and then re-run @aqmonitor. The script will create up a monitor user (which can be modified as required), create tables used to store AQ performance information and load the monitor package. After this has been completed connect as the monitor user. Add queue owners to the monitoring list and set any monitoring parameters before starting the monitor. For example, if you are going to run the monitor for several days, you could set relatively large frequency values. In the following example the monitor sets the log directory to /home/jerry/test (the oracle software owner will require read/write privileges on the directory). If the directory contains old log files, the monitor will overwrite them. The monitor will collect runtime statistics every 600 seconds and queue configuration statistics every 3600 seconds. It will also dump an AWR report every 3000 seconds, and dump accumulative statistics in log files every 1800 seconds. SQL> set serveroutput on SQL> EXEC dbms_aq_monitor.add_queue_owners('A1'); SQL> EXEC dbms_aq_monitor.set_log_dir('/home/jerry/test', TRUE); SQL> EXEC dbms_aq_monitor.set_monitoring_param('config_collect_freq',3600); SQL> EXEC dbms_aq_monitor.set_monitoring_param('runtime_collect_freq',600); SQL> EXEC dbms_aq_monitor.set_monitoring_param('awr_dump_freq', 3000); SQL> EXEC dbms_aq_monitor.set_monitoring_param('accum_dump_freq', 1800); SQL> EXEC dbms_aq_monitor.show_config; SQL> EXEC dbms_aq_monitor.start_monitor The final step immediately starts the monitor jobs in the background, and all the queues belonging to the user A1 are monitored. You can stop the monitor after a set period of time SQL > exec dbms_aq_monitor.stop_monitor(60); The monitor will be automatically stopped after 60 minutes. Alternatively, you could run "exec dbms_aq_monitor.stop_monitor" at any time when you want to stop the monitor. At any time after the monitor has been started, you can run the following commands to generate reports. You do not need to stop the monitor in order to generate reports. SQL> exec dbms_aq_monitor.get_report; SQL> exec dbms_aq_monitor.get_all_queues_reports; The above commands generate the summary report for all queues, and generate detailed reports for all queues on the current instance. NOTE: It is recommended to use set serveroutput on when using the above APIs. They will print execution information to the screen. Notes and Restrictions 1. The queue owner must be added before the monitor is started. Otherwise statistics for new owners will not be collected. 2. Once a monitor is started, all previously collected statistics will be cleared. When the monitor is stopped, collected statistics will not be cleared. 3. At most one monitor instance is allowed at all time. It means that, if start_monitor procedure is successfully executed (in any session), a new monitor instance will be started and all previous monitoring results will be cleared. 4. The monitor instance works across multiple sessions. For example, you could start the monitor in one session, and stop it in another session. A monitor operation can be executed in any session and will have the same effect. 5. Reports could be generated without stopping the monitor. Generating reports doesn't affect ongoing monitoring. Plotting the Data Generated If the file_plot parameter is set SQL > exec dbms_aq_monitor.set_monitoring_param('file_plot', 1); Then, for each of the queues that detailed queue reports are generated, there is an additional data file. The data file is named 'aqmon_queue_ABC_XXYY.S.T.gnuplot', where ABC stands for the instance number, XXYY stands for the queue id, S could be '11.1' or '11.2' (depending on the database version), and T could be 'persistent' or 'buffered' (depending on the queue type). The shell script 'aqmon.plot' can be used to plot monitoring results based on above data files. In order to do this put all the data files into the directory which contains the shell script, and then run the shell script. The script will generate one plot file for each of the data files. The name of a plot file is the name of the corresponding data file appended by '.png'. Alternatively the data can be loaded into spreadsheet software for further analysis. Sample Results Here is a sample plot generated by gnuplot
  • 7. The same data could be imported in a spreadsheet package as an alternative to gnuplot. Still have questions ? To discuss this information further with Oracle experts and industry peers, we encourage you to review, join or start a discussion in the My Oracle Support Streams and Distributed Database Community. The goal of this community is to exchange knowledge and concepts about Oracle Streams Advanced Queuing (AQ) and distributed databases, with special consideration for the components listed below: - Distributed Databases - Streams Replication and Advanced Queuing - Advanced Replication - XA To provide feedback on this note, click on the "Rate this document" link above.