Using IBM TotalStorage Enterprise Storage Server (ESS) ® with IBM® DB2® UDB Enterprise Edition V7.
. © Copyright International Business Machines Corporation 2002. All rights reserved.
Trademarks The following terms are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both: AIX DB2 DB2 Universal Database Enterprise Storage Server (ESS) ESCON FlashCopy IBM iSeries zSeries The following terms are trademarks SAP AG in Germany, in the United States, other countries, or both: SAP mySAP.com R/3 Other products or service names may be trademarks or registered trademarks of their respective owners.
Table of contents ABSTRACT.................................................................................................................................................IV ABOUT THE AUTHORS ........................................................................................................................... V DB2 UDB SUSPENDED I/O OVERVIEW.................................................................................................
Abstract SAP® R/3™ and its components have been the success of more than 19,000 installations in enterprises of every size in more than 106 countries worldwide. The SAP R/3 system is an open, integrated system that covers all business applications including accounting and controlling, production and materials management, quality management and plant maintenance, sales and distribution, human resources and project management. The mySAP.
About the authors Aslam Nomani has been working with the IBM Database Technology team in the Toronto Laboratory for five years. For the past four years, he has worked in the DB2 UDB System Verification Test department. Aslam has worked extensively in testing DB2 UDB EE and DB2 UDB EEE in a high availability environment. He is currently one of the team leads within the UDB test organization.
DB2 UDB suspended I/O overview DB2 UDB v7.2 has implemented suspended I/O technology, which provides the capability to use split mirroring technology while DB2 is online. Suspended I/O supports continuous system availability by providing a full implementation for splitting a mirror (pair) without shutting down the database. The split copy of the database can be used to do such things as: • Provide a transactionally consistent snapshot of the database at the current point in time.
DB2 UDB commands We use the following commands: set write suspend The suspend command (db2 set write suspend for database) suspends all write operations to the DB2 UDB database (i.e., to tablespaces and log files). Read operations are not suspended and are thus allowed to continue. Applications can continue to process insert, update, and delete operations utilizing the DB2 bufferpools. A database connection is required for issuing the suspend command.
Universal Database V7 http://www7b.software.ibm.com/dmdd/library/techarticle/0204quazi/0204quazi.html..
Overview of IBM 2105 Enterprise Storage Server The IBM 2105 Enterprise Storage Server (ESS) provides superior storage sharing for Unix®, Windows NT®, Windows 2000®, Novell Netware, iSeries™ and zSeries™ servers. With the ESS any combination of these heterogeneous platforms can be used.
Overview of Copy Services Copy Services is a separately priced feature of the ESS, which provides powerful functions for replication of mission-critical data. For the Open Systems environment Copy Services offer point-in-time replication with FlashCopy and dynamic synchronous mirroring to a remote ESS with Peer-to-Peer Remote Copy (PPRC). The examples described in this paper use FlashCopy.
Overview of FlashCopy 6
Overview of the ESS Copy Services Web interface The ESS Copy Services Web interface is used to create and manage Copy Services tasks. This Web interface consists of a number of HTML screens and Java™ applets and can be accessed from a standard Web browser.
Overview of ESS Command Line Interface (CLI) The ESS Command Line Interface consists of a number of scripts to communicate with the ESS Copy Services server. The Command Line Interface is Java-based and therefore requires the Java JDK version 1.1.8 to be installed on each host system from which you want to issue the commands. The CLI code level must be at the same release level as the microcode that is installed in the ESS clusters.
ESS Copy Services CLI command description rsExecuteTask Executes one or more predefined Copy Services Server tasks and waits for the tasks to complete execution. The command returns 0 for successful completion and greater-than zero if there is an error. . Note: For FlashCopy tasks, execution is completed when the FlashCopy pairs have been established and the control bitmaps have been generated. This usually only lasts a few seconds.
Overview of standard SAP R/3 system installation with DB2 UDB A SAP R/3 system is identified by a three character system identifier and a two digit system number between 00 and 96. The following information about the directory structure applies to a Central System consisting of the SAP R/3 central instance and database instance installed on a single host. We do not consider the installation of dialog instances on additional systems.
Detailed discussions about the layout of a SAP R/3 system on an ESS are contained in the following white papers: • • • Sanjoy Das, Siegfried Schmidt, Jens Claussen, BalaSanni Godavari: “Storage Management for SAP and DB2 UDB: Split Mirror Backup / Recovery with IBM Enterprise Storage Server (ESS)”, at http://www.storage.ibm.com/hardsoft/products/sap/smdb2.pdf Siegfried Schmidt: “SAP R/3 Storage Management – Split Mirror Backup Recovery on IBM’s Enterprise Storage Server (ESS)”, at http://www.storage.ibm.
Sample configuration of SAP R/3 with DB2 UDB and IBM ESS In this configuration, we will work with a standard SAP R/3 installation and describe the following different scenarios that use the DB2 UDB split mirror functionality: • Creating a clone SAP system (Snapshot database scenario on page 26) • Creating a standby SAP database (Standby database scenario on page 28) • Creating a split mirror copy of the SAP R/3 database for backup and restore (Split-Mirror online backup scenario on page 31) • Creating a spl
volume groups are created on the Primary server for the SAP system and the database, respectively. DB2 Universal Database v7.2 for AIX® is used; DB2 UDB suspended I/O capabilities are available on all platforms supported by DB2 UDB. An IBM ESS 2105 F20 is used. The same scenarios also pertain to other ESS models supporting the same functionality as the ESS F20, such as the ESS Model 800 (Silvertip). The servers were attached to the ESS via SCSI adapters, but alternatively fibre channel may be used.
lsdev –C | grep 2105 3. Use the ESS Command Line Interface command rsList2105s to display the mapping of host physical volume name to ESS volume serial number for all disks assigned to the host system: cd /usr/opt/ibm2105cli ./rsList2105s.sh 4. Determine the SCSI paths and disks to be used for the SAP system, the DB2 database, and the DB2 logs. 5. Document the corresponding ldev’s <> to be used for AIX logical volumes.
Configuring a system with two hosts Overview 1. 2. 3. 4. Install the ESS CLI on the Primary Server. Assign ESS disks to both servers. Install DB2 for AIX on both servers. Install a standard SAP R/3 system on the Primary Server. Figure 2 shows the configuration we used for the FlashCopy examples.
• • • • • The host name of the Backup server is MACHB. The host name of the ESS Copy Services Server is ESSCSS. The name of the SAP system is TS1; its system number is 00. To achieve optimal performance the disks are spread equally over all 8 LSSs of the ESS. The Primary server uses the source disks while the Backup server uses the target disks.
• o hdisk42 o hdisk40 o hdisk38 o hdisk37 o hdisk43 The source and target volume of each FlashCopy pair reside in the same ESS LSS. Note: The root userid must be used to execute all ESS and AIX commands, and to install DB2 and create the DB2 instance. The remainder of the DB2 commands are executed from the ID db2ts1,which is the DB2 instance-owning ID. 1.
For the Split Mirror Restore Scenario we need FlashCopy tasks for the database data filesystems only without the ‘no copy’ option. We also need FlashCopy tasks for establishing reverse FlashCopy pairs for the database data filesystems. Although these could be defined with the no copy option this is not recommended. We create two group tasks: ts1dbdatafc and ts1dbdatarevfc.
Alternatively, issue the following command: mkvg –f –y sapvg –s 64 hdisk15 # smit vg ->Add a Volume Group Alternatively, issue the following command: mkvg –f –y dbvg –s 64 hdisk9 hdisk11 hdisk21 hdisk26 hdisk28 hdisk29 hdisk33 hdisk34 hdisk41 Create logical volumes The following procedure creates two logical group names: saplv and data1lv.
Alternatively, issue the following command: mklv –y saplv sapvg 60 #smit lv ->Add a Logical Volume ->VOLUME GROUP name [dbvg] Configuring a Two Host System 20
Alternatively, issue the following commands: mklv –y dblv dbvg mklv –y data1lv mklv –y data2lv mklv –y data3lv mklv –y data4lv mklv –y data5lv mklv –y data6lv mklv –y data7lv mklv –y dbloglv 60 hdisk26 dbvg 295 hdisk9 dbvg 295 hdisk33 dbvg 295 hdisk11 dbvg 295 hdisk29 dbvg 295 hdisk21 dbvg 295 hdisk41 dbvg 295 hdisk28 dbvg 295 hdisk34 Create file systems.
Alternatively, issue the following command: crfs –v jfs –d saplv –m /usr/sap –A yes –p rw #smit fs ->Add / Change / Show / Delete File Systems ->Journaled File Systems >Add a Journaled File System on a Previously Defined Logical Volume ->Add a Standard Journaled File System Alternatively, issue the following commands: crfs crfs crfs crfs crfs crfs crfs crfs crfs –v –v –v –v –v –v –v –v –v jfs jfs jfs jfs jfs jfs jfs jfs jfs –d –d –d –d –d –d –d –d –d dblv –m data1lv data2lv data3lv data4lv data5lv data
chfs chfs chfs chfs -a -a -a -a size=14000000 size=14000000 size=14000000 size=14000000 /db2/TS1/sapdata6 /db2/TS1/sapdata7 /db2/TS1/log_dir /db2/TS1/db2ts1/NODE0000 Mount the file systems: mount mount mount mount mount mount mount mount mount mount /usr/sap /db2/TS1/db2ts1/NODE0000 /db2/TS1/sapdata1 /db2/TS1/sapdata2 /db2/TS1/sapdata3 /db2/TS1/sapdata4 /db2/TS1/sapdata5 /db2/TS1/sapdata6 /db2/TS1/sapdata7 /db2/TS1/log_dir Change ownership of the file systems to the SAP administrative user and DB2 ins
/db2/TS1/log_dir. Loading the data into the database may last several hours. For more details about installing an SAP R/3 system please refer to the SAP R/3 Installation Guide. 8. Flash the SAP software to the target disk and system: a. Create the group dbts1adm and the user ts1adm on the target system with the same userid and groupid as on the source system. b. Copy the files from the ts1adm home directory (default: /home/ts1adm) to the ts1adm home directory on the target system.
11. On the Backup server from the db2inst1 instance, catalog the database TS1 even though the file systems that contain the database TS1 does not currently exist on the Backup server: db2 “catalog db TS1 on /db2/TS1” The base configuration is now done and the following sections will provide examples on how ESS FlashCopy technology and DB2 UDB suspended I/O technology can be used together.
Snapshot database scenario This scenario starts with SAP R/3 system TS1 running on the Primary server and clients using the Primary database. The Backup server has TS1 and DB2 stopped and DB2 file systems for data and logs unmounted. 1. From the Primary Server issue the suspend command on the Primary database: db2 “connect to ts1” db2 “set write suspend for database” 2.
Snapshot Database Scenario 27
Standby database scenario This scenario starts with the SAP R/3 system TS1 running on the Primary server. On the Backup server, TS1 is stopped and the DB2 filesystems for data and logs are unmounted. This scenario assumes that the FlashCopy pairs and tasks are already defined on the ESS Copy Services Server. Because the standby scenario requires logs from the Primary database to be applied to the Backup database, configure the SAP DB2 userexit program to copy the log files to the Backup server.
6. Start the DB2 instance db2ts1 on the Backup server: db2start 7. Place the Backup database into a rollforward pending state, and take it out of its suspended state: db2inidb ts1 as standby 8. As DB2 log files are successfully getting archived to the archive directory on the Primary database, make them available to the retrieve path for the Backup database. Be careful not to roll forward through a log file on the Backup server that is only partially copied to the retrieve directory. 9.
before the logic error occurred. If the database needs to be recovered to the point when the Primary server failed, then a rollforward to end of logs should be performed: db2 “rollforward database ts1 to end of logs and stop” or db2 “rollforward database ts1 to stop” 2000-06-19-20.57.00.0000 and 15.
Split-Mirror online backup scenario This scenario starts with the SAP R/3 system TS1 running on the Primary server. The Backup server has TS1 stopped and DB2 file systems for data and logs unmounted. Attention: This scenario is currently not supported for databases that contain SMS tablespaces. 1. NFS-mount the log directory of the system where you want to restore the backup and configure the SAP DB2 userexit program so that it copies the log files to this directory: in the configuration file initTS1.
7. The following command places the Backup database into a rollforward pending state and take it out of a suspended state: db2inidb ts1 as standby 8. Perform a DB2 backup on the Backup server using the supported backup system: db2 “backup database ts1 to /backupfs” 9. Stop the DB2 instance on the Backup server: db2stop 10.
5.
Split-mirror restore scenario This scenario starts with the SAP R/3 system TS1 running on the Primary server. The Backup server has TS1 stopped and DB2 file system for data and logs unmounted. 1. Edit the userexit program and place it in the appropriate directory on the Primary server so DB2 knows where archived logs are located. The user exit program will archive the logs. 2. Issue the suspend command on the Primary database: db2 “connect to ts1” db2 “set write suspend for database” 3.
mount /db2/TS1/sapdata6 mount /db2/TS1/sapdata7 9. Start the DB2 instance on the Primary server: db2start 10. On the Primary database issue the db2inidb command to take the database image out of a suspended state and place it into a rollforward pending state: db2inidb ts1 as mirror 11. On the Primary database, rollforward through the DB2 logs and stop.