Anda di halaman 1dari 26

SQL SERVER FAQ

Version 1.0 Date: 5 April 2004

SAP SQL SERVER FAQ

Introduction
This document was compiled by a member of SAP Active Global Support in order to provide a gathering of questions and answers from SAP SQL Server Development and Support Development to provide helpful instruction to our customers. This document is not intended to replace SAP Notes or standard Microsoft documentation. For many questions we have provided a basic answer and then pointed to an existing SAP Note or Microsoft document. Please follow the SAP Note or Microsoft document in the event of a conflict. For the present time this document is available as an attachment to SAP Note 555223: FAQ: Microsoft SQL Server. Soon it will be posted to the Service Marketplace (http://service.sap.com) where you can download it and provide feedback to the author.

Version 1.0 Page 2 of 26

SAP SQL SERVER FAQ

Introduction.......................................................................................................................................................2 1 FAQ...............................................................................................................................................................5 IMPORTANT INFORMATION BEFORE YOU CONTINUE...........................................................................5 What are good resources for information on administering and troubleshooting SQL Server?.................5 Best practices for opening a message with SAP Support..........................................................................6 Top 5 Operational Problems to Avoid........................................................................................................6 Is There Automatic Monitoring of SAP Software?......................................................................................7 Available Training Classes and Books.......................................................................................................7 ADMINISTRATION TASKS AND QUESTIONS............................................................................................8 Why do I need environment variables defined? .......................................................................................8 What are important profile parameters for SQL Server?...........................................................................8 How do I change database parameters?...................................................................................................8 How can I move/increase/decrease datafiles?..........................................................................................8 Can I monitor a non-Basis/ WAS remote system? ....................................................................................8 How do I remove stored procedures created by the SAP kernel?.............................................................8 What do I need to know about the SAP Database Monitor?......................................................................8 What are standard jobs I need to ensure are scheduled?.........................................................................9 Where are the important SAP and Microsoft error logs physically located?..............................................9 What is the SQLDIAG utility and how do I run it?......................................................................................9 AUTHENTICATION AND ACCOUNTS USED..............................................................................................9 What are the authentication methods?......................................................................................................9 How do I change the password for the sa account?................................................................................10 How do I change passwords for accounts that connect to SQL Server?.................................................10 DATAFILES.................................................................................................................................................10 Why is the number of datafiles important?...............................................................................................10 How many data files should I create? .....................................................................................................10 What do I need to consider about the file layout?....................................................................................10 Can I just let autogrowth handle data growth needs?..............................................................................11 INSTALLATIONS/ UPGRADES/ SYSTEM COPIES...................................................................................11 What do I need to know about installing or upgrading to SQL Server 2000?..........................................11 How do I perform an SAP installation or upgrade?..................................................................................11 How do I perform a system copy?...........................................................................................................11 NETWORK PROTOCOLS...........................................................................................................................11 Which client network protocols should I configure?.................................................................................11 How do I identify the client network protocol being used by SAP?..........................................................12 How do I review/change client network protocols?..................................................................................12 SQL SERVER SERVICES...........................................................................................................................12 Is Microsoft Distribution Transaction Service needed for SAP installations?...........................................12 Is Microsoft SQL Agent need for SAP installations?................................................................................12 RECOVERY MODELS AND BACKUP/RESTORE......................................................................................12 What is the proper recovery model for me?.............................................................................................12 What should I know about backups from SAP?.......................................................................................12 What is the most critical part of backup and recovery?...........................................................................13 What do I need to know about backups from Microsoft?.........................................................................13 SERVICE, SUPPORT PACKS AND PATCHES..........................................................................................13 What are Service Packs and QFEs?.......................................................................................................13 Which Microsoft Service Packs and Hotfixes are supported by SAP? ...................................................13 Does SAP Support Microsoft Security Patches?.....................................................................................14 How do I install Microsoft Service Packs?...............................................................................................14 What are Support Packs? .......................................................................................................................14 How do I apply an SAP kernel patch?.....................................................................................................14 MULTIPLE DATABASES, sql INSTANCES AND MCOD............................................................................14 What are the differences between multiple SQL Server instances on one server, multiple databases on one server and MCOD?...........................................................................................................................14 SQL SERVER AND SAP PROGRAMMING................................................................................................15 Can I use database hints in ABAP?.........................................................................................................15 Are customer-created SQL Server triggers supported on SAP systems?...............................................15 Can I get data from a remote SQL Server?.............................................................................................15 2 Performance................................................................................................................................................16 3 Determining the cause of long SAP response times...............................................................................16 4 SQL Server..............................................................................................................................................17 SQL Server Parameters...........................................................................................................................17 Version 1.0 Page 3 of 26

SAP SQL SERVER FAQ

Memory Configuration..............................................................................................................................17 SAP and SQL Server...............................................................................................................................17 Does reorganization help performance?..................................................................................................17 General Performance Questions.............................................................................................................17 Do you have DBCC CHECKDB job scheduled during business hours or critical processing times?...17 Are auto create and auto update statistics turned on?.........................................................................17 Are page locks turned off for frequently updated tables? ....................................................................18 Is tempdb sized appropriately?............................................................................................................18 What is the difference between blocking and deadlocking?.................................................................18 SQL Server Myths....................................................................................................................................18 Parallelism always improve performance.............................................................................................18 Updating statistics manually improves performance............................................................................18 Reorganizing an index will increase query performance......................................................................18 SQL Server Is Not an Enterprise Database as Theres No Row-Level Locking...................................18 5 I/O Performance......................................................................................................................................19 SQL Server IO Tools................................................................................................................................19 Windows IO Tools....................................................................................................................................19 Submitting a Message to Support Regarding IO.....................................................................................20 6 General Troubleshooting.............................................................................................................................21 7 Basic STEPS...........................................................................................................................................21 8 Windows Event Log.................................................................................................................................21 9 SQL Server Error Log..............................................................................................................................21 10 Trace flags.............................................................................................................................................22 11 SAP Transactions to use for troubleshooting........................................................................................22 12 Specific Troubleshooting...........................................................................................................................23 13 Excessive Transaction Log Growth.......................................................................................................23 14 SQL Errors.............................................................................................................................................23 15 Cluster troubleshooting..........................................................................................................................24 16 Backup problems/ FAILURES...............................................................................................................24 17 Post restore activities:...........................................................................................................................24 18 Suspect Database.................................................................................................................................24 19 SICK Database...................................................................................................................................25 20 Hanging System....................................................................................................................................25 21 Diagnosing deadlocks...........................................................................................................................25 22 Upgrading 7.0 to 2000 or Installing 2000...............................................................................................25 23 Database connectivity problems............................................................................................................25 24 POST SYSTEM COPY problems..........................................................................................................25 25 ST04 BUFFER RATIO > 100%.............................................................................................................26

Version 1.0 Page 4 of 26

SAP SQL SERVER FAQ

1 FAQ
IMPORTANT INFORMATION BEFORE YOU CONTINUE
What are good resources for information on administering and troubleshooting SQL Server?
For SQL Server, the primary resource is SQL Server Books online. Unless you changed the default installation, it was automatically installed with the database. There is an updated copy from January 2004 you can download from Microsoft here. For both Windows and SQL Server , the Microsoft Knowledge Base is an excellent source troubleshooting. For example, suppose you find the following error in your System Event Log:

Go to the Microsoft Knowledge Base to search for more information. First use the search phrase event id 4. As with any search, start with the widest criteria (all products, full text) and narrow the criteria if too many results are returned. Also, search with a variety of criteria to receive different matches, e.g., one search with the exact phrase event ID 4, one search for all the words event id 4 e100B, Adapter Link Down, etc. For SAP software, your best resource for bug fixes is SAPNet R/3 Frontend (formerly called OSS). Search for SAP Notes using the same general recommendations we gave above for the Microsoft site, i.e., use a variety of terms and searching methods to evaluate the best amount of information. For general SAP software information, the website SAP Help Portal is essential. Its really just the SAP help files posted online, but the search engine is great and is invaluable. You can search it to find out the proper usage of a transaction, what a report is used for, standard administration tasks, etc. Often searching the functional information is invaluable for a Basis person to understand what the functional staff is doing on the system.

Version 1.0 Page 5 of 26

SAP SQL SERVER FAQ

Best practices for opening a message with SAP Support


Describe the problem by answering the following questions: What are all the symptoms of the problem? o Be precise. For example: give the full text of the error message or the exact time the system crashed or the time period that you had the performance problem (9:00-10:00 on Mondays). Did it happen one time only? Does it reoccur on a cycle? o For example, it only happened once on Monday morning after a system restart or every Thursday afternoon or the last week of every month. Can you reproduce it? Can you provide us with the steps so that we can re-execute it on command at any time of the day? o The following is a good example. Execute transaction FD02, select customer 1000001, company code 1000, and on the address screen change the value of, for example, the field 'postal code'. Hit Save. After a few minutes you will get the error mentioned above. Open the remote connection (SAP Note 31515) and add the logon information to the secure area of the message (see SAP Note 508140). Make sure the user ID is in the validity date, this is a common mistake. Also be advised that logon information is deleted from the secure area after 5 days for your security so you may have to reattach the logon data several times. We prefer that you open the connection for several days but understand if that is too costly for you. Attach relevant files. Zip the SQL Server Error logs, Windows Event Logs, dev_* trace files and SAP system logs. Make sure to document any entries in these logs that you think relate to the problem. Either attach the zip files to the message, which is only available in the Service Marketplace (SAP Note 541726), or FTP the files to sapserv (SAP Note 40024). Please do not paste all the text of a dump to a message, it wastes space and is difficult to read in our internal system, use the attachment or FTP method to send the dump to us. Document if you found any errors or items that may relate to the problem. For example, list any entries in ST22 or SM21. A list of SAP transactions you can review for troubleshooting is provided later in the document. Document if you found any SAP Notes that youve found related to this and why they do or do not apply?

Top 5 Operational Problems to Avoid


These items are covered here briefly to identify critical problems customers experience but should never occur. Each point is covered in detail later in the document. 1. Although a backup is run every day it is never tested. When a critical error occurs the customer attempts to restore the data only to run into errors due to a bad tape, bad drive, etc. A disaster recovery drill is just as important as the backup procedure. Without a readable tape the backup itself is pointless. Outdated MS Service Packs, SAP Support Packs, SAP kernel or client connectivity software. Often customers experience a critical problem due to a bug that was already fixed by MS or SAP but was missing in their system due to a lax support schedule. Maintenance downtimes should be determined by the application and technical staff with periodic downtime clearly established so that updates can be made. Depending on the system availability required this can be weekly, monthly or quarterly but we dont recommend maintenance be more than a quarter apart. a. Example: The SQL Slammer worm was a perfect example of an event that would have been minimal if Service Packs were applied on a consistent basis. SQL Server is not configured to SAP recommendations. Often problems, especially performance problems, occur because someone has tweaked SQL Server parameters. There is a lot of general information on performance for SQL Server but running an SAP installation is an entirely different event. Only rely on SQL Server performance information provided by SAP. Transaction log is full (error 9002). This is a common error and a simple one to avoid. Ensure that the transaction log is sufficiently sized (at least 3 GB), that it has plenty of space to grow if needed and that you backup the log frequently enough so the log is truncated.

2.

3.

4.

Version 1.0 Page 6 of 26

SAP SQL SERVER FAQ

Is There Automatic Monitoring of SAP Software?


Yes, there is a lot of monitoring built in to the system and you can create your own custom monitoring with the SAP tools. There are also many third party tools that will monitor SAP. The main platform for monitoring in SAP is called CCMS, Central Computer Management System, and the monitoring transaction is RZ20. After executing RZ20 you will see one of the monitoring trees is called SAP SQL Server Monitor. Carefully read the following monitor questions and you will notice these are key issues that are covered repeatedly in this document. Using this monitor can help you better maintain your system. You can also enable emails or pages to be automatically sent when an RZ20 monitor hits a defined threshold. See SAP Note 176492 for the steps on configuring this. For advanced monitoring configuration SAP provides the training class ADM106. Due to ongoing development this tree will grow and add more monitoring objects but as of Q1 2004 it monitors the following: Are automatic statistics enabled? Are auto update statistics enabled? Are ANSI Nulls enabled? Do VBHDR, VBDATA and VBMOD have auto stats disabled? Do VBHDR, VBDATA and VBMOD have Page level locking turned off? Do ARFCRDATA, ARFCSDATA and TRFCQUEUE have Page level locking turned off? Is the compatibility level set to 8.0? Are the database parameters set according to SAP recommendations? Is the network packet size is set to 4096 bytes or 8192? Has tempdb autogrown? Is the tempdb at least 240MB? Is the tempdb log size at least 60MB? Are the transaction log files and tempdb files on same device? Are the transaction log files and SAP database files on the same device? Is LPC enabled on the database server? Are the clients (application servers) configured to use TCP/IP to connect? If AWE is enabled then is MAX memory set? On a server with < 10 GB and fixed memory, is the database memory allocated less than 90% of physical? Is the Recovery Model not set to FULL and do transaction log backups exist? Is the Recovery Model not set to FULL and do transaction log backups not exist? Do triggers exist not owned by SAP? Are there different versions of dbmsssllib.dll, disp+work.exe or MSDART.dll? The SAP Solution Manager also uses RZ20 as its basic monitor. For more information on the Solution Manager see the Service Marketplace http://service.sap.com/solutionmanager.

Available Training Classes and Books


Training Class: SAP Education provides ADM520 Database Administration with SQL Server. The course covers: SAP system architecture and SQL Server architecture Backup o Backup concepts o Performing database backups Database restore Database monitoring o Working with the SQL Server monitors o Working with CCMS monitors System management and problem solving Books: SAP Database Administration with MS SQL Server 2000 by Paul Read Version 1.0 Page 7 of 26

SAP SQL SERVER FAQ

This book offers you expert information about SAP database administration using Microsoft SQL Server 2000. The book addresses all aspect of SQL Server and the SAP system that play a part in coordinating the two systems productively. The author works for SAP Active Global Support. Inside Microsoft SQL Server 2000 by Kalen Delaney The book focuses on SQL Server architecture and the internal workings of SQL Server. SAP Performance Optimization Guide, Third Edition by Thomas Schneider This is a step-by-step performance optimization and monitoring guide. The author works for SAP Active Global Support. See a detailed Table of Contents here: http://www.sap-press.com/H951.html

ADMINISTRATION TASKS AND QUESTIONS


Why do I need environment variables defined?
SAP Tools like tp, r3trans, saplicense, etc. all reside outside the Basis/ WAS layer so they use Windows environment variables to connect to the database. If you do not set the environment variables correctly you will experience connection problems with these tools. For a list of the required environment variables see SAP Note 128126: Database Connect for external tools.

What are important profile parameters for SQL Server?


A detailed explanation is in SAP Note 28667: Microsoft SQL Server Specific Profile Parameters.

How do I change database parameters?


First, dont change the parameters unless SAP Support has asked you to. Almost all database parameters should be left at the default installation values. The exceptions are described in SAP Note 327494: Configuration Parameters for SQL Server 2000. You can either change parameters with native SQL commands or in the GUI. Usually SAP consultants will give you the Native SQL parameter name and expect you will change it with the SQL method described below. SQL Method: Query Analyzer. See the Books online section titled Setting Configuration Options for the parameter names and script examples for changing the parameters. Note that this section identifies which parameters require a restart of SQL Server. GUI Method: SQL Server Enterprise Manager -> Microsoft SQL Servers SQL Server Group -> Right click the appropriate instance name (most likely called local (Windows NT)) -> Choose Properties. The Properties panel displays the database options but they will not appear the same as most SAP or MS employees will refer to them.

How can I move/increase/decrease datafiles?


The procedure is described in detail in SAP Note 363018: File management with SQL Server 7 and 2000.

Can I monitor a non-Basis/ WAS remote system?


Yes, you can use tools like ST04, DB02 and Profiler on a remote system with no Basis/ WAS layer by following the directions in SAP Note 358507: SQL Server: Remote Database Monitor.

How do I remove stored procedures created by the SAP kernel?


This is not always a required action but some customers are interested in it. See SAP Note 333458: Too many permanent stored procedures in MSSQL.

What do I need to know about the SAP Database Monitor?


The SAP Note 139945: SAP Database Monitor for MS SQL Server has detailed documentation on installing, configuring and troubleshooting the SAP Database Monitor. It also lists SAP database monitoring transactions that are not supported on SQL Server. Version 1.0 Page 8 of 26

SAP SQL SERVER FAQ

What are standard jobs I need to ensure are scheduled?


For standard Basis/ WAS jobs, see SAP Note 16083: Standard jobs, reorganization jobs. In addition, we recommend scheduling a periodic check of the consistency of the database using DBCC CHECKDB. This job can be very performance intensive so it should be scheduled during a long period of low activity like nights or weekends when no users are online and no critical jobs are scheduled. If you do not have periods of low activity then you need to carefully consider if you should schedule the job. See SAP Note 142731: DBCC checks of SQL server for a detailed explanation of the check and how to schedule it. After the job runs you should always ensure that you check the logs for entries regarding the job and if it made any repairs or found any errors. If you have scheduled DBCC directly using the SQL Server Agent you can check the SQL Server error log for the error and repair summary. Make sure you schedule the job with the proper parameters. For example, do *not* run checkdb with repair_allow_data_loss option as this may result in data loss and ruin the logical integrity of the database.

Where are the important SAP and Microsoft error logs physically located?
The SAP dev traces and system logs are found in /usr/sap/<sid>/<instancetype><system number>/work. For example, /usr/sap/PRD/ DVEBMGS00/work. They will be found on the drive where you installed SAP. To find the SQL Server Error Log, follow the directions in the SQL Server Books Online section Viewing Error Logs. Double-click the Current Log and one of the first lines will tell you the log file name with the full path in case you need to send the logs to SAP. You could also view the log from inside SAP by ST04 -> Detail Analysis -> Error Logs. To attach the Windows Event Logs to an SAP support message you will need to first save a local copy. Open Event Viewer via Start -> Control Panel -> Administrative Tools. Then right-click the log name in the left frame (for example, System) and choosing Save log file as. You can save it in any of the formats listed. To open a locally saved log file with the extension .evt you need to open Event Viewer. Then right-click somewhere in the right frame and choose Open Log File Navigate to the locally saved copy and choose it. You must specify whether it is a System, Application or Security log.

What is the SQLDIAG utility and how do I run it?


SQLDIAG is an executable located in the \MSSQL\Binn directory that gathers detailed information about the SQL Server installation and physical server and saves it to a log in \MSSQL\Log. See the SQL Server Books Online section titled SQLDIAG Utility for more information. You can also view the output log with Notepad or WordPad. On non-clustered SQL Server installations you can run it either by command prompt or by double-clicking the file in Windows Explorer. For a clustered installation you will need to execute it from the command line with the parameter -c. Sometimes SAP Support will ask you to execute SQLDIAG and either FTP or attach the log to an open message.

AUTHENTICATION AND ACCOUNTS USED


What are the authentication methods?
There are two ways to connect to SQL Server, either Windows Authentication or SQL Server Authentication. Since 4.5A, SAP uses Windows Authentication which means a Windows account is used to connect to SQL Server. The installation guide for your version has the detail on all the Windows accounts used. More detail and history is available in SAP Notes 116735: OLEDB Connections and Security and 28893: Changing passwords for SQL Server.

Version 1.0 Page 9 of 26

SAP SQL SERVER FAQ

How do I change the password for the sa account?


See SQL Server Books Online (Updated version) section titled Assigning an sa Password for information regarding the sa account and how to change the password.

How do I change passwords for accounts that connect to SQL Server?


Since 4.5A and the use of Windows Authentication, changing the passwords of the Windows accounts that connect to the database is not a big issue. Change the passwords as you would any other local/domain Windows account. For 4.0B and earlier systems that use SQL Server authentication, you must be very careful to change the passwords in SQL Server and R/3 at the same time. Follow the directions in SAP Note 28893: Changing passwords for SQL Server. This topic is also covered partially in SAP Note 555223: FAQ: Microsoft SQL Server.

DATAFILES
Why is the number of datafiles important?
SQL Server databases store the data in datafiles which are contained in filegroups. SAP does not support user-created filegroups for an SAP database, only the initially created Primary group. See the SQL Server Books Online section Default Filegroups. Within that Primary filegroup, you must create datafiles to contain the SAP data and the number of datafiles created. SQL Server uses proportional fill to spread the data between the datafiles according to eachs freespace. This is called the proportional fill strategy. So you want to have several files each with free space available for the IO load to be spread out. If you only had one datafile then either the physical disks themselves would be overloaded and cause a bottleneck or the datafile itself would become a bottleneck due to datafile header contention. The SQL Server Books Online gives an excellent example how SQL Server would fill two files, see the section titled Using Files and Filegroups. The example is important also because it emphasizes the freespace is how SQL Server decides where the data will go. To reach the best distribution across multiple files they should be created all at the same size and, when increases are needed, all increased by the same amount. This will allow you to keep an approximately equal amount of freespace in each file so the data is well distributed.

How many data files should I create?


An extremely basic answer is that you should have a number of datafiles that falls between the number of processors divided by 4 and the number of processors divided by 2 (with at least a minimum of 3 files). So, if you have a 32-way CPU system the optimal number of datafiles is between 8 and 16 (32/4 = 8 and 32/2 = 16). If you have a 16-way CPU system then the optimal number of datafiles is between 4 and 8 (16/4 = 4 and 16/2 = 8). For an 8-way hyper-threaded system (like 8 Xeon MP Processors) you will use the same number of datafiles as a 16-way. Lastly, if you have a 4-way system you will still configure 3 datafiles as that is the minimum number we recommend. When deciding the number of files make sure that you plan for future growth and choose the proper number of datafiles. If you are setting up a small system to rollout to 500 users for a year but plan on adding 5000 users to upgraded hardware next year make sure to create enough datafiles to distribute the load. If you later add datafiles to an established database you always risk IO contention as SQL Server will automatically begin to fill the new files until they are filled equally with the old ones. If you have no choice but to add datafiles then make sure you add at least three so the load is distributed among the new files.

What do I need to consider about the file layout?


For best performance we recommend you have the different file types on separate physical disks. This means that you should keep the following file types on separate physical disks from each other: Production database datafiles Version 1.0 Page 10 of 26

SAP SQL SERVER FAQ

Production database transaction log files Temporary database datafiles Temporary database log Windows Swap files

It is acceptable to have multiple production database datafiles on the same disks or have multiple temporary database datafiles on the same disks. Just dont have production database datafiles on the same disks as the temporary database datafiles. Dont rely on the logical drives letters (D:, E:, F:, etc.) as proof that the datafiles are on separate physical disks. The hardware layer is invisible to Windows and the hardware could have the same physical disks mapped to drives E: and F:. Hardware vendors have software to analyze the physical disk allocation.

Can I just let autogrowth handle data growth needs?


We recommend that you enable autogrowth on all your database files only as a safety precaution as autogrowth itself is very performance intensive and can severely affect online users. To avoid the performance hit, we recommend that you monitor the net growth of the DB on a regular basis and manually increase the files during non-business hours. Autogrowth also can be dangerous if all the files in a filegroup fill at once. This causes SQL Server to abandon proportional fill and only grow and fill each file sequentially. More detail on this behavior is available in the SQL Server Books Online section titled Using Files and Filegroups.

INSTALLATIONS/ UPGRADES/ SYSTEM COPIES


What do I need to know about installing or upgrading to SQL Server 2000?
The SQL Server installation as part of an SAP system is always described in the installation guide for the product youre installing. Find the guides at the alias /instguides. In addition, there is an SAP Note which discusses upgrading SQL Server 7.0 to 2000. See SAP Note 209596: Setting up Microsoft SQL Server 2000.

How do I perform an SAP installation or upgrade?


SAP provides a lot of documentation for version upgrades. See the alias /instguides for more information whether it is a Basis, WAS, R/3, BW, etc. upgrade. Note: Upgrading any SAP version < 4.6A to a version >= 4.6A requires you perform a Long Datatype Conversion (or LDC). There are several SAP Notes regarding the process but the introductory SAP Note is 154686: Long Datatype Conversion for MS SQL Server.

How do I perform a system copy?


System Copies are documented in the heterogeneous (e.g., Oracle to SQL Server) and homogeneous (e.g., SQL Server to SQL Server) guides at /instguides. In addition, see the SAP Notes 48585: SAP R/3 system copy and 151603: Copying an SQL Server database for more information and advice.

NETWORK PROTOCOLS
Which client network protocols should I configure?
Simply, on the database server you should use Named Pipes whereas all application servers should use TCP/IP. For clustered servers, see the SAP Note provided below for additional information depending on the cluster configuration.

Version 1.0 Page 11 of 26

SAP SQL SERVER FAQ

Additionally, on the database server we do not recommend having the setting Enable Shared Memory Protocol checked. More information is available in SAP Note 208632: TCP/IP network protocol for MSSQL.

How do I identify the client network protocol being used by SAP?


You can easily view this by executing ST04 -> Detail Analysis -> System Tables-> Processes (sysprocesses). View the last column named "NetLib" and it will identify either LPC, Named Pipes or TCP/IP.

How do I review/change client network protocols?


Use the Client Network Utility installed with SQL Server. The shortcut to the utility is in the Microsoft SQL Server group in your Programs menu. More information is available in SAP Note 208632: TCP/IP network protocol for MSSQL.

SQL SERVER SERVICES


Is Microsoft Distribution Transaction Service needed for SAP installations?
No, this service is not used by SAP and does not need to be started. If you have it flagged to start automatically you will see errors in the SQL Error Log on every SQL Server start as it will be unable to find a server to distribute to.

Is Microsoft SQL Agent need for SAP installations?


Yes, the SQL Agent should always be running when SAP is running as it executes some jobs needed by R/3, mostly CCMS jobs, and SQL Server jobs like backup and DBCC CHECKDB. A specific example is in SAP Note 547911: SAP CCMS Blocking Lockstats.

RECOVERY MODELS AND BACKUP/RESTORE


What is the proper recovery model for me?
For all SAP installations you should use the Full Recovery option. This enables you the best data security by allowing you to recover to a specific point in time. A simple explanation of the different recovery models is available in the SQL Server Books Online section titled, Selecting a Recovery Model. For more SAP-specific information, see SAP Note 400251: Index creation fills up transaction log. This Note explains the different models and how you can switch between them for better performance during index creation.

What should I know about backups from SAP?


SAP Note 44449: Backup strategies with SQL Server describes the standard recommendations for backups. You can schedule backups in the SAP transaction DB13. In addition, there are several Notes available with either detailed error information or that answer backuprelated questions. They are: SAP Note 44533: Scheduling a backup as a time-controlled task SAP Note 421644: SQL error 9002: The transaction log is full SAP Note 413516: Backup tools for SQL server and SAP SAP Note 193816: Restore with SQL Server SAP Note 551915: R/3 won't start after database restore or database SAP Note 37152: SQL Server Backup to a dump file

Version 1.0 Page 12 of 26

SAP SQL SERVER FAQ

SAP Note 153763: Sub-optimal Tape Backup Performance on SQL Server 7

What is the most critical part of backup and recovery?


Backing up the database is useless unless youre sure you can restore the data. You must test restoring a backup to a physical server at least once after every significant system change (service pack application, support pack application, hardware change, etc.). In addition, testing the restore periodically ensures the staff is practiced in performing a restore and can restore the data quicker. Dev Supp cant help if restores arent reliable Many customers perform their test restore by refreshing their training system and therefore complete 2 tasks at once.

What do I need to know about backups from Microsoft?


SAP Support has compiled a list of known articles from Microsoft that discuss backup/restore. See SAP Note 437160: MS Disaster Recovery Articles for MS SQL Server for a listing of the Q articles.

SERVICE, SUPPORT PACKS AND PATCHES


What are Service Packs and QFEs?
Service Packs (SPx) are the bundled version of Microsoft code fixes. Each application, like Windows 2000 Server and SQL Server 2000, has its own Service Pack release schedule and versioning. There is not a direct relationship between Service Packs of different applications. So although you apply Windows 2000 Server SP3 it does not also apply SQL Server 2000 SP3. The SQL Server 2000 SP3 would be a separate release and a separate installation. However, sometimes a Service Pack for one application has a prerequisite for another. For example if you want to apply Service Pack 3 to SQL Server 2000 on Windows NT 4.0 your Windows NT 4.0 must be at least at SP5. This information is always documented on the webpage or in the README that comes with the Service Pack. Service Packs for a single application are cumulative. So if you install Windows 2000 Server fresh from the original RTM (released-to-manufacture) CD you can just apply Windows 2000 Server SP3 and it will apply all three Service Packs to Windows. With every SQL Server service pack application, ensure that you also update the client software on each of the SAP application servers. This updates any modification to the SQL Server Network Libraries and the MDAC components necessary for application server connections to the database server. A QFE (quick-fix-engineering) is also referred to as a Hotfix. These are immediate fixes released by Microsoft in response to a specific problem, some are released to the public for all to apply but most are released only by Microsoft Support in response to a specific problem. QFEs for SQL Server 2000 and Windows 2000 are applied differently as Windows QFEs are not cumulative but SQL Server 2000 QFEs are cumulative after a Service Pack. For example, if you have the current SQL Server 2000 Service Pack applied and two QFEs are later released you only need to apply the largest numbered QFE for that current Service Pack. Download Service Packs and Hotfixes from here. To find out the end-of-life for Microsoft Support of your software, the Microsoft Support Lifecycle is available here.

Which Microsoft Service Packs and Hotfixes are supported by SAP?


The following SAP Notes document the supported versions: SAP Note 30478: Service Packs on Windows NT/Windows 2000 o Also provides relevant Windows QFEs (or Hotfixes) SAP Note 62988: Service Packs for MS SQL Server SAP Note 608651: SQL Server 2000 Most Recent Hotfix

Version 1.0 Page 13 of 26

SAP SQL SERVER FAQ

Does SAP Support Microsoft Security Patches?


Simply put, SAP fully supports every patch Windows delivers. This means SAP gives the customer full support running on every single Windows patch. However, if a Microsoft Security Patch is applied and the result is that an SAP application instance which was running before does not start up anymore after applying the patch, SAP will direct the customer to Microsoft. See SAP Note 663621: Supporting Microsoft hot fixes with Windows update for more information.

How do I install Microsoft Service Packs?


Instructions on applying Service Packs are in the following SAP Notes: SAP Note 159268: Service Pack installation on SQL Server 7.0 SAP Note 417089: Service Pack installation on SQL Server 2000

What are Support Packs?


Support Packs are the bundled version of SAP Notes (code fixes). Support Packs are available for download at the alias /patches. SAP Support Packs are not cumulative so you must download all the Support Packs and apply them in order. During Support Package application, the SAP software will recommend that you read a Note (the number is version dependent) prior to continuing. Always read the Note carefully as it documents known issues with the application of the Support Packs chosen and can save you from a disastrous situation. Often these Notes document a termination that can occur in one of the steps or Support Packs that have to be applied in separate queues, etc. Many customers ignore these Notes and end up in a critical situation where they have to perform a database restore in order to get the system up prior to the business need. For more information regarding Support Packs and new tools like the Side-Effects of SAP Notes interactive tool, go to the alias /patches and view the information under SAP Support Packages in Detail.

How do I apply an SAP kernel patch?


See SAP Note 19466: Downloading SAP kernel patches for detailed definitions and instructions. Make sure to update the other binaries as well like tp, r3load and (most importantly) the database library (also called DBSL). If upgrading to a new backward compatible kernel (for example, the first time a 6.20 kernel is applied to 6.10 system) you should make sure to execute the stored procedure SAP_DROPROC to drop the existing stored procedures so you can be sure that new ones are created with the new kernel. Execute it in the Microsoft tool Query Analyzer with the following command exec sap_droproc; but dont use the quote marks. See SAP Note 333458: Deleting obsolete stored procedures in SQL Server for more information on the sap_drop* stored procedures.

MULTIPLE DATABASES, SQL INSTANCES AND MCOD


What are the differences between multiple SQL Server instances on one server, multiple databases on one server and MCOD?
If you install multiple SQL Server instances it means you have installed SQL Server itself multiple times. Each installation has its own directory and therefore its own executables. Each instance can then also have different database parameters, amount of memory allocated and datafiles. They will have unique system tables and unique backups. Multiple databases exist in one SQL Server instance. This means they share the same executables, the same memory allocated to SQL Server and the same database parameters because they are in the same instance. Although they will share system tables they will have different backups and different datafiles. MCOD uses schemas to install multiple SAP systems in one SQL Server database. Schemas are a subset of a database and keep the data separate by creating and accessing the tables via a user account with the

Version 1.0 Page 14 of 26

SAP SQL SERVER FAQ

same name as the system SID. For example, you install an MCOD system with a CRM SID of CRP and an R/3 SID of PRD and would like to see the client list for each in SQL Query Analyzer. You would have to execute 2 separate SQL statements like this: Select * from crp.t100 Select * from prd.t100 One backup will cover all schemas since they are installed in one database and all schemas could be restored to one point in time. Again, they will share the same memory block and have the same database parameters because they are in the same database. They will also share datafiles and transaction log since they are in the same database. Since R/3 Enterprise (4.7) all SQL Server systems are automatically installed as a schema under the user <sid>. There are several other sources of information. The alias /mcod has more information and so do the following SAP Notes: o SAP Note 374276: Single database, multiple schemata o SAP Note 171929: Several R/3 Systems on one SQL Server 7.0 o SAP Note 388638: Multpl. componts. on 1 DB (MCOD) MSSQL installation

SQL SERVER AND SAP PROGRAMMING


Can I use database hints in ABAP?
Yes, database hints can be used in ABAP. There is the general SAP Note 129385: Database hints in Open SQL and the SQL Server-specific SAP Note 133381: Database-Hints in Open SQL for MS SQL Server.

Are customer-created SQL Server triggers supported on SAP systems?


Technically they can be created however because they can cause significant inconsistencies SAP does not support the use of them. See SAP Note 689152: Triggers in SQL Server for more information.

Can I get data from a remote SQL Server?


Yes, you can programmatically connect to another SQL Server to retrieve data using the instructions in SAP Note 178949: MSSQL: Database MultiConnect with EXEC SQL. The remote server does not have to be running any SAP software but the system starting the connection must have an SAP instance on the same server.

Version 1.0 Page 15 of 26

SAP SQL SERVER FAQ

2 Performance
3 DETERMINING THE CAUSE OF LONG SAP RESPONSE TIMES
For standard SAP performance tuning the best resource is SAP R/3 Performance Optimization by Thomas Schneider, available at many web stores and SAP Press. This is the best resource and the section below is a small part of the analysis roadmaps detailed in the book and has been greatly simplified in an attempt to provide a basic roadmap for novices. Many important topics, like Memory Management, have been completely skipped as they cannot be simplified. The first step is to identify the average dialog response time of the system. For an OLTP system like R/3, CRM, etc, the time should be less than 1,000 ms. SAP Support normally starts an analysis by viewing the average dialog response time for the total system for the prior week. Transaction ST03N -> Change the view from Administrator to Expert Mode -> Double click the prior weeks date under Workload Total Week. The Workload Overview will appear in the right frame. The average dialog response time will be in the column titled Time. o The average database time should not be > than 40% of average dialog time. Be careful with this rule, if the overall response time is very good than the database time can easily be greater than 40% but still not a concern. Use per transaction analysis to see if specific transactions have long database times and perform SQL Statement Analysis with ST04 to identify expensive statements on the database. o Load time should be < 50 milliseconds If its is greater than 50 your program buffer may be too small and need to be enlarged. Use ST02 to analyze the program buffer and determine if you have enough free memory to enlarge the buffer. o Wait time should be < 50 milliseconds Are there enough work processes? Is something consuming too many work processes (parallel program or CPIC calls)? Use SM50 to see if you ever have dialog processes in the waiting status. There should always be a few available on each instance. Another performance tool is to use SM66/SM50 to watch active work processes. First, you want to ensure that you always have some work processes in the status waiting so that you have processes available when needed. Secondly, you can analyze the performance by analyzing the running processes as below: Processes in running status for a long time (manual screen refreshes over several minutes) o Are they stuck in a long running sequential read? Trace the transaction with ST05 to determine the reason for the long read time. o Are there exclusive locks? You can view this many ways. (1) SM66 (with flag checked in Settings) (2) ST04 -> Detail Analysis -> Exclusive Lockwaits or (3) transaction DB01. o Is it in load report or have semaphore 1? Use ST02 to see if the program buffer is too small. o Is it in roll in/roll out or semaphore 6? Use ST02 to review extended memory and roll buffer. o Is it in PRIV? Use St02 and ST03 to see who is consuming extended memory. May not be the PRIV process. o Is it in CPIC? Is the RFC destination server too busy and causing a bottleneck on your system? Performing a SQL Cache analysis of slow SQL statements is complex. We have provided the central SAP Note 155413: Analysis of slow SQL statements. In addition, there are a few other Notes which document problems with specific tables: o Slow access to the CE4xxxx tables SAP Note 443404: Performance: CE4xxxx tables on SQL server SAP Note 35288: Profitability Analysis: Technical Documentation

Version 1.0 Page 16 of 26

SAP SQL SERVER FAQ

o o

SAP Note 499858: Storage parameter maintenance with MS SQL Server SAP Note 540881: Index for accessing VBBE, ATP_VBBE SAP Note 305909: Performance of STXH in SELECT_TEXT on SQL Server (DB2)

4 SQL SERVER
SQL Server Parameters
SQL Server Parameters should remain at the default installed values unless indicated otherwise in SAP Note 327494: Configuration Parameters for SQL Server 2000 or by SAP Active Global Support. If you are unsure of the default value for a database parameter, see the SQL Server Books Online section titled Setting Configuration Options. Many customers have changed the default values for Priority Boost, Set Working Size and Max Degree of Parallelism based on general internet advice regarding performance. SAP has tested these parameters intensively and has determined that all three settings should be disabled. This means that Priority Boost and Set Working Size would be set to 0 and Max Degree of Parallelism would be set to 1 (setting it to one means processes can only use 1 processor). The only exception to this rule so far is that Parallelism is at times good to enable in BW or APO systems. See the SAP Note mentioned above for the details.

Memory Configuration
If the database server also has an SAP instance running you need to ensure that the database and SAP are not competing for memory. Make sure that SQL Server is using a fixed amount of memory, that the SAP parameter PHYS_MEMSIZE is set to restrict its amount of memory and that some extra memory is left over for Windows. See SAP Note 327494: Configuration Parameters for SQL Server 2000 for more detail. If this is not a central system (one physical server with the database and SAP and no other application servers) it is best to allocate more memory to SQL Server and restrict the SAP instance. This would also mean you have to be careful how many users you allow on the SAP instance on the database server as well.

SAP and SQL Server


There are ABAP parameters that influence SQL Server behavior. See SAP Note 28667: Microsoft SQL Server Specific Profile Parameters.

Does reorganization help performance?


No, there is no significant mid to long-term performance benefit. If you feel you must do something, use DBCC INDEXDEFRAG (SQL 2K only) rather than DBCC DBREINDEX. See SAP Note 159316: Reorganizing tables under SQL Server 7.0 / SQL 2000 for more information.

General Performance Questions


Do you have DBCC CHECKDB job scheduled during business hours or critical processing times?
This job can be very system intensive so make sure its scheduled at a time that will not affect online users or critical jobs. See SAP Note 142731: DBCC checks of SQL server

Are auto create and auto update statistics turned on?


Make sure you have these enabled for all tables except VBHDR, VBDATA and VBMOD. See SAP Note 327494: Configuration Parameters for SQL Server 2000 for more detail.

Version 1.0 Page 17 of 26

SAP SQL SERVER FAQ

Are page locks turned off for frequently updated tables?


Make sure you have page locking disabled for the tables VBHDR, VBDATA, VBMOD, ARFCDATA, ARFCRDATA, TRFCQUEUE and D010TAB. See SAP Note 327494: Configuration Parameters for SQL Server 2000 for more detail.

Is tempdb sized appropriately?


Do you have tempdb set to start at 500 MB with an autogrowth size of 100 MB and it routinely grows to 4 GB during daily use? If yes, then set tempdb to start at 7 GB and monitor the size to ensure it doesnt begin growing larger than 7. Autogrowth is very performance intensive.

What is the difference between blocking and deadlocking?


Quoted directly from SQL Server Books Online Troubleshooting Locking: A deadlock occurs when two users (or sessions) have locks on separate objects and each user wants a lock on the other's object. Each user waits for the other to release their lock. Microsoft SQL Server detects when two connections have gotten into a deadlock. One of the connections is chosen as a deadlock victim. The connection's transaction is rolled back and the application receives an error. Blocking happens when one connection holds a lock and a second connection wants a conflicting lock type. This forces the second connection to either wait or block on the first. Both blocking and deadlocking type conflicts occur in all databases. From a performance and stability perspective, blocking is acceptable if the second connection does not wait too long and not too many processes line up waiting for the resource. Deadlocking is much more important and should be investigated carefully. See the Troubleshooting section below for information on troubleshooting deadlocks.

SQL Server Myths


Parallelism always improve performance
Generally this is true however SAP testing has shown that enabling SQL Server Intraquery Parallelism (setting Max Degree of Parallelism to anything <> 1) can cause significant performance problems for some SQL Statements. And because the database server is a central resource the few SQL statements that parallelism affects cause a disruption to all end users. Other than a single time in BW, we always recommend this be disabled. See SAP Note 327494: Configuration Parameters for SQL Server 2000 for more detail.

Updating statistics manually improves performance


The fact that a manual UPDATE STATISTICS dramatically improved the performance of a specific SQL statement does not necessarily mean that the original performance problem was caused by outdated table statistics. It could just be the case that the previously cached execution plan was tailored for very different values in the WHERE clause and behaved badly for the actual values. The statistics update also generates a recompilation of stored procedures which would have removed the cached plan that caused the original slow performance. The most promising solution for these kinds of problems is to include the "reparse" hint in the ABAP SQL statement.

Reorganizing an index will increase query performance


Not on SQL Server. Again, there is no significant mid to long-term performance benefit. If you feel you must do something, use DBCC INDEXDEFRAG (SQL 2K only) rather than DBCC REINDEX. See SAP Note 159316: Reorganizing tables under SQL Server 7.0 / SQL 2000 for more detail.

SQL Server Is Not an Enterprise Database as Theres No Row-Level Locking


This is not true, SQL Server 7.0 and 2000 do have row-level locking. This was only true for the older unsupported version of SQL Server 6.0 and 6.5. SQL Server 7 and 2000 have complex locking capabilities which are detailed in the SQL Server Books Online section titled Understanding Locking in SQL Server.

Version 1.0 Page 18 of 26

SAP SQL SERVER FAQ

5 I/O PERFORMANCE
IO problems can cause drastic performance problems and also temporary or periodic problems. In this section we have listed the most common problems weve seen and a brief listing of indicators you can check to help you see you possibly have a problem. If yes, we recommend gathering the data that you think shows the IO problem and submitted a message to BC-DB-MSS for Support to review. Confirming an IO problem is not always easy and actually identifying the IO problem is often very difficult. The most common problems see are: 1. Controllers are configured improperly. The controller sits between the Windows server and the disk array or storage system and will have to be examined by a hardware partner. Real-life examples of poor controller configuration are: a. There are two controllers meant to supply load-balancing. However, one controller is configured as a failover for the first so in reality there is only one controller working and it is overloaded. b. Read caching was disabled on the controller so its performance was not as good as it should have been. 2. The disk system has too few spindles. Some customers have a disk system that is just too small for the amount of data throughput an SAP system requires. Although there is plenty of total storage space it is spread across devices with too few spindles to platters so the data just cant be retrieved quickly enough. 3. IO intensive files are on the same physical disks. Files of the following types should each be on separate physical disks: a. Database data files b. Database transaction log c. Temporary database data files d. Temporary database transaction log e. Operating system swap files NOTE: Although it may appear the files are separated according to Windows (e.g., files are on separate G:, H:, I: and L: drives) that does not mean they are separated at the storage level. So even though the files appear separate to Windows they could actually be on the same physical disks. All hardware vendors have tools to see which physical drives in the storage system are mapped to a logical drive in Windows, they can provide you with this information. 4. Disk file system cluster size is too small. For best performance the disks should be formatted with a 64KB cluster size, although 4K, 8K, 16K are acceptable. At this time we do not recommend reformatting your disks unless they are significantly different (for example, if they are at 64 bytes or 256 KB). See the SQL Server Books Online section titled File Systems. There are SQL Server tools and Windows tools to help you review IO performance.

SQL Server IO Tools


In SQL Server you can use the fn_virtualfilestats function or execute DBCC SQLPERF(WAITSTATS). Both commands are discussed in the SQL Server Books Online in the sections fn_virtualfilestats and DBCC SQLPERF. There is also an SAP Note which describes the commands and how they are implemented in SAP depending on your Basis/ Web Application Server release. See SAP Note 521750: FAQ: SQL Server I/O performance for more detail. NOTE: These counters are all cumulative since the startup of the database. So to figure out the average/ millisecond for some values you will need to divide the counter by the number of milliseconds that have passed since startup. In Web Application Server 6.40 SAP will display counters that refresh periodically so snapshots are easier to obtain. If you want to observe these statistics during a possible IO problem you will need to execute the commands periodically, calculate the difference and then divide it by the time period to obtain the average.

Windows IO Tools
System Monitor, called Performance Monitor in NT 4.0, is a Microsoft tool that you can configure to capture performance data. Before trying to do IO disk performance analysis you must enable disk counters by executing diskperf y in a Windows command prompt. A server reboot is then needed to activate the change.

Version 1.0 Page 19 of 26

SAP SQL SERVER FAQ

System Monitor allows you to log the counters for future evaluation and analysis by yourself or SAP. We recommend reading the Windows Help files as System monitor is a complex tool. Open the Help files at Start -> Help and then search for System Monitor. Note: Be careful when enabling System Monitor. Enabling too many counters for a long period of time can cause the log to grow rapidly and affect system performance. Watch the file carefully when first starting a collection to ensure it does not grow too rapidly. You can also set a maximum file size but the file will overwrite itself. Many people (and standard Windows documentation) use the counters PhysicalDisk: % Disk Time and PhysicalDisk: Avg. Disk Queue Length to analyze disk performance. We have found that these counters are not always reliable when observing an SAP system since the throughput is so demanding. You may have a high disk queue number but if the results are consistently served in a millisecond then the length of the queue isnt so important. The counters we would evaluate for IO performance are: PhysicalDisk: Avg disk sec / read PhysicalDisk: Avg disk sec / transfer PhysicalDisk: Avg disk sec / writes These values provide a time analysis which is the more crucial information. These are snapshot values which is why you want to configure System Monitor to log the counters for a period of time. If a hardware vendor uses a proprietary tool to check the disk throughput you should turn on System Monitor logging at the same time. Some vendor tools calculate the time after the request passes the controller and to the disk. With the controller itself often being a bottleneck the Windows counters will reveal the time that the operating system has to wait for the data. If this value is high but the vendor tool has low numbers then you should investigate the controllers.

Submitting a Message to Support Regarding IO


When submitting a message about an IO problem make sure to attach any System Monitor logs that show long access times and all other system data from that time (download of SM66, errors in SM21, dumps in ST22, etc.). Also, if the problem usually occurs at the same time be sure to identify when Support should look on the system. For example, make sure to note if the problem always happens Wednesday mornings around 09:00 (note your local time zone too). This will enable Support to be prepared and on the system at that time.

Version 1.0 Page 20 of 26

SAP SQL SERVER FAQ

6 General Troubleshooting
7 BASIC STEPS
Ensure the client libraries and database server are on the same SQL Server version (especially SQLOLEDB.DLL and DBNETLIB.DLL). Since WAS 6.20 you can easily check the dll version by reading the contents of the database table MSSDWDLLS. Prior to that you have to check it manually. Ensure the SAP kernel and DBSL are the latest version. Review SAP and MS logs (see below). Ensure your database parameters are set properly according to SAP Note 327494: Configuration Parameters for SQL Server 2000. Search for SAP fixes at http://service.sap.com/notes. Search for Microsoft fixes in the Knowledge Base at http://support.microsoft.com/default.asp.

8 WINDOWS EVENT LOG


Get to the Event Logs via Start -> Programs -> Control Panel -> Administrative Tools -> Event Viewer. The System log contains system event errors (server shutdown, network problems, service failures, etc.). The Security Log tracks security events that you must define (login success, logon failure, etc.). The Application Log has application messages/ errors (anti-virus events, group policy application, etc.). o Remember that the Event Logs are maintained on each physical server in your system. To avoid the System log being overwritten too frequently you should disable print logging (turned on by default in NT 4 and W2K). See the MS Knowledge base article: Q115841 Always check all three logs on all servers for the time surrounding a server hang or crash to find any messages logged. In the event of a system hang or crash it is always good to immediately archive the logs after the restart so you can be sure to analyze them without worrying about the data being overwritten. The beginning of this document provides instructions for saving the logs locally and attaching them to a message.

9 SQL SERVER ERROR LOG


You can read the SQL server error log either in Enterprise Manager (located under the Management tree) or through SAP in ST04 -> Detail Analysis -> Error Logs. Search the logs for the key words error or warning. Also read the steps of the last startup to make sure there were no warnings posted about memory allocation or any other startup error. If you find an error in the log, the Severity is the first key value. A Severity less than 17 is mostly information although you should still investigate it so you understand the message. Anything 17 and over is more critical and must be investigated at once. The severity levels are described in SQL Server Books Online in the section titled Error Message Severity Levels. For example, SQL logs often show the entry Error: 15457, Severity: 0, State: 1. If you search Books Online for 15457 you will find that this error means: Configuration option '%ls' changed from %ld to %ld. Run the RECONFIGURE statement to install. This only means that someone changed a configuration option. This is purely informational and non-critical as the severity indicates (unless of course the parameter was changed without permission) You can also identify the actual error number in SQL Server Books online by navigating to the error charts in the Troubleshooting tree or by searching with the error number and the word error, like error 156. You should also search the Microsoft Knowledge Base and SAP Notes for the error as well. If you find an error and need to open a message with SAP Support make sure to zip all the logs and attach them. Follow the best practices advice at the top and clearly explain the error code, where it is in the logs and attach all other logs for best analysis.

Version 1.0 Page 21 of 26

SAP SQL SERVER FAQ

10 TRACE FLAGS
Trace flags are a valuable tool for in-depth analysis. But they should never be added unless SAP Support or Microsoft directs you to use them.

11 SAP TRANSACTIONS TO USE FOR TROUBLESHOOTING


These transactions are not described here in detail but they are a critical tool for system analysis. The SAP class ADM520 covers these tools in detail. System-wide transactions: o SSAA System Administration tool with transaction list for system maintenance o ST03 to determine if a bottleneck exists o SM21 (System Log) for each instance o ST22 (ABAP Dumps) o ST11 (Trace logs) for dispatcher and work process logs o ST04 (Database Monitor) for DB KPIs, SQL Error Log, Deadlock Detection, Stored Procedure Cache, etc. o DB02 for technical information about the available databases, filespace size, missing indexes and more o SM66 Per instance transactions: o SM21 (also can do system-wide) o ST05 (Database Trace) to determine long runtimes on the database o SE30 (ABAP Trace) to determine long runtimes due to ABAP o SM50 Per operating system: o ST06/OS07 (OS Monitor) for OS KPIs and Windows Event Log (System only)

Version 1.0 Page 22 of 26

SAP SQL SERVER FAQ

12 Specific Troubleshooting
13 EXCESSIVE TRANSACTION LOG GROWTH
See the following SAP Notes, this is an easy error to avoid: o SAP Note 307911: Transaction Log Filling Up in SQL Server 7.0 o SAP Note 400251: Index creation fills up transaction log o SAP Note 421644: SQL error 9002: The transaction log is full

14 SQL ERRORS
0 o 11 o 156 o In a SQL command you used a reserved keyword of SQL Server. For example, when you created a backup device you named it database. This is a keyword in SQL Server so backups trying to use this device name will fail with a syntax error. See the SQL Server Books Online sections titled Error 156 and Reserved Keywords for more information. SAP Note 392892: DBIF_RSQL_SQL_ERROR (SQL error 0 or 11) SAP Note 392892: DBIF_RSQL_SQL_ERROR (SQL error 0 or 11)

169 o SAP Note 110143: Field must not appear more than once in ORDER-BY 207/ 208 o SAP Note 459676: MSSQL is case-sensitive o SAP Note 65009: SQL208 o SAP Note 555623: SQL error 208 or 2812 in a SQL script 446 o SAP Note 505906: SQL error 446: Cannot resolve collation conflict 601 o SAP Note 607689: SQL Server 2000: Database Error 601 o SAP Note 429255: 601 on DDNTT, 823 and 1453 in SQL Error log in SQL 7.0 SP2 o SAP Note 565708: SQL Server: database error 601 o SAP Note 142731: DBCC checks of SQL server 605 o SAP Note 142731: DBCC checks of SQL server 644 o SAP Note 142731: DBCC checks of SQL server 823 o SAP Note 429255: 601 on DDNTT, 823 and 1453 in SQL Error log in SQL 7.0 SP2 o SAP Note 142731: DBCC checks of SQL server 1205 o SAP Note 565710: SQL Server: Database error 1205 (deadlock) 1453 o SAP Note 429255: 601 on DDNTT, 823 and 1453 in SQL Error log in SQL 7.0 SP2 2511 o SAP Note 142731: DBCC checks of SQL server 2714 o SAP Note 460271: There is already an object named ... 2750 o SAP Note 137821: SQL2750, decimal fields with more than 28 places 2812 o SAP Note 555623: SQL error 208 or 2812 in a SQL script 3023 (SQL 7.0) o SAP Note 182170: SQL error 3023 when creating an index 8115

Version 1.0 Page 23 of 26

SAP SQL SERVER FAQ

o SAP Note 429805: SQL error 8115 8645 o SAP Note 206694: SQL 7.0 Error 8645 {Insufficient Memory Resources} 8928 o SAP Note 142731: DBCC checks of SQL server 8944 o SAP Note 142731: DBCC checks of SQL server 8952 o SAP Note 142731: DBCC checks of SQL server 8976 o SAP Note 142731: DBCC checks of SQL server 9002 t-log is full o SAP Note 421644 - SQL error 9002: The transaction log is full o SAP Note 400251: Index creation fills up transaction log o SAP Note 307911: Transaction Log Filling Up in SQL Server 7.0 9004 o SAP Note 325443: SQL error 9004

15 CLUSTER TROUBLESHOOTING
If you have problems installing a cluster node on a server that previously had a SQL Server installation, the original SQL Server may not have uninstalled completely. Open a message to SAP for Supports assistance in checking the registry and file system. Cluster installations are not support on named instances. You must install to the default instance and must not later install any other SQL Server instances on that database server. There are several information sources already for cluster installations. From SAP: SAP Note 413553: SQL 2000 cluster set-up fails SAP Note 112266: R/3 + MS cluster server: Frequent questions + hints SAP Note 209596: Setting up Microsoft SQL Server 2000 From Microsoft: Q 233332: How To Run SQLDIAG On a Clustered/Virtual SQL Server Q 254321: Clustered SQL Server Do's, Don'ts, and Basic Warnings Q 254593: Troubleshooting SQL Cluster Wizard Failures

16 BACKUP PROBLEMS/ FAILURES


SAP Note 443879: SQL Server Tape Backup Problems on Windows 2000 using /pae In a SQL command you used a reserved keyword of SQL Server. For example, when you created a backup device you named it database. This is a keyword in SQL Server so backups trying to use this device name will fail with a syntax error. See the SQL Server Books Online sections titled Error 156 and Reserved Keywords for more information.

17 POST RESTORE ACTIVITIES:


If youre restoring a database to the same server: Run a full CHECKDB with NO_INFOMSGS to make sure no physical inconsistencies exist. SAP Note 98678: SQL Server Connection Issues SAP Note 551915: R/3 won't start after database restore or database copy After restoring to a different system or after a system copy: SAP Note 610640: sp_check_sap_login

18 SUSPECT DATABASE
See SAP Note 81692: Suspect Database

Version 1.0 Page 24 of 26

SAP SQL SERVER FAQ

19 SICK DATABASE
See SAP Note 126973: SICK messages with MS SQL Server

20 HANGING SYSTEM
SAP Note 155402: Analysis of hanging situations SAP Note 541256: Hangman 3.0

21 DIAGNOSING DEADLOCKS
For a full explanation of blocking locks versus deadlocks, see the SQL Server Books Online section Troubleshooting Locking. There are a few different resources for troubleshooting deadlocks. Microsoft provides instruction in the SQL Server Books Online section Deadlocking. SAP has many Notes regarding deadlocking. The first SAP Note you should read for detailed instructions on how you can trace a deadlock is SAP Note 32129: Setting up deadlock tracing for SQL-Server. An FAQ which answers many additional questions is SAP Note 111291: FAQ: SQL server analysis and avoidance of deadlocks. We also have compiled a list of known SAP Notes that have a fix for deadlocks on specific tables. See SAP Note 565710: SQL Server: Database error 1205 (deadlock). If the deadlock has only SAP objects then you should open a message for help from Support. Provide the deadlock information from the SQL Error Log and everything else according to best practices. If any one or more of the objects are a customer table (begins with a Y or Z) then it is custom code causing the deadlock and your developers need to evaluate the program causing the deadlock. Ways to reduce the possibility of deadlocks are: 1. Keep the transaction short 2. Always change all objects in the same order 3. If the code is accessing a custom object then make sure the clustered index is appropriate for the update statement.

22 UPGRADING 7.0 TO 2000 OR INSTALLING 2000


There are several SAP Notes available: SAP Note 428676: SQL 2000 upgrade stops in SQL script 1 SAP Note 377430: SQL Server 2000 installation CD of SAP SAP Note 497446: Upgrading to SQL 2000 stops when executing SAP Note 327494 - Configuration Parameters for SQL Server 2000

23 DATABASE CONNECTIVITY PROBLEMS


There are several SAP Notes available: SAP Note 128126: Database Connect for external tools SAP Note 28667: Microsoft SQL Server Specific Profile Parameters SAP Note 351586: TP: DBSL error 107, DB error 208 with Connect SAP Note 98678: SQL Server Connection Issues SAP Note 548823: Errors in RSCOLL00: gethostbyname for <server>\SID SAP Note 116225: Password change for database user sapr3

24 POST SYSTEM COPY PROBLEMS


For troubleshooting startup afterwards: SAP Note 98678: SQL Server Connection Issues SAP Note 551915: R/3 won't start after database restore or database copy

Version 1.0 Page 25 of 26

SAP SQL SERVER FAQ

25 ST04 BUFFER RATIO > 100%


This is a known issue that occurs after SQL Server SP2 application. See SAP Note 520422: Data cache hit ratio in ST04 > 100%.

Version 1.0 Page 26 of 26

Anda mungkin juga menyukai