Oracle® Database PL/SQL Packages and Types Reference 11g Release 2 (11.2) Part Number E25788-04 |
|
|
PDF · Mobi · ePub |
The UTL_SPADV
package, one of a set of Oracle Streams packages, provides subprograms to collect and analyze statistics for the Oracle Streams components in a distributed database environment. This package uses the Oracle Streams Performance Advisor to gather statistics.
This chapter contains the following topic:
Overview
Security Model
Operational Notes
See Also:
Oracle Streams Concepts and Administration for more information about this package and the Oracle Streams Performance AdvisorThis package enables you to collect and analyze statistics about the performance or Oracle Streams components. You can either collect statistics on demand or you can create a monitoring job that continually monitors Oracle Streams 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.
Security on this package can be controlled in either of the following ways:
Granting EXECUTE
on this package to selected users or roles.
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 Streams administrator and connect as the Oracle Streams administrator when using this package.
See Also:
Oracle Streams Replication Administrator's Guide for information about configuring an Oracle Streams administratorTo use this package, you must connect to an Oracle database as an Oracle Streams administrator and run the utlspadv.sql
script in the rdbms/admin directory in ORACLE_HOME
.
The utlspadv.sql
script creates the following tables:
The Oracle Streams Performance Advisor populates these tables when it is run.
The STREAMS$_PA_COMPONENT
table displays information about the Oracle Streams components at each database.
Table 236-1 STREAMS$_PA_COMPONENT Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
|
Identification number assigned to the component by the Oracle Streams 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 Streams components.
Table 236-2 STREAMS$_PA_COMPONENT_LINK Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
|
Identification number assigned to the path by the Oracle Streams Performance Advisor |
|
|
Unique key assigned to the path by the Oracle Streams 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 Streams Performance Advisor.
Table 236-3 STREAMS$_PA_COMPONENT_PROP Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
|
Identification number assigned to the component by the Oracle Streams 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 Streams component.
Table 236-4 STREAMS$_PA_COMPONENT_STAT Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
Identification number of the Oracle Streams Performance Advisor run |
|
|
|
Time when the Oracle Streams Performance Advisor was run for the advisor run ID |
|
|
|
Identification number assigned to the component by the Oracle Streams 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 |
The STREAMS$_PA_CONTROL
table displays the parameters set for the COLLECT_STATS
procedure in this package. The parameters control the monitoring behavior.
Table 236-5 STREAMS$_PA_CONTROL Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
Identification number of the Oracle Streams Performance Advisor run |
|
|
|
Time when the Oracle Streams Performance Advisor was last run |
|
|
|
The name of the parameter |
|
|
|
The value set for the parameter |
|
|
|
The unit of the parameter |
The STREAMS$_PA_DATABASE
table displays information about each database that contains Oracle Streams components.
Table 236-6 STREAMS$_PA_DATABASE Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
|
Global name of the database analyzed by the Oracle Streams 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 Streams database property information necessary for analysis by the Streams Performance Advisor.
Table 236-7 STREAMS$_PA_DATABASE_PROP Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
|
Global name of the database analyzed by the Oracle Streams Performance Advisor |
|
|
Property name The database properties include the following:
|
|
|
|
Property value |
The STREAMS$_PA_MONITORING
table displays information about each monitoring job running in a database.
Table 236-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 Streams components that might be slowing down the flow of messages.
Table 236-9 STREAMS$_PA_PATH_BOTTLENECK Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
Identification number of the Oracle Streams Performance Advisor run |
|
|
|
Time when the Oracle Streams Performance Advisor was last run |
|
|
|
Reason for the bottleneck |
|
|
|
Identification number assigned to the path by the Oracle Streams Performance Advisor |
|
|
|
Unique key assigned to the path by the Oracle Streams Performance Advisor |
|
|
|
Identification number assigned to the component by the Oracle Streams 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 |
The STREAMS$_PA_PATH_STAT
table displays performance statistics about each stream path.
Table 236-10 STREAMS$_PA_PATH_STAT Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
Identification number of the Oracle Streams Performance Advisor run |
|
|
|
Time when the Oracle Streams Performance Advisor was run for the advisor run ID |
|
|
|
Identification number assigned to the path by the Oracle Streams Performance Advisor |
|
|
|
Unique key assigned to the path by the Oracle Streams 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 Streams components.
Table 236-11 STREAMS$_PA_SHOW_COMP_STAT Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
Identification number of the Oracle Streams Performance Advisor run |
|
|
|
Time when the Oracle Streams Performance Advisor was last run |
|
|
|
Identification number assigned to the path by the Oracle Streams Performance Advisor |
|
|
|
Position of the component in the path |
|
|
|
Identification number assigned to the component by the Oracle Streams 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 Streams configuration. A monitoring job uses this table as the default table for the statistics collected for stream paths.
Table 236-12 STREAMS$_PA_SHOW_PATH_STAT Table
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
Identification number assigned to the path by the Oracle Streams Performance Advisor |
|
|
|
Identification number of the Oracle Streams Performance Advisor run |
|
|
|
Time when the Oracle Streams Performance Advisor was last run |
|
|
|
Setting for the Oracle Streams 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. |
Table 236-13 DBMS_STREAMS Package Subprograms
Subprogram | Description |
---|---|
Alters the monitoring job submitted by the current user. |
|
Uses the Oracle Streams Performance Advisor to gather statistics about the Oracle Streams 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 |
|
Starts a monitoring job. |
|
Stops a monitoring job. |
This procedure alters the monitoring job submitted by the current user.
UTL_SPADV.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);
Table 236-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 Streams component session is eligible for bottleneck analysis based on its The If |
|
A percentage that determines whether an Oracle Streams component session is eligible for bottleneck analysis based on its The If |
|
The number of hours to retain monitoring results. If |
Table 236-15 ALTER_MONITORING Procedure Exceptions
Exception | Description |
---|---|
|
no active monitoring job found |
This procedure uses the Oracle Streams Performance Advisor to gather statistics about the Oracle Streams components and subcomponents in a distributed database environment.
Note:
This procedure commits.See Also:
Oracle Streams Concepts and Administration for more information about the Oracle Streams Performance AdvisorUTL_SPADV.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);
Table 236-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 Streams Performance Advisor is run by the procedure. |
|
The name of the table that stores the statistics collected for Oracle Streams 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 Streams component session is eligible for bottleneck analysis based on its The |
|
A percentage that determines whether an Oracle Streams component session is eligible for bottleneck analysis based on its The |
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.
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:
"START_MONITORING Procedure"UTL_SPADV.IS_MONITORING( job_name IN VARCHAR2 DEFAULT 'STREAMS$_MONITORING_JOB', client_name IN VARCHAR2 DEFAULT NULL) RETURN BOOLEAN;
Table 236-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. |
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:
Oracle Streams Concepts and Administration for more information about the Oracle Streams Performance Advisor
UTL_SPADV.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);
Table 236-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 Streams Performance Advisor run ID to show in the range of runs. See "Usage Notes" for more information about this parameter. |
|
The last Oracle Streams 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 |
Use the bgn_run_id
and end_run_id
together to specify the range of Oracle Streams 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 Streams 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 Streams Performance Advisor runs.
See Also:
Oracle Streams Concepts and Administration for information about the combined capture and apply optimizationThis procedure starts a monitoring job.
This procedure runs the COLLECT_STATS
procedure to gather statistics about the Oracle Streams components and subcomponents in a distributed database environment.
Note:
This procedure commits.See Also:
Oracle Streams Concepts and Administration for more information about the Oracle Streams Performance Advisor
UTL_SPADV.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);
Table 236-19 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 Streams component session is eligible for bottleneck analysis based on its The |
|
A percentage that determines whether an Oracle Streams component session is eligible for bottleneck analysis based on its The |
|
The number of hours to retain monitoring results. |
Table 236-20 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 Streams monitoring job Stop the Streams monitoring job, and run the |
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 Streams components.
The user must have been granted privileges using the DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE
procedure, and each database link must connect to a user at the remote database that has been granted privileges using the DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE
procedure.
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 |
---|---|---|
NULL |
STREAMS$_MONITORING_JOB |
STREAMS$_MONITORING_JOB |
EM |
STREAMS$_MONITORING_JOB |
EMSTREAMS$_MONITORING_JOB |
strm |
STREAMS$_MONITORING_JOB |
strmSTREAMS$_MONITORING_JOB |
strm |
mjob1 |
strmmjob1 |
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
and STRMSTREAMS$_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.
This procedure stops a monitoring job that was submitted by the current user.
UTL_SPADV.STOP_MONITORING( purge IN BOOLEAN DEFAULT FALSE);