Oracle to SQL Migration FAQ -v5.3.docx · Web viewSupport Package Stacks (SPSs) for SQL Server 2014...

28
FAQ: OS/DB Migration to Microsoft SQL Server v5.3 April 2015 Summary You are currently running an SAP system on a Unix, Windows or Linux operating system and Oracle, Informix, DB2, Sybase, HANA or MaxDB database and wish to migrate your SAP system to Microsoft SQL Server. You may also wish to convert your SAP system to Unicode during the migration to SQL Server. Background Information SAP & Microsoft have extended the capabilities of the SAP OS/DB migration tools and procedures to simplify the process of migrating SAP systems to SQL Server. This note contains the latest information regarding the technical capabilities and features for OS/DB Migrations where the target database is SQL Server. Please review the latest blogs at: http://blogs.msdn.com/b/saponsqlserver/ Solution There are a number of new enhancements that will significantly speed up and simplify the process of migrating a SAP system to SQL Server. In general all of these features are available for all systems based on WAS 6.20 and above (such as SAP R/3 4.7 Extension Set 110 and higher). The link http://scn.sap.com/docs/DOC-8324 contains more information on the OS/DB Migration process. Also review note 82478 . Customers should target conversion throughput of around 1-2TB per hour using all of the enhancements contained in this document. RECOMMENDATIONS 1. Required patch levels for Migration Tools, Windows & SQL Server You must use these patch levels or higher for the following components. It is generally recommended to use the most recent version of these components. SWPM, SAPInst & R3SETUP > 7.1 latest SL Toolset https://service.sap.com/sltoolset (use SWPM) 7.0x latest SL Toolset https://service.sap.com/sltoolset (use 70SWPM) 6.40 Netweaver 04 Master SR1 (compatible with 6.20/R/3 4.7 systems) 4.6D R3SETUP 46D SR1 (for use on 4.6C - available on request from SAP) R3LOAD 7.4/7.42 740 latest release 7.3x Please use 721 EXT latest release 7.1x Please use 721 EXT latest release 7.0x Please use 721 EXT latest release 6.40 Patch Level latest 4.6D Patch Level latest DBSL 7.4/7.42 740 latest release 7.3x Please use 721 EXT latest release 7.1x Please use 721 EXT latest release 7.0x Please use 721 EXT latest release 6.40 Patch Level latest 1 | Page

Transcript of Oracle to SQL Migration FAQ -v5.3.docx · Web viewSupport Package Stacks (SPSs) for SQL Server 2014...

FAQ: OS/DB Migration to Microsoft SQL Server v5.3 April 2015

SummaryYou are currently running an SAP system on a Unix, Windows or Linux operating system and Oracle, Informix, DB2, Sybase, HANA or MaxDB database and wish to migrate your SAP system to Microsoft SQL Server.

You may also wish to convert your SAP system to Unicode during the migration to SQL Server.

Background Information SAP & Microsoft have extended the capabilities of the SAP OS/DB migration tools and procedures to simplify the process of migrating SAP systems to SQL Server. This note contains the latest information regarding the technical capabilities and features for OS/DB Migrations where the target database is SQL Server. Please review the latest blogs at: http://blogs.msdn.com/b/saponsqlserver/

SolutionThere are a number of new enhancements that will significantly speed up and simplify the process of migrating a SAP system to SQL Server. In general all of these features are available for all systems based on WAS 6.20 and above (such as SAP R/3 4.7 Extension Set 110 and higher).

The link http://scn.sap.com/docs/DOC-8324 contains more information on the OS/DB Migration process. Also review note 82478.

Customers should target conversion throughput of around 1-2TB per hour using all of the enhancements contained in this document.

RECOMMENDATIONS

1. Required patch levels for Migration Tools, Windows & SQL Server You must use these patch levels or higher for the following components. It is generally recommended to use the most recent version of these components.

SWPM, SAPInst & R3SETUP> 7.1 latest SL Toolset https://service.sap.com/sltoolset (use SWPM)7.0x latest SL Toolset https://service.sap.com/sltoolset (use 70SWPM)6.40 Netweaver 04 Master SR1 (compatible with 6.20/R/3 4.7 systems)4.6D R3SETUP 46D SR1 (for use on 4.6C - available on request from SAP)R3LOAD7.4/7.42 740 latest release 7.3x Please use 721 EXT latest release 7.1x Please use 721 EXT latest release 7.0x Please use 721 EXT latest release 6.40 Patch Level latest4.6D Patch Level latestDBSL7.4/7.42 740 latest release 7.3x Please use 721 EXT latest release 7.1x Please use 721 EXT latest release 7.0x Please use 721 EXT latest release 6.40 Patch Level latest4.6D Patch Level latest

MIGMONJava based Migration Monitor is downward compatible 7.4x, 7.3x, 7.1x, 7.0x, 6.40, 4.6C and lower. Use the most recent version. To download Migmon check OSS Note 784118

R3TAR3TA Table Splitter is only available for 7.4x, 7.3x, 7.1x, 7.0x and 6.40. Use the most recent version. Use the latest R3TA possible. 7.3x, 7.1x and 7.0x should use the latest 7.21_EXT versions. Review Note 1650246 - R3ta: new split method for MSSQLand Note 1784491 - R3ta: Split of physical Clustertables

R3LDCTL, loadercli & R3SIZCHKUse the most recent version.

1 | P a g e

System Copy OSS Notes7.4x - 7.0x 888210 - NW 7.**: System copy (supplementary note)1738258 - System Copy of Systems Based on SAP NetWeaver 7.1 and Higher1768158 - System Copy of Systems Based on SAP NW 7.0 / 7.0 EHP 1-36.40 Note 784931 and 771209 4.6D Note 316353

SAP_BASIS Support Pack Release 4.6C 53 (SQL 2005)Release 6.20 57 (SQL 2005)Release 6.40 15 (SQL 2005)Release 7.00 14 (SQL 2008/R2) Release 7.10/7.11 8 (SQL 2008/R2) Release 7.3x SQL 2012 recommended see belowRelease 7.40 SQL 2012 recommended see below

SQL 2012 Basis Support PacksRequired minimum SAP Netweaver Support Package Stacks (SPSs) for SQL Server 2012SAP NETWEAVER 7.0 - SPS 26 (SAP BASIS 26, SAP BW 28)SAP EHP1 FOR SAP NETWEAVER 7.0 - SPS 11 (SAP BASIS 11, SAP BW 11)SAP EHP2 FOR SAP NETWEAVER 7.0 - SPS 11 (SAP BASIS 11, SAP BW 11)SAP EHP3 FOR SAP NETWEAVER 7.0 - SPS 03 (SAP BASIS 03, SAP BW 03)SAP NETWEAVER 7.1 - SPS 14 (SAP BASIS SP14)SAP EHP1 FOR SAP NETWEAVER 7.1 EhP1 - SPS 10(SAP BASIS SP10, SAP BW SP10)SAP NETWEAVER 7.3 - SPS 07 (SAP BASIS 07, SAP BW 07)SAP EHP1 FOR SAP NETWEAVER 7.3 - SPS 03 (SAP BASIS 03, SAP BW 03)

See note 799058 for SQL 2005, note 1152240 for SQL 2008/R2, note 1651862 for SQL 2012 and 1966681 for SQL 2014

Required minimum SAP Netweaver Support Package Stacks (SPSs) for SQL Server 2014 (SAP ABAP or SAP ABAP+JAVA stacks)

SAP SOFTWARE SUPPORT PACKAGE STACK (SPS) requirements

SUPPORT PACKAGE STACK (SPS) requirements for SAP BW

SAP NETWEAVER 7.0 SPS 29 (SAP_BASIS SP 29) SPS 30 (SAP_BASIS SP 30, SAP BW SP 32) + SAP note 2010451

SAP EHP1 FOR SAP NETWEAVER 7.0 SPS 15 SPS 15 + SAP note 2010451

SAP EHP2 FOR SAP NETWEAVER 7.0 SPS 14 SPS 15 + SAP note 2010451

SAP EHP3 FOR SAP NETWEAVER 7.0 SPS 09

SAP NETWEAVER 7.1 SPS 17

SAP EHP1 FOR SAP NETWEAVER 7.1 SPS 12 SPS 13 + SAP note 2010451

SAP NETWEAVER 7.3 SPS 10 SPS 11 + SAP note 2010451

SAP EHP1 FOR SAP NETWEAVER 7.3 SPS 09 SPS 11 + SAP note 2010451

SAP NETWEAVER 7.4 SPS 04 SPS 06 + SAP note 2010451

If your system is running on an SPS lower than the one required above, you have to apply the minimum required SPS before upgrading/migrating to SQL Server 2014.

Windows & SQL ServerAs at April 2015 Windows Server 2012 R2 and SQL 2014 SP1 are recommended.Windows Server 2012 R2 is recommended for all new projects - Use the latest cumulative update and service pack as documented in Note 30478 Windows Service PacksBlog: Windows Server 2012 Generally Available for SAP NetWeaver – April 2013

2 | P a g e

Windows Server 2012 R2 is Generally Available for NetWeaver Applications April 2014

SQL Server 2012** or 2014*** Enterprise Edition x64 - download and install the latest service pack and CU. Refer to Note 62988 Service packs for Microsoft SQL Server. This link is useful to find the latest SP or CU for SQL Server http://blogs.msdn.com/b/sqlreleaseservices/

**Support is documented in note 1651862 *** SQL 2014 CU5 is required

After installation of Windows Server 2012 R2 it is recommended to apply all the latest patches. Please deploy Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2 update rollup: March 2014 and all previous Rollups

It is recommended to review these links as well:Recommended hotfixes and updates for Windows Server 2012 R2-based failover clustersHyper-V: Update List for Windows Server 2012 R2

For Windows Server 2012 (non-R2) please see these links:Please deploy Windows RT, Windows 8, and Windows Server 2012 update rollup: March 2014 and all previous RollupsRecommended hotfixes and updates for Windows Server 2012-based failover clustersHyper-V: Update List for Windows Server 2012

Do not to use 32bit versions of Windows or SQL. If your system is 4.6C based run 4.6C on 64 bit Windows 2003 and 64 bit SQL 2005.

2. Hardware ConfigurationsReview SAP Note 1612283 - Hardware Configuration Standards and Guidance. Follow the guidance in this note. Do not under specify memory. 384GB is the minimum for new SAP server deployments. Customers with 1-3TB of RAM are now mainstream. It is strongly recommended to utilize FusionIO cards (or similar) for larger OS/DB Migrations.

Recommended Hardware Configurations:

SAP Application or DB Server: 2 Processor E5 v3 between 10-18 core per processor 384-768GB RAM 10GB Network card. Cost = $13,000 USD list price* SAPS = ~90,000 (18 core configs)

DB Server:Use 2 socket server as above or 4 Processor E7 v2 1-4TB RAM 10GB Network card. Cost = $33,000-56,000 list price* SAPS = ~135,000

*Source www.dell.com

3. Unsorted ExportAn unsorted export is supported and may be imported into a SQL Server database. A sorted export will take much longer to export and is only marginally faster to import into SQL Server. Unicode Conversion customers must export certain cluster tables in sorted mode. This is to allow R3LOAD to read an entire logical cluster record, decompress the entire record (which may be spread over multiple database records) and convert it to Unicode. See Note 954268, 1040674 and 1066404. The content of OSS Note 1054852 has been updated

Our default recommendation is to export unsorted as in the majority of cases the UNIX/Oracle or DB2 server has only a fraction of the CPU, IO and RAM capacity of a modern Intel commodity server. Even though there is an overhead involved in inserting rows into the clustered index on SQL Server, this overhead is relatively small.

4. Table SplittingA table split export is fully supported and may be imported into a SQL Server database. Table split packages for the same table may be imported concurrently. Table splitting is only supported for R3LOAD 6.40 and higher (R3LOAD 6.40 is backwards compatible with Basis 6.20 releases such as R/3 4.7). Review Note 952514 The limitations on SQL Server table splitting listed in some SAP documentation are out of date and should be ignored.

3 | P a g e

Customers have successfully split large tables into 20-80 splits and achieved good results on tables that have poor import or export throughput. There are some tables that we always recommend to split due to slow export or import performance:CDCLS, S033, TST03, GLPCA, STXL, CKIT, REPOSRC, APQD, REPOTEXT, INDTEXT

To run R3TA manually use this command line. r3ta -f c:\export\abap\data\<TABLE NAME>.str -l <TABLE NAME>whr.log -o c:\export\abap\data\<TABLE NAME>.WHR -table <TABLE NAME>%<NUMBER OF SPLITS>Using this command in Excel a command line can be built

=CONCATENATE("R3TA -f d:\export\abap\data\",A9,".str ","-l ",A9,"_WHR.log"," -o d:\export\abap\data\",A9,".WHR"," -table ",A9,"%",B9)

After generating WHR files with R3TA the WHR splitter must be run to create split packages. Always set the whereLimit parameter to 1, meaning 1 package for each where clause.

where_splitter.bat -whereDir d:\export\abap\data\ -strDir d:\export\abap\data -outputDir d:\export\abap\data -whereLimit 1

5. Package SplittingThe Java based Package Splitting tool is fully supported in all cases. It is recommended not to use the Perl based splitter.

This command will generate the TPL files and the default STR files (without the EXT files)r3ldctl –l logfilename –p D:\exportdirectory

Note: Exports to SQL Server do not need Extent files and the whole Extent file (*.EXT) file generation process can be skipped to save time. Instead it is recommended to use the following script to determine the largest tables in the Oracle database:

spool tablefile.txtset lines 100 pages 200col Table format a40col Owner format a10col MB format 999,999,999select owner "Owner", segment_name "Table", bytes/1024/1024 "MB" from dba_segments where bytes > 100*1024*1024 and segment_type like 'TAB%' order by owner asc, bytes ascspool off;

Then it is recommended to extract the largest tables (possibly anything more than ~2GB) into their own packages (and also table split if required). The following command can be used. Please note that when using SWPM EXT files are required. EXT files can be bypassed only when doing a manual Migmon based migration

str_splitter.bat -strDirs d:\export\abap\data -outputDir d:\export\abap\data -tableFile tablefile.txt ***(Note: there is no space between the “-“ and “tableFile”)

6. FASTLOAD All SAP data types can now be loaded in Bulk Copy mode. It is recommended to set the –loadprocedure fast option for all imports to SQL Server. These are the default settings for SAPInst. If migration monitor is used this parameter must be specified. 4.6C/D migrations should use the parameter –fast (without the “loadprocedure”). Please also note that to support FastLoad on LOB columns set environment variable BCP_LOB=1 and review note 1156361The parameters we recommend for Migmon or SAPInst are loadArgs=-stop_on_error -merge_bck -loadprocedure fast

7. Migration Time AnalyzerIt is recommended to use MIGTIME with the –html option to graphically display the export and/or import time of packages. It is generally recommended to ensure the longest running packages are started at the beginning of the export or import. MIGTIME is available for 4.6C and higherImport_time.bat -installDirs d:\import -html

The script below shows the actual status of the SAP Export using SAP MigrationMonitor log files. The script reloads every 20 seconds and displays- actual CPU Load

4 | P a g e

- Actual running Packages- Actual waiting Packages

Before first usage:- Unzip the MigMonStatus archive in the Migration Monitor directory - Rename status.txt in status.cmd- rename queryCPU.txt in queryCPU.vbs- start the status.cmd

8. Package Order by recommendationsIt is recommended to use an OrderBy.txt text file to optimize the export of an Oracle system and the import to SQL. By default a system will export packages in alphabetical order and import packages in size order.

The OrderBy.txt can be used to instruct Migration Monitor to start packages in a specific order. Normally the best order is to start the longest running packages first. It is recommended to perform an export on a test system to determine which tables are likely to run longest. Note: It is normal for the export and import runtimes of a package to be very different. Some packages may be very slow to export yet very fast to import and vice-versa.

9. Oracle Source System SettingsPlease review note 936441 - Oracle settings for R3load based system copy

SAP have released SAP Note 1043380 which contains a script that converts the WHERE clause in a WHR file to a ROW ID value. Alternatively the latest versions of SAPInst will automatically generate ROW ID split WHR files if SWPM is configured for Oracle to Oracle R3LOAD migration. The STR and WHR files generated by SWPM are independent of OS/DB (as are all aspects of the OS/DB migration process).

The OSS note contains the statement “ROWID table splitting CANNOT be used if the target database is a non Oracle database”. Customers wishing to speed up an export from Oracle may send an OSS message to BC-DB-ORA and request clarification of this restriction. Technically the R3LOAD dump files are completely independent of database and operating system. There is one restriction however, restart of a package during import is not possible on SQL Server. In this scenario the entire table will need to be dropped and all packages for the table restarted. ROW ID has a disadvantage that calculation of the splits must be done during downtime – see 1043380. OS/DB Migrations larger than 1-2TB will benefit from separating the R3LOAD export processes from the Oracle database server. Note: Windows application servers can be used as R3LOAD export servers even for Unix or mainframe based database servers. Intel based server have far superior performance in SAPS/core than most Unix servers, therefore R3LOAD will run much faster on Intel servers with a high clock speed. The simplest way to allow Windows R3LOAD to logon to Unix Oracle server is to change the SAP<SID> on schema systems or sapr3 on non-schema systems to “sapr3” without quotes. This password is hardcoded into R3LOAD. If the password cannot be changed then the user account on the R3LOAD Windows server (normally DOMAIN\<sid>ADM) will need to be added to the SAPUSER table OPS$<DOMAIN>\<SAPSID>ADM

10. SQL Server Target System Settings

It is recommended to use Windows Server 2012 R2 and SQL 2014 SP1 or SQL 2012 SP2 CU5. Only 64bit platforms are supported. 32bit platforms are now depreciated and customers are instructed not to use 32bit versions of Windows or SQL Server. SAP R/3 4.6C offers no native x64 kernel however 4.6C 32 bit kernel can run on Win2003 x64 and is fully supported by Microsoft & SAP.

The SQL Server database should be manually extended so that the SQL Server automatic file growth mechanism is not used as it will slow the import. The transaction log file should be increased to ~100+GB for larger systems. Migrating 10TB+ systems need around 1TB of Transaction Log.

Max Degree of Parallelism should be set to 1 usually. Due to the logic for parallelizing index REBUILD or CREATE statements it is highly likely that most index creation on SAP systems will be single threaded irrespective of what MAXDOP is specified. Some indexes may benefit from MAXDOP of 4. Do not set MAXDOP to 0

SQL 2005 CU8 contains minimal logging feature for SAP migrations.See SAP Note 1241751. It is recommended to use SQL 2005 SP3, SP4 or SQL 2008, SQL 2008 R2 or higher as these releases have this feature built in.

5 | P a g e

To activate minimized logging start SQL Server with Trace Flag 610. See SAP Note 1482275If R3LOAD or SQL Server aborts during the import, you need to drop all the tables which were in process at that time. The reason is that there is a small time window where data should be written to disk in a synchronous manner, but the writes are asynchronous. Therefore the consistency of the table cannot be guaranteed and the table should be dropped and the import restarted.

In general we recommend 610, 1118 and 1117. To display trace flags run DBCC tracestatusRemove trace flags 610 after the migration. These traceflags should not be used in live systems.

11. Setting up a standalone R3LOAD server – SQL and OracleOS/DB Migrations larger than 0.5-1TB will benefit from separating the R3LOAD import processes from the database server:

a. Install SQL Server 2005, 2008, 2008R2 SNAC, 2012 or 2014 odbc (client libraries only)b. Apply latest Service Pack for the client libraries c. Install SAP Java SDK on serverd. Copy the latest versions of R3LOAD.EXE, DBMSSLIB.DLL and MIGMON.SAR (MIGMON.SAR can be

found on the SAP installation master DVD)e. Set the system environment variables MSSQL_DBNAME=<SID>, MSSQL_SCHEMA=<sid>,

MSSQL_SERVER=<hostname> (or MSSQL_SERVER=<hostname>\<inst> named instance) and dbms_type=mss

f. If the database logins are required please manually create the users Domain\<sid>adm and Domain\SAPService<SID> and then use the script attached to Note 1294762 - SCHEMA4SAP.VBS

g. Logon as Domain\<sid>adm and run R3LOAD –testconnect

For creating a R3LOAD server for exporting an Oracle system

a. Install the full 10g/11g x64 client for Windows – not just the SAP client. It is easiest to work with the full client.

b. Download the Oracle R3LOAD and DBSL – unzip and place in a directory such as C:\Export\Oracle\Kernel

c. Set the follow Environment variables (it might be useful to make a small batch file for this):SET DBMS_TYPE=oraSET dbs_ora_schema=SAPR3 or <SID>SAP for schema systemsSET dbs_ora_tnsname=<SID>SET NLS_LANG=AMERICAN_AMERICA.WE8DEC (or UTF8 if Unicode)SET ORACLE_HOME=D:\oracleSET ORACLE_SID=<SID>SET SAPDATA_HOME= D:\Export\Oracle\KernelSET SAPEXE=D:\Export\Oracle\KernelSET SAPLOCALHOST=<set to local hostname>SET SAPSYSTEMNAME=<SID>SET TNS_ADMIN= D:\oracle\....ora home..\network\admin

d. Edit the SQLNET.ORA and TNSNAMES.ORA to resemble the below################# Filename......: sqlnet.ora# Created.......: created by SAP AG, R/3 Rel. >= 6.10# Name..........:# Date..........:# @(#) $Id: //bc/700-1_REL/src/ins/SAPINST/impl/tpls/ora/ind/SQLNET.ORA#4 $################AUTOMATIC_IPC = ONTRACE_LEVEL_CLIENT = OFFNAMES.DEFAULT_DOMAIN = WORLDSQLNET.EXPIRE_TIME = 10SQLNET.AUTHENTICATION_SERVICES = (NTS)DEFAULT_SDU_SIZE=32768################# Filename......: tnsnames.ora# Created.......: created by SAP AG, R/3 Rel. >= 6.10# @(#) $Id: //bc/700-1_REL/src/ins/SAPINST/impl/tpls/ora/ind/TNSNAMES.ORA#4 $

6 | P a g e

################<SID>.WORLD= (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (COMMUNITY = SAP.WORLD) (PROTOCOL = TCP) (HOST = <hostname goes here>) (PORT = 1527) or can be 1521 – check each system ) ) (CONNECT_DATA = (SID = <SID>) (GLOBAL_NAME = <SID>.WORLD) ) )

e. Edit the hosts file on the UNIX server and enter the Windows R3LOAD server ip address and hostname. On the Windows server edit the hosts file and enter the UNIX server ip address and hostname. Test with PING

f. Test the Oracle connectivity with TNSPING <SID>.WORLD. g. Run the script attached to SAP Notes 50088 and 361641 (userdomain will usually be the local hostname

of the R3LOAD server if the server is not a domain member). This script will create the OPS$ users that are needed for SAP to login to Oracle. : sqlplus /NOLOG @oradbusr.sql SCHEMAOWNER UNIX SAP_SID x (The reason for using the UNIX script is that Oracle on UNIX cannot “see” the hostname of the Windows server)

h. Try logging into the Oracle database from the Windows server with the following syntax (for schema systems replace SAPR3 with <SID>SAP) : sqlplus SAPR3/sap@<SID>.WORLD

i. To ensure correct authorizations try running SELECT * FROM T000; j. Try running R3LOAD –testconnect (remember to set the environment first)

It is recommended to review this blog: http://blogs.msdn.com/b/saponsqlserver/archive/2011/02/04/installation-amp-configuration-of-windows-nfs-client-to-enable-unix-to-windows-to-mount-a-unix-file-system.aspx

12. Network SettingsDue to the very high volume of traffic it is recommended to configure 10GB Ethernet links between a server running R3LOAD and the SQL Server. As of May 2011 it is strongly recommended to make all new server purchases with 10Gigabit Network Cards. 10G cards have reduced in price dramatically and offer vastly better performance. For HP servers the NC552SFP (Emulex) or NC560 (Intel) network card has proved very highly performing. Do not use QLogic NC523/522 as at August 2012.

It is further recommended to configure Jumbo Frames on both the R3LOAD server and the Database Server both during the export and import. Note that the Jumbo Frame size must be configured identically on the Database Server, the Switch ports used by both the DB and R3LOAD Server and the NIC card on the R3LOAD Server. The normal value for Jumbo Frames is 9000 or 9014, though some network devices may only allow 9004. It is essential that this value is the same (or higher) on all devices or conversions will occur.If high kernel times are seen on specific Logical Processors in Task Manager check RSS options on the NIC cards. Windows 2008 and higher allows for RSS Ring configuration usually up to 8 CPUs on 1Gbps NIC and up to 16 on 10Gbps cards. Perfmon can be used to monitor “Queued DPC” per CPU. This will indicate how many CPUs are being used for Network DPC traffic and how many RSS Rings are configurable. RSS Ring configuration can be changed under the Advance Network Properties for most NIC drivers. RSS does not function well in combination with 3rd party network teaming software. It is recommended to use Windows Server 2012 which has built in network teaming. Network Settings, Network Teaming, Receive Side Scaling (RSS ... In some cases the network traffic generated from an import will be so great network errors may cause R3LOAD to fail. If this occurs please review Microsoft KB899599.

It is also recommended to review Note 392892 and implement http://support.microsoft.com/kb/948496. This is required on Win2003. In all cases use Windows Server 2012 R2 if possible. Windows Server 2012 R2 includes integrated teaming that has proven to be a vast improvement over previous teaming solutions in Windows 2008

7 | P a g e

Note1: Network settings are critical for TCPIP based export/imports.Note2: Most software based Network Teaming utilities offer only Transmit (Tx) aggregation. SLB or LACP Switch Based Teaming (requiring trunking on the switch) is required to get Receive (Rx) aggregation.Note3: Advanced consultants may wish to setup SOFT NUMA on large NUMA based systems. Testing has shown 20-30% performance boost.http://msdn.microsoft.com/en-us/library/ms345346.aspxhttp://blogs.msdn.com/ddperf/archive/2008/09/09/mainstream-numa-and-the-tcp-ip-stack-part-iv-paralleling-tcp-

ip.aspx

13. Disabling or Deleting Secondary IndexesDisabling secondary indexes can be done and certain long running indexes built online after the system is restarted and validated. To do this remove the Index definition from the STR structure file. After the system is restarted 10-20 indexes can be built online simultaneously. It is recommended to start the ONLINE index build phase prior to users logging onto the system. If using SQL 2014 start the index build with low priority lock

14. Disable Hyperthreading (on older Xeon)Intel Nehalem systems our recommendation is to use Hyperthreading (leave hyperthreading enabled on Xeon 55xx, 56xx, E5 and 75xx, E7 CPU)

15. Purge non-critical tablesMost SAP systems have tables that contain unnecessary data. In many cases these tables can be purged:Purge SW* tables 738148Purge Basis tables 706478Purge SW* tables 702356

Note: The SAP Note 706478 contains references to many other OSS notes that contain procedures for purging or archiving many “system” type tables. These tables do not contain business transaction data. In all cases please use the SAP documented procedures for purging or archiving these tables.

16. TCPIP Port Export/Import Procedure TCPIP Port based export to a SQL Server system is fully supported. In general we recommend this method for advanced migration consultants only.

In such an export procedure R3LOAD will communicate directly with the R3LOAD process on the target server. No dump files will be created as all data is passed via TCPIP. A socket export/import reduces the R3LOAD CPU consumption and may allow slow legacy servers to run a larger total number of R3LOAD processes.

It is not possible to use TCPIP Port based migration procedure when converting from non-Unicode to Unicode.

It is possible to migrate a Unicode SAP system running on an Oracle database to a Unicode SAP system running on SQL Server (even if the source system is running on a big Endian 4102 platform and SQL Server is on a little Endian 4103 platform)

Note: a socket export the OrderBy parameter on the import server must not be set or the import will crash with a Java error (import order is set by the export server).

17. BW Specific Recommendations

It is critical to fully review system copy notes before migrating BW systems or significant problems are likely to occur. Review 886102 - System Landscape Copy for SAP NetWeaver BWBI 7.** 888210, 1444413 and 1460372 (for APO systems 1471193)BW 3.5 771209 BW 3.1 777024

New SMIGR_CREATE_DDL is described in 1593998. SAP Note 886102 - System Landscape Copy for SAP NetWeaver BW contains the complete list of important SAP notes required before doing an export. Ensure this note has be carefully checked BEFORE starting the export.

Several critical SAP Notes must be applied on the source system prior to running SMIGR_CREATE_DDL. These Notes have no impact on the source system and cannot be tested any other way other than running SMIGR_CREATE_DDL:1901705 - Long import runtime with certain tables on MSSQL1747330 - Missing data base indexes after system copy to MSSQL

8 | P a g e

1993315 - SMIGR_CREATE_DDL: double columns in create index statements

SQL Server 2012 & 2014 supports a new highly efficient and highly performing Column Store index. It is possible to export from Oracle/DB2 directly into SQL Server. To do this:

1. Review this blog SQL Server Column-Store: Updated SAP BW code2. Ensure SMIGR_CREATE_DDL is fully up to date by applying notes listed in 888210 under the section for SQL

Server. These notes will not impact a Oracle or DB2 system3. On the source system run MSSCSTORE and change the storage format for all large cubes to Column Store

(this will not impact the source system as this program only applies to SQL Server)4. Run SMIGR_CREATE_DDL and generate the DFACT.SQL5. Export the source system to dump files6. Import dump files to SQL Server7. Ensure all post processing steps listed in the System Copy Guide are followed especially

RS_BW_POST_MIGRATION

Modern versions of SQL Server support up to 15,000 table partitions. It is still recommended to check for objects with many partitions on the source and target systems. Migrations to SQL Server will be re-partitioned even if the source system is not partitioned 1471910 - SQL Server Partitioning in System Copies and DB MigrationsTo check partition count in SQL Server run the following:

select COUNT(partition_id),object_name(object_id),index_id from sys.partitionswhere OBJECTPROPERTY(object_id,'IsUserTable')=1group by object_id, index_id order by 2,3 asc

To check in Oracle:You can use the following query on your ORACLE database to check in sqlplus if tables with more than 999 partitions exist:

select table_name from user_part_tables where partition_count >= 999 and table_name like '/%';

The following two notes are needed when importing onto SQL 2008SAP Note 1157904 and Note 1364683

To repartition systems follow note 1471910

18. Unicode Conversion Specific RecommendationPlease see notes on Unicode conversion, restrictions on unsorted export and socket export. New versions of R3LOAD will export cluster tables sorted always. OSS Note 1139642 has been corrected to accurately state Unicode storage on SQL Server. Since SQL 2008 R2 the storage efficiency of SQL Server is probably at least as good or better than other DBMS.

19. SQL Server PAGE Compression SQL Server includes powerful and efficient DB compression technologies. Please see blogs on http://blogs.msdn.com/b/saponsqlserver/ for further information. To prepare a system for PAGE compression during a migration implement SAP Note 1581700 in the source system. This code will have no impact on the source system as this note only contains code that runs if SAP detects the database is SQL Server

To force PAGE compression edit the DDLMSS.TPL file to read

cretab: CREATE TABLE &tab_name& ( /{ &fld_name& &fld_desc& /-, /} ) &compression_page&drptab: DROP TABLE &tab_name&

crepky: ALTER TABLE &tab_name& ADD CONSTRAINT &pri_key& PRIMARY KEY &clustered& ( /{ &key_fld& /-, /} ) &compression_page&drppky: ALTER TABLE &tab_name& DROP CONSTRAINT &pri_key&creind: CREATE &unique& INDEX &ind_name& ON &tab_name&

9 | P a g e

( /{ &fld_name& /-, /} ) &compression_page&

drpind: DROP INDEX &tab_name&.&ind_name&This procedure is fully supported for all customer systems as of Sept 2010. Current SWPM will all default to PAGE compression

The TPL file that needs to be modified is in the c:\program files\SAPInst directory (do a search of this directory) or the TPL file that is referenced in the package import log

Dozens of large SAP customers migrating from Oracle (Unicode or Non-Unicode) to SQL 2008 R2 (which offers Unicode compression) and secondary index compression have reduced the DB size by 80% to just 20% of original size. This means a 10TB Oracle system will become ~2TB on SQL Server. This allows customers running on multi-million dollar UNIX hardware to migrate to inexpensive highly performing Intel hardware easily. Testing around performance has shown very significant improvements in performance on servers such as the HP DL580 G7 compared to UNIX servers that cost ~$3m USD.

To check the compression properties of a particular table run the following in SQL Management Studio

select OBJECT_NAME(object_id), index_id, data_compression, data_compression_desc from sys.partitions where object_id = OBJECT_ID('<TABLENAME>');

20. Overview of SAP Tools & ReleasesEvery version including SAP 4.6C and higher can run on SQL 2005. Some older releases of SAP R/3 do not have R3SETUP/SAPInst for SQL 2005 – a major source of confusion.

Basis Release 3.1I 4.0B 4.5B 4.6x 6.20 6.40 7.00 and higher

R3SETUP 4.6D 4.6D 4.6D 4.6D - - -SAPINST - - - - 6.40 6.40 7.00R3LDCTL 3.1I 4.0B 4.5B 4.6D 6.40 6.40 7.00R3SZCHK - - 4.5B 4.6D 6.40 6.40 7.00R3LOAD 3.1I 4.0B 4.5B 4.6D 6.40 6.40 7.00

MIGMON yes yes yes yes yes yes yesR3TA no no no no yes yes yesDISTMON no no no no yes yes yes

Package Splitter:-Perl (don’t use) no yes yes yes yes yes yes-Java yes yes yes yes yes yes yesSQL 2000 SP4a no no yes yes yes yes yes (not recommended)SQL 2005 SP4 no no no yes yes yes yes (not recommended)SQL 2008 SP4* no no no no no no yes (not recommended)SQL 2008 R2 SP3 no no no no no no yes (64 bit only)SQL 2012 SP2CU5 no no no no no no yes (Intel/AMD x64 only)SQL 2014 SP1 no no no no no no yes (Intel/AMD x64 only)SQL 2015 vnext To be confirmed Win 2003 SP2 x64 no no yes yes yes yes yes (not recommended)Win 2008 SP2 no no no no no no yes (not recommended)Win 2008 R2 SP1 no no no no no no yes (64 bit only)Win2012 no no no no no no yes (Intel/AMD x64 only)Win2012 R2 no no no no no no yes (Intel/AMD x64 only)Win “next” To be confirmed

*at least SQL 2008 SP1 (or CU2) must be used

21. Oracle or DB2 ABAP Hints or EXEC SQL – How to handle these In general we have found that the SQL Server Optimizer does not require as many hints as Oracle. Therefore it is our standard recommendation to ignore Oracle or DB2 hints on SQL Server. Only if a specific performance problem is identified should a SQL Server ABAP hint be added. This applies to both SAP standard and custom Z ABAP. We strongly recommend against manually converting all Oracle ABAP hints into their SQL Server form. This is time consuming and unnecessary. SAP provide a small report to scan ABAP to detect hints and EXEC SQL - Report RS_ABAP_SOURCE_SCANReview http://blogs.msdn.com/b/saponsqlserver/archive/2011/08/31/how-to-integrate-sql-server-specific-hints-in-abap.aspx

10 | P a g e

22. Exporting from UNIX ServersIn some situations it may be required to run SAPInst and R3load on legacy UNIX servers. If possible it is recommended to use Intel servers to run R3load as they have proven to be vastly faster than UNIX servers. However if there is no choice then follow the procedure below:

1. Download the latest SL Toolset https://service.sap.com/sltoolset (SWPM)2. Logon to the Database server (not supported on application servers) and run ./sapinst –nogui as root3. On a Windows server run sapinstgui.exe and connect to the UNIX server on port 212124. Export system using the SAPinst GUI5. FTP dump files to Windows server and import

This link may be useful when for vi and for setting UNIX environment variables such as JAVA_HOME

23. SAP 4.7, ECC 5.0 on Windows 2008 R2 or Windows Server 2012 (R2)SAP only support Basis 7.0 or higher components on Windows 2008 R2, however it is possible to migration from UNIX/Oracle to Windows 2008 R2 and SQL Server on older releases provided an upgrade is immediately performed.

This is documented explicitly in: Note 1443424 - Migration path to Win2008/MSSQL2008 for 4.6C and 6.20/6.40 Note 1476928 - System copy of SAP systems on Windows 2008 (R2): SQL Server1783528 - Migration path to Win2012/MSSQL2012 for 4.6C and 6.20/6.40

III. System Copy of a 6.20/6.40 SAP SystemYou must perform the system copy as described in the system copy guide.You can either migrate your system by performing a homogeneous system copy with the database-specific detach/attach method or a heterogeneous system copy with the database-independent R3load method. You can perform the heterogeneous system copy procedure to migrate systems from other database platforms to SQL Server system.

24. SQL 2012 “slipstream” installationsDownload the latest SQL 2012 service pack and CU from http://blogs.msdn.com/b/sqlreleaseservices/ and place in a central source along with SQL 2012. Run the following commands to automatically patch SQL 2012 during install: C:\SAPCD\SQL2012\SQLFULL_x64_ENU>setup /Action=Install /UpdateEnabled=TRUE /UpdateSource="C:\SAPCD\SQL2012SP1"

Also review SQL4SAP_docu.pdf as detailed in: Note 1684545 - SAP Installation Media and SQL4SAP for SQL Server 2012

25. Common Problems & ErrorsThe system copy procedure must be followed exactly or some of the errors below may occur.

a. ERROR: ExeFastLoad: rc = 2Please review SAP Note 942540. It is probable that the DFACT.SQL file has not been generated by the SMIGR_CREATE_DDL report or the file is not in the <export dir>\DB\MSS directory. If the problem continues try setting the NO_BCP=1 to stop FASTLOAD. This will allow R3LOAD to output a more specific error message. Also check the SQL Server Error Log.

b. SQL Stack Dump LATCH TIMEOUTIt is likely that the SAPDATAx files or SAPLOG1 file was not created large enough and SQL Server has tried to extend this file. Under extremely heavy load this error may be seen. Expand the database to the expected final size prior to beginning the import. Ensure the log file is at least 100GB for larger systems.

c. Dump on Logon Screen makes it impossible to logon: DYNPRO_ITAB_ERROR See Note 1287210

d. Deadlock error in package log fileIf message : Transaction was deadlocked on lock resources with another process and has been chosen as the deadlock victim. This message is extremely rare but can theoretically occur on large split tables. In the majority of cases the fastest resolution will be to drop the table and reset the status of the TSK files and import all packages of the split table again.

(IMP) INFO: EndFastLoad failed with <2: Bulk-copy commit unsuccessful:[208] Invalid object name '<sid>.MSSDEADLCK'.

11 | P a g e

[1205] Transaction (Process ID xxx) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.[208] Invalid object nam>(IMP) ERROR: EndFastload: rc = 2

If you are using table splitting you may wish to reduce the default BCP batch size from 10000 to 5000. Note that larger batch sizes produce faster import times. For non-split tables you may wish to consider increasing the batch size after careful testing. The MIGMON/R3LOAD parameter BCP_BATCH_SIZE=50000 or set the environment variable set BCP_BATCH_SIZE=50000. Note: SQL 2008 R2 contains an enhancement that will greatly reduce the occurrence of this problem. It is expected that the batchsize can be increased significantly on SQL 2008 R2. Testing with values of 100,000 have shown good results. It is recommended to monitor memory consumption with large batch sizes

e. Various Error Messages Installing 4.6x/4.7 on x64 ServersAll SAP systems should run on 64bit versions of Windows and SQL Server. The installation routines for 4.6C/D were created before x64 versions of Windows were available. Because of this there may be errors. Please review Notes 862789, 960769, 899111 & 814834.

f. BW/BI or other NetWeaver Systems BW or NetWeaver systems have special restrictions and special requirements. In general we recommend that for BW or NetWeaver systems the following support packs are implemented:

NetWeaver 7.0 BI 7.0 Support Pack Stack 9Review Notes: 888210, 962124, 1010854

NetWeaver ’04 BW 3.5 Support Pack Stack 18Review Notes: 771209, 996263, 960504, 1010854

SAP BW 3.0b/3.1cSAP_BASIS >=58BW 3.0B/3.1C >=25/19Review Notes: 777024

OS/DB Migrations on support packs lower than the above recommendations are still possible and carefully reviewing all related notes and implementing these corrections in the source system. In some cases new functionality such as table partitioning will not be activated unless certain prerequisites are met.

In all cases customers must carefully implement note 875986 before implementing any notes with SNOTE.

g. 4.6C Error (BEK) ERROR: SlicGetInstallationNo() failedThe system environment variable SAPSYSTEMNAME = <SID> is not set. Set this variable for the user <sid>adm

h. 4.6C error in dev_w* - Long Datatype Conversion not performed” please see Note 126973 - SICK messages with MS SQL Server

i. R3SETUP and possibly very old SAPInst may attempt to create a SAP database with code page 850BIN prior to the import of the dump files. Note 799058 and 600027 strictly forbid the use of code page 850BIN and require conversion to 850BIN2.Also note that the utility for converting codepage 850BIN to 850BIN2 does not work on SQL 2005 or higher (the fast conversion feature was dropped from SQL 2005). Therefore care should be taken to avoid the case where R3SETUP creates a 850BIN database on SQL 2005 and then MIGMON is used to import the system into this database. Clearly this will result in an unsupported system running code page 850BIN on SQL 2005. Conversion will be impossible and the import will need to be repeated after dropping and then manually creating the database.The following commands display the server (default) and database collations:

SELECT SERVERPROPERTY('Collation') SQL_Latin1_General_CP850_BIN2 SELECT DATABASEPROPERTYEX('<SID>', 'Collation')

12 | P a g e

 SQL_Latin1_General_CP850_BIN2

An incorrect code page will sometime product import errors with “ERROR: DbSlEndModify failed rc = 26”

j. ABAP Shortdump & SM21 error max. marker count = 2090>B *** ERROR => dbtran ERROR (set_input_da_spec): statement too big> marker count = 2576 > max. marker count = 2090

This is because the limit on the number of parameters on a stored procedure is 2100 on SQL. It is higher on other databaseshttp://technet.microsoft.com/en-us/library/ms191132.aspx

It is possible to change queries with > 2090 parameters to “literal” queries. Review SAP Note 1552952

k. In very rare cases a JOIN on Oracle may not work on SQL Server. This can happen on systems such as CRM where GUIDs are stored in RAW datatypes and a JOIN is attempted on a CHAR datatype. Please review Note 1294101

l. A simple and easy way to suspend and release all batch jobs on a system is to run these reports in SE38Suspend: BTCTRNS1Release: BTCTRNS2

SQL statement that includes the Jobs for EarlyWatch-Alert (Standard): update sapr3.tbtco set status = 'P' where jobname not like 'EU%' and jobname not like 'RDDIMP%' and jobname not like 'SAP%' and jobname not like 'COLLECTOR_FOR%' and status = 'S' delete from sapr3.tbtcs where jobname not like 'EU%' and jobname not like 'RDDIMP%' and jobname not like 'SAP%' and jobname not like 'COLLECTOR_FOR%' SQL statement that includes the Jobs for EarlyWatch-Alert (if system is just being moved): update sapr3.tbtco set status = 'P' where jobname not like 'EU%' and jobname not like 'RDDIMP%' and jobname not like 'SAP%' and jobname not like 'COLLECTOR_FOR%' and jobname not like 'SCUI%' and jobname not like 'AUTO_SESSION_MANAGER' and status = 'S' delete from sapr3.tbtcs where jobname not like 'EU%' and jobname not like 'RDDIMP%' and jobname not like 'SAP%' and jobname not like 'COLLECTOR_FOR%' and jobname not like 'SCUI%' and jobname not like 'AUTO_SESSION_MANAGER'

m. These command will purge old UNIX host profile parameters. Import new profiles with RZ10.Do not migrate UNIX style profile parameters to Win/SQL. Use zero memory management and keep the default parameters in general.

truncate table prd.TPFETtruncate table prd.TPFHT

26. Troubleshooting Tipsa. R3LOAD Connection Problems

Review SAP Note 98678. The system environment variable MSSQL_DBSLPROFILE=1 will write a trace file dbsl_<pid> to the current directory. This file will become very large and seriously reduce the performance of a system. In some cases it may be necessary to set the SAPSYSTEMNAME=<SID> system environment variable. Additional logging can be switched on with environment variable R3LOAD_TL = 1, 2 or 3

b. R3LOAD Cannot Find DFACT.SQL, STR or DumpfilesThe system environment variable R3LOAD_WL=1 will output extra information in the <package>.LOG file

c. Scan log files with Windows FINDSTR (Windows version of grep)The command line below will output all the error lines from the export or import directoryFindstr /C:ERROR: <path to log files>\*.log

13 | P a g e

d. ABAP Dump DATA_OFFSET_TOO_LARGE -> CX_SY_RANGE_OUT_OF_BOUNDS This problem is usually caused by too longer hostnames in combination with local extended buffering of some number ranges. Hostname requirements are documented in SAP Note 611361. Review http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/25163 and consider replacing extended local buffering with parallel buffering as per note 599157. It is also possible to use virtual hostnames to workaround this issue

e. UNIX and Windows CR 0x0D – carriage return formatting is different. SAP Note 27 (not a mistake, note 27) contains the profile parameter abap/NTfmode. Also see 788907

f. Copying a file in UNIX is possible but Locked in Windows. If the ABAP command OPEN DATASET is used to open a file on UNIX OS it is still possible to copy this file. On Windows a lock on the file will be held. It is required (and best practice) to ensure a CLOSE DATASET ABAP command is issued before manipulating a file external to the ABAP server

g. A large number of R3LOAD processes are configured and Oracle issues this error

The system Error message returned by DbSl:ORA-00018: maximum number of sessions exceeded(DB) INFO: disconnected from DB

Solution:Increase the parameters in unix: $ORACLE_HOME/dbs/init<DBSID>.ora windows:$ORACLE_HOME/database/<initDBSID>.ora PROCESSES=1000 SESSIONS=1105

h. Sorting some BW or other large tables can consume massive amounts of PSAPTEMP. If this occurs there are two options: (1) switch to Unsorted export (see earlier section in this document or (2) run the commands below to increase PSAPTEMP

(EXP) ERROR: DbSlExeRead failed rc = 99, table "/BIC/B0000585000" (SQL error 1652) error message returned by DbSl:ORA-01652: unable to extend temp segment by 128 in tablespace PSAPTEMP(DB) INFO: disconnected from DB

Sqlplus /nologConnect / as sysdbaSQL> ALTER TABLESPACE PSAPTEMP ADD TEMPFILE 'E:\oracle\BWP\sapdata1\temp_1\TEMP.DATA2' SIZE 20000MSELECT * FROM V$TEMP_SPACE_HEADER;

i. FASTLOAD ErrorsThe system environment variable NO_BCP=1 will override the –loadprocedure –fast option and force R3LOAD to use the normal DBSL interface for import

j. Special characters are corrupted Please review this SAP Note 1279882

k. To Enable fastload on LOB columns in 6.40 & 7.00 set BCP_LOB=1 and review note 1156361

l. If this error occurs during a MDMP Unicode conversion review 992956(DB) INFO: UMGPMDII~WRD created(DB) INFO: UMGPMDIT created(DB) INFO: UMGPMDIT~0 created(IMP) INFO: ExeFastLoad failed with <2: BCP Commit failed:[2627] Violation of PRIMARY KEY constraint 'UMGPMDIT~0'. Cannot insert duplicate key in object 'dbo.UMGPMDIT'.[3621] The statement has been terminated.>(IMP) ERROR: ExeFastload: rc = 2(DB) INFO: disconnected from DB

14 | P a g e

m. ASSERTION_FAILED during generation of DFACT.SQL. Please cross reference 984396 first. If this is unsuccessful please run RSDDS_CHANGERUN_TMPTABLS_DEL

n. If the following error is seen read OSS Note 1721059. Atomic Bind on SQL 2012 (DB) ERROR: DDL statement failed (INSERT INTO @XSQL VALUES (' sap_atomic_defaultbind 0, '/BI0/E0BWTC_C02', 'KEY_0BWTC_C02P' ') ) DbSlExecute: rc = 103 (SQL error 2812)

o. Logon or other License profiles implement this note in transaction SECSTORE 1532825

p. MaxDB Migrations using a Windows R3LOAD server require that the appropriate security is in place to allow connection to MaxDB. See SAP Note 39439 - XUSER entries for SAP DB and MaxDB Syntax should look similar to this: xuser -U w -u <SID>ADM,<password> -d <SID> -n <maxdbhost> -S SAPR3 set

q. Very slow import times on systems with a large amount of RAMSQL 2005 may be very slow to import during the data load phase if inserts are overflowing the page flush buffer. This is because the overflow is stored in the SQL datacache. The process to store and retrieve overflow rows is single threaded. The larger the amount of memory available for SQL Server data cache the worse the problem becomes. This problem is fixed in SQL 2008 and page flush manager queue has been increased to 1024 pages (under trace flag 3917 it is 8192 pages). It is recommended to contact Microsoft support if this problem is encountered on SQL 2005. If a customer is using a SAP Kernel 7.0 or higher component it is strongly recommended to use SQL 2012 or higher. Update: this traceflag should seldom be needed and we no longer recommend to set unless there is a specific problem.

r. Below is a useful script to run if an Import fails and the entire SAP database needs to be purged of all tables. Thanks to Amit for providing this. WARNING: Running this script will drop all tables in the current database

Use <SID>;EXEC sp_MSforeachtable 'drop table ?';

s. Towards the end of an import there may be many “suspended” SQL processes. These can be viewed with SQL Management Studio Activity Monitor. Clicking on the suspended process may show that a process is performing a CREATE INDEX. Towards the end of an import most of the table data import is complete and SQL Server will be building secondary indexes. The primary clustered index has been built simultaneously as the table data is loaded. Often these secondary indexes are non-standard Z indexes or sometimes unused SAP standard indexes. These indexes may be deleted in the source system before export or created after the system has been restarted and the downtime period is over. SQL 2005 and higher supports online index creation. The memory consumption during index creation can be substantial, especially if many indexes are being built simultaneously. This script is useful to detect situations when SQL is suspending index creation due to insufficient memory

-- current memory grants per query/sessionselect session_id, request_time, grant_time , requested_memory_kb / ( 1024.0 * 1024 ) as requested_memory_gb , granted_memory_kb / ( 1024.0 * 1024 ) as granted_memory_gb , used_memory_kb / ( 1024.0 * 1024 ) as used_memory_gb , st.textfrom  sys.dm_exec_query_memory_grants g  cross apply sys.dm_exec_sql_text(sql_handle) as  st-- uncomment the where conditions as needed-- where grant_time is not null  -- these sessions are using memory allocations-- where grant_time is     null  -- these sessions are waiting for memory allocations

-- overall server status

15 | P a g e

select * from sys.dm_exec_query_resource_semaphores

If many R3LOAD BCP or CREATE INDEX Processes are in status SUSPENDED with RESOURCE_SEMAPHORE wait type in the DMV below:

select session_id, request_id,start_time, status , command, wait_type, wait_resource, wait_time, last_wait_type, blocking_session_idfrom sys.dm_exec_requests where session_id >49 order by wait_time desc;If this is the case, it may be useful to cap the amount of memory that a particular secondary index build task can consume. This will force the Secondary Index Build to use TEMPDB. The way to cap memory is to Active Resource Governor (by right clicking on it in SSMS). Adjust the memory percentage value as needed. By default SQL Server can easily consume 10-40GB RAM per Index Build if no limit is set – the actual value depends on the amount of RAM in the server. This substantially improves Index build speed, however if too many secondary indexes are built at one time this will consume all available memory, thereby blocking other resources. It is recommended to monitor TempDB utilization when setting this option

USE master;BEGIN TRAN;-- Create 1 workload group for SAP R3Load -- Workload group is getting assigned to default pool automaticallyCREATE WORKLOAD GROUP R3load;GOCOMMIT TRAN;go-- Create a classification function.CREATE FUNCTION dbo.classify_r3load() RETURNS sysname WITH SCHEMABINDING ASBEGIN    DECLARE @grp_name sysname      IF (APP_NAME() LIKE 'R3 00%')          SET @grp_name = 'R3load'    RETURN @grp_nameEND;GO-- Register the classifier function with Resource GovernorALTER RESOURCE GOVERNOR WITH (CLASSIFIER_FUNCTION= dbo.classify_r3load);GO--change maximum memory grant a query can get. Default = 25%ALTER WORKLOAD GROUP R3load with (REQUEST_MAX_MEMORY_GRANT_PERCENT=5);go -- Start Resource GovernorALTER RESOURCE GOVERNOR RECONFIGURE;GO

t. ONLINE Rebuild of Large Secondary IndexesTables such as BSIS may have huge secondary indexes. These can be deleted from the STR files and created ONLINE after the import. This allows post processing and even users to access a system while indexes are still building. It is recommended to make scripts and execute these scripts via SQLCMD –S hostname –E –i <script>**Warning: it is very dangerous to restrict SAP memory with resource governor. This can lead to terminations and unexpected behavior. Remove the R3 Load resource governor prior to starting the SAP application.

USE master;BEGIN TRAN;-- Create 1 workload group for SAP SQLCMD -- Workload group is getting assigned to default pool automaticallyCREATE WORKLOAD GROUP SQLCMD;GOCOMMIT TRAN;go-- Create a classification function.

16 | P a g e

CREATE FUNCTION dbo.classify_ SQLCMD () RETURNS sysname WITH SCHEMABINDING ASBEGIN    DECLARE @grp_name sysname      IF (APP_NAME() LIKE SQLCMD ')          SET @grp_name = ' SQLCMD '    RETURN @grp_nameEND;GO-- Register the classifier function with Resource GovernorALTER RESOURCE GOVERNOR WITH (CLASSIFIER_FUNCTION= dbo.classify_ SQLCMD);GO--change maximum memory grant a query can get. Default = 25%ALTER WORKLOAD GROUP SQLCMD with (REQUEST_MAX_MEMORY_GRANT_PERCENT=5);go -- Start Resource GovernorALTER RESOURCE GOVERNOR RECONFIGURE;GO

u. To transfer all objects from the dbo schema (or any other schema) into the <sid> schema run the scripts attached to OSS Note 1294762 – usr_change.sql or copy the output of this script and paste into a new query window and execute:

DECLARE @sourceschema VARCHAR(100)DECLARE @destinationschema VARCHAR(100) SET @sourceschema = 'sourceschema' SET @destinationschema = 'destinationschema' SELECT 'ALTER SCHEMA ' + @destinationschema + ' TRANSFER ' + b.name + '.' + ' [' + a.name + ']' FROM sys.objects a JOIN sys.schemas b ON a.schema_id=b.schema_id WHERE a.type IN ('U','P','FN','V')

AND b.name=@sourceschema;

After running this script, re-run MSSPROCS in SE38

v. If high WRITELOG and/or LOGBUFFER times are seen review the blog on FusionIO & other SSD devices on http://blogs.msdn.com/b/saponsqlserver/archive/2011/06/10/accelerating-oracle-gt-sql-server-migrations-with-fusionio-ssd-disks.aspx . FusionIO devices are highly recommended for large migrations to speed up writes to the Transaction Log and/or tempdb. FusionIO and SSD devices are fully supported for use with SQL Server. Always run Windows Server 2012 or higher as only this version of Windows supports the TRIM command

w. Moving from a UNIX clustered/HA CI to a ASCS. SAP do not support clustering a SAP central instance on modern releases of SAP. Windows MSCS only supports a ASCS or SCS (Enqueue & Message Server). None of the other components of an SAP systems are single points of failure therefore it is not permitted to cluster them (Dialog, Batch etc).In all cases customers must use logon load balancing. This can be setup in transaction SMLGThere appears to be a deficit in SAP documentation about RFCs from .NET http://help.sap.com/saphelp_nw04/helpdata/en/22/042a31488911d189490000e829fbbd/frameset.htmA file called saprfc.ini must be created and the system or user environment variable set to the following or similar RFC_INI = c:\windows\saprfc.ini

Type BConnects to an SAP system using load balancing. The application server will be determined at runtime.The following parameters can be used:

DEST = <destination in RfcOpen>   TYPE = <B: use Load Balancing feature> R3NAME = <name of SAP system, optional; default: destination> MSHOST = <host name of the message server> GROUP = <group name of the application servers, optional; default: PUBLIC> RFC_TRACE = <0/1: OFF/ON, optional; default:0(OFF)>

17 | P a g e

ABAP_DEBUG = <0/1: OFF/ON, optional; default:0(OFF)> USE_SAPGUI = <0/1: OFF/ON, optional; default:0(OFF)>

In addition to the documentation provide by SAP the following may also have to be set:

dest.SAPSystemName = "<SID>";The service name of the message server must be defined in the ‘service’ file (<service name> = sapms<SAP system name>).

Please also review:Note 1447900 - LIBRFC32.dll unable to get some environment variables

Note 21151 - Multiple Network adapters in SAP Servers (download the attachments and read them)Note 129997 - Hostname and IP address lookup (from this note)It is crucial for the operation of the R/3 system that the following requirement is fulfilled for all hosts running R/3 instances:

a) The hostname of the computer (or the name that is configured with the profile parameter SAPLOCALHOST) must be resolvable into an IP address.b) This IP address must resolve back into the same hostname. If the IP address resolves into more than one address, the hostname must be first in the list.c) This resolution must be identical on all R/3 server machines that belong to the same R/3 system.Note 364552 - Loadbalancing does not find application server

Note 1011190 - MSCS:Splitting the Central Instance After Upgrade to 7.0/7.1

27. Migration for 4.6C or lower based systems : High level process:a. Raise an OSS message requesting a copy of the 4.6D SAP R3SETUP. (R3SETUP is no longer

available for download)b. Prepare system according to 4.6D system copy guidec. Install R3SETUP on the source system and update the DBMSSLIB.DLL, R3LOAD.EXE &

R3SZCHK.EXEd. Modify R3SETUP DBEXPORT.R3S to force R3SETUP to exit just before starting the export

<xx>=R3SZCHK_IND_IND<xx>=DBEXPCOPYEXTFILES_NT_IND<xx>=DBR3LOADEXECDUMMY_IND_IND ***delete***<xx>=CUSTOMER_EXIT_FOR_EXPORT ***add***<xx>=DBEXPR3LOADEXEC_NT_IND ***delete***<xx>=DBGETDATABASESIZE_IND_IND

[CUSTOMER_EXIT_FOR_EXPORT] ***add***CLASS=CExitStep ***add***EXIT=YES ***add***

e. Run R3SETUP and open DBEXPORT.R3S. Do not select the Perl based package splitter. Exit at the customer stop point

f. Copy the Java based splitter to the R3SETUP install directory. Copy *.EXT and *.STR files from <export dir>\DATA to the installation directory. Configure and run the Java based package splitter tool. The package splitter will process the EXT and STR files and rename them to *.OLD and create new EXT and STR files.

g. Copy Migration Monitor to the installation directory and run Migration Monitor to export the system

h. R3SETUP and open DBEXPORT.R3S to continue the export steps. These steps will generate the DBSIZE.TPL

i. Run Migration Time Analyzer to check which packages run the longest. Try to optimize the export by starting these packages first using the OrderBy.txt file

18 | P a g e

j. Start a CMD.EXE session from the \Windows\syswow64 directory and run SETUP.BAT to install R3SETUP on target server. Immediately update the DBMSSLIB.DLL and R3LOAD.EXE

k. Modify DBMIG.R3S with exit point190=DBDBSLTESTCONNECT_NT_IND200=MIGRATIONKEY_IND_IND<xx>=CUSTOMER_EXIT_FOR_IMPORT ***add***210=DBR3LOADEXECDUMMY_IND_IND ***delete***220=DBR3LOADEXEC_NT_MSS ***delete***230=DBR3LOADVIEWDUMMY_IND_IND ***delete***240=DBR3LOADVIEW_NT_IND ***delete***250=DBPOSTLOAD_NT_MSS260=DBCONFIGURATION_NT_MSS

[CUSTOMER_EXIT_FOR_IMPORT] ***add***CLASS=CExitStep ***add***EXIT=YES ***add***

l. Run R3SETUP and open DBMIG.R3S. Exit at the customer stop pointm. Copy the <export dir> to the target system and run Migration Monitor to import the systemn. Run R3SETUP to continue the installation. If R3SETUP fails review note 965145o. Run Migration Time Analyzer and review OrderBy.txtp. Perform the post system copy steps as per the 4.6D system copy guide

28. Useful Oracle CommandsDuring migrations it may be useful to check how the export is running with some of the following commands:

select sesion.sid,sesion.username,optimizer_mode, hash_value, address, cpu_time, elapsed_time, sql_text from v$sqlarea sqlarea, v$session sesion where sesion.sql_hash_value = sqlarea.hash_value and sesion.sql_address = sqlarea.address and sesion.username is not null;

The following Oracle command can detect if an individual table is corrupt.ANALYZE TABLE SAPSR3."/1BA/HM_WRC6_320" VALIDATE STRUCTURE;

29. Java Export/Import ProblemsJava and ABAP+Java exports/imports have some unique issues. Some of the more common are documented here. Always check 1768158 - System Copy of Systems Based on SAP NW 7.0 / 7.0 EHP 1-3

Using virtual hosts for central and/or DB instancesSYMPTOM:You are using virtual host names for your central instance and/or the database instance (e.g. in a HA environment). Although SAPinst finishes successfully, some export steps are not being performed.The following error message occurs when it prompts for the migration export:You entered: <export directory path> Unable to find a LABEL.ASC..( look for label SAP:MIGSDM:70:*:*:*)SOLUTION:Start the export with the property SAPINST_USE_HOSTNAME=<virtual host>.If the central instance and the database instance run on different hosts, run the database export with SAPINST_USE_HOSTNAME=<virtual host name of the DB server> and - if you run a Java or ABAP+Java system - run the central instance export with SAPINST_USE_HOSTNAME=<virtual host name of the central instance host>.If you run a central system with different host names in the profiles, handle the export as a distributed export, calling SAPinst with parameter SAPINST_USE_HOSTNAME. Perform the export of the database instance on the DB server, calling SAPinst with SAPINST_USE_HOSTNAME=<virtual host of the DB server>.

19 | P a g e

In a HA MSCS environment, named at the Windows Server release 2008/2008R HA WFCS (Windows Failover Cluster Services), typically the database instance is installed on the shared drive with use of virtual host, while the central instance is installed on a local host.In this case, run the database export with SAPINST_USE_HOSTNAME=<virtual host name of the DB server> and - if you run a Java or ABAP+Java system - run the central instance export on the host where the central instance is located, but without parameter SAPNST_USE_HOSTNAME.Also check SAP Note 1556874 - Incomplete export or incomplete JVM switch

30. SQL Server 2014 is not available as a DB version in SMIGR_CREATE_DDLSQL Server 2014 is not listed in SMIGR_CREATE_DLL

Either implement the support packs in note below. If it is not possible to upgrade the SAP Support Pack Stack or just the SAP_BASIS support pack, then export the system and select SQL 2012.

1984903 - SMIGR_CREATE_DDL: SQL Server 2014 support

31. SAP and Microsoft will stop supporting Windows 2003Windows 2003 server is now over 12 years old has significant performance and reliability deficits compared to modern Windows releases. Customers are advised to stop running SAP systems on Windows 2003 as soon as possible. The following SAP note strongly advises customers to terminate this obsolete Operating System:

2135423 - Support of SAP Products on Windows Server 2003 after 14-Jul-2015

32. Migration to Microsoft Azure Public Cloud Azure public cloud platform is now fully support and popular platform for many customers, especially customers with large non-production landscapes.For customers moving from different on-premise based OS/DB combinations to Windows & SQL Server there is special guidance:

1. The R3load based export process from UNIX or Linux on-premise is no different2. The R3load based import process may need to be handled in one of 2 different ways:

a. If the compressed SQL DB size is >300-500GB it is recommended to run the import on-premise on fast modern Intel hardware. After the import is complete a compressed backup can be uploaded to Azure and restored and the SAP application installed

b. If the compressed SQL DB size is relatively small, less than ~300GB then the R3load dump files can be uploaded to Azure and imported on Azure VMs directly. It is generally recommended to use a DS series VM with a P30 Premium Storage disk for the SQL transaction log

If low downtime migrations are required, it is recommended to migrate to Windows and SQL Server on-premise on Hyper-V, go live in production and use Azure Site Recovery to failover to Azure after the database replication has completed.

ExpressRoute connections between on-premise systems and Azure are a theoretical maximum of 10Gbit/sec. It is not possible for any one copy operation to one target in Azure to achieve throughput of 10Gbit/sec however. Therefore it would not be possible to upload a SQL backup file or R3load dump files at 10Gbit/sec. Upload rates of ~200Mbit/sec are achievable.

To upload huge amounts of data to Azure it is recommended to use the Azure Import/Export Service

20 | P a g e

Before deploying SAP on Azure it is essential to completely review and understand the documentation:http://msdn.microsoft.com/library/dn745892.aspxAdditional SAP Notes that should be reviewed include:1928533 - SAP Applications on Azure: Supported Products and Azure VM types2015553 - SAP on Microsoft Azure: Support prerequisites1999351 - Troubleshooting Enhanced Azure Monitoring for SAP1409604 - Virtualization on Windows: Enhanced monitoring1380654 - SAP support in public cloud environments2145537 - Support of SAP BusinessObjects BI platform on Microsoft Azure

As at April 2015 the following VM sizes are supported in Production. It is not recommended to attempt to run or install SAP on sizes smaller than those listed below as there will likely be errors during installation or memory exceptions.

   VM Type        VM Size  SAPS  Basic/Standard

    A5  2 CPU,  14 GB  1,500     Standard    A6  4 CPU,  28 GB  3,000     Standard    A7  8 CPU,  56 GB  6,000     Standard

  A8 / A10  8 CPU,  56 GB 11,000

    Standard

  A9 / A11 16 CPU, 112 GB

 22,000

    Standard

 D11 / DS11

 2 CPU,  14 GB  2,325     Standard

 D12 / DS12

 4 CPU,  28 GB  4,650     Standard

 D13 / DS13

 8 CPU,  56 GB  9,300     Standard

 D14 / DS14

 16 CPU, 112 GB

 18,600

    Standard

For current information about High Availability and DR solutions for Azure deployments please check http://blogs.msdn.com/saponsqlserver/

21 | P a g e