36
Leveraging PowerHA for i in an SAP Environment IBM Systems & Technology Group Kolby Hoelzle [email protected] This document can be found on the web, www.ibm.com/support/techdocs Version Date: September 9, 2008

Leveraging PowerHA for i in an SAP Environment - … · 2018-05-30 · Leveraging PowerHA for i in an SAP Environment Page 2 of 36 ... Leveraging PowerHA for i in an SAP Environment

Embed Size (px)

Citation preview

Leveraging PowerHA for i in an SAP Environment

IBM Systems & Technology Group

Kolby Hoelzle

[email protected]

This document can be found on the web, www.ibm.com/support/techdocs

Version Date: September 9, 2008

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 2 of 36

Notices IBM may not offer the products, services, or features discussed in this document in other coun-tries. Consult your local IBM representative for information on the products and services currently available in your area. Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property right may be used instead. However, it is the user's responsibility to evaluate and verify the operation of any non-IBM product, program, or service.

IBM may have patents or pending patent applications covering subject matter described in this document. The furnishing of this document does not give you any license to these patents. You can send license inquiries, in writing, to: IBM Director of Licensing, IBM Corporation, North Castle Drive Armonk, NY 10504-1785 U.S.A.

The following paragraph does not apply to the United Kingdom or any other country where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you.

This information could include technical inaccuracies or typographical errors. Changes are peri-odically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice.

Any references in this information to non-IBM Web sites are provided for convenience only and do not in any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of the materials for this IBM product and use of those Web sites is at your own risk.

Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products.

This information contains examples of data and reports used in daily business operations. To il-lustrate them as completely as possible, the examples include the names of individuals, compa-nies, brands, and products. All of these names are fictitious and any similarity to the names and addresses used by an actual business enterprise is entirely coincidental.

COPYRIGHT LICENSE:

This information contains sample application programs in source language, which illustrates pro-gramming techniques on various operating platforms. You may copy, modify, and distribute these sample programs in any form without payment to IBM, for the purposes of developing, using, marketing or distributing application programs conforming to the application programming inter-face for the operating platform for which the sample programs are written. These examples have not been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reli-ability, serviceability, or function of these programs.

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 3 of 36

Table of Contents Preface............................................................................................................4

About the Author .............................................................................................4

Acknowledgements.........................................................................................4

Introduction .....................................................................................................5

High Availability Overview...............................................................................5

PowerHA for i ..................................................................................................8

SAP Application Architecture ..........................................................................9

SAP Applications in an iASP.........................................................................10

Implementing High Availability ......................................................................12

Conclusion ....................................................................................................29

References....................................................................................................30

Appendix .......................................................................................................31

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 4 of 36

Preface The IBM i and its predecessors the iSeries and AS/400 are known for their legendary re-liability. However, a single computer system, no matter how resilient, may no longer be sufficient in providing the level of availability required in today’s demanding business en-vironment. As companies continue to increases their reliance on computer systems and the mission critical data that these systems store and process, availability is of utmost importance. Companies must prepare for unplanned outages, resulting from disasters or other unforeseen circumstances, and planned outages, resulting from regularly sched-uled maintenance or other planned activities. Regardless of whether the outage is planned or unplanned, companies must be prepared to handle any outage and keep downtime to a minimum.

High availability solutions can include elements of data resiliency, device resiliency, and application resiliency. This paper explores the use of PowerHA for i and more specifically the Solution Based GUI in simplifying the implementation of a cross-site mirroring with geographic mirroring solution for SAP environments on IBM i.

About the Author Kolby Hoelzle is a member of the SAP on IBM i development team, which is part of the IBM i development lab in Rochester, Minnesota. He joined IBM in 1999 and has over seven years of experience with SAP on the IBM i platform, including two years working at the SAP development lab in Walldorf, Germany as a member of the joint IBM-SAP IBM i porting team. Kolby graduated from Utah State University in 1999.

Acknowledgements Thank you to the following reviewers:

Ray Bills, IBM Server & Technology Group – PowerHA for i Development

Paul Swenson, IBM Server & Technology Group – ERP Development

Bjoern Willig, SAP AG – SAP on IBM i Porting Team

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 5 of 36

1. Introduction The IBM i™ and its predecessors the iSeries® and AS/400® are known for their legendary reliability. However, a single computer system, no matter how resilient, may no longer be sufficient in providing the level of availability required in today’s demanding business en-vironment. As companies continue to increases their reliance on computer systems and the mission critical data that these systems store and process, system availability is of utmost importance. Companies must prepare for unplanned outages, resulting from dis-asters or other unforeseen circumstances, and planned outages, resulting from regularly scheduled maintenance or other planned activities. Regardless of whether the outage is planned or unplanned, companies must be prepared to handle any outage and keep downtime to a minimum.

SAP® is one of the world’s leading providers of business software. SAP products provide a wide range of solutions to empower nearly every aspect of business operations. SAP provides collaborative business solutions for many industries with customers throughout the world.

SAP has supported running its applications in an independent auxiliary storage pool (iASP) since 2002. This has allowed customers to implement various data resiliency so-lutions to better meet their availability needs. Since the initial support of iASPs, SAP has continued to enhance support of iASPs by making architecture changes, code enhance-ments, and providing tooling to assist in configuring applications to run in iASPs. Many SAP on IBM i customers are now successfully running production environments in high availability solutions based on iASPs.

High availability solutions can include elements of data resiliency, device resiliency, and application resiliency. This paper explores the use of PowerHA™ for i and more specifi-cally the Solution Based GUI in simplifying the implementation of a cross-site mirroring with geographic mirroring solution for SAP environments on IBM i. For more information on SAP application resiliency refer to the SAP Help Portal1.

Even though this paper discusses details of implementing high availability configurations in an SAP on IBM i environment, it is important that you work with a service provider or someone with high availability experience to plan and implement your high availability so-lution. This paper is not meant to be a definitive guide for implementing high availability in an SAP on IBM i environment.

2. High Availability Overview High availability means different things to different people. It is entirely possible that an adequate high availability solution for one company is completely unacceptable for an-other. Selecting and implementing a high availability solution will depend on your avail-ability needs and your downtime tolerances. Some customers may require that backup and recovery systems are located miles away at a different site. This customer may also have a downtime tolerance of just a few minutes. Another customer might be satisfied with a backup and recovery system that is located in a different building on the same site and have a downtime tolerance of a couple of hours.

1 SAP AG. SAP Help Portal. < http://help.sap.com/ >.

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 6 of 36

Different availability needs necessitate different solutions. A solution may be focused on the availability of data, devices, the application, or a combination. Even though availabil-ity features are already built into many of the individual components that make up an ap-plication environment it is important to take a holistic approach to availability. For exam-ple, most computer systems are configured with some type of a redundant array of inde-pendent disks (RAID) to protect against individual disk failure, but what happens when access to the entire computer system is lost? A complete availability solution should take into consideration the entire computing environment as well as incorporate the built in availability features of the individual components making up that environment. This pa-per will focus on the macro view of availability, specifically the availability of data in an SAP on IBM i environment.

2.1 Independent Auxiliary Storage Pools An iASP is an auxiliary storage pool (ASP) that can be located on internal or external storage and be brought online or taken offline independent of system data or other ASPs. An ASP is a collection of disks grouped together logically. To your system an ASP looks like a single unit of storage. Switched disk and hardware replication solutions on the IBM i all utilize iASPs. For more information on implementing SAP applications using an iASP see SAP note 568820 “iSeries: Implementing an Independent ASP (iASP) System”.

2.2 Clusters High availability clusters are central to many high availability solutions. A clustered envi-ronment is a collection of multiple redundant computer systems or logical partitions con-figured in what is commonly referred to as a cluster. Each system or partition in a cluster is called a cluster node. These nodes function as a distributed computing system that enables critical resources on the production system, such as data, devices, and environ-ment attributes to automatically be available on one or more backup systems if the pro-duction system is not available. IBM i cluster technology provides the underpinnings and mechanisms that make switched disk and hardware replication solutions possible.

Clusters can be simple, consisting of only two nodes or very complex with a large number of nodes. IBM i clustering provides the necessary tools to configure, monitor, and man-age a clustered environment. For more information on IBM i clustering technology refer to High Availability choices and considerations on IBM i2.

2.3 Switched disk A switched disk configuration utilizes an iASP that can be switched between different nodes in a high availability cluster. Switched disk can be used to create a simple and cost effective high availability solution for planned and some unplanned outages. In a switched disk environment only one copy of the data exists. Because there is only one copy of the data, performance is not impacted by data synchronization.

In a switched disk environment, the distance between the production and backup system is limited by the physical length of the cables used to connect the systems. The maximum distance recommended is fifteen meters.

2 International Business Machines Corporation. High Availability choices and considera-tions on IBM i. Redbook SG24-7405. First edition, 2008.

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 7 of 36

Both high availability switchable resources (option 41 of the operating system) and iASPs are required for a switched disk solution.

2.4 Hardware replication Cross-site mirroring is a collective term used for high availability solutions based on hardware replication. With hardware replication a copy of the production data is mirrored to a backup system, so two or more copies of the data will exist. The three variations of cross-site mirroring supported on the IBM i include: geographic mirror, metro mirror, and global mirror.

2.4.1 Geographic mirror Geographic mirror utilizes page level mirroring performed at the operating system level. An exact copy of the production data is maintained on a backup system by utilizing synchronous mirroring. Synchronous mirroring means that the source system waits until acknowledgement from the target system that the data has been received. Synchronous mirroring keeps the data consistent and prevents data loss.

Geographic mirror allows for production and mirrored copies to be separated geographically. This offers protection in the event of a site-wide outage. Production and backup servers can be located up to 300 kilometers away. However, because of synchronous communication, longer distances may impact performance and require more communication bandwidth.

Both high availability switchable resources (option 41 of the operating system) and iASPs are required for a geographic mirror solution. An external storage server is optional.

2.4.2 Metro mirror Metro mirror is similar to geographic mirror except metro mirror utilizes disk sector level mirroring performed by an external storage server. In a metro mirror environment the mirroring is synchronous preventing data loss between the production and backup system. Production data and backup data can be located on the same external storage server or on different external storage servers seperated geographically. With separate storage servers the production and backup storage servers can be located up to 300 kilometers away. However, because of synchronous communication, longer distances may impact performance and/or require more communication bandwidth.

External storage servers, high availability switchable resources (option 41 of the operating system), and iASPs are all required for a metro mirror solution.

2.4.3 Global mirror Global mirror utilizes disk I/O level mirroring between external storage servers. The mirroring is asynchronous, meaning that the source system does not wait for acknowledgement from the target system that data has been received. Depending on the distance between the storage servers this means that the data on the backup system might lag the data on the production system by a few seconds. This allows the production and the backup server to be seperated by virtually unlimited distances with no impact to application performance.

External storage servers, high availability switchable resources (option 41 of the operating system), and iASPs are all required for a global mirror solution.

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 8 of 36

2.5 Logical replication Logical replication utilizes object based replication performed at the middleware or application level. For journaled objects the data is replicated to a backup system by applying journal changes to the backup data. For non-journaled objects the objects are saved and then written to the backup system.

Since logical replication is performed at the object level it is possible to be more selective with data and object replication, which may reduce network traffic. The replication process can be synchronous to prevent data lag or asynchronous allowing virutally unlimited distance between production and backup systems.

Logical replication environments can be implemented using internal storage or external storage servers. Independent ASPs are not required for logical replcation solutions. Products that provide logical replication services are provided by both IBM and independent software vendor (ISV) products. This paper will not discuss any logical replication solutions. For more information about available logical replication products see:

IBM DataMirror ( www.datamirror.com ) noMax ( www.maximumavailability.com ) Trader’s ( www.quick-edd.com/uk/index_uk.htm ) Vision Solutions ( www.visionsolutions.com )

2.6 Hybrid solutions None of the data resiliency options discussed above is mutually exclusive. Depending on your availability needs it is possible to combine different data resiliency configurations to create a hybrid solution. For example, logical replication might be combined with hard-ware replication in order to provide synchronization between objects that are not sup-ported in an iASP.

In addition to combining multiple data resiliency configurations it is possible to combine data resiliency with application resiliency to provide yet another layer of availability.

3. PowerHA for i PowerHA for i, previously known as the High Availability Solutions Manager (HASM), is a licensed program product3 that provides simplified configuration and management for high availability solutions on the IBM i operating system. Combined with high availability switchable resources (option 41 of the operating system) and iASPs, PowerHA for i enables a complete end-to-end hardware based clustering solution for high availability and disaster recovery. PowerHA for i allows system adminstrators to configure and manage their high availability solution using one of two Web based interfaces:

Cluster Resource Services GUI or Task Based GUI High Availabilty Solutions Manager GUI or Solution Based GUI

3 57xx-HAS is the licensed program product identifier for PowerHA for i.

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 9 of 36

Both Task Based GUI and Solution Based GUI are integrated into the IBM System Direc-tor for i5/OS®. Traditional commands executed from the IBM i command line interface are also available with PowerHA for i.

3.1 Task Based GUI The Task Based GUI is a Web enabled interface that allows you to configure clustered resources and manage all aspects of a clustered environment. As its name would indi-cated, the Task Based GUI is based on task oriented goals such as creating and manag-ing clusters, cluster nodes, cluster resource groups, and cluster administrative domains.

3.2 Solution Based GUI Solution Based GUI, often referred to as High Availability Solution Manager (HASM), is a Web enabled interface that is solution based. Customers using the Solution Based GUI can select one of four proposed high availability solutions including:

switched disk between logical partitions switched disk between systems switched disk with geographic mirroring cross-site mirroring with geographic mirroring

This paper will focus on using the Solution Based GUI to implement a cross-site mirroring with geographic mirroring solution. Work with you service provider to determine whether this solution is right for your environment.

4. SAP Application Architecture The core SAP applications are based on one of two different runtime technology layers: Advanced Business Application Programming, commonly known as ABAP™ and Java™ technology. Though the underlying implementations of SAP applications differ signifi-cantly between ABAP and Java, the high level architecture as it pertains to high availabil-ity is very similar. For purposes of running SAP applications in an iASP, knowledge of the high level architecture is sufficient.

SAP applications regardless of whether they are ABAP or Java consist of three main components: kernel, database, and integrated file system directories and files.

4.1 Kernel The kernel is a collection of executable files that provide the infrastructure for an SAP system. The kernel contains the executables that are responsible for running SAP appli-cations, maintaining locks, managing the work flow, and maintaining the SAP system to name a few. The kernel provides the interface between the SAP system and the operat-ing system and the database. The kernel contains both Integrated Language Environ-ment® (ILE) objects and Integrated File System (IFS) objects. Even though the kernel consists of both ILE and IFS objects all objects are stored in a library, commonly referred to as a kernel library. In order to use a specific kernel with an SAP system the kernel must be applied to that SAP system. This process extracts the IFS objects to the proper IFS directory as well as creates necessary symbolic links to enable the kernel for use.

For a complete description of the SAP kernel on IBM i please refer to the Redbook “Im-plementing SAP Applications on the IBM System i Platform with IBM i5/OS” chapter 12 “The SAP kernel on the System i server”.

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 10 of 36

4.2 Database SAP applications utilize a relational database to store customer data and application data. On the IBM i, the database is often referred to as the database library. Each SAP system will have its own database and in the case of a double-stack SAP system, where an ABAP and Java system are combined, the SAP system will have two databases, one for ABAP and one for Java.

In addition to the database, SAP systems are configured to use database journaling. With database journaling each transaction is recorded by an object called a journal and written to a repository called a journal receiver. In case of data loss the database can be rebuilt using journal entries. The journal receivers are located in a library separate from the database library.

SAP data libraries have the following naming conventions, where <sid> is the SAP sys-tem ID:

ABAP data library: R3<sid>DATA ABAP journal library: R3<sid>JRN Java database: SAP<sid>DB Java journal library: SAP<sid>JRN

For a complete description of the IBM i integrated database as it relates to SAP applica-tions please refer to the Redbook “Implementing SAP Applications on the IBM System i Platform with IBM i5/OS” section 9.5 “Basic principles of SAP database and SAP sys-tems”.

4.3 IFS Directories and Stream Files The file system structure for SAP applications consists of two main directory trees: /sapmnt and /usr/sap. SAP applications utilize directories and stream files for storing many different types of objects including: log files, configuration data, executables, and stand-alone tools. Each individual SAP system maintains its own branch in the directory trees with the following naming convention, where <sid> is the SAP system ID:

/usr/sap/<sid> /sapmnt/<sid>

In addition to the individual SAP system directories, a directory tree called the transport directory exists. The transport directory is /sapmnt/trans and is global for all SAP sys-tems in an SAP landscape. Normally, one transport directory for the entire SAP land-scape physically resides on one host system. The other host system in the SAP land-scape will then be linked to this transport directory.

For a complete description of the IBM i integrated file system and the SAP directory structure on IBM i please refer to the Redbook “Implementing SAP Applications on the IBM System i Platform with IBM i5/OS” (SG24-7166) section 8.2.4 “The Integrated File System”.

5. SAP Applications in an iASP Key to any high availability solution is determining how to deal with application objects with respect to the solution. For switched disk and all hardware replication solutions, the application objects for an SAP system can be grouped into three categories:

objects that need to be migrated to the iASP

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 11 of 36

objects that are not migrated to the iASP, but managed by an administrative domain objects that are neither migrated, nor part of an administrative domain

5.1 Objects migrated to the iASP SAP application objects that need to be migrated to the iASP include:

database libraries and all of the contents journal libraries and all of the contents kernel library and all of the contents directories and files under /sapmnt/<sid> directories and files under /usr/sap/<sid> home directory for each SAP user profile

Currently SAP recommends that all directories under /usr/sap/<sid> and /sapmnt/<sid> be moved to the iASP. The transport directory is moved to the iASP only if the SAP sys-tem designated as the domain controller is also located in the iASP. To eliminate dual maintenance of the kernel, the kernel library should be located on the iASP.

For more information on migrating the transport directory to an iASP see SAP note 568820 “iSeries: Implementing an Independent ASP (iASP) System”.

5.2 Objects managed by the administrative domain Certain objects utilized by SAP applications cannot be migrated to the iASP. These ob-jects will exist on both the production and the backup system. In order to simplify main-tenance and management, some of these objects will be added to an administrative do-main. Objects added to an administrative domain are automatically monitored and then kept synchronized between the production host and the backup host. Some of the ob-jects that can be monitored and managed by an administrative domain include system values, system environment variables, subsystem descriptions, TCP/IP attributes, and user profiles. Except for user profiles, the PowerHA for i Solution Based GUI will auto-matically add objects to the administrative domain to be monitored. The user is respon-sible for selecting which profiles to add to the administrative domain. The following SAP user profiles should be selected and added to the administrative domain (<sid> repre-sents the SAP system ID and <nn> is the SAP instance number):

<sid>ADM <sid>GROUP <sid>OFR <sid>OPR <sid>OPRGRP <sid>OWNER <sid><nn> (an SAP system may have multiple <sid><nn> user profiles) R3OWNER R3GROUP

5.3 Objects remaining in SYSBAS Some objects will neither be migrated to the iASP nor added to an administrative domain. These objects mostly consist of temporary objects, static objects, and objects unsup-ported in an iASP. All SAP application objects that will not be migrated to an iASP nor

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 12 of 36

added to the administrative domain are contained in the following libraries and will remain in SYSBAS (<sid> is the SAP system ID and <nn> is the SAP system instance number):

R3<sid>400 R3<sid><generated_name> (libraries containing SQL packages have this form) R3SYS R3WRK<nn> (an SAP system may have multiple R3WRK<nn> libraries) R3400

These libraries do not contain any objects that need to be migrated.

6. Implementing High Availability With something as complex as high availability any method of reducing the complexity and thus reducing the cost and chances for error is welcome. Using the High Availability Solution Manager can significantly reduce complexity in configuring certain high availabil-ity solutions in an SAP environment. This section takes you through two methods of im-plementing a geographic mirror solution using the High Availability Solution Manager. The first method discusses how you would use the High Availability Solution Manager to configure your high availability environment and migrate an existing SAP system. The second method discusses how to use the High Availability Solution Manager to configure your high availability environment and then install an SAP installation directly into the newly created environment.

For both methods, the high availability configuration will be cross-site mirroring with geo-graphic mirroring, utilizing internal disk for storage and running on IBM i V6.1. The SAP application is a Netweaver 7.0 double-stack system and is installed in a two-tier configu-ration.

6.1 Migrating SAP applications with the Solution Based GUI The PowerHA for i High Availability Solution Manager can be used to simplify the imple-mentation of geographic mirror in a simple SAP landscape. Use of the High Availability Solution Manager automates many of the steps required to implement a geographic mir-ror high availability solution and to migrate an SAP applications to an iASP. Consult your business partner to determine whether a geographic mirror solution is the best fit for your situation and availability requirements.

Instructions for manually migrating SAP applications to an iASP can be found in the document “Configuring SAP for use with an Independent ASP”. This document is at-tached to SAP note 568820 “iSeries: Implementing an Independent ASP (iASP) System”. This document is the definitive source for implementing SAP applications in an iASP and was used as the main reference for the sections discussing pre-processing and post-processing tasks. If necessary refer to this document for further detail on implementing SAP in an iASP.

6.1.1 Pre-processing tasks Before starting the actual geographic mirror configuration there are some tasks that will need to be completed. It is assumed, at this point, that the SAP system is installed and running on the production host and that all software and hardware requirements have been met including the configuration of the necessary TCP/IP interfaces that are needed for clustering. At a minimum two additional TCP/IP interfaces are required, one for the server takeover IP and one to four interfaces for the dataport.

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 13 of 36

Verify health of the SAP system It is highly recommended that you verify the health of the SAP system. It is important to identify any existing problems in order to validate that problems do not arise due to con-figuration changes and the migration of the SAP system to the iASP. A list of tests that can be run to verify your SAP system can be found in section 7 of the document “Config-uring SAP for Use with an Independent ASP”.

Backup SAP system Once the health of the system is verified and any existing problems are fixed, it is good practice to completely back-up the SAP system to tape.

Prepare backup host While the production host is being backed-up to tape, the backup host can be prepared. To prepare the backup host it is necessary to perform a partial install of an SAP system. The partial install will create the necessary infrastructure to enable switching your SAP system from the production host to the backup host. To prepare the backup host perform the following steps:

(All commands are run from the IBM i command line, unless otherwise noted)

1. Save the kernel library from the production host to a save file using the SAVLIB command.

2. Transfer the save file to the backup host using FTP.

3. Restore the kernel library using the RSTLIB command. The restored kernel li-brary should have a different library name than the original kernel library on the production host. This can be done by using the RSTLIB parameter on the RSTLIB command or by using the RNMOBJ command after the library has been restored. Changing the kernel library name on the backup host will avoid a potential con-flict when switching the SAP system to the backup host.

4. Add the restored kernel library to the library list by calling ADDLIBLE.

5. Fix the owners and authorities of the objects in the kernel library by calling FIXR3OWNS.

6. Set the system value QRETVRSEC to 1 to allow user profiles to be migrated to the admin domain. This can be done by running the command CHGSYSVAL SYSVAL(QRETSVRSEC) VALUE('1').

7. Create a new SAP system using the CRTR3SYS command. The SAP system ID (SID) should be the same as the SID of the SAP system on the production host.

8. Create an SAP instance(s) using the CRTR3INST command. The instance num-ber(s) and role(s) should be the same instance number(s) and role(s) of the SAP system on the production host.

9. Create an SAP Java user using the CRTSAPUSR command for stand alone Java and double-stack systems.

10. Delete the following directories and their contents from IFS using the RMVDIR command.

/usr/sap/<sid> /sapmnt/<sid> /sapmnt/trans

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 14 of 36

The backup host is now prepared and ready for implementing the high availability solu-tion. Further details of the steps outlined above can be found in section 5.2 of the docu-ment “Configuring SAP for Use with an Independent ASP”.

6.1.2 Implementation process The High Availability Solution Manager is used to easily configure an iASP and a high availability cluster environment. It can also be used to migrate and enable applications to operate in a high availability environment. This section will mostly discuss the steps that are specific to implementing a geographic mirror solution for an SAP system. For a gen-eral and more complete reference for using High Availability Solution Manager refer to High Availability choices and considerations on IBM i4.

The High Availability Solution Manager is integrated with IBM Systems Director Navigator for i5/OS and can be found by expanding the i5/OS Management menu option and then clicking the High Availability Solutions Manager option. You are now in the High Avail-ability Solution Manager and will see the five action items necessary for setting up your high availability solution, see Figure 1.

Figure 1. High Availability Solution Manager tasks

The action items are meant to be executed serially and will take the user through all of the necessary steps for setting up and managing a high availability environment. Since

4 International Business Machines Corporation. High Availability choices and considera-tions on IBM i. Redbook SG24-7405. First edition, 2008.

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 15 of 36

many of the steps are generic, I will only focus on the steps that are specific to imple-menting SAP applications in a high availability environment.

Select your high availability solution After reviewing the high availability solutions and how they work you are now ready to begin the process of implementing your solution. When asked to select your high avail-ability solution, select the option “Cross-Site Mirroring with Geographic Mirroring”, see Figure 2.

Figure 2. Select Cross-Site Mirroring with Geographic Mirroring

After making the selection, click on “View customized shopping list” and you will be pre-sented with a list of all of the components required for that solution. The High Availability Solution Manager will collect an inventory of your production system and if a TCP/IP host table entry for the backup host exists on the production system it will collect inventory on the backup host as well. The inventory will be merged with the shopping list to verify that the correct and necessary resources are included in the solution. Make sure that a server takeover IP address (this IP address should have already been configured) and an adequate number of dataport IP addresses are included in your solution, see Figure 3.

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 16 of 36

Figure 3. Add IP resources to the shopping list

After selecting your high availability solution and ensuring that your shopping list is com-plete, you can now continue with the next action item.

Set up your high availability solution After verifying that all requirements have been met, it is now time to start the actual im-plementation and set up your high availability solution. This action item consists of multi-ple steps, see Figure 4. Of these steps only migrate user profiles; migrate libraries; and migrate directories are specific to SAP all other steps are generic. Refer to chapter 6 for more details of these steps.

Figure 4. Steps to setup your high availability solution

When asked to migrate user profiles, you will need to select the SAP user profiles. Mi-grating user profiles is part of configuring the administrative domain. Due to dependen-

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 17 of 36

cies the group profiles, <sid>GROUP, <sid>OPRGRP, and R3GROUP must be migrated first. After migrating the group profiles the remaining SAP profiles can now be selected and migrated, see Figure 5.

Figure 5. Migrate SAP user profiles

If the system value QRETSVRSEC was not set to 1 during the initial SAP application in-stall it will be necessary to sign-on and sign-off for each user before migrating. For user profiles where the initial menu attribute is set to *SIGNOFF, the sign-on attempt is suffi-cient (as long as the password is correct) and it is not necessary to change the user pro-file attributes.

When asked to select libraries to migrate, you will select the kernel library, database li-brary, and journal library, see Figure 6. Due to dependencies both the database library and the journal library must be migrated at the same time. For double-stack systems there will be two database libraries and two journal libraries.

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 18 of 36

Figure 6. Migrate SAP libraries

When asked to select IFS directories to migrate you will need to select the directory trees /sapmnt/<sid> and /usr/sap/<sid>, where <sid> is the name of the SAP system to be mi-grated.

It is also necessary to migrate the home directories of each SAP user profile. The home directories are found in /home and will have the same name as the user profile. For ex-ample, the home directory for <sid>ADM will be /home/<sid>ADM, see Figure 7.

Figure 7. Migrate SAP IFS directories

After migrating the IFS directories the remaining steps are generic. Once you have com-pleted the remaining steps your SAP system will be fully migrated to the iASP.

6.1.3 Configure exit programs To further automate the switchover and/or failover process, exit programs can be utilized. Exit programs can be used to automatically stop and start the SAP application during a switchover and automatically start the SAP application during a failover. Exit programs can also be used to keep SAP application objects not migrated to the iASP, (namely the

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 19 of 36

SAP initialization program R3INLPGM) synchronized between the production and backup hosts.

Two exit programs will need to be used, one for the shutdown and one for the startup. To use an exit program, the name and location of the exit program must be entered in the designated data area in library QUSRHASM. The name of the data areas are QSHUTDOWN and QSTARTAPP. When entering the name of exit program in the data area be sure to enter the name of the program followed by the library where it is located. The fields for both the exit program name and library are ten characters wide and should be padded with blanks. For example, to use an exit program named STRSAPCLU in li-brary MYLIB run the following command from the command line: CHGDTAARA DTAARA(QUSRHASM/QSTARTAPP) VALUE('STRSAPCLU MYLIB ')

The exit programs are called with the user profile QPGMR. During the processing of the exit programs the user profile is switched to <sid>ADM, so it is necessary to grant QPGMR the necessary authority to <sid>ADM in order to execute the exit programs suc-cessfully. Run the following command to grant the necessary authority: GRTOBJAUT OBJ(<sid>ADM) OBJTYPE(*USRPRF) USER(QPGMR) AUT(*USE)

The exit programs need to exist on both the production and backup host and all of the commands to configure the exit programs need to be run on both hosts. See appendix 1 and 2 for sample exit programs.

6.1.4 Post-processing tasks To enable SAP to run in the iASP and switchover to the backup host it is necessary to complete a few final application configuration tasks.

Reapply the SAP kernel Now that the kernel library is located in the iASP, it is necessary to remove and reapply the kernel library. Add the SAP kernel to the library list using the ADDLIBLE command. Remember that since the kernel is now in the iASP it is necessary to make the iASP visi-ble by running the command SETASPGRP. Run the command RMVSAP to remove the ker-nel. Once the remove is complete the kernel can be re-applied by running APYSAP. Fi-nally, run FIXR3OWNS to fix the owners and authorities of the objects in the kernel library.

The SAP system should now start and run on the production system, however, because it has not yet been configured to use virtual host names, it will not start on the backup sys-tem. In order to complete the implementation, the SAP system must be configured to use virtual host names.

Configure the SAP system to use a virtual host name Configuring SAP to use virtual host names is done my modifying the default profile and instance profile for both ABAP and Java systems. For Java standalone or double-stack systems the secure store and the instance properties must also be modified. Detailed in-struction for configuring SAP system to use virtual host names can be found in section 6 of the document “Configuring SAP for Use with an Independent ASP”.

For seamless access to the SAP system regardless of whether it is running on the pro-duction host or backup host, the SAP logon properties for each user should also be con-figured to use the virtual host name.

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 20 of 36

Verify the SAP system on the production host and the backup host After configuring the SAP system to use virtual host names start the SAP system on the production host and verify the health of the system. After verifying that the SAP system still works on the production host, switch over to the backup host. After the switchover is complete, start the SAP system as you normally would and verify the health of the sys-tem on the backup host.

The SAP system is now completely migrated and configured for a geographic mirrored environment. The SAP system can easily be switched from the production to the backup host with minimal effort.

6.1.5 Manage your high availability solution Once the configuration of your high availability solution is complete, the Solution Based GUI can be used to manage that solution. The Solution Based GUI provides a Web inter-face that simplifies many of the tasks associated with managing a high availability solu-tion, see Figure 8.

Figure 8. Using the Solution Based GUI to manage your high availability solution

The Solution Based GUI allows a systems administrator to perform administrative tasks including starting your high availability environment, stopping your high availability envi-ronment, and performing a switchover. In addition to administrative tasks, the Solution Based GUI can be used to monitor elements of your high availability environment includ-ing the status of nodes, cluster resource groups, monitored resources in the administra-tive domain, and TCP/IP interfaces.

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 21 of 36

6.2 Using Solution Based GUI and SAP direct installation In cases where the SAP application has not yet been installed, it is possible to use the High Availability Solution Manager to easily configure an iASP and a high availability cluster environment and then install SAP directly into the new high availability environ-ment.

Starting with SAP Netweaver® 7.0 SR3 SAP Netweaver applications can be installed di-rectly into an iASP and automatically configured using a virtual host name. This provides significant advantages in reducing the complexity of configuring SAP for an iASP envi-ronment by eliminating the application migration and eliminating the need to reconfigure the SAP application to use a virtual host name.

6.2.1 Pre-processing tasks Before starting the geographic mirror configuration and SAP installation there are some tasks that will need to be completed. It is assumed, at this point, that all software and hardware requirements have been met including the configuration of the necessary TCP/IP interfaces that are needed for clustering. At a minimum two additional TCP/IP in-terfaces are required, one for the server takeover IP and one to four interfaces for the dataport.

Determine iASP number The iASP number is required during the installation of SAP applications. If BRMS is in-stalled this can be done using the command DSPASPBRM. If BRMS is not installed, use System Director Navigator to determine the number. In System Director Navigator, under i5/OS Management click Configuration and Service. Under the Configuration and Ser-vices tab, click on the Disk Pools option. This will display the disk pool number with the name of the disk pool in parenthesis for all disk pools configured on the system. Find the appropriate disk pool and take note of the number, see Figure 9.

Figure 9. Determine the iASP number

Set QRETVRSEC system value Set the system value QRETVRSEC to 1 to allow user profiles to be migrated to the ad-ministrative domain. This can be done by running the command CHGSYSVAL SYSVAL(QRETSVRSEC) VALUE('1'). This will need to be done on both the production and backup hosts.

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 22 of 36

6.2.2 Configure iASP and Cluster The PowerHA for i High Availability Solution Manager can be used to easily configure an iASP and a high availability cluster environment. The SAP application will be directly in-stalled into the high availability environment after the iASP and cluster environment is configured. Follow the process in section 6.1.2 beginning on page 14. Since there will be no application migration during the initial configuration, the steps: migrate user pro-files; migrate libraries; and migrate directories can all be closed without performing any migrations. All steps should be completed including the final step “Finish setup and clean up work files”. After SAP is installed, the Solution Based GUI will be used for some fur-ther configuration tasks. For a more complete reference for using High Availability Solu-tion Manager refer to High Availability choices and considerations on IBM i5.

6.2.3 Direct Install SAP Application After using the PowerHA for i High Availability Solution Manager to configure and verify your high availability solution, the SAP application can then be installed directly into the iASP. Before beginning the SAP installation, shut down clustering, but keep the iASP available. This can be done from the “Manage Your High Availability Solution” option in the High Availability Solution Manager, see Figure 10.

Figure 10. Shut down your high availability solution while keeping the iASP available

The SAP application direct install is performed like any other SAP installation, with the use of SAPinst. This section will highlight the steps specific to installing SAP applications directly into an iASP and using a virtual host name. For a generic and more complete description of installing SAP applications please refer to the SAP installation guides6 for IBM i.

Install TMKSVR Before starting any installation on IBM i it is necessary to install the TMKSVR on the tar-get host. The TMKSVR is used to communicate between the SAPinst GUI and the target IBM i. The TMKSVR installation files are part of the SAP master installation DVDs.

5 International Business Machines Corporation. High Availability choices and considera-tions on IBM i. Redbook SG24-7405. First edition, 2008. 6 SAP AG. SAP Service Marketplace. < http://service.sap.com/ >

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 23 of 36

Install the TMKSVR specifying the virtual host name of your cluster solution in the field “iSeries Hostname”. If the virtual host name has not yet been registered with your TCP/IP domain name server it will be necessary to create a host table entry on the PC from which you are running SAPinst. For more information on installing TMKSVR, see the SAP installation guide for IBM i.

Start SAPinst with a virtual hostname After the TMKSVR has been installed, you can start SAPinst. By default, SAPinst will use the actual host name of the target host for the installation. To install using a virtual host name, the behavior must be overridden. This can be done by starting SAPinst using the parameter “SAPINST_USE_HOSTNAME”. To start SAPinst with this parameter run SAPinst from a DOS prompt on the PC where SAPinst will run. From the DOS prompt, navigate to the directory where SAPinst is located and run the following command, where <virtual_host> is the virtual host name used by the cluster.

sapinst SAPINST_USE_HOSTNAME=<virtual_host>

When prompted for session parameters, make sure that your virtual host name is speci-fied and that the installation drive is the rootbin share using the virtual hostname. Figure 11 shows the session parameters using a virtual host name of ERPMLXV.

Figure 11. Specify the virtual hostname in session parameters

Continue the installation as you would any other installation.

Revise installation After completing the installation dialogs, you are presented with the opportunity to revise the installation. It is within the revision dialog that the necessary modifications are made for installing directly into an iASP. The following parameters should be selected for revi-sion:

Kernel Load Parameters ABAP Database Library ASPs (for ABAP only or add-in systems)

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 24 of 36

Java Database Library ASPs (for Java only or add-in systems)

When presented with the dialog for “Kernel Load Parameters” enter the iASP number for the field “Kernel Library ASP”, see Figure 12.

Figure 12. Specify the iASP number for the kernel library ASP

Note that SAPinst cannot use a kernel that resides in the iASP. The kernel must be lo-cated in SYSBAS and then migrated to the iASP at a later time. See SAP note 1152408 “Installing SAP Systems into an Independent ASP(iASP)” for more details.

When presented with dialogs for “ABAP Database Library ASPs” and “Java Database Li-brary ASPs” enter the iASP number for both the library ASP and the journal receiver ASP, see Figure 13.

Figure 13. Specify the iASP number for both the database libraries and journal receiver libraries

After making the necessary revisions, you are ready to finish the installation process.

Modify profile parameter The direct install eliminates most of the requirements for manually modifying the SAP profiles after the installation. After the installation completes, the only manual modifica-tion that needs to be me made is adding the relational database name to the instance profile. Add the following profile parameter to the central instance profile:

dbs/db4/rdbname = HASMIASP

The installation of SAP directly into an iASP using virtual host names is now complete.

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 25 of 36

6.2.4 Prepare backup host The initial configuration of the backup host can be done at any time. The SAP application does not have to be installed on the production host first. Before preparing the backup host, make sure that clustering is not active. Perform the following steps to configure the backup host:

(All commands are run from the IBM i command line, unless otherwise noted)

1. Save the kernel library from the production host to a save file using the SAVLIB com-mand.

2. Transfer the save file to the backup host using FTP.

3. Restore the kernel library using the RSTLIB command. The restored kernel library should have a different library name than the original kernel library on the production host. This can be done by using the RSTLIB parameter on the RSTLIB command or by using the RNMOBJ command after the library has been restored. Changing the kernel library name on the backup host will avoid a potential conflict when switching the SAP system to the backup host.

4. Add the restored kernel library to the library list by calling ADDLIBLE.

5. Fix the owners and authorities of the objects in the kernel library by calling FIXR3OWNS.

6. Set the system value QRETVRSEC to 1 to allow user profiles to be migrated to the admin domain. This can be done by running the command CHGSYSVAL SYSVAL(QRETSVRSEC) VALUE('1').

7. Create a new SAP system using the CRTR3SYS command. The SAP system ID (SID) should be the same as the SID of the SAP system on the production host.

8. Create an SAP instance(s) using the CRTR3INST command. The instance number(s) and role(s) should be the same instance number(s) and role(s) of the SAP system on the production host.

9. Create an SAP Java user using the CRTSAPUSR command for stand alone Java and double-stack systems.

10. Configure the SAP system for use with an iASP by using the CFGSAP2HO command.

6.2.5 Complete high availability configuration At this point the installation on the production host should be complete and the SAP sys-tem should now run in an iASP using a virtual host name. The SAP configuration on the backup host should also be finished, however, a complete SAP system has not been in-stalled on the backup host so you should not expect SAP to start on the backup host. To complete the high availability configuration, a few remaining steps must be completed, but before these steps can be done, the cluster must be restarted and the data synchro-nized. This can be done by selecting “Resume” in the “Manage Your High Availability Solution” option in the High Availability Solution Manager see Figure 14.

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 26 of 36

Figure 14. Resume clustering

The data imported by the SAP installation will need to be synchronized to the mirror copy of the iASP before the high availability solution resumes. Depending on the speed of your network and the number of dataports configured, this process may take a while.

Setup administrative domain Add the user profiles created during the SAP application install to the administrative do-main. Select the “Set up your high availability solution” option from the High Availability Solution Manager interface. On the “Migrate user profiles” step click the double arrow next to complete and select the “Retry…” menu option, see Figure 15.

Figure 15. Migrate user profiles to the administrative domain

On the “Migrate user profile” page, first select and migrate the SAP group profiles. These profiles include <sid>GROUP, <sid>OPRGRP, and R3GROUP. It might be necessary to click the “Refresh” button if the profiles do not appear in the list. After the group profiles have been migrated, then migrate the remaining SAP user profiles, see Figure 16.

Figure 16. Migrate SAP user profiles

Click “Close” once the user profiles have been migrated. The user profiles should now be part of the administrative domain and will be kept synchronized on the production and backup hosts.

Migrate kernel Before migrating the kernel library to the iASP, make sure there will not be a name colli-sion on the backup host. If a kernel library of the same name as the migrated library ex-ists on the backup host, then one of the libraries will need to be renamed.

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 27 of 36

Select the “Set up your high availability solution” option from the High Availability Solution Manager interface. On the “Migrate libraries” step click the double arrow next to com-plete and select the “Retry…” menu option. On the “Migrate Libraries” page, select and migrate the kernel library, see Figure 17.

Figure 17. Migrate kernel library

Now that the kernel library is located in the iASP, it is necessary to remove and reapply the kernel library. Add the SAP kernel to the library list using the ADDLIBLE command. Remember that since the kernel is now in the iASP it is necessary to make the iASP visi-ble by running the command SETASPGRP. Run the command RMVSAP to remove the ker-nel. Once the remove is complete the kernel can be re-applied by running APYSAP. Fi-nally, run FIXR3OWNS to fix the owners and authorities of the objects in the kernel library.

Migrate home directories One final step to keep data consistent between the production and backup host is to mi-grate the home directories of the SAP user profiles to the iASP. Select the “Set up your high availability solution” option from the High Availability Solution Manager interface. On the “Migrate directories” step click the double arrow next to complete and select the “Re-try…” menu option. On the directories migration dialog select and migrate the home di-rectory for each SAP user profile, see Figure 18.

Figure 18. Migrate home directories for SAP user profiles

Click close to exit the “Migrate Directories” page. The configuration using the High Avail-ability Solution Manager is now complete. Click close to exit the “Set Up High Availability Solution” page.

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 28 of 36

6.2.6 Configure exit programs To further automate the switchover and/or failover process, exit programs can be utilized. Exit programs can be used to automatically stop and start the SAP application during a switchover and automatically start the SAP application during a failover. Exit programs can also be used to keep SAP application objects not migrated to the iASP, (namely the SAP initialization program R3INLPGM) synchronized between the production and backup hosts. Refer to section 6.1.3 on page 18 for details on configuring exit programs.

6.2.7 Post-processing tasks At this point you are ready to switchover from your production host to your backup host. This can be done from the “Manage Your High Availability Solution” option in the High Availability Solution Manager, see Figure 19.

Figure 19. Switchover from production host to backup host

If the exit programs have been configured on both hosts, then the switchover will fail on the “Call Program” step on the backup host. This is because the SAP kernel has never been applied to the system on the backup host. Add the SAP kernel to the library list us-ing the ADDLIBLE command. Remember that since the kernel is now in the iASP it is necessary to make the iASP visible by running the command SETASPGRP. Run the com-mand RMVSAP to remove the kernel. Once the remove is complete the kernel can be re-applied by running APYSAP.

After applying the kernel, continue the switch over by clicking “Run Now”. Your SAP sys-tem should now be configured for geographic mirroring environment.

Verify the SAP system on the production host and the backup host After configuring the SAP system to use virtual host names start the SAP system on the production host and verify the health of the system. After verifying that the SAP system still works on the production host, switch over to the backup host. After the switchover is complete, start the SAP system as you normally would and verify the health of the sys-tem on the backup host.

For seamless access to the SAP system regardless of whether it is running on the pro-duction host or backup host, the SAP logon properties for each user should also be con-figured to use the virtual host name.

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 29 of 36

The SAP system is now completely migrated and configured for a geographic mirrored environment. The SAP system can easily be switched from the production to the backup host with minimal effort.

7. Conclusion High availability in an SAP environment is crucial in today’s demanding business envi-ronment. With PowerHA for i it is possible to reduce the complexity of implementing and managing a cross-site mirroring with geographic mirror high availability solution. When properly migrated and configured an SAP NetWeaver system will be able to easily switch back and forth between production and backup hosts. With switchover and failover automation, the SAP application is automatically restarted on the backup host after a switchover or failover. With the use of a takeover IP address and a virtual host name, the host that the SAP system is running on will be transparent to the user. Running your SAP application in a geographic mirror environment provides the device and data resil-iency and the flexibility to quickly recover from both expected and unexpected downtime. Using PowerHA for i to implement and manage your SAP cross-site mirroring with geo-graphic mirror environment provides a simple solution to achieving your availability goals.

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 30 of 36

8. References International Business Machines Corporation. High Availability choices and considera-tions on IBM i. Redbook SG24-7405. First edition, 2008.

International Business Machines Corporation. Implementing SAP Applications on the IBM System i Platform with IBM i5/OS. Redbook SG24-7166. First edition, 2006

SAP AG. SAP Help Portal. < http://help.sap.com/ >.

SAP AG. SAP Service Marketplace. < http://service.sap.com/ >

SAP AG. SAP Note 568820 “iSeries: Implementing an Independent ASP (iASP) System”.

SAP AG. SAP Note 1152408 “Installing SAP Systems into an Independent ASP (iASP)”.

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 31 of 36

Appendix A.1 Example CL startup exit program

The program example below can be used to automatically start an SAP system after a switchover or failover. Passing parameters into an exit program are not supported by the High Availability Solution Manager, so it is necessary to hard code the SAP system ID of your SAP system. This can be done by replacing <sid> with the actual SID of your SAP system in the single line of code in the program that matches the line below:

CHGVAR VAR(&SID) VALUE(<sid>)

After making the necessary modification for your environment, compile the exit program and place it in a library that is not located on the iASP. The library R3<sid>400 is my recommendation. Regardless of the library used to store the exit programs, make sure that the user profile QPGMR has at least *USE authority to that library. QPGMR is the user profile used by the High Availability Solution Manager to call the exit program.

To compile the program you will need to first add an SAP kernel library to the library list because the program uses function that is part of the kernel. After the kernel has been added to the library list compile the program by executing the following commands from the IBM i command line interface.

CRTCLMOD MODULE(<my_lib>/STRSAPCLU) SRCFILE(<my_lib>/QCLSRC)

CRTPGM PGM(R3<sid>400/STRSAPCLU) MODULE(<my_lib>/STRSAPCLU)

Replace <my_lib> with the library containing the program source and <sid> with the SAP system ID of your SAP system.

/******************************************************************************/

/* PROGRAM: STRSAPCLU */

/* */

/* PURPOSE: Start SAP jobs after a switchover */

/* */

/* PARAMETERS: None. Parameters are not supported by HASM, so it is */

/* necessary to hard code the SID in this program. This can */

/* be done by replacing <sid> with the SID of your SAP system in */

/* the single line of code in the program that matches the one */

/* below: */

/* */

/* CHGVAR VAR(&SID) VALUE(<sid>) */

/* */

/******************************************************************************/

/* LICENSE AND DISCLAIMER */

/* This material contains IBM copyrighted programming source code ("Source */

/* Code"). IBM grants you a nonexclusive license to compile, link, execute, */

/* display, reproduce, distribute and prepare derivative works of this Source */

/* Code. The Source Code has not been thoroughly tested under all */

/* conditions. IBM, therefore, does not guarantee or imply its reliability, */

/* serviceability, or function. IBM provides no program services for the */

/* Source Code. */

/* */

/* All Source Code contained herein is provided to you "AS IS" without any */

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 32 of 36

/* warranties of any kind. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS */

/* FOR A PARTICULAR PURPOSE AND NON-INFRINGMENT ARE EXPRESSLY DISCLAIMED. */

/* SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO */

/* THE ABOVE EXCLUSIONS MAY NOT APPLY TO YOU. IN NO EVENT WILL IBM BE LIABLE */

/* TO ANY PARTY FOR ANY DIRECT, INDIRECT, SPECIAL OR OTHER CONSEQUENTIAL */

/* DAMAGES FOR ANY USE OF THE SOURCE CODE INCLUDING, WITHOUT LIMITATION, ANY */

/* LOST PROFITS, BUSINESS INTERRUPTION, LOSS OF PROGRAMS OR OTHER DATA ON */

/* YOUR INFORMATION HANDLING SYSTEM OR OTHERWISE, EVEN IF WE ARE EXPRESSLY */

/* ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */

/* */

/* COPYRIGHT */

/* --------- */

/* (C) Copyright IBM CORP. 2008 */

/* All rights reserved. */

/* US Government Users Restricted Rights - */

/* Use, duplication or disclosure restricted */

/* by GSA ADP Schedule Contract with IBM Corp. */

/* Licensed Material - Property of IBM */

/* */

/******************************************************************************/ PGM

DCL VAR(&SID) TYPE(*CHAR) LEN(3)

DCL VAR(&SIDLIB) TYPE(*CHAR) LEN(10)

DCL VAR(&SIDADM) TYPE(*CHAR) LEN(10)

DCL VAR(&CURUSER) TYPE(*CHAR) LEN(10)

DCL VAR(&ADMHANDLE) TYPE(*CHAR) LEN(12)

DCL VAR(&CURHANDLE) TYPE(*CHAR) LEN(12)

DCL VAR(&JOBNAME) TYPE(*CHAR) LEN(10)

DCL VAR(&ERRORMSG) TYPE(*CHAR) LEN(70)

DCL VAR(&MSGTEXT) TYPE(*CHAR) LEN(42)

DCL VAR(&KERNEL) TYPE(*CHAR) LEN(10)

MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(ERROR))

/* YOU CAN'T PASS PARAMETERS INTO THE EXIT PROGRAM, SO IT */

/* IS NECESSARY TO HARDCODE THE SAP SYSTEM ID */

CHGVAR VAR(&SID) VALUE(<sid>)

/**********************************************************/

/* SWITCH USER TO <sid>ADM */

/**********************************************************/

SWITCHUSER:

/* REMEMBER CURRENT USER PROFILE: */

RTVJOBA CURUSER(&CURUSER)

CALL PGM(QSYS/QSYGETPH) +

PARM(&CURUSER '*NOPWDCHK' &CURHANDLE)

/* SWITCH TO USER PROFILE <sid>ADM: */

CHGVAR VAR(&SIDADM) VALUE(&SID *TCAT 'ADM')

CALL PGM(QSYS/QSYGETPH) +

PARM(&SIDADM '*NOPWDCHK' &ADMHANDLE)

CALL PGM(QSYS/QWTSETP) PARM(&ADMHANDLE)

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 33 of 36

/**********************************************************/

/* INITIALIZE SAP ENVIRONMENT */

/**********************************************************/

INLSAP:

CHGVAR VAR(&SIDLIB) VALUE('R3' *TCAT &SID *TCAT '400')

CALL PGM(&SIDLIB/R3INLPGM)

/* SYNC R3<sid>400/R3INLPGM WITH KERNEL VERSION */

RTVSAPKRN SID(&SID)

MONMSG MSGID(CPF9897) EXEC(RCVMSG MSG(&MSGTEXT))

MONMSG MSGID(CPFA0A9) EXEC(GOTO CMDLBL(STARTSAP))

CHGVAR VAR(&KERNEL) VALUE(%SST(&MSGTEXT 32 10))

DLTPGM PGM(&SIDLIB/R3INLPGM)

MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(STARTSAP))

CRTDUPOBJ OBJ(R3INLPGM) FROMLIB(&KERNEL) OBJTYPE(*PGM) +

TOLIB(&SIDLIB)

MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(STARTSAP))

/**********************************************************/

/* START SAP */

/**********************************************************/

STARTSAP:

CHGVAR VAR(&ERRORMSG) VALUE('Startup of SAP system +

' *CAT &SID *TCAT ' failed. See joblog +

for jobname ' *CAT *JOBNAME)

STARTSAP SID(&SID) INSTANCE(*ALL) WAIT(*YES)

MONMSG MSGID(CPF0000) +

EXEC(SNDMSG MSG(&ERRORMSG) +

TOUSR(*SYSOPR))

/**********************************************************/

/* CLEANUP */

/**********************************************************/

CLEANUP:

/* MAKE SURE ASP GROUP IS SET TO *NONE */

SETASPGRP ASPGRP(*NONE)

/* SWITCH BACK TO ORIGINAL USER PROFILE: */

CALL PGM(QSYS/QWTSETP) PARM(&CURHANDLE)

GOTO CMDLBL(END)

/**********************************************************/

/* ERROR */

/**********************************************************/

ERROR:

SNDPGMMSG MSGID(CPF0001) +

MSGF(QCPFMSG) +

MSGDTA('STRSAPCLU FAILED') +

MSGTYPE(*ESCAPE)

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 34 of 36

/**********************************************************/

/* END */

/**********************************************************/

END:

ENDPGM

A.2 Example CL shutdown exit program The program example below can be used to automatically end an SAP system prior to a switchover. Passing parameters into an exit program are not supported by the High Availability Solution Manager, so it is necessary to hard code the SAP system ID of your SAP system. This can be done by replacing <sid> with the actual SID of your SAP sys-tem in the single line of code in the program that matches the line below:

CHGVAR VAR(&SID) VALUE(<sid>)

After making the necessary modification for your environment, compile the exit program and place it in a library that is not located on the iASP. The library R3<sid>400 is my recommendation. Regardless of the library used to store the exit programs, make sure that the user profile QPGMR has at least *USE authority to that library. QPGMR is the user profile used by the High Availability Solution Manager to call the exit program.

To compile the program you will need to first add an SAP kernel library to the library list because the program uses function that is part of the kernel. After the kernel has been added to the library list compile the program by executing the following commands from the IBM i command line interface.

CRTCLMOD MODULE(<my_lib>/ENDSAPCLU) SRCFILE(<my_lib>/QCLSRC)

CRTPGM PGM(R3<sid>400/ENDSAPCLU) MODULE(<my_lib>/ENDSAPCLU)

Replace <my_lib> with the library containing the program source and <sid> with the SAP system ID of your SAP system.

/******************************************************************************/

/* PROGRAM: ENDSAPCLU */

/* */

/* PURPOSE: Stop all SAP jobs prior to switchover */

/* */

/* PARAMETERS: None. Parameters are not supported by HASM, so it is */

/* necessary to hard code the SID in this program. This can */

/* be done by replacing <sid> with the SID of your SAP system in */

/* the single line of code in the program that matches the one */

/* below: */

/* */

/* CHGVAR VAR(&SID) VALUE(<sid>) */

/* */

/******************************************************************************/

/* LICENSE AND DISCLAIMER */

/* This material contains IBM copyrighted programming source code ("Source */

/* Code"). IBM grants you a nonexclusive license to compile, link, execute, */

/* display, reproduce, distribute and prepare derivative works of this Source */

/* Code. The Source Code has not been thoroughly tested under all */

/* conditions. IBM, therefore, does not guarantee or imply its reliability, */

/* serviceability, or function. IBM provides no program services for the */

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 35 of 36

/* Source Code. */

/* */

/* All Source Code contained herein is provided to you "AS IS" without any */

/* warranties of any kind. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS */

/* FOR A PARTICULAR PURPOSE AND NON-INFRINGMENT ARE EXPRESSLY DISCLAIMED. */

/* SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO */

/* THE ABOVE EXCLUSIONS MAY NOT APPLY TO YOU. IN NO EVENT WILL IBM BE LIABLE */

/* TO ANY PARTY FOR ANY DIRECT, INDIRECT, SPECIAL OR OTHER CONSEQUENTIAL */

/* DAMAGES FOR ANY USE OF THE SOURCE CODE INCLUDING, WITHOUT LIMITATION, ANY */

/* LOST PROFITS, BUSINESS INTERRUPTION, LOSS OF PROGRAMS OR OTHER DATA ON */

/* YOUR INFORMATION HANDLING SYSTEM OR OTHERWISE, EVEN IF WE ARE EXPRESSLY */

/* ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */

/* */

/* COPYRIGHT */

/* --------- */

/* (C) Copyright IBM CORP. 2008 */

/* All rights reserved. */

/* US Government Users Restricted Rights - */

/* Use, duplication or disclosure restricted */

/* by GSA ADP Schedule Contract with IBM Corp. */

/* Licensed Material - Property of IBM */

/* */

/******************************************************************************/ DCL VAR(&SID) TYPE(*CHAR) LEN(3)

DCL VAR(&SIDLIB) TYPE(*CHAR) LEN(10)

DCL VAR(&SIDADM) TYPE(*CHAR) LEN(10)

DCL VAR(&CURUSER) TYPE(*CHAR) LEN(10)

DCL VAR(&ADMHANDLE) TYPE(*CHAR) LEN(12)

DCL VAR(&CURHANDLE) TYPE(*CHAR) LEN(12)

DCL VAR(&JOBNAME) TYPE(*CHAR) LEN(10)

DCL VAR(&ERRORMSG) TYPE(*CHAR) LEN(70)

MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(ERROR))

/* YOU CAN'T PASS PARAMETERS INTO THE EXIT PROGRAM, SO IT */

/* IS NECESSARY TO HARDCODE THE SAP SYSTEM ID */

CHGVAR VAR(&SID) VALUE(<sid>)

/**********************************************************/

/* SWITCH USER TO <sid>ADM */

/**********************************************************/

SWITCHUSER:

/* REMEMBER CURRENT USER PROFILE: */

RTVJOBA CURUSER(&CURUSER)

CALL PGM(QSYS/QSYGETPH) +

PARM(&CURUSER '*NOPWDCHK' &CURHANDLE)

/* SWITCH TO USER PROFILE <SID>ADM: */

CHGVAR VAR(&SIDADM) VALUE(&SID *TCAT 'ADM')

CALL PGM(QSYS/QSYGETPH) +

PARM(&SIDADM '*NOPWDCHK' &ADMHANDLE)

CALL PGM(QSYS/QWTSETP) PARM(&ADMHANDLE)

© IBM Copyright, 2008 Version: September 9, 2008

www.ibm.com/support/techdocs

Leveraging PowerHA for i in an SAP Environment Page 36 of 36

/**********************************************************/

/* INITIALIZE SAP ENVIRONMENT */

/**********************************************************/

INLSAP:

CHGVAR VAR(&SIDLIB) VALUE('R3' *TCAT &SID *TCAT '400')

CALL PGM(&SIDLIB/R3INLPGM)

/**********************************************************/

/* STOP SAP */

/**********************************************************/

STOPSAP:

CHGVAR VAR(&ERRORMSG) VALUE('Stop of SAP system +

' *CAT &SID *TCAT ' failed. See joblog +

for jobname ' *CAT *JOBNAME)

STOPSAP SID(&SID) INSTANCE(*ALL) WAIT(*YES) WAITTIME(600) +

ENDSBS(*YES)

MONMSG MSGID(CPF0000) +

EXEC(SNDMSG MSG(&ERRORMSG) +

TOUSR(*SYSOPR))

STOPSAP SID(&SID) INSTANCE(*ALL) STARTUPSRV(*YES) +

WAIT(*YES)

/**********************************************************/

/* CLEANUP */

/**********************************************************/

CLEANUP:

/* MAKE SURE ASP GROUP IS SET TO *NONE */

SETASPGRP ASPGRP(*NONE)

/* SWITCH BACK TO ORIGINAL USER PROFILE: */

CALL PGM(QSYS/QWTSETP) PARM(&CURHANDLE)

GOTO CMDLBL(END)

/**********************************************************/

/* ERROR */

/**********************************************************/

ERROR:

SNDPGMMSG MSGID(CPF0001) +

MSGF(QCPFMSG) +

MSGDTA('ENDSAPCLU FAILED') +

MSGTYPE(*ESCAPE)

/**********************************************************/

/* END */

/**********************************************************/

END:

ENDPGM