0000028667- microsoft sql server specific profile parameters

4
SAP Note Header Data Symptom Profile parameters and Environment Variables for SQL Server This is a description of all instance profile parameters for SAP Systems on Microsoft SQL Server. Default values of these parameters can generally be used. At installation time these parameters need not be set. In SAP 3.x kernels the dblib interface will be used (slmsslib.dll). In SAP 4.x kernels and later the OLEDB interface will be used (implemented in dbmssslib.dll). In SAP 7.0x kernels the OLEDB interface is used unless the SQL Server release is SQL Server 2008 (10.0) or later. In this case the ODBC interface will be used. Both are implemented in dbmssslib.dll. In SAP 7.1x kernels and later, the ODBC interface will be used. The ODBC based DBSL is simpler than the old one, and many parameters listed below do not apply when using the ODBC based DBSL. There are two ways to set parameters for SAP Systems on SQL Server: l Set a profile parameter, either ¡ In the instance profile (sys\profile\SID_DVEBMGS00_host). This affects only the particular application server controlled by that profile. ¡ In sys\profile\DEFAULT.PFL. This affects ALL application servers for that particular SAP system. Only some of the parameters listed below can be set in the DEFAULT.PFL. If a parameter is not listed in report RSPFPAR, then it will have no effect when placed in DEFAULT.PFL. NOTE: In SAP kernel release 6.20 or later, profile parameters must be set using the dbs/mss/<parameter> form. Other ways (see below) are still supported, but not recommended. l In the environment (MyComputer->Properties->Advanced->Env Var.). The environment settings are usually created for users SIDADM and SAPServiceSID automatically during installation. See below how to set environment variables for SAP systems on SQL Server. The environment variables override the profile parameter settings. NOTE: Using Profile parameters: Since 4.6D patch 917 "MSSQL: environment var. MSSQL_* profile parameters" 6.10 patch 329 "MSSQL: environment var. MSSQL_* profile parameters" and in 6.20 kernel, only standalone executables (r3trans, tp, r3load,...) react to environment variables. If a conflicting value for an environment variable is detected (at workprocess startup) for those releases, a message will appear in the developer trace file(s) stating that the environment variable value is being ignored. Each parameter has a unique name. The parameters can be set in any of the following ways: l Set dbs/mss/<param_name> in the profile. This method was introduced in kernel release 6.20. It's also supported in 4.6d since patchlevel 437 (delivered in 2001). For older releases use the methods below. For kernel 4.6D and later use only this method. l Set rsdb/mssql/<param_name> in the profile. This will be understood by the dblib interface and the oledb interface. l Set dbs/oledb/<param_name> in the profile. This will be understood only by the oledb interface 4.0B and later. l Set MSSQL_PARAMNAME in the environment. This will be understood by both interfaces. This value is only used if no profile parameter value is found (standalone programs for example). Ignored in SAP kernels for some later releases (see above). l set OLEDB_PARAMNAME in the environment. Only understood by the oledb interface. Only used if no profile parameter value is found. Ignored in SAP kernels for some later releases (see above). 28667 - Microsoft SQL Server Specific Profile Parameters Version 42 Validity: 02.12.2008 - active Language English (Master) Released On 04.12.2008 07:58:05 Release Status Released for Customer Component BC-DB-MSS Microsoft SQL Server Priority Recommendations / Additional Info Category Customizing

Upload: pkumar1012275

Post on 17-Feb-2016

217 views

Category:

Documents


0 download

DESCRIPTION

sql sap note

TRANSCRIPT

Page 1: 0000028667- Microsoft SQL Server Specific Profile Parameters

SAP Note

Header Data

Symptom

Profile parameters and Environment Variables for SQL Server This is a description of all instance profile  parameters for SAP Systems on Microsoft SQL Server. Default values of these parameters can generally be used. At installation time these parameters need not be set. In SAP 3.x kernels the dblib interface will be used (slmsslib.dll). In SAP 4.x kernels and later the OLEDB interface will be used (implemented in dbmssslib.dll). In SAP 7.0x kernels the OLEDB interface is used unless the SQL Server release is SQL Server 2008 (10.0) or later.  In this case the ODBC interface will be used.  Both are implemented in dbmssslib.dll. In SAP 7.1x kernels and later, the ODBC interface will be used. The ODBC based DBSL is simpler than the old one, and many parameters listed below do not apply when using the ODBC based DBSL. There are two ways to set parameters for SAP Systems on SQL Server:

l Set a profile parameter, either

¡ In the instance profile (sys\profile\SID_DVEBMGS00_host). This affects only the particular application server controlled by that profile.

¡ In sys\profile\DEFAULT.PFL.  This affects ALL application servers for that particular SAP system.  Only some of the parameters listed below can be set in the DEFAULT.PFL.  If a parameter is not listed in report RSPFPAR, then it will have no effect when placed in DEFAULT.PFL.

NOTE: In SAP kernel release 6.20 or later, profile parameters must be set using the dbs/mss/<parameter> form.  Other ways (see below) are still supported, but not recommended.

l In the environment (MyComputer->Properties->Advanced->Env Var.). The environment settings are usually created for users SIDADM and SAPServiceSID automatically during installation.  See below how to set environment variables for SAP systems on SQL Server.  The environment variables override the profile parameter settings.

NOTE: Using Profile parameters: Since 4.6D patch 917 "MSSQL: environment var. MSSQL_* profile parameters" 6.10 patch 329 "MSSQL: environment var. MSSQL_* profile parameters" and in 6.20 kernel,  only standalone executables (r3trans, tp, r3load,...) react to environment variables. If a conflicting value for an environment variable is detected (at workprocess startup) for those releases, a message will appear in the developer trace file(s) stating that the environment variable value is being ignored. Each parameter has a unique name.  The parameters can be set in any of the following ways:

l Set dbs/mss/<param_name> in the profile.  This method was introduced in kernel release 6.20.  It's also supported in 4.6d since patchlevel 437 (delivered in 2001).  For older releases use the methods below.  For kernel 4.6D and later use only this method.

l Set rsdb/mssql/<param_name> in the profile.  This will be understood by the dblib interface and the oledb interface.

l Set dbs/oledb/<param_name> in the profile.  This will be understood only by the oledb interface 4.0B and later.

l Set MSSQL_PARAMNAME in the environment.  This will be understood by both interfaces.  This value is only used if no profile parameter value is found (standalone programs for example). Ignored in SAP kernels for some later releases (see above).

l set OLEDB_PARAMNAME in the environment.  Only understood by the oledb interface. Only used if no profile parameter value is found. Ignored in SAP kernels for some later releases (see above).

    28667 - Microsoft SQL Server Specific Profile Parameters  

Version   42     Validity: 02.12.2008 - active   Language   English (Master)

Released On 04.12.2008 07:58:05

Release Status Released for Customer

Component BC-DB-MSS Microsoft SQL Server

Priority Recommendations / Additional Info

Category Customizing

Page 2: 0000028667- Microsoft SQL Server Specific Profile Parameters

Note that when setting environment variables the underscores are removed.  For example rsdb/mssql/stats_on is the same as dbs/oledb/stats_on which is the same as MSSQL_STATSON which is the same as OLEDB_STATSON - and for 6.20 kernel and later the same as dbs/mss/stats_on. The list below only specifies the name of the profile parameter, when applying a profile parameter, it must be set as either rsdb/mssql/<parameter> = value          # For 3.x kernel OR dbs/oledb/<parameter> = value           # For 4.x kernel or higher OR dbs/mss/<parameter> = value             # For 4.6D kernel or higher Do NOT set these parameters unless you need a value different from the default. Here is the list:

l verbose If set to 1 then some extra information appears in the developer trace files (dev_w* ). Mostly this information tells you which parameters are set etc. Output may accumulate as the system runs because of duplicate row messages, but it is safe to set in production systems if the sizes of the dev files are monitored closely. DEFAULT: 0   (=> off)

l user The name of the MSSQL login when using SQL Server Authentication (4.0B or before).  Do not change this parameter unless you use the same SQL server to control multiple SAP databases. DEFAULT: sapr3

l passwd The password of the sql login. DEFAULT: sap In R/3 4.0B (the oledb interface), R/3 will retrieve user and password information from the database.  In this case "user" and "passwd" profile parameters are ignored. In R/3 4.5B and later SAP releases , the system  will use "Windows NT Authentication".  This also means that "user" and "passwd" are ignored. Multiple SAP databases are supported on the same server by using different SAPServiceSID NT user accounts to run the SAP Services.  The user account sapr3 doesn't have to exist on SQL Server for SAP releases 4.6C or later.

l schema Only for SAP release 4.6C or later. The name of the schema system.  Many SAP systems (4.6C or later) can share the same database.  This parameter specifies the user (or schema) to which the database objects belong.  When connecting, the SAP kernel will issue a "setuser" command for this user.  Following that command only database objects that belong to that user in the SAP (shared) database will be visible to the SAP system. DEFAULT: The <SID> of the SAP system in lowercase.

l server The name of the SQL Server.  This profile parameter inherits the value SAPDBHOST if it's not set explicitly.

l dbid, dbname Name of the database used.  In the 6.20 kernel and later dbid is not used anymore. NOTE: In the environment this parameter is named MSSQL_DBNAME. DEFAULT: <SID>

l packet_size Network packet size used when connecting to SQL Server across the network. If value is less than the minimum 512 or larger than 16k, then set to the min and max resp. DEFAULT: 8192 in 7.20 the default changed to 0, which means the packet size is not set, and the default 4k packet size is used.

l add_procs (not in ODBC DBSL) Set to n where n is the number of additional uncommitted read connections to the database.  The total number of connections per work process is add_procs + 3.  Each connection uses approximately 50KB of memory. This parameter is not used in kernel release 4.6d and later.  As many connections as necessary (up to 40) are used. DEFAULT: 5 - this results in up to 8 connections per work process.

l pn_cache_size (not in ODBC DBSL) The number of permanent stored procedures in the name cache. The size of the cache is calculated by the number of names times 94 bytes. Typically set it to at least as large as the number of Y* stored procedures in the database.  Monitor this value using the msstats and increase the value if you see swaps. There is a maximum of 32000 for this parameter.  If set to anything > 32000, then the system still uses only 32000. DEFAULT: 10000 except in 6.30 and later it is 20000

l tsp_cache_size (not in ODBC DBSL) The number of the temporary stored procedures in the name cache. The size of the cache is calculated by the number of temporary stored procedures times 664 bytes. Monitor this value using the msstats and increase the value if you see swaps. See also CSP note 69937. There is a maximum of 32000 for this parameter. If set to anything > 32000, then the system still uses only 32000. This profile parameter was eliminated in kernel release 6.20 because temporary stored procedures are not used anymore. DEFAULT: 10000

l par_stmt_cache_size (not in ODBC DBSL)

Page 3: 0000028667- Microsoft SQL Server Specific Profile Parameters

This parameter was introduced in kernel release 6.20 to manage a small cache containing performance information on "parameterized" statements. These are the same statements that were executed using temporary stored procedures before.  This parameter controls how much memory is used when statement statistics are being collected (parameter stats_on = 1). If statement statistics (see ST04 -> Detail Analysis -> SAP Stats on SPs) are not used, then this parameter can be set to a smaller value (10 for example). DEFAULT: 1000, 500 in basis 7.00 or later. MIN: 10 MAX: 5000

l recompile_par_stmts (not in ODBC DBSL) This parameter is only available in kernel releases 6.40 and 7.0x.  The purpose is to prompt the SQL Server optimizer to recreate the query plan at every execution. In release 6.40 it causes a huge overhead because it introduces a small difference in the text of each parameterized statement. When this is the case, each such statement will be re-optimized every time it's executed. This will use more memory and CPU on SQL Server, but it guarantees that query plans are re-evaluated to make sure the best access method is used for the given parameters.  Do not use this parameter in 6.40 even though it is available. In release 7.0x when running on SQL Server 2005, a RECOMPILE hint is used in the statements instead.  This produces less overhead, but it's still not recommended. DEFAULT: 0

l max_duration (not in ODBC DBSL) If set to a value >0, then "exec sp_recompile <proc_name>" will be executed whenever the runtime exceeds max_duration milliseconds.  If zero, then this will never be done. This will allow the optimizer to adapt dynamically in the case where the first execution of a stored procedure is using unusual parameters which result in a sub-optimal query plan for the general case. A typical setting for this parameter is 1000 (1 second). This parameter is NOT recommended in kernel release 6.40 and later because the overall performance penalty is even greater than before. The reason is that sp_recompile can not be used for dynamic statements. Instead a small change in the statement is introduced and this will have the same effect as sp_recompile, but with much more overhead. It is recommended to instead use hints for individual statements (see note 133381). In latest patches for all releases. DEFAULT: 0

l stats_on (not in ODBC DBSL) If set to a value >0, then statement statistics will be collected from startup of the SAP system. See ST04 -> Detail Analysis -> SAP Stats on SPs. DEFAULT: 0   In 6.30 kernel this was changed to 1.

l fae_batch (not in ODBC DBSL) Uses batched rpcs to execute a SELECT FOR ALL ENTRIES statement. Instead of creating one huge temporary stored procedure with lots of selects or'ed or union'ed together, one small temporary stored procedure will be sent n times to the server, and all the rowsets will be collected together afterwards. Implemented in kernel/DBSL releases 4.0B up to 4.6D.  Not implemented in kernel 6.xx or later. DEFAULT:  Up to release 4.6b, the default is 1. Originally in 4.6c and 4.6d the default is 0 for SQL 2000, 1 for SQL 7.0. In patch level 1525 for 4.6d the default was again switched to 1 because of note 624951. Update: On March 16th 2005, the default for this parameter was changed to 0 for 4.6d. This is because of the upcoming SP4 for SQL Server 2000, which then means that SAP doesn't support any versions of SQL Server which contain the bug described in note 624951.

l direct_fae_batch (not in ODBC DBSL) If fae_batch is enabled, then setting this parameter to 1 will not use temporary stored procedures for SELECT FOR ALL ENTRIES Instead a parameterized direct statement string is sent to the server. This parameter is only for R/3 4.6x with 4.6d executables. See also note 579463. DEFAULT: 0

l fae_join (not in ODBC DBSL) If set to 1 then FOR ALL ENTRIES statements containing UNION ALL are converted into a join of the real table and a set of "select @Pnnn,... UNION ALL select @Pmmm...".  This is a more efficient method in most cases and it also reduces the size of the resulting temporary stored procedure.  This method will not work if fae_batch is set to a nonzero value. Exists in kernel release 4.6C and later. Obsolete as of kernel release 7.00.  Starting with release 7.00 the generic database interface employs this method for FOR ALL ENTRIES. DEFAULT=1 when running on SQL 2000, 0 when running on 7.0. In recent patch levels for 4.6d and 6.20, the default was switched to 0 because of HOT news note 624951.  This was done in DBSL patch 1525 for 4.6d and patch 849 for 6.20.  The default is still 0 for 6.40 and later. Update: On March 16th 2005, the default for this parameter was changed to 1 for 4.6d and 6.40.  This is because of the upcoming SP4 for SQL Server 2000, which then means that SAP doesn't support any versions of SQL Server which contain the aforementioned bug. See also note 828147.

Other Terms

profile parameters mssql SQL Server Microsoft 6.0 7.0 8.0 9.0 10.0 2000 2005 2008 dblib ODBC OLEDB DBSL

Page 4: 0000028667- Microsoft SQL Server Specific Profile Parameters

Reason and Prerequisites

Solution

Not applicable.  Just documentation.

Other Attributes

Validity

This document is not restricted to a software component or software component version

References

This document refers to:

SAP Notes

This document is referenced by:

SAP Notes (7)

NT/INTEL

NT/INTEL3.5.1

MSSQLSRV

1248222   ODBC DBSL profile parameters and connect options

652634   FOR ALL ENTRIES performance with SQL Server

624951   Incorrect SELECT result on SQL Server 2000

579463   Unexpected return code 13 on SELECT FOR ALL ENTRIES

539508   Unknown MS SQL Server parameters in rz10

133381   Database-Hints in Open SQL for MS SQL Server

98678   SQL Server Connection Issues

133381   Database-Hints in Open SQL for MS SQL Server

98678   SQL Server Connection Issues

652634   FOR ALL ENTRIES performance with SQL Server

1248222   ODBC DBSL profile parameters and connect options

624951   Incorrect SELECT result on SQL Server 2000

539508   Unknown MS SQL Server parameters in rz10

579463   Unexpected return code 13 on SELECT FOR ALL ENTRIES

Operating system

Database System