使用ORACLESTREAMSTRMMON监控工具
Oracle Streams STRMMON Monitoring Utility [ID 290605.1]
In this Document
Purpose
Scope and Application
Oracle Streams STRMMON Monitoring Utility
Installation
Usage
Output
Known problems
References
Applies to:
Oracle Server - Enterprise Edition - Version: 9.2.0.1 to 10.2.0.4 - Release: 9.2 to 10.2
Information in this document applies to any platform.
On release 11G and onwards STRMMON functionality has been replaced by the Streams Performance Advisor distributed within the Streams product and implemented through DBMS_STREAMS_ADVISOR_ADM PL/SQL package. Please refer to chapter "Monitoring the Oracle Streams Topology and Performance" on "Oracle Streams Concepts and Administration 11g Release 1" guide for further information on the Streams Performace Advisor
strmmon工具适用于oracle9i和10g,在11g中,oracle提供了Streams Performance Advisor来替代strmmon,Streams Performance Advisor通过DBMS_STREAMS_ADVISOR_ADM PL/SQL 实现其功能。
Purpose
***Checked for relevance on 10-Jan-2011***
The purpose of the note is to explain how to install, use and interpret the output of STRMMON utility.
本文的目的旨在说明如何安装,使用strmmon工具,如何理解strmmon工具的输出
Scope and Application
STRMMON is a monitoring tool focused on Oracle Streams. Using this tool,Database administrators get a quick overview of the Streams activity occurring within a database.
STRMMON can also be used to report Streams activity on two databases at a time within the same strmmon session.
strmmon工具可以同时监控两个数据库
In releases 9i and 10G Release 1, STRMMON is not a supported tool, as of Oracle 10g Release 2, STRMMON is distributed as in the demo directory of the database distribution code.
在oracle9i和10g1中,默认没有安装strmmon,需要我们单独下载strmmon压缩包来安装,在10g2中,oracle默认提供strmmon安装文件,位置在$ORACLE_HOME/rdbms/demo
Also note that alternatively and in newer releases of RDA you can get using similar information that STRMMON retrieve by using Streams Monitoring Information module (STM). So you can get this information by running
./rda.sh -vCRP STM or
./rda.sh -vCRP OS DB DBA NET D2PC STC STM
Oracle Streams STRMMON Monitoring Utility
Installation
STRMMON is delivered as a zip file that includes an OCI program and make file for use with Oracle releases prior to 10g Release 2.
Click here to download the STRMMON zip file. Change directory to a new directory. If necessary transfer the tar file in BINARY mode. Extract the files from the zip file.
For releases prior to Oracle Database 10g Release 2
Create a directory for the STRMMON files. Extracted the files from the downloaded STRMMON.zip file. Before compiling and linking the strmmon program, make sure that the ORACLE_HOME and LD_LIBRARY_PATH environmental variables are set up appropriately. To compile and link, use the command:
make –f strmmon.mk strmmon
在oracle9i和10g1下,首先我们下载strmmon压缩包,解压后,运行 make -f stmmon.mk strmmon命令,在运行命令前,需要正确设置ORACLE_HOME和LD_LIBRARY_PATH环境变量。
After the program has been compiled and linked, strmmon can be used for monitoring a Streams environment.
NOTE: STRMMON is an OCI program. If you have difficulty using the supplied make file, follow the recommended procedure for compiling and linking OCI programs for your platform. (demo_rdbms.mk in the $ORACLE_HOME/rdbms/demo directory).
The strmmon.mk file identified above is a copy of the demo_rdbms.mk file from the Oracle 9i Database Release 2 software for the Solaris 32-bit platform.
如果使用上面的方式无法编译strmmon(压缩包中的 strmmon 是9i下 solaris 32 平台下demo_rdbms.mk的拷贝),可以采用下面的方法试一试
For Oracle Database 10g Release 2
STRMMON is distributed in the rdbms/demo directory on Release 10G release 2.
It is installed when installing "Oracle Database 10G Products" in the Companion CD.
To use the latest version of strmmon in Oracle Database 10g Release 2, archive the existing strmmon.c, strmmon.o, and strmmon files in the $ORACLE_HOME/rdbms/demo directory into a backup location. Then, extract the strmmon.c and the strmmon.html files from the STRMMON zip file into the rdbms/demo directory. Use the existing make file (demo_rdbms.mk) in the demo directory to generate the strmmon executable.
在10g2下,oracle默认为我们提供了strmmon,但是,我们也可以自己来编译,编译方法如下: 1:备份demo下的文件 2:拷贝下载的strmmon下的strmmon.c和strmmon.html文件到demo下 3:使用demo_rdbms.mk来编译strmmon
[yue@node1 demo]$ ll
total 452
-rw-r--r-- 1 yue oinstall 190 Aug 9 14:17 aqxml.conf
-rw-r----- 1 yue oinstall 190 Aug 9 13:58 aqxml.conf.ouibak
-rw-r--r-- 1 yue oinstall 10131 May 14 2009 demo_rdbms32.mk
-rw-r--r-- 1 yue oinstall 10118 Sep 28 2007 demo_rdbms64.mk
-rw-r--r-- 1 yue dba 9877 Aug 16 20:00 demo_rdbms.mk
-rw-r--r-- 1 yue dba 131780 Feb 7 2008 strmmon.c
-rw-r--r-- 1 yue dba 45922 Feb 10 2007 strmmon.htm
-rw-r--r-- 1 yue dba 1308 Aug 23 2004 strmmon.mk
-rw-r--r-- 1 yue dba 186688 Aug 16 20:02 strmmon.o
-rw-r--r-- 1 yue dba 31981 Aug 16 19:59 strmmon.zip
[yue@node1 demo]$ make -f demo_rdbms.mk strmmon
make -f /u01/app/singleoracle/product/11.2.0/db/rdbms/demo/demo_rdbms.mk build EXE=strmmon OBJS=strmmon.o
make[1]: Entering directory `/u01/app/singleoracle/product/11.2.0/db/rdbms/demo'
/usr/bin/gcc -L/u01/app/singleoracle/product/11.2.0/db/lib/ -L/u01/app/singleoracle/product/11.2.0/db/rdbms/lib/ -o strmmon strmmon.o -lclntsh `cat /u01/app/singleoracle/product/11.2.0/db/lib/sysliblist` -ldl -lm -lpthread
make[1]: Leaving directory `/u01/app/singleoracle/product/11.2.0/db/rdbms/demo'
[yue@node1 demo]$ ll
total 584
-rw-r--r-- 1 yue oinstall 190 Aug 9 14:17 aqxml.conf
-rw-r----- 1 yue oinstall 190 Aug 9 13:58 aqxml.conf.ouibak
-rw-r--r-- 1 yue oinstall 10131 May 14 2009 demo_rdbms32.mk
-rw-r--r-- 1 yue oinstall 10118 Sep 28 2007 demo_rdbms64.mk
-rw-r--r-- 1 yue dba 9877 Aug 16 20:00 demo_rdbms.mk
-rwxr-xr-x 1 yue dba 129998 Aug 16 23:27 strmmon
-rw-r--r-- 1 yue dba 131780 Feb 7 2008 strmmon.c
-rw-r--r-- 1 yue dba 45922 Feb 10 2007 strmmon.htm
-rw-r--r-- 1 yue dba 1308 Aug 23 2004 strmmon.mk
-rw-r--r-- 1 yue dba 186688 Aug 16 20:02 strmmon.o
-rw-r--r-- 1 yue dba 31981 Aug 16 19:59 strmmon.zip
[yue@node1 demo]$ ./strmmon
Usage: strmmon -interval -count [-user ]
[-passw ] [-dbname ] [-sysdba]
[-long]
[yue@node1 demo]$ mv strmmon strmmon.bak
[yue@node1 demo]$ make -f strmmon.mk strmmon
make -f /u01/app/singleoracle/product/11.2.0/db/rdbms/demo/demo_rdbms.mk build EXE=strmmon OBJS=strmmon.o
make[1]: Entering directory `/u01/app/singleoracle/product/11.2.0/db/rdbms/demo'
/usr/bin/gcc -L/u01/app/singleoracle/product/11.2.0/db/lib/ -L/u01/app/singleoracle/product/11.2.0/db/rdbms/lib/ -o strmmon strmmon.o -lclntsh `cat /u01/app/singleoracle/product/11.2.0/db/lib/sysliblist` -ldl -lm -lpthread
make[1]: Leaving directory `/u01/app/singleoracle/product/11.2.0/db/rdbms/demo'
[yue@node1 demo]$ ./strmmon -s
Error: option 's' needs a value
[yue@node1 demo]$ ./strmmon
Usage: strmmon -interval -count [-user ]
[-passw ] [-dbname ] [-sysdba]
[-long]
[yue@node1 demo]$ ll
total 716
-rw-r--r-- 1 yue oinstall 190 Aug 9 14:17 aqxml.conf
-rw-r----- 1 yue oinstall 190 Aug 9 13:58 aqxml.conf.ouibak
-rw-r--r-- 1 yue oinstall 10131 May 14 2009 demo_rdbms32.mk
-rw-r--r-- 1 yue oinstall 10118 Sep 28 2007 demo_rdbms64.mk
-rw-r--r-- 1 yue dba 9877 Aug 16 20:00 demo_rdbms.mk
-rwxr-xr-x 1 yue dba 129998 Aug 16 23:29 strmmon
-rwxr-xr-x 1 yue dba 129998 Aug 16 23:27 strmmon.bak
-rw-r--r-- 1 yue dba 131780 Feb 7 2008 strmmon.c
-rw-r--r-- 1 yue dba 45922 Feb 10 2007 strmmon.htm
-rw-r--r-- 1 yue dba 1308 Aug 23 2004 strmmon.mk
-rw-r--r-- 1 yue dba 186688 Aug 16 20:02 strmmon.o
-rw-r--r-- 1 yue dba 31981 Aug 16 19:59 strmmon.zip
[yue@node1 demo]$ diff strmmon strmmon.bak
从这里可以看出strmmon.mk最后还是通过demo_rdbms.mk来进行编译
Usage
There are 7 command line input parameters for STRMMON: interval, count, user, passwd, dbname, sysdba and long.
The first 2 parameters (interval and count) control the sampling rate and the amount of output. The next 4 parameters specify the connect information to the particular Streams database.
Use multiple occurrences of these 4 parameters to monitor multiple databases within the same strmmon command.
Specifying the last parameter (long) displays more detailed information about each process.
When the command strmmon is issued without any parameters, a usage message is displayed:
strmmon的命令格式如下:
% strmmon
Usage: strmmon -interval -count [-user ]
[-passwd ] [-dbname ] [-sysdba]
Parameters
Parameter Name
Value Units
Description
-interval
Seconds
The interval at which STRMMON will monitor the database. To specify that the sampling rate to be every 3 seconds:
-interval 3
This is a required parameter for strmmon.
采样间隔
-count
Number
The number of iterations to monitor the Streams environment. To specify 5 iterations, use the following: -count 5
This is a required parameter for strmmon.
采样总次数
-user
Username
The schema name for logging into the database. Any schema name can be specified. If the SYS schema is specified, additional information is displayed. To specify the SYSTEM schema, use
-user SYSTEM
This parameter should not be specified if logging in as / as sysdba is desired.
-user is an optional parameter for strmmon.
指定登陆用户名,如果不指定,则默认以“/ as sysdba”方式登陆
-passwd
password
The login password for the schema identified with the -user clause. To specify the password for the SYSTEM schema, use
-passwd oracle
This parameter should not be specified if logging in as / as sysdba is desired
-passwd is an optional parameter for strmmon.
登陆密码
-dbname
Service name
The connection information or service name from tnsnames.ora for the specific database to be monitored. To specify the connect information for the monitored database, use
-dbname ORCL.WORLD
This is an optional parameter for strmmon.
tnsname.ora文件中的数据库登陆标示
-sysdba
This flag indicates that the login role is SYSDBA. This optional parameter is typically used with the SYS schema.
When logging in as / as sysdba, the -user and -passwd parameters are not required
是否以sysdba方式登陆
-long
This flag indicates that the more detailed report is desired. This is an optional parameter for STRMMON. By default, only the capture, apply and propagation rates are
displayed.
指定该参数,则输出详细信息
STRMMON have to be used with the Oracle release used for compilation or linking although it can connect to a different release database by using -dbname parameter.
strmmon必须在编译和链接的数据库上运行
Output
The STRMMON output format comes in two formats: default and long.
The default format reports the rate of activity occuring for Streams processes.
The long format provides the detailed information that was available in previous releases of STRMMON. The reporting interval and number of iterations to display are configurable.
The strmmon output begins with a banner line identifying the program parameters and database. This information is followed with a brief description of the major components of the output display.
strmmon工具的首先输出版本信息和格式说明两部分
After this initial information about the program, Strmmon produces a single line of output representing the current status of Oracle Streams after the requested interval for each iteration. For example, if strmmon is invoked with '-interval 3 -count 5’, a line of output will be displayed every 3 seconds. After 5 lines have been displayed (15 seconds), the monitoring will end. .
然后,strmmon每间隔一定时间,输出一次streams的状态信息
Each line is composed of multiple blocks of information dependent on the streams processes configured within the database. These blocks are displayed by a keyword to identify the component followed by the statistics for that particular component. The separator between the components is the '|' symbol.
There are 7 components for Streams: LOG, NET, Cxxx, Qx, PRxx, PSxx and Axxx.
strmmon的输出包含7个组件:log net cxxx qx prxx psxx axxx
Except for the LOG and NET components, multiple occurrences of each component are possible dependent on the streams processes configured at database.
ARxx (Apply Reader) and ASxx (Apply Server) are subcomponents associated with each Axxx component.
An example of this identifying output is shown below:
% strmmon -interval 3 -count 5 -sysdba
STREAMS Monitor, v 2.5 Copyright Oracle Corp. 2002, 2005.
Interval = 3, Count=5
Logon= @ ORACLE 10.2.0.2.0
Streams Pool Size = 152M
LOG : 日志信息
NET: 网络信息
Cxxx: capture信息
MEM : % stream pool 信息
PRxx: 接受的message信息
Qx : queue信息
PSxx: propagation信息
Axxx: apply信息
: flow control in effect
: potential bottleneck 潜在的瓶颈
AR: apply reader
AS(n): n number of apply server
:
xx->: database instance name
To connect to multiple databases, the following command can be issued. inst1 and inst2 are the network service names (tnsnames.ora) for each database.
An example of the identifying output for the long report is shown below
链接多个数据库的示例:
% strmmon -interval 1 -count 1 -user sys -passw change_on_install \
-dbname inst1 -user sys -passw change_on_install -dbname inst2 \
-sysdba -long
STREAMS Monitor, v 2.5 Copyright Oracle Corp. 2002, 2005.
Interval = 3, Count=5
Logon=sys@inst1 ORACLE 10.2.0.2.0
Streams Pool Size = 152M
LOG :
NET:
Cxxx:
MEM : %
PRxx: /
Qx : /
PSxx: /
Axxx:
: flow control in effect
: potential bottleneck
AR: apply reader
AS(n): n number of apply serve
:
xx->: database instance name
STREAMS Monitor, v 2.5 Copyright Oracle Corp. 2002, 2005.
Interval = 3, Count=5
Logon=sys@inst2 ORACLE 10.2.0.2.0
Streams Pool Size = 152M
LOG :
NET:
Cxxx:
MEM : %
PRxx: /
Qx : /
PSxx: /
Axxx:
: flow control in effect
: potential bottleneck
AR: apply reader
AS(n): n number of apply serve
:
xx->: database instance name
NOTE: The information about the Streams Pool Size is displayed only for database versions greater than or equal to 10gR1.
LOG
Information about the redo log activity is written in this block.
The first statistic following the LOG: keyword is the current SCN that has been written to the redo log. This number represents the current activity within the database. If this number does not increase, no activity is occurring on the database.
The second statistic is the last block number written in the redo log. Redo blocks are always 512 bytes, so this statistic can be used to calculate the amount of redo generated between intervals.
The output for the LOG component under the -long option is always the first entry after the timestamp and the database name on the display and appears as follows:
2005-08-13 18:05:23 || lnxmain-> | LOG 2952151 812574 |
2005-08-13 18:05:23 || lnxmain-> | LOG 2952151 812574 |
2005-08-13 18:05:27 || lnxmain-> | LOG 2952155 812576 |
2005-08-13 18:05:30 || lnxmain-> | LOG 2952156 812577 |
2005-08-13 18:05:33 || lnxmain-> | LOG 2952156 812577 |
In the above example, the current scn that written to the redo log is 2952151 and the last block number is 812574. Since the strmmon command was issued with –interval 3 –count 5, 5 lines of output are displayed with a 3 second interval between them. The activity on this database is very low, as seen by the fact that the current scn increases infrequently (note change between 18:05:23 and 18:05:27 and 18:05:30).
For the default output, the LOG component entry shows the rate at which redo information is generated:
2005-08-13 18:08:51 || lnxmain-> | LOG 1K |
2005-08-13 18:08:54 || lnxmain-> | LOG 341 |
2005-08-13 18:08:57 || lnxmain-> | LOG 170 |
2005-08-13 18:09:00 || lnxmain-> | LOG 0 |
The printed value is the average number of bytes of redo generated per
日志的统计信息,很容易明白,不过多解释
NET
For the default output, the average number of bytes per second generated over the network by clients and dblinks is reported. For the -long output, the current values for the statistics of client and dblink network activity are reported.
Cxxx
For each capture process configured in the database, a separate block will be displayed. Each block displays the number of lcrs captured per sec, number of lcrs enqueued per sec and the capture latency. If "-long" option is specified, then in each block, the Logminer read scn, the total number of messages captured from the redo log and the most recent scn captured from the redo log are shown. In addition, the number of messages that match the rules specified for the capture process including the most recent message scn enqueued are shown along with the capture latency.
One can also use the difference between successive capture "messages captured" statistics to determine the rate at which capture is mining the redo log. The enqueue scn of capture is an indicator of where the capture process will restart, if capture is stopped and restarted while the database is running. This statistic can also be used for comparison with the appropriate database Apply process high-water mark scn. If these statistics match, the capture and apply are caught up and the data is synchronized.
MEM%
If strmmon is run from the SYS schema connected as SYSDBA, and the database version is 10gR1 or higher, then this displays the percentage of Streams Pool memory currently in use and the size of the Streams Pool. These statistics are reported in both the default and –long output formats.
Qx
For each streams queue in the database, a separate block displays the queue identifier, the cumulative message rate and the spill rate. If "-long" option is specified, then for each streams queue in the database, a separate block will display the queue identifier as well as the number of outstanding messages in the buffered queue, the cumulative number of messages that have been in the queue and the number of messages spilled from memory to disk. In version 9iR2, the number of messages currently spilled is displayed. In 10gR1, the cumulative number of messages spilled is displayed. For 9iR2, the default and the "-long" option display the same data.
The queue identifier (QID) can be used to identify the name of the queue. Use the QID in queries against the DBA_QUEUES view to identify the particular queue in the database. In Oracle Database 9i Release 2, the number of outstanding messages in the buffered queue is only displayed if strmmon is run from the SYS schema as SYSDBA. In 9iR2, if the number of spilled messages becomes non-zero, consider stopping capture temporarily to slow down the flow of data. See Metalink Note 259609.1 for an example flow control script.
PSxx
For each propagation sender, the number of lcrs propagated per sec is displayed. If "-long" option is specified, the for each propagation, the total number of messages and the total number of bytes propagated to the destination site and the total time needed to propagate those messages is displayed.
PRxx
For each propagation receiver, the number of lcrs received per sec is displayed. If "-long" option is specified, the for each propagation, the total number of messages received and the total time to receive those messages is displayed
Axxx
For each apply process, the number of lcrs applied per sec, the number of transactions applied per second, and the apply latency are displayed. If the "-long" option is specified, then for each apply process in the database, the total messages dequeued and the most recent scn dequeued by the apply reader, the dequeue latency, the total number of transactions received, assigned and applied by the coordinator are displayed. The apply high water mark scn along with the apply high water mark latency is also shown. This statistic records the most recent scn from the source site that has been applied at the destination site.
AR
This subcomponent lists the percentage of idle events, flow control events, and the single most significant wait event for the apply reader process if the database version is 10gR1 or higher.
AS(n)
This subcomponent lists the percentage of idle events, flow control events, and the single most significant wait event for the apply server process(es) if the database version is 10gR1 or higher. When apply parallelism is enabled, the values reflect the sum of all associated apply servers in each category: idle, flow control, and wait event.
Flags
- Flow Control
This indicates that the capture process is blocked due to flow control.
- Potential Bottlenecks
This indicates that the capture or apply process is currently a bottleneck.
-
When displayed for a component, x%I indicates the percentage(x%) of idle(I) time for the component. x%F indicates the percentage(x%) of time waiting on flow control events(F). The event with the highest percent (x%) of time waited is indicated(xx)the percentage of time(x%) spent waiting on
- Instance
This indicates the name of the database instance for which the data follows.
Known problems
Compilation/Linking errors while running make command
Error: sh: cc: not found
Cause : C compiler can not be found in the path.
Solution: Include the path to the C compiler in the PATH environmental variable.
Error:
strmmon.c:1114: parse error before "ub8"
strmmon.c:1114: warning: no semicolon at end of struct or union
strmmon.c:1115: warning: data definition has no type or storage class
strmmon.c: In function `print_prop_stats':
Cause : strmmon make use of ub8 definition, sometimes the expansion for this definition has failed.
Solution: Include the definition of ub8 in the strmmon file, just before the definition of prop struct.
Definition of ub8 is as follows:
#define ub8 unsigned long long
Execution errors while running strmmon utility
Error: Strmmon dump a core or raise a Memory fault
Cause : Compilation parameters are not the best for this platform
Solution : Use -user and -passwd parameters with user SYSTEM
Error: Error while loading shared libraries
Cause: LD_LIBRARY_PATH not defined
Solution : Define LD_LIBRARY_PATH
Error: OCIEnvCreate() failed
Cause : strmmon has been compiled/linked with a release different to the one that is being used now.
Solution : Use the right ORACLE_HOME and use -dbname parameter to access a different database release
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
http://www.dengb.com/oracle/866170.htmlwww.dengb.comtruehttp://www.dengb.com/oracle/866170.htmlTechArticle使用ORACLESTREAMSTRMMON监控工具 Oracle Streams STRMMON Monitoring Utility [ID 290605.1] In this Document Purpose Scope and Application Oracle Streams STRMMON Monitoring Utili...