266 UTL_RPADV
The UTL_RPADV
package provides subprograms to collect and analyze statistics for the Oracle Replication components in a distributed database environment. This package uses the Oracle Replication Performance Advisor to gather statistics.
This chapter contains the following topic:
266.1 UTL_RPADV Overview
This package enables you to collect and analyze statistics about the performance or Oracle Replication components. You can either collect statistics on demand or you can create a monitoring job that continually monitors Oracle Replication performance.
When this package is used on an Oracle Database 11g Release 2 (11.2) database, it can monitor Oracle Database 10g Release 2 (10.2) and later databases. It cannot monitor databases before release 10.2.
266.2 DBMS_COMPARISON Security Model
Security on this package can be controlled by either granting EXECUTE
on this package to selected users or roles, or by granting EXECUTE_CATALOG_ROLE
to selected users or roles.
If subprograms in the package are run from within a stored procedure, then the user who runs the subprograms must be granted EXECUTE
privilege on the package directly. It cannot be granted through a role.
To ensure that the user who runs the subprograms in this package has the necessary privileges, configure an Oracle Replication administrator and connect as the Oracle Replication administrator when using this package.
266.3 UTL_RPADV Operational Notes
To use this package, you must connect to an Oracle database as an Oracle Replication administrator and run the utlrpadv.sql
script in the rdbms/admin
directory in ORACLE_HOME
.
The utlrpadv.sql
script creates the following tables:
The Oracle Replication Performance Advisor populates these tables when it is run.
STREAMS$_PA_COMPONENT Table
The STREAMS$_PA_COMPONENT
table displays information about the Oracle Replication components at each database.
Table 266-1 STREAMS$_PA_COMPONENT Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
|
Identification number assigned to the component by the Oracle Replication Performance Advisor |
|
|
Name of the component |
|
|
|
Name of the database that contains the component |
|
|
|
Type of the component The following types are possible:
|
|
|
|
Time when the component was last changed |
STREAMS$_PA_COMPONENT_LINK Table
The STREAMS$_PA_COMPONENT_LINK
table displays information about how information flows between Oracle Replication components.
Table 266-2 STREAMS$_PA_COMPONENT_LINK Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
|
Identification number assigned to the path by the Oracle Replication Performance Advisor |
|
|
Unique key assigned to the path by the Oracle Replication Performance Advisor |
|
|
|
|
Source component ID for the path The path starts with this component. |
|
|
|
Destination component ID for the path The path ends with this component. |
|
|
Position of the component in the path |
STREAMS$_PA_COMPONENT_PROP Table
The STREAMS$_PA_COMPONENT_PROP
table displays information about capture processes and apply processes necessary for analysis by the Replication Performance Advisor.
Table 266-3 STREAMS$_PA_COMPONENT_PROP Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
|
Identification number assigned to the component by the Oracle Replication Performance Advisor |
|
|
Property name For a capture process, the component properties include the following:
For an apply process, the component properties include the following:
|
|
|
|
Property value |
STREAMS$_PA_COMPONENT_STAT Table
The STREAMS$_PA_COMPONENT_STAT
table displays performance statistics and session statistics about each Oracle Replication component.
Table 266-4 STREAMS$_PA_COMPONENT_STAT Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
Identification number of the Oracle Replication Performance Advisor run |
|
|
|
Time when the Oracle Replication Performance Advisor was run for the advisor run ID |
|
|
|
Identification number assigned to the component by the Oracle Replication Performance Advisor |
|
|
|
Time when the statistic was recorded |
|
|
|
Name of the statistic |
|
|
|
Value recorded for the statistic |
|
|
|
Unit of measurement for the statistic |
|
|
|
Type of the subcomponent Only capture processes and apply processes have subcomponents. The following capture process subcomponent types are possible:
The following apply process subcomponent types are possible:
|
|
|
|
Identification number of the session for the component. Query the |
|
|
|
Session serial number of the session for the component. Query the |
STREAMS$_PA_CONTROL Table
The STREAMS$_PA_CONTROL
table displays the parameters set for the COLLECT_STATS
procedure in this package. The parameters control the monitoring behavior.
Table 266-5 STREAMS$_PA_CONTROL Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
Identification number of the Oracle Replication Performance Advisor run |
|
|
|
Time when the Oracle Replication Performance Advisor was last run |
|
|
|
The name of the parameter |
|
|
|
The value set for the parameter |
|
|
|
The unit of the parameter |
STREAMS$_PA_DATABASE Table
The STREAMS$_PA_DATABASE
table displays information about each database that contains Oracle Replication components.
Table 266-6 STREAMS$_PA_DATABASE Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
|
Global name of the database analyzed by the Oracle Replication Performance Advisor |
|
|
The time when the Performance Advisor successfully collected information from a database in its last run |
|
|
|
The error number of the error encountered when the database was last queried |
|
|
|
The error message of the error encountered when the database was last queried |
STREAMS$_PA_DATABASE_PROP Table
The STREAMS$_PA_DATABASE_PROP
table displays Oracle Replication database property information necessary for analysis by the Replication Performance Advisor.
Table 266-7 STREAMS$_PA_DATABASE_PROP Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
|
Global name of the database analyzed by the Oracle Replication Performance Advisor |
|
|
Property name The database properties include the following:
|
|
|
|
Property value |
STREAMS$_PA_MONITORING Table
The STREAMS$_PA_MONITORING
table displays information about each monitoring job running in a database.
Table 266-8 STREAMS$_PA_MONITORING Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
|
Name of the monitoring job |
|
|
Name of the client that submitted the job See Also: "Full Monitoring Job Names" |
|
|
|
User granted privileges to view the monitoring results |
|
|
|
Name of the table used by the |
|
|
|
Time the monitoring job started |
|
|
|
Time the monitoring job last stopped |
|
|
|
Time the monitoring job was last altered |
|
|
|
State of the monitoring job, either |
STREAMS$_PA_PATH_BOTTLENECK Table
The STREAMS$_PA_PATH_BOTTLENECK
table displays information about Oracle Replication components that might be slowing down the flow of messages.
Table 266-9 STREAMS$_PA_PATH_BOTTLENECK Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
Identification number of the Oracle Replication Performance Advisor run |
|
|
|
Time when the Oracle Replication Performance Advisor was last run |
|
|
|
Reason for the bottleneck |
|
|
|
Identification number assigned to the path by the Oracle Replication Performance Advisor |
|
|
|
Unique key assigned to the path by the Oracle Replication Performance Advisor |
|
|
|
Identification number assigned to the component by the Oracle Replication Performance Advisor |
|
|
|
Session ID of the top component. Query the |
|
|
|
Session serial number of the top component. Query the |
|
|
|
Action name for the top session |
|
|
|
Whether a bottleneck was identified |
STREAMS$_PA_PATH_STAT Table
The STREAMS$_PA_PATH_STAT
table displays performance statistics about each stream path.
Table 266-10 STREAMS$_PA_PATH_STAT Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
Identification number of the Oracle Replication Performance Advisor run |
|
|
|
Time when the Oracle Replication Performance Advisor was run for the advisor run ID |
|
|
|
Identification number assigned to the path by the Oracle Replication Performance Advisor |
|
|
|
Unique key assigned to the path by the Oracle Replication Performance Advisor |
|
|
|
Time when the statistic was recorded |
|
|
|
Name of the statistic |
|
|
|
Value recorded for the statistic |
|
|
|
Unit of measurement for the statistic |
STREAMS$_PA_SHOW_COMP_STAT Table
The STREAMS$_PA_SHOW_COMP_STAT
table displays statistics for Oracle Replication components.
Table 266-11 STREAMS$_PA_SHOW_COMP_STAT Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
Identification number of the Oracle Replication Performance Advisor run |
|
|
|
Time when the Oracle Replication Performance Advisor was last run |
|
|
|
Identification number assigned to the path by the Oracle Replication Performance Advisor |
|
|
|
Position of the component in the path |
|
|
|
Identification number assigned to the component by the Oracle Replication Performance Advisor |
|
|
|
Name of the component |
|
|
|
Type of the component The following types are possible:
|
|
|
|
Type of the subcomponent Only capture processes and apply processes have subcomponents. The following capture process subcomponent types are possible:
The following apply process subcomponent types are possible:
|
|
|
|
Identification number of the session for the component. Query the |
|
|
|
Session serial number of the session for the component. Query the |
|
|
|
Name of the statistic |
|
|
|
Name of the statistic |
|
|
|
Value recorded for the statistic |
|
|
|
Unit of measurement for the statistic |
STREAMS$_PA_SHOW_PATH_STAT Table
The STREAMS$_PA_SHOW_PATH_STAT
table displays statistics for the stream paths in an Oracle Replication configuration. A monitoring job uses this table as the default table for the statistics collected for stream paths.
Table 266-12 STREAMS$_PA_SHOW_PATH_STAT Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
Identification number assigned to the path by the Oracle Replication Performance Advisor |
|
|
|
Identification number of the Oracle Replication Performance Advisor run |
|
|
|
Time when the Oracle Replication Performance Advisor was last run |
|
|
|
Setting for the Oracle Replication Performance Advisor Run |
|
|
|
Component-level statistics |
|
|
|
Session-level statistics |
|
|
|
Whether the path uses the combined capture and apply optimization 0 (zero) means that the path does not use the combined capture and apply optimization. 1 means that the path uses the combined capture and apply optimization. |
266.4 Summary of UTL_RPADV Subprograms
This table lists the UTL_RPADV
subprograms and briefly describes them.
Table 266-13 UTL_RPADV Package Subprograms
Subprogram | Description |
---|---|
Alters the monitoring job submitted by the current user. |
|
Uses the Oracle Replication Performance Advisor to gather statistics about the Oracle Replication components and subcomponents in a distributed database environment. |
|
Checks whether a monitoring job is currently running. |
|
Generates output that includes the statistics gathered by the |
|
Generates HTML output that includes the statistics gathered by the |
|
Starts a monitoring job. |
|
Stops a monitoring job. |
266.4.1 ALTER_MONITORING Procedure
This procedure alters the monitoring job submitted by the current user.
Syntax
UTL_RPADV.ALTER_MONITORING( interval IN NUMBER DEFAULT NULL, top_event_threshold IN NUMBER DEFAULT NULL, bottleneck_idle_threshold IN NUMBER DEFAULT NULL, bottleneck_flowctrl_threshold IN NUMBER DEFAULT NULL, retention_time IN NUMBER DEFAULT NULL);
Parameters
Table 266-14 ALTER_MONITORING Procedure Parameters
Parameter | Description |
---|---|
|
The amount of time, in seconds, between each Performance Advisor run. The maximum is 3600 seconds. If |
|
A percentage that determines whether a top wait event statistic is collected. The percentage for a wait event must be greater than the value specified in this parameter for the procedure to collect the wait event statistic. For example, if If |
|
A percentage that determines whether an Oracle Replication component session is eligible for bottleneck analysis based on its The If |
|
A percentage that determines whether an Oracle Replication component session is eligible for bottleneck analysis based on its The If |
|
The number of hours to retain monitoring results. If |
Exceptions
Table 266-15 ALTER_MONITORING Procedure Exceptions
Exception | Description |
---|---|
|
no active monitoring job found |
266.4.2 COLLECT_STATS Procedure
This procedure uses the Oracle Replication Performance Advisor to gather statistics about the Oracle Replication components and subcomponents in a distributed database environment.
Note:
This procedure commits.
Syntax
UTL_RPADV.COLLECT_STATS( interval IN NUMBER DEFAULT 60, num_runs IN NUMBER DEFAULT 10, comp_stat_table IN VARCHAR2 DEFAULT 'STREAMS$_ADVISOR_COMP_STAT', path_stat_table IN VARCHAR2 DEFAULT 'STREAMS$_ADVISOR_PATH_STAT', top_event_threshold IN NUMBER DEFAULT 15, bottleneck_idle_threshold IN NUMBER DEFAULT 50, bottleneck_flowctrl_threshold IN NUMBER DEFAULT 50);
Parameters
Table 266-16 COLLECT_STATS Procedure Parameters
Parameter | Description |
---|---|
|
The amount of time, in seconds, between each Performance Advisor run. The maximum is 3600 seconds. |
|
The number of times that the Oracle Replication Performance Advisor is run by the procedure. |
|
The name of the table that stores the statistics collected for Oracle Replication components and subcomponents. Specify the table name as The procedure creates the specified table if it does not exist. Oracle recommends that you use the default table See "Usage Notes" for more information about this parameter. |
|
The name of the table that stores the statistics collected for stream paths. Specify the table name as The procedure creates the specified table if it does not exist. Oracle recommends that you use the default table See "Usage Notes" for more information about this parameter. |
|
A percentage that determines whether a top wait event statistic is collected. The percentage for a wait event must be greater than the value specified in this parameter for the procedure to collect the wait event statistic. For example, if |
|
A percentage that determines whether an Oracle Replication component session is eligible for bottleneck analysis based on its The |
|
A percentage that determines whether an Oracle Replication component session is eligible for bottleneck analysis based on its The |
Usage Notes
The table specified in the path_stat_table
parameter stores stream path statistics. This table also concatenates the component and subcomponent statistics stored in the table specified in the comp_stat_table
parameter. The SHOW_STATS
procedure in this package shows only the statistics stored in the table specified in the path_stat_table
parameter.
266.4.3 IS_MONITORING Function
This function checks whether a monitoring job is currently running. This function either returns TRUE
if a monitoring job is currently running or FALSE
if a monitoring job is not currently running.
A monitoring job is submitted using the START_MONITORING
procedure.
See Also:
Syntax
UTL_RPADV.IS_MONITORING( job_name IN VARCHAR2 DEFAULT 'STREAMS$_MONITORING_JOB', client_name IN VARCHAR2 DEFAULT NULL) RETURN BOOLEAN;
Parameters
Table 266-17 IS_MONITORING Function Parameters
Parameter | Description |
---|---|
|
The name of the job for which to check. |
|
The name of the client that submitted the job. |
266.4.4 SHOW_STATS Procedure
This procedure generates output that includes the statistics gathered by the COLLECT_STATS
and START_MONITORING
procedures.
The output is formatted so that it can be imported into a spreadsheet for analysis.
Note:
This procedure does not commit.
See Also:
Syntax
UTL_RPADV.SHOW_STATS( path_stat_table IN VARCHAR2 DEFAULT 'STREAMS$_ADVISOR_PATH_STAT', path_id IN NUMBER DEFAULT NULL, bgn_run_id IN NUMBER DEFAULT -1, end_run_id IN NUMBER DEFAULT -10, show_path_id IN BOOLEAN DEFAULT TRUE, show_run_id IN BOOLEAN DEFAULT TRUE, show_run_time IN BOOLEAN DEFAULT TRUE, show_optimization IN BOOLEAN DEFAULT TRUE, show_setting IN BOOLEAN DEFAULT FALSE, show_stat IN BOOLEAN DEFAULT TRUE, show_sess IN BOOLEAN DEFAULT FALSE, show_legend IN BOOLEAN DEFAULT TRUE);
Parameters
Table 266-18 SHOW_STATS Procedure Parameters
Parameter | Description |
---|---|
|
The name of the table that contains the stream path statistics. Specify the table name as When you gather statistics using the When you gather statistics using the |
|
A stream path ID. If non- If |
|
The first Oracle Replication Performance Advisor run ID to show in the range of runs. See "Usage Notes" for more information about this parameter. |
|
The last Oracle Replication Performance Advisor run ID to show in the range of runs. See "Usage Notes" for more information about this parameter. |
|
If If |
|
If If |
|
If If |
|
If If |
|
If If |
|
If If |
|
If If |
|
If If |
Usage Notes
Use the bgn_run_id
and end_run_id
together to specify the range of Oracle Replication Performance Advisor runs to display. Positive numbers show statistics from an earlier run forward. Negative numbers show statistics from a later run backward.
For example, if bgn_run_id
is set to 1
and end_run_id
is set to 10
, then the procedure shows statistics for the first ten Oracle Replication Performance Advisor runs.
However, if bgn_run_id
is set to -1
and end_run_id
is set to -10
, then the procedure shows statistics for the last ten Oracle Replication Performance Advisor runs.
266.4.5 SHOW_STATS_HTML Procedure
This procedure generates HTML output that includes the statistics gathered by the COLLECT_STATS
and START_MONITORING
procedures.
Note:
This procedure does not commit.
See Also:
Syntax
UTL_RPADV.SHOW_STATS_HTML( directory IN VARCHAR2, reportname IN VARCHAR2 DEFAULT 'RPADVREPORT.HTML', comp_stat_table IN VARCHAR2 DEFAULT 'STREAMS$_ADVISOR_COMP_STAT', path_id IN NUMBER DEFAULT NULL, bgn_run_id IN NUMBER DEFAULT -1, end_run_id IN NUMBER DEFAULT -10, detailed IN BOOLEAN DEFAULT TRUE);
Parameters
Table 266-19 SHOW_STATS_HTML Procedure Parameters
Parameter | Description |
---|---|
|
The directory object for the directory on the local computer system into which the generated HTML report is placed The specified directory object must be created using the SQL statement |
|
The name of the HTML report |
|
The name of the table that stores the statistics collected for Oracle Replication components and subcomponents. Specify the table name as When you gather statistics using the When you gather statistics using the Oracle recommends that you start a monitoring job with the |
|
A stream path ID. If non- If |
|
The first Oracle Replication Performance Advisor run ID to show in the range of runs. See "Usage Notes" for more information about this parameter. |
|
The last Oracle Replication Performance Advisor run ID to show in the range of runs. See "Usage Notes" for more information about this parameter. |
|
If If |
Usage Notes
Use the bgn_run_id
and end_run_id
together to specify the range of Oracle Replication Performance Advisor runs to display. Positive numbers show statistics from an earlier run forward. Negative numbers show statistics from a later run backward.
For example, if bgn_run_id
is set to 1
and end_run_id
is set to 10
, then the procedure shows statistics for the first ten Oracle Replication Performance Advisor runs.
However, if bgn_run_id
is set to -1
and end_run_id
is set to -10
, then the procedure shows statistics for the last ten Oracle Replication Performance Advisor runs.
266.4.6 START_MONITORING Procedure
This procedure starts a monitoring job.
This procedure runs the COLLECT_STATS
procedure to gather statistics about the Oracle Replication components and subcomponents in a distributed database environment.
Note:
This procedure commits.
See Also:
Syntax
UTL_RPADV.START_MONITORING( job_name IN VARCHAR2 DEFAULT 'STREAMS$_MONITORING_JOB', client_name IN VARCHAR2 DEFAULT NULL, query_user_name IN VARCHAR2 DEFAULT NULL, interval IN NUMBER DEFAULT 60, top_event_threshold IN NUMBER DEFAULT 15, bottleneck_idle_threshold IN NUMBER DEFAULT 50, bottleneck_flowctrl_threshold IN NUMBER DEFAULT 50, retention_time IN NUMBER DEFAULT 24);
Parameters
Table 266-20 START_MONITORING Procedure Parameters
Parameter | Description |
---|---|
|
The name of the monitoring job to create. |
|
The name of the client. |
|
The user who will query the result tables. This procedure grants privileges to the specified user to enable the user to query the result tables. |
|
The amount of time, in seconds, between each Performance Advisor run. The maximum is 3600 seconds. The specified interval is used for the interval parameter in the |
|
A percentage that determines whether a top wait event statistic is collected. The percentage for a wait event must be greater than the value specified in this parameter for the procedure to collect the wait event statistic. For example, if |
|
A percentage that determines whether an Oracle Replication component session is eligible for bottleneck analysis based on its The |
|
A percentage that determines whether an Oracle Replication component session is eligible for bottleneck analysis based on its The |
|
The number of hours to retain monitoring results. |
Exceptions
Table 266-21 START_MONITORING Procedure Exceptions
Exception | Description |
---|---|
|
cannot start monitoring due to active EM monitoring job Stop the Oracle Enterprise Manager (EM) monitoring job, and run the |
|
cannot start monitoring due to active Replication monitoring job Stop the Replication monitoring job, and run the |
Usage Notes
The following are usage notes for the START_MONITORING
procedure:
Requirements for the User Running the Procedure
The user who runs the START_MONITORING
procedure must meet the following requirements:
-
The user must have access to a database link to each database that contains Oracle Replication components.
-
The user must have been granted privileges using the
DBMS_XSTREAM_AUTH.GRANT_ADMIN_PRIVILEGE
procedure, and each database link must connect to a user at the remote database that has been granted privileges using theDBMS_XSTREAM_AUTH.GRANT_ADMIN_PRIVILEGE
procedure.
Full Monitoring Job Names
When you submit a monitoring job, the client name and job name are concatenated to form the full monitoring job name. You specify the client name using the client_name
parameter and the job name using the job_name
parameter when you run the START_MONITORING
procedure. The client name for a monitoring job submitted by Oracle Enterprise Manager is always EM
.
The following table show examples of full monitoring job names:
Setting for client_name Parameter | Setting for job_name parameter | Full Monitoring Job Name |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Restrictions on Monitoring Jobs
The following restrictions apply to monitoring jobs:
-
The limit for the length of the full monitoring job name is 30 bytes.
-
Two monitoring jobs cannot have the same full monitoring job name, even if the monitoring jobs were submitted by different schemas. The name check is not case-sensitive. For example,
strmSTREAMS$_MONITORING_JOB
andSTRMSTREAMS$_MONITORING_JOB
are considered to be the same name. -
Oracle Enterprise Manager can have at most one monitoring job for each database.
-
Each schema can have at most one monitoring job.
266.4.7 STOP_MONITORING Procedure
This procedure stops a monitoring job that was submitted by the current user.
Syntax
UTL_RPADV.STOP_MONITORING( purge IN BOOLEAN DEFAULT FALSE);
Parameters
Table 266-22 STOP_MONITORING Procedure Parameters
Parameter | Description |
---|---|
|
If If |