sp_monitorconfig

Description

Displays cache usage statistics regarding metadata descriptors for indexes, objects, databases, and the kernel resource memory pool. sp_monitorconfig also reports statistics on auxiliary scan descriptors used for referential integrity queries, and usage statistics for transaction descriptors and DTX participants.

Syntax

sp_monitorconfig "configname"[, "result_tbl_name"][, "full"]

Parameters

configname

is either all, or part of the configuration parameter name with the monitoring information that is being queried. Valid configuration parameters are listed in the “Usage” section. Specifying all displays descriptor help information for all indexes, objects, databases, and auxiliary scan descriptors in the server.

result_tbl_name

is the name of the table you create to save the stored procedure results. This is an optional parameter. If you pass a table name for result_tabl_name that does not already exist, sp_monitorconfig creates a table to hold the result set.

“full”

returns a set of values for the configname that you specify. The values are:

  • config_val – reports the configured value

  • system_val – reports the systems default value when there’s novalue configured

  • total_val – reports the actual value used

Examples

Example 1

Shows all items that are open:

sp_monitorconfig "open"
Configuration option is not unique.
option_name                    config_value run_value  
-----------------------------   ----------  ----------
number of open databases                12           12
number of open objects                 500          500
curread change w/ open cursors           1            1
open index hash spinlock ratio         100          100
number of open indexes                 500          500
open index spinlock ratio              100          100
open object spinlock ratio             100          100
number of open partitions              500          500

Example 2

Shows the status for all configurations:

sp_monitorconfig "all"
-------------
Usage information at date and time: May  6 2010  4:32PM.
Name                   Num_free Num_active Pct_act Max_Used Reuse_cnt Instance_Name
--------------------   --------- --------- -------  ------- --------- -------------
additional network memory  1358436  809440   37.34    825056        0           NULL
audit queue size               100       0    0.00         0        0           NULL
disk i/o structures            256       0    0.00        29        0           NULL
heap memory per user          4096       0    0.00         0        0           NULL

. . . 

size of process object he     3000       0    0.00          0        0          NULL
size of shared class heap     6144       0    0.00          0        0          NULL
size of unilib cache        306216     816    0.27        816        0          NULL
txn to pss ratio               400       0    0.00          0        0         NULL

Example 3

Shows 61 active object metadata descriptors, with 439 free. The maximum used at a peak period since Adaptive Server was last started is 61:

sp_monitorconfig "open objects"
Usage information at date and time: Apr 22 2002  2:49PM.
Name                   Num_free Num_active Pct_act Max_Used Reuse_cnt Instance_Name
--------------------   --------- --------- -------  ------- --------- -------------
number of open objects        439      61    12.20        61        0           NULL

You can then reset the size to 550, for example, to accommodate the 439 maximum used metadata descriptors, plus space for 10 percent more:

sp_configure "number of open objects", 330

Example 4

Shows the maximum number of index metadata descriptors, which is 44:

sp_monitorconfig "open indexes"
Usage information at date and time: Apr 22 2002  2:49PM.
Name                   Num_free Num_active Pct_act Max_Used Reuse_cnt Instance_Name
--------------------   --------- --------- -------  ------- --------- -------------
number of open indexes        556     44      7.33        44        0           NULL

You can reset the size to 100, the minimum acceptable value:

sp_configure "number of open indexes", 100

Example 5

Shows the number of active scan descriptors as 30, though Adaptive Server is configured to use 200. Use the number of aux scan descriptors configuration parameter to reset the value to at least 32. A safe setting is 36, to accommodate the 32 scan descriptors, plus space for 10 percent more:

sp_monitorconfig "aux scan descriptors"
Usage information at date and time: Apr 22 2002  2:49PM.

Name                   Num_free Num_active Pct_act Max_Used Reuse_cnt Instance_Name
--------------------   --------- --------- -------  ------- --------- -------------
number of aux scan descri     170     30    15.00         32        0           NULL

Example 6

Adaptive Server is configured for five open databases, all of which have been used in the current session.

sp_monitorconfig "number of open databases"
Name                   Num_free Num_active Pct_act Max_Used Reuse_cnt Instance_Name
--------------------   --------- --------- -------  ------- --------- -------------
number of open databses         0      5    100.00         5  Yes              NULL

However, as indicated by the Reuse_cnt column, an additional database needs to be opened. If all 5 databases are in use, an error may result, unless the descriptor for a database that is not in use can be reused. To prevent an error, reset number of open databases to a higher value.

Example 7

Only 10.2 percent of the transaction descriptors are currently being used. However, the maximum number of transaction descriptors used at a peak period since Adaptive Server was last started is 523:

sp_monitorconfig "txn to pss ratio"
Usage information at date and time: Apr 22 2002  2:49PM.
Name                   Num_free Num_active Pct_act Max_Used Reuse_cnt Instance_Name
--------------------   --------- --------- -------  ------- --------- -------------
txn to pss ratio              784     80     10.20       523        0           NULL

Example 8

Using the optional parameter result_tbl_name to create a user table saves the sp_monitorconfig result to this table:

create table sample_table
(Name varchar(35),Config_val int, System_val int, Total_val int,
Num_free int, Num_active int, Pct_act char(6), Max_used int,
Num_Reuse int, Date varchar(30))
create table sample_table
(Name varchar(35),
Config_val int,
System_val int,
Total_val int,
Num_free int,
Num_active int,
Pct_act char(6),
Max_Used int,
Reuse_cnt int,
Date varchar(30),
Instance_Name varchar(35))

The name of the table created becomes the second parameter of sp_monitorconfig. Capture the values for number of locks and number of alarms in sample_table:

sp_monitorconfig "locks", sample_table
sp_monitorconfig "number of alarms", sample_table

Display the values captured in sample_table:

select * from sample_table
 Name               Config_val System_val Total_val Num_free Num_active
Pct_act Max_used Reuse_cnt   Date                Instance_Name
------------------- ----------- ---------- --------- --------- ----------
------- -------- ---------   ------------------- ------------------------
 number of locks         5000        684      5000     4915         85
1.70        117         0    Aug 23 2006  6:53AM
 number of alarms             40       0        40       28         12
30.00        13         0    Aug 23 2006  6:53AM

The result set saved to the table accumulates until you delete or truncate the table.

NoteIf sample_table is in another database, you must provide its fully qualified name in quotes.

Example 9

Displays the configure_value, system_value, and run_value columns of all the configurations:

sp_monitorconfig "all", null, "full"
go
Usage information at date and time: Mar 23 2004  5:15PM
Name                    Configure Value  System Value  Run Value
Num_free   Num_active  Pct_act  Max_Used  Reuse_cnt   Instance_Name
------------------------     ----------     ----------      -------
---------  ----------  -------  --------  ---------   -------------------
additional network memory             0        2167876      2167876
  1358436      809440    37.34    825056          0                  NULL
audit queue size                    100              0          100
      100           0     0.00         0          0                  NULL
disk i/o structures                 256              0          256
      256           0     0.00        29          0                  NULL
heap memory per user               4096            563         4096  
     4096           0     0.00         0          0                  NULL
kernel resource memory             4096              0         4096
     3567         529    12.92       529          0                  NULL
max cis remote connection             0            100          100
      100           0     0.00         0          0                  NULL
. . .
size of shared class heap          6144              0         6144
     6144           0     0.00         0          0                  NULL
size of unilib cache            0307032         307032       306216
      816           0      .27       816          0                  NULL
txn to pss ratio                     16              0           16
      400           0     0.00         0           0                 NULL

Usage

Permissions

Only a system administrator can execute sp_monitorconfig.

Auditing

Values in event and extrainfo columns from the sysaudits table are:

Event

Audit option

Command or access audited

Information in extrainfo

38

exec_procedure

Execution of a procedure

  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

  • Proxy information – Original login name, if set proxy in effect

See also

System procedures sp_configure, sp_countmetadata, sp_helpconfig, sp_helpconstraint, sp_sysmon