Professional Documents
Culture Documents
Applies to NetWeaver 7.00 (SR3) and 7.10 based products Summary This white paper provides an overview of the key features of Microsoft SQL Server 2008 R2 and the key
features of SQL Server 2008 that are relevant to SAP NetWeaver 7.00 (SR3) and 7.10 based products.
Author Jrgen Thomas, Principal Program Manager Company Microsoft Corporation Author Bio Jrgen Thomas, Microsoft, Principal Program Manager Technical Reviewer Cameron Gardiner, Microsoft, Senior Program Manager
Table of Contents
Executive Summary ................................................................................................................................................................................................ 5 Who Should Read this White Paper ........................................................................................................................................................... 5 Topics Covered in this White Paper ........................................................................................................................................................... 5 SQL Server 2008 R2 Release ............................................................................................................................................................................... 6 New Features in SQL Server 2008 R2......................................................................................................................................................... 6 UCS-2 Compression for Unicode Data Type ..................................................................................................................................... 6 Support for Machines with 256 Logical Processors ........................................................................................................................ 7 Support for Up to 15,000 Table Partitions .......................................................................................................................................... 7 SQL Server 2008 Release ..................................................................................................................................................................................... 8 Key Features in SQL Server 2008 ................................................................................................................................................................. 8 Features Actively Leveraged by SAP NetWeaver ............................................................................................................................. 9 Transparent Features of SQL Server 2008 .............................................................................................................................................. 14 Backup Compression ................................................................................................................................................................................. 14 Audit ................................................................................................................................................................................................................ 15 Transparent Data Encryption ................................................................................................................................................................. 16 Encrypt Connections using Secure Sockets Layer ......................................................................................................................... 16 Lock Escalation Granularity ..................................................................................................................................................................... 17 Minimal Logging Enhancements .......................................................................................................................................................... 17 Query Plan Freezing .................................................................................................................................................................................. 18 SQL Server Database Mirroring Enhancements Compression .............................................................................................. 19 SQL Server Database Mirroring Enhancements AutoRepair .................................................................................................. 19 Changed Autogrowth Behavior ............................................................................................................................................................ 20 Appendix .................................................................................................................................................................................................................. 21 SAP and SQL Resources ................................................................................................................................................................................ 21 SAP Notes ........................................................................................................................................................................................................... 21 Microsoft Blogs................................................................................................................................................................................................. 22
Executive Summary
Microsoft and SAP have been working together closely for more than 15 years to ensure that the Microsoft platform and SAP solutions work well together. SAP certification of Microsoft Windows Server 2008 and Microsoft SQL Server 2008 R2 is the technical stamp of approval of the joint work between Microsoft and SAP. Worldwide, the number of developers proficient in these technologies and the number of organizations adopting SQL Server for SAP continue to grow.
This white paper is organized in two sections. The first section discusses enhancements to SQL Server 2008 R2 and the second section discusses enhancements to SQL Server 2008.
Note: For a detailed discussion on database compression for SAP, see the Using SQL Server Database Compression with SAP NetWeaver white paper at http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50c5de8f-282a-2e10-cb8aa5859a0994a4?QuickLink=index&overridelayout=true.
Note: SAP has published the correction instructions for SAP BW in SAP note 1494789, Enabling 1000+ partitions support on SQL Server. For more information, see http://blogs.msdn.com/b/saponsqlserver/archive/2011/03/18/increased-partition-support-of-sql-server-in-sapbw.aspx.
To take advantage of these features, you need to run SAP applications based on NetWeaver 7.0 and meet the requirements specific to the basis support packages. For more information, see SAP note 1152240.
The following features are helpful when running a SAP system: Backup compression Auditing Transparent data encryption Encrypt connections using Secure Sockets Layer (SSL) Lock escalation granularity Logging enhancements Resource Governor Query Plan freezing Database mirroring enhancements Changed Autogrowth algorithms
The features are transparent to SAP applications and need no further changes in SAP coding.
Data Compression Data compression in SQL Server 2008 includes: Storing numeric data more efficiently, such as int, bigint, float, and decimal data types Shrinking the size of tables that have primarily numeric data while optimizing the storage of default values Providing improved query performance in input/output (I/O) bottleneck scenarios Reducing hardware requirements and operation costs for storage and backup infrastructure Enabling compression at the table level
With SQL Server 2008 there are two types of data compression available: Row Compression A newly defined row format to optimize storing numeric values. ROW compression, as delivered in SQL Server 2008, is an extension of what was delivered for the specific decimal case in SQL Server 2005 SP2. Page Dictionary Compression Works on a per page level to store common prefixes and values only once on the page.
Figure 2 shows row compression with SQL Server 2008, which extends the variable length storage format of a decimal data type to other data types such int, bigint, and float. Other optimizations also reduce the space needed to store values like 0 or 0.0. Instead of consuming two bytes as in vardecimal, such a value will only consume four bits in SQL Server 2008.
The row compression feature provides a new storage format for a table that saves space without using a compression algorithm. A new row format has been introduced to help save more space, but it is not related to compression algorithms trying to compress a row on a page. Figure 3 shows page dictionary compression in SQL Server 2008, where a prefix list is stored in the page for common prefixes. Individual values are replaced by a token for the prefix, and a suffix for the value.
Figure 3. Page Dictionary Compression with Individual Values in SQL Server 2008 DateID 20070601 20070601 20070602 20070602 20070602 20070602 20070603 CarrierTracking 4911-403C-98 4911-403C-99 6431 6431-4D57-83 6431-4D57-84 6431-4D57-85 4E0A-4F89-AE OfferID 10 10 10 10 10 10 10 PriceDisc 0.00 0.00 0.00 0.00 0.00 100.00 0.00
Page dictionary compression has two optimizations, which apply to the data/index page of SQL Server. The first optimization helps find prefixes which are common in different rows. For example, the DateID column, which represents the way SAP stores dates in a varchar column, has a common prefix of 2007060 for all the values in the column DateID. SQL Server page compression stores this prefix value separately on the page and places a 12 byte token as a placeholder pointing to the shared prefix. Figure 4 shows page dictionary compression in SQL Server 2008, where a common value dictionary is stored in the page. Common values are replaced by tokens.
Figure 4. Page Dictionary Compression with Common Values in SQL Server 2008
In the second optimization the common values are replaced by a token, but only if space can be saved.
Data Compression in SQL Server 2008 and 2008 R2 Compression Recommendations All customers are advised to implement SQL Server page compression on tables and secondary indexes on development, QAS, and production systems. Modern Intel and AMD-based servers are powerful enough to process the compression algorithms without any observed latency, and the reduction in I/O and improved cache hit ratios results in a performance benefit for end users. It is therefore recommended to enable page compression for all tables and secondary indexes on all SAP ABAP-based systems. New SAP installations have already been defaulted to use page compression for all tables and secondary indexes. SAP has changed the default compression type from row to page compression with the following results with SQL Server 2008 R2: Up to 80 percent reduction in database size on ECC Unicode Systems Approximately 70 percent reduction in database size on ECC Non-Unicode Systems Generally 80 percent reduction in database size on SAP components such as BW, CRM, and SCM Approximately 70 to 80 percent reduction in database size for customers moving from Oracle to SQL Server Virtually all customer deployments have shown significant improvement in performance ranging from 5 to 35 percent Negligible amount of measurable higher CPU consumption and in some cases a reduction in CPU consumption
For more information on page compression, see the Running Sap Applications on SQL Server blog at http://blogs.msdn.com/b/saponsqlserver/archive/2010/10/08/compressing-an-sap-database-using-reportmsscompress.aspx and the Data Compression: Strategy, Capacity Planning and Best Practices white paper at http://msdn.microsoft.com/en-us/library/dd894051.aspx. Star Join Query Processing SQL Server 2008 introduced a new way to build query plans around star or snowflake schemas. SQL Server joins dimensions with the fact table or the intermediate result set of the former join result, one dimension at a time. However, SQL Server rarely analyzes several dimension tables first, overlaying the matching rows and then accessing the fact table to perform a first join. This is demonstrated in the next sequence. A typical plan as observed today looks like joining the dimensions. This helps reduce the optimal number rows as with the fact table, and then takes the intermediate result set and joins that with the next dimension.
Figure 5. Star Join Query Processing
SAP 7.0, SQL Server 2000, and SQL Server 2005 build one dynamic bitmap filter, which is usually used for the first join.
Figure 6. Star Join Query Processing with One Dynamic Bitmap Filter
SQL Server 2008 allows you to build multiple dynamic bitmap filters.
Figure 7. Star Join Query Processing with Multiple Dynamic Bitmap Filters
These dynamic bitmap filters can be moved and overlaid before accessing the fact table. This means a combined filter of multiple dimension tables is applied in one step.
Figure 8. Star Join Query Processing with Moving Dynamic Bitmap Filters
Star join query processing can only be utilized with a maximum degree of parallelism greater than 1 (that is, star join requires at least a maximum degree of parallelism of 2). The standard recommended global maximum degree of parallelism must always be set to 1 for SAP systems. Microsoft and SAP have implemented a new parallelization setting that can be switched on for specific BW queries on cubes. These changes are implemented in SAP support packs or SAP note 1126568. For more information, see http://blogs.msdn.com/b/saponsqlserver/archive/2010/12/03/sap-bw-7-and-sql-server-2008-star-joinoptimization.aspx.
Unlike LiteSpeed for SQL Server, SQL Server 2008 backup compression does not have any compression grades to configure. It is one grade only, which is possible with SQL Server. A comparison between different grades of LiteSpeed for SQL Server and SQL Server 2008 backup compression with a 5.5 terabyte SAP Unicode ERP shows the following: SQL Server 2008 backup compression provides a better compression rate with slightly more CPU consumption than LiteSpeed for SQL Server (which is configured for compression grade 1) LiteSpeed for SQL Server provides a slightly better compression rate with compression grade 11 and significantly more CPU resource consumption than SQL Server 2008 Backup Compression The transaction log compression rate is between 2.0 and 2.5. The compression rate on SAP ERP is between 4.0 and 5.0.
Audit
Auditing, a new feature in SQL Server 2008, addresses the auditing of user activity, including compliance and auditing concerns for unapproved SAP users who are accessing the database directly. It helps to monitor the activities of system operators and SAP database administrators (DBAs). To achieve this, the new audit functionality was created with a first-class server object. This means the auditing is not done using SQL Server Profiler, but by defining audit sessions and audit rules through simple T-SQL statements. No additional tools are necessary. This functionality is completely integrated into the SQL Server relational engine.
Figure 9. Capabilities of Different Tools Moved into one SQL Server Engine Functionality to Audit Activities
To make auditing of non-SAP motivated database accesses successful in a SAP landscape, you should adhere to the following guidelines: Never keep the log on the database server Do not give SAPServiceSID and SIDAdm access to the share on the server where the log resides Do not give any DBAs access to the share on where the log resides Delete the BUILTIN\Administrator Login in SQL Server SQL Server should run in the context of an account, which is not allowed to login interactively
While it is not always possible to prevent a system administrator from disabling the audit session or changing its definition, you can build an audit session that tracks: Who logged into SQL Server and got mapped into the system administrator role What changes were done to the audit session with that logged in session
Although the very same person does not have access to the audit log, it should not be possible for that person to manipulate the results of the audit log showing manipulations.
Figure 10. Simple Audit Session and its Specifications Defined
An issue with lock escalation granularity is the lack of a central switch to indicate that row level locks for a specific table should always be used, with a command such as: ALTER TABLE VBDATA set (LOCK_ESCALATION = DISABLE).
These events lead to the following: Only the first batch is minimally logged All subsequent batches get fully logged, which means that millions of rows are entered into the transaction log as well A large volume is required in the SQL Server Transaction Log and it takes up too much space, especially in Unicode/platform migrations
SQL Server 2008 expands the minimal logging behavior to all batches loaded. This has cut down the required space for the SQL Server transaction log by a factor of up to 50 in some observed instances.
Query Plan Freezing works as follows: 1. 2. 3. 4. Checks sys.dm_exec_query_stats to find the plan to be frozen Finds queries to freeze at http://blogs.msdn.com/saponsqlserver/archive/2007/06/05/sap-dbacockpit-andsome-related-sql-scripts-part-1.aspx Takes a plan_handle and checks whether the query has the plan to be frozen Takes sql_handle and statement offset and executes sp_create_plan_guide_from_cache @name = Nmyfirst_plan_guide', @plan_handle = <sql_handle>, @statement_start_offset = <statement offset>
For more information on database mirroring, see OSS note 965908, SQL Server Database Mirroring and SAP Applications.
The problem occurs when all the files are running full. In this case, the current algorithms will grow by one file at a time. This kind of autogrowth behavior destroys the even fill that is ideal for different data files.
SQL Server 2008 introduces startup trace flag 1117. This trace flag changes the autogrowth behavior to one where all data files are grown in the same size (assuming the autogrowth rate is set the same for each of the files), instead of growing one data file only.
For more information on trace flag 1117, see OSS note 1238993, Proportional File Auto-Growth with SQL Server 2008.
Appendix
SAP and SQL Resources
http://www.sdn.sap.com/irj/sdn/mss http://www.microsoft.com/isv/sap/technology/platform/sql.aspx http://blogs.msdn.com/saponsqlserver/ http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50c5de8f-282a-2e10-cb8aa5859a0994a4?QuickLink=index&overridelayout=true
SAP Notes
This section includes SAP notes on a wide variety of topics relevant to SQL Server technologies for SAP solutions. 1006887 - Online index creation with SQL Server 2005, 2008 and 2008 R2 1067103 - Transaction context lost 1076022 - Release planning for Microsoft SQL Server 2008 (R2) 1126568 - Enable star join optimization with SQL Server 2008 1134345 - Using locked pages for SQL Server 1141630 - Preparations for SQL 2008 BW customers 1144459 - SQL4SAP and SAP Installation Media for SQL Server 2008 1152240 - Setting Up Microsoft SQL Server 2008 1158936 - DBACOCKPIT Backup compression option in SQL 2008 1174635 - TempDB sizing in SAP BW systems on Microsoft SQL Server 1177356 - MS SQL Server End of Support for SAP Releases 1237682 - Configuration Parameters for SQL Server 2008 1238993 - Proportional File Auto-Growth with SQL Server 2008 1241751 - SQL Server minimal logging extensions 1252970 - Triggers on SAP tables 1280476 - SQL 2008 Cluster The current SKU is invalid 133381 - Database-Hints in Open SQL for MS SQL Server 1380493 - SQL Server Transparent Data Encryption (TDE) 142731 - DBCC checks of SQL server 1443424 - Migration path to Win2008MSSQL2008 for 4.6C and 6.206.40 1459005 - Enabling index compression for SQL Server 1476928 - System copy of SAP systems on Windows 2008 (R2) SQL Server 1488135 - Database compression for SQL Server 1494789 - Enabling 1000+ partitions support on SQL Server 1497623 - SQL Server Database Files Should Not be Sparse 1505884 - R3load compression for table index 1570930 SQL Server network encryption with SAP 151603 - Copying an SQL Server database
159316 - Reorganizing tables on SQL Server SQL 20002005 208632 - TCPIP network protocol for MSSQL 28667 - Microsoft SQL Server Specific Profile Parameters 32129 - Deadlock analysis for the SQL server 327494 - Configuration Parameters for SQL Server 2000 363018 - File management for SQL Server 392892 - DBIF_RSQL_SQL_ERROR (SQL error 0 or 11) 398136 - Support Policy for Microsoft SQL Server 493290 - Configuring SQL server Log shipping 521750 - FAQ SQL Server 2000 IO performance 551915 - R3 won't start after database restore or database copy 592514 - MSSQL internal database users, permissions and security 600027 - Installing the Corrected MS SQL Server Collation 62988 - Service packs for Microsoft SQL Server 652634 - FOR ALL ENTRIES performance with Microsoft SQL Server 683447 - SAP Tools for MS SQL Server 799058 - Setting Up Microsoft SQL Server 2005 849062 - Optimizer statistics for InfoCubes in BW 869407 - Partitioning on MS SQL Server 2005 879941 - Configuration Parameters for SQL Server 2005 905634 - Release planning for Microsoft SQL Server 2005 947702 - DB13 - DBCC Checkdb job fails in SQL 2005 SP1 960769 - Windows Migration from 32-bit to 64-bit (x86_64) 965145 - Installation of 46C SAP Systems on MS SQL Server 2005 965908 - SQL Server Database Mirroring and SAP Applications 985137 - Service Pack Installation for SQL Server 2005 98678 SQL Server Connection Issues 987961 - FAQ SQL Server 2005 IO performance 989595 - FAQ Cache Hit Ratio in SQL Server 991014 - Vardecimal Compression for SQL Server 2005
Microsoft Blogs
http://blogs.msdn.com/saponsqlserver/ http://blogs.msdn.com/saptech/ http://blogs.technet.com/virtualization/ http://blogs.msdn.com/b/saponsqlserver/archive/2011/03/18/increased-partition-support-of-sql-server-insap-bw.aspx
The SAP SD Standard Application Benchmark Results for Two-Tier Internet Configuration: SAP enhancement package 4 for SAP ERP 6.0; SQL Server 2008 and Windows Server 2008 R2 Enterprise Edition; 4 processors, 40 cores, 80 threads, Intel Xeon Processor E7-4870, 2.4 Ghz, 64 KB L1 cache and 256 KB L2 cache per core, 30 MB L3 cache per processor. For more details, see certification number 2011016 at http://www.sap.com/solutions/benchmark/sd2tier.epx.