By R.N. Sangwan-www.rnsangwan.com
To Learn or Teach visit www.theskillpedia.com
Visit www.theskillpedia.com to learn or teach. By: www.rnsangwan.com 1
• Configuration Parameters
• Using sp_configure to Manage Parameters
• Invoking sp_configure
• sp_configure Syntax
• Configuration File with sp_configure
• Examples of using files
• Examples :• Memory, Cache Configuration, Number of devices, User Connections
Visit www.theskillpedia.com to learn or teach. By: www.rnsangwan.com 2
• Config parameter defines the server wide settings and is divided in to static and dynamic.
• All the static configured parameters values are stored in table sysconfigure.
• All the dynamic configured parameters values are stored in table syscurconfigure.
• Config values also stored in the <server name>.cfg file and every time you modify the config
values the current <server name>.cfg file will be saved as <server name>.001 and new
config values will be appeared in <server name>.cfg file.
• We cannot start the ASE without valid config file.
• Always have the backup for config file
Visit www.theskillpedia.com to learn or teach. By: www.rnsangwan.com 3
• sp_configure displays and resets configuration parameters.
• You can restrict the number of parameters that sp_configure shows by
using sp_displaylevel to set your display level to one of:
• Basic
• Intermediate
• Comprehensive
Visit www.theskillpedia.com to learn or teach. By: www.rnsangwan.com 4
Command Effect
sp_configure Displays all configuration parameters by group, their
current values, default values, the value to which they
have most recently been set etc.
sp_configure “parameter” Displays current value, default value, most recently
changed value, and amount of memory used by the
specified parameter.
sp_configure
“parameter”, value
Resets parameter to value.
sp_configure “parameter”, 0,
“default”
Resets the specified parameter to its default value.
sp_configure “group_name” Displays all configuration parameters in group_name.
sp_configure “configuration
file”, 0, “sub_command”,
“file_name”
Sets configuration parameters from the configuration
file.
Visit www.theskillpedia.com to learn or teach. By: www.rnsangwan.com 5
sp_configure includes a variety of variables to help you configure SAP ASE.
• parameter – is any valid SAP ASE configuration parameter or parameter substring.
• value – is any integer within the valid range for that parameter. Parameters that work as
toggles have only two valid values: 1 (on) and 0 (off).
• group_name – is the name of any group in the parameter hierarchy.
sp_configure parses each parameter as “%parameter%”. A string that does not uniquely
identify a particular parameter returns values for all parameters matching the string.
Visit www.theskillpedia.com to learn or teach. By: www.rnsangwan.com 6
• returns values for all configuration parameters that include “lock,” such as lock shared
memory, number of locks, lock promotion HWM,server clock tick length, print
deadlock information, and deadlock retries:
sp_configure "lock"
Visit www.theskillpedia.com to learn or teach. By: www.rnsangwan.com 7
You can Configure SAP ASE either interactively, by using sp_configure, or non interactively,
by reading values from configuration file.
Advantages of using configuration files:
• Replicate a specific configuration across multiple servers by using the same configuration
file.
• Use a configuration file as a baseline for testing configuration values on your server.
• Use a configuration file to perform validation checking on parameter values before actually
setting the values.
• Create multiple configuration files and switch between them as your resource needs change.
Visit www.theskillpedia.com to learn or teach. By: www.rnsangwan.com 8
sp_configure "configuration file", 0, "subcommand", "file_name“
Where :
• “configuration file” - the configuration file.
• 0 – required—for backward compatibility.
• “subcommand” – is one of:
• write – creates a file named file_name with the current configuration.
• read – performs validation checking and load on values contained
in file_name.
• verify – performs validation checking on the values in file_name.
• restore – creates file_name with the most recently configured values.
• file_name – specifies the configuration file to use in conjunction with
any subcommand. If you do not specify a directory as part of the file
name, the directory where SAP ASE was started is used.
Visit www.theskillpedia.com to learn or teach. By: www.rnsangwan.com 9
• Performs validation checking on the values in the file srv.config and
reads the parameters that pass validation into the server. Current run
values are substituted for values that do not pass validation checking:
sp_configure "configuration file", 0, "read", "srv.config"
• Creates the file my_server.config and writes the current configuration
values the server is using to that file:
sp_configure "configuration file", 0, "write", "my_server.config"
Visit www.theskillpedia.com to learn or teach. By: www.rnsangwan.com 10
The configuration file is an ASCII file that you can edit with any text editor that can save files in
ASCII format.
The syntax for each parameter is:
parameter_name={value | DEFAULT}
Examples
• Specifies that the transaction can retry its attempt to acquire a lock one time when
deadlocking occurs during an index page split or shrink:
deadlock retries = 1
• Specifies that the default value for the parameter cpu accounting flush interval should be
used:
cpu accounting flush interval=DEFAULT
Visit www.theskillpedia.com to learn or teach. By: www.rnsangwan.com 11
1> sp_configure memory
2> goMsg 17411, Level 16, State 1:
Server 'SYB_UDEQA2', Procedure 'sp_configure', Line 214:
Configuration option is not unique.
Parameter Name Default Memory Used Config Value Run Value Unit Type
------------------------------ ----------- ----------- ------------ ----------- -------------------- ----------
additional network memory 0 740 757760 757760 bytes dynamic
allocate max shared memory 0 0 0 0 switch dynamic
compression memory size 0 76 0 0 memory pages(2k) dynamic
engine memory log size 0 2 0 0 memory pages(2k) dynamic
heap memory per user 4096 0 4096 4096 bytes dynamic
lock shared memory 0 0 0 0 switch static
max memory 33792 4096000 2048000 2048000 memory pages(2k) dynamic
memory alignment boundary 2048 0 2048 2048 bytes static
memory per worker process 1024 48 1024 1024 bytes dynamic
messaging memory 400 0 400 400 memory pages(2k) dynamic
shared memory starting address 0 0 0 0 not applicable static
total logical memory 33792 3914828 1957414 1957411 memory pages(2k) read-only
total physical memory 0 3914832 0 1957416 memory pages(2k) read-only
(1 row affected)
12Visit www.theskillpedia.com to learn or teach. By: www.rnsangwan.com
• You can adjust the size of default data cache dynamically. For example to allocate 900MB to
default data cache you can use the following command:
sp_cacheconfig 'default data cache' , '900M‘
go
(return status = 0)
13Visit www.theskillpedia.com to learn or teach. By: www.rnsangwan.com
1> sp_cacheconfig 'default data cache'
2> goCache Name Status Type Config Value Run Value
------------------ ------ ------- ------------ ------------
default data cache Active Default 1625.00 Mb 1625.00 Mb
------------ ------------
Total 1625.00 Mb 1625.00 Mb
==========================================================================
Cache: default data cache, Status: Active, Type: Default
Config Size: 1625.00 Mb, Run Size: 1625.00 Mb
Config Replacement: strict LRU, Run Replacement: strict LRU
Config Partition: 4, Run Partition: 4
IO Size Wash Size Config Size Run Size APF Percent
-------- --------- ------------ ------------ -----------
16 Kb 5120 Kb 25.00 Mb 25.00 Mb 10
32 Kb 20480 Kb 100.00 Mb 100.00 Mb 10
64 Kb 61440 Kb 300.00 Mb 300.00 Mb 10
8 Kb 61440 Kb 0.00 Mb 1200.00 Mb 10
(return status = 0)
14Visit www.theskillpedia.com to learn or teach. By: www.rnsangwan.com
Example of creating a user defined cache and the associated pools
1> sp_cacheconfig tempdb_log_cache, '500M', 'logonly', 'relaxed', 'cache_partition=1'
2> go
Since this is a log cache, it should be mainly made up of 4K buffer pools and some 16K buffer pools aswell:
1> sp_poolconfig "tempdb_log_cache", "370M", "4K", "2K"
2> go
1> sp_poolconfig "tempdb_log_cache", "125M", "16K", "2K"
2> go
15Visit www.theskillpedia.com to learn or teach. By: www.rnsangwan.com
Display information about this cache
1> sp_cacheconfig tempdb_log_cache
2> goCache Name Status Type Config Value Run Value
------------------------------ --------- -------- ------------ ------------
tempdb_log_cache Active Log Only 500.00 Mb 500.00 Mb
------------ ------------
Total 500.00 Mb 500.00 Mb
==========================================================================
Cache: tempdb_log_cache, Status: Active, Type: Log Only
Config Size: 500.00 Mb, Run Size: 500.00 Mb
Config Replacement: relaxed LRU, Run Replacement: relaxed LRU
Config Partition: 1, Run Partition: 1
IO Size Wash Size Config Size Run Size APF Percent
-------- --------- ------------ ------------ -----------
2 Kb 1024 Kb 0.00 Mb 5.00 Mb 10
4 Kb 61440 Kb 370.00 Mb 370.00 Mb 10
16 Kb 25600 Kb 125.00 Mb 125.00 Mb 10
16Visit www.theskillpedia.com to learn or teach. By: www.rnsangwan.com
• As a rule of thumb you can set this one to 301> sp_configure devices
2> go
Parameter Name Default Memory Used Config Value Run Value
------------------------------ ----------- ----------- ------------ -----------
number of devices 10 #17 30 30
17Visit www.theskillpedia.com to learn or teach. By: www.rnsangwan.com
A value of 100 should be sufficient for most non production servers
1> sp_configure 'user connections'
2> go
Parameter Name Default Memory Used Config Value Run Value
------------------------------ ----------- ----------- ------------ -----------
number of user connections 25 17261 100 100
18Visit www.theskillpedia.com to learn or teach. By: www.rnsangwan.com
Visit www.theskillpedia.com to learn or teach. By:
www.rnsangwan.com 19