DBA_DB6

175
Database Administration Guide Database Administration Guide Database Administration Guide Database Administration Guide SAP SAP SAP SAP ® on IBM DB2 on IBM DB2 on IBM DB2 on IBM DB2 Universal Database Universal Database Universal Database Universal Database for UNIX and for UNIX and for UNIX and for UNIX and Windows Windows Windows Windows

description

DBA_DB6

Transcript of DBA_DB6

  • Database Administration GuideDatabase Administration GuideDatabase Administration GuideDatabase Administration Guide

    SAPSAPSAPSAP on IBM DB2 on IBM DB2 on IBM DB2 on IBM DB2

    Universal DatabaseUniversal DatabaseUniversal DatabaseUniversal Databasefor UNIX andfor UNIX andfor UNIX andfor UNIX andWindowsWindowsWindowsWindows

  • Copyright 2002 SAP AG. All rights reserved.

    No part of this publication may be reproduced or transmitted in anyform or for any purpose without the express permission of SAP AG.The information contained herein may be changed without priornotice.

    Some software products marketed by SAP AG and its distributorscontain proprietary software components of other software vendors.

    Microsoft, WINDOWS, NT, EXCEL, Word, PowerPoint andSQL Server are registered trademarks of Microsoft Corporation.

    IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex,MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries,pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner, WebSphere,Netfinity, Tivoli, Informix and Informix Dynamic Server

    TM are

    trademarks of IBM Corp. in USA and/or other countries.

    Linux is are registered trademark of Linus Torvalds and othersORACLE is a registered trademark of ORACLE Corporation.

    UNIX, X/Open, OSF/1, and Motif are registered trademarks ofthe Open Group.

    Citrix, the Citrix logo, ICA, Program Neighborhood , MetaFrame,WinFrame, VideoFrame, MultiWin and other Citrix product namesreferenced herein are trademarks of Citrix Systems, Inc.

    HTML, DHTML, XML, XHTML are trademarks or registeredtrademarks of W3C, World Wide Web Consortium, MassachusettsInstitute of Technology.

    JAVA is a registered trademark of Sun Microsystems, Inc.

    J2EE is a registered trademark of Sun Microsystems, Inc.

    JAVASCRIPT is a registered trademark of Sun Microsystems, Inc.,used under license for technology invented and implemented byNetscape.

    SAP, SAP Logo, R/2, RIVA, R/3, SAP ArchiveLink, SAP BusinessWorkflow, WebFlow, SAP EarlyWatch, BAPI, SAPPHIRE,Management Cockpit, mySAP, mySAP.com, and other SAP productsand services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and inseveral other countries all over the world. MarketSet and EnterpriseBuyer are jointly owned trademarks of SAP Markets and CommerceOne. All other product and service names mentioned are thetrademarks of their respective owners.

    DisclaimerSome components of this product are based on Java. Any codechange in these components may cause unpredictable and severemalfunctions and is therefore expressively prohibited, as is anydecompilation of these components.

    Any Java Source Code delivered with this product is only to be usedby SAPs Support Services and may not be modified or altered in anyway.

    Documentation in the SAP Service MarketplaceYou can find this documentation at the following address:http://service.sap.com/xxxxxxxxhttp://service.sap.com/xxxxxxxxhttp://service.sap.com/xxxxxxxxhttp://service.sap.com/xxxxxxxx

    SAP AGSAP AGSAP AGSAP AGNeurottstrae 1669190 WalldorfGermanyT +49/18 05/34 34 24F +49/18 05/34 34 20www.sap.comwww.sap.comwww.sap.comwww.sap.com

  • Typographic Conventions

    Type Style Represents

    Example Text Words or characters thatappear on the screen. Theseinclude field names, screentitles, pushbuttons as well asmenu names, paths andoptions.

    Cross-references to otherdocumentation

    Example text Emphasized words or phrasesin body text, titles of graphicsand tables

    EXAMPLE TEXT Names of elements in thesystem. These include reportnames, program names,transaction codes, tablenames, and individual keywords of a programminglanguage, when surrounded bybody text, for example,SELECT and INCLUDE.

    Example text Screen output. This includesfile and directory names andtheir paths, messages, namesof variables and parameters,source code as well as namesof installation, upgrade anddatabase tools.

    Example text Exact user entry. These arewords or characters that youenter in the system exactly asthey appear in thedocumentation.

    Variable user entry. Pointedbrackets indicate that youreplace these words andcharacters with appropriateentries.

    EXAMPLE TEXT Keys on the keyboard, forexample, function keys (suchas F2) or the ENTER key.

    Icons

    Icon Meaning

    Caution

    Example

    Note

    Recommendation

    Syntax

  • Database Administration Guide: SAP on IBM DB2 UDB for UNIX and Windows

    4 May 2002

    Contents

    1 Introduction......................................................................................... 71.1 About this Guide.....................................................................................7

    1.1.1 Who Should Use this Guide ..........................................................................................71.1.2 How this Guide is Structured.........................................................................................8

    1.2 Naming Conventions..............................................................................91.3 New Features ........................................................................................10

    1.3.1 Admin Tools: Enhancements and Changes................................................................101.3.2 DB2 UDB for UNIX and Windows Version 7: Enhancements.....................................13

    2 Basic Concepts................................................................................. 162.1 Introduction...........................................................................................16

    2.1.1 The SAP DB2 Admin Tools.........................................................................................162.1.2 User Interfaces............................................................................................................17

    2.2 SAP Log File Management...................................................................182.2.1 Recovery - The Need for Log Files .............................................................................182.2.2 Recovering Log Files (User Exit, brarchive, brrestore) ...............................................202.2.3 Log File Life Cycle (Archive and Restore) ..................................................................222.2.4 Log File Deletion .........................................................................................................252.2.5 Protocols .....................................................................................................................262.2.6 Raw Device Log Files .................................................................................................272.2.7 Log File States ............................................................................................................272.2.8 Special Cases - Non-Standard Behaviour of Database Systems...............................28

    2.3 SAP Security Concept..........................................................................292.4 Multi-Node Systems (DB2 UDB EEE for UNIX and Windows)...........30

    3 Installation and Setup ...................................................................... 313.1 Introduction...........................................................................................313.2 SAP System Environment....................................................................33

    3.2.1 SAP System Users and Groups..................................................................................333.2.2 User Environment........................................................................................................353.2.3 Access Privileges for Admin Tool-Related Directories................................................37

    3.3 Installing the Admin Tools Manually...................................................383.3.1 Prerequisites for the Admin Tool Installation ..............................................................393.3.2 General Information.....................................................................................................413.3.3 Upgrading the Admin Tools.........................................................................................423.3.4 Installing the Latest Admin Tools ................................................................................423.3.5 Checking the Admin Tools Environment.....................................................................433.3.6 Actions Performed by the sddb6ins Program .............................................................443.3.7 Special Configurations ................................................................................................483.3.8 Enabling the Database for Roll-Forward Recovery.....................................................48

    3.3.8.1 Enabling Roll-Forward Recovery for DB2 UDB EE...............................................493.3.8.2 Enabling Roll-Forward Recovery for DB2 UDB EEE.............................................50

    3.4 Installation and Setup of the DB2 Control Center Extensions .........523.4.1 Installation of the DB2 Control Center.........................................................................523.4.2 Installing the DB2 Control Center Extension...............................................................523.4.3 Setting Up the DB2 Control Center .............................................................................533.4.4 Using the DB2 Control Center Extensions..................................................................57

  • Database Administration Guide: SAP on IBM DB2 UDB for UNIX and Windows

    May 2002 5

    4 Configuration.................................................................................... 584.1 Changing the Admin Tools Configuration..........................................58

    4.1.1 Parameters Affecting Log File Management Storage.................................................584.1.2 Configuring the Admin Toosl using Environment File init.db6.....................60

    4.2 Configuring for Indirect Archiving ......................................................614.2.1 Indirect Archiving to Tape ...........................................................................................614.2.2 Indirect Archiving to TSM ............................................................................................66

    4.3 Configuring for Direct Archiving.........................................................674.3.1 Archiving Directly to TSM............................................................................................674.3.2 Archiving to an Alternative Storage Management Product .........................................68

    4.4 Configuring TSM (Tivoli Storage Management).................................684.4.1 Configuring TSM Files dsm.opt and dsm.sys .............................................................694.4.2 Configuring TSM Environment Variables....................................................................70

    4.5 DB2 Configuration Parameters ...........................................................734.6 Disk Space Considerations for Running the Admin Tools ...............74

    5 Regular Administration.................................................................... 765.1 DB2 Log File Management...................................................................76

    5.1.1 Archiving Log Files from Disk to Tape or TSM ...........................................................765.1.2 Deleting Log Files........................................................................................................78

    5.2 Storage Management ...........................................................................805.2.1 Checking the Space Available in a File System..........................................................805.2.2 Checking the Space Available in a Tablespace..........................................................815.2.3 Checking the Size of Tables and Indexes...................................................................82

    5.3 Performance Monitoring ......................................................................825.3.1 Monitoring Database Performance .............................................................................835.3.2 Monitoring Dynamic SQL Statements.........................................................................845.3.3 Updating Statistics for Database Tables and Check for Reorganization ....................855.3.4 Job Monitoring.............................................................................................................86

    5.4 Database Backup..................................................................................865.4.1 Backup Considerations ...............................................................................................875.4.2 Integrity of Backups.....................................................................................................875.4.3 Frequency of Backups and Time Required.................................................................88

    6 Advanced Tasks ............................................................................... 896.1 The db6util Tool....................................................................................896.2 Setting and Updating Passwords........................................................906.3 Using the Journal in the DB2 Control Center Extension...................906.4 Advanced Log File Management Tasks..............................................916.5 Reorganization of Tables and Tablespaces .......................................936.6 Redirected Restore...............................................................................94

    6.6.1 Tool Usage ..................................................................................................................956.7 Command Line Tasks Using DB6CLP ................................................986.8 Monitoring Database Alerts ...............................................................1006.9 Monitoring Lock Waits and Deadlocks.............................................1006.10 Managing Backups and Logs Archived on TSM............................100

    7 Emergency Tasks........................................................................... 1027.1 SAP Database Recovery ....................................................................1027.2 Log File Restore and Roll-Forward of the SAP Database ...............103

  • Database Administration Guide: SAP on IBM DB2 UDB for UNIX and Windows

    6 May 2002

    7.3 Recovery of the Admin Database......................................................107Appendix A: Tool Line Command Line Parameters....................... 110

    brarchive - Log File Archive Tool............................................................110brdb6brt - Redirected Restore Tool ........................................................113brrestore - Log File Retrieval Tool ..........................................................117db2adutl - DB2 TSM Management Tool ..................................................120db2ckbkp - DB2 Check Backup Utility....................................................122db2trc - DB2 Trace....................................................................................123db2uext2 - DB2 User Exit.........................................................................126db6adutl - SAP TSM Management Tool ..................................................127db6util - Tool to Assist Database Administration..................................128dmdb6bkp - Database Backup Tool........................................................130dmdb6srp - Update Statistics Tool .........................................................131dmdb6rts - Table Reorganization Tool ...................................................133sddb6ins - Admin Tools Installation Program .......................................134sddb6mir - Admin Database Creation and Mirror Tool Utility...............136

    Appendix B: Troubleshooting.......................................................... 137DB2 Traces................................................................................................137

    DB2 Trace Facility db2trc ...................................................................................................137DB2 CLI Trace....................................................................................................................138

    Admin Tools Traces .................................................................................139Downloading Admin Tool Patches from SAP Service Marketplace...................................140

    Troubleshooting Admin Tools and Programs........................................141General Troubleshooting Comments .................................................................................141Initial Troubleshooting Steps..............................................................................................142Installation (sddb6ins) Troubleshooting .............................................................................142User Exit Troubleshooting..................................................................................................143brarchive/brrestore Troubleshooting ..................................................................................147DB2 Control Center Extension Troubleshooting ................................................................159Collecting Diagnostic Information for SAP Support ...........................................................160

    Appendix C: Implementation Details............................................... 161Admin Database Structure ......................................................................161

    brarchive/brrestore/backend Library Architecture ..............................................................165DB2 Control Center Extensions Architecture ........................................166

    Appendix D: Example of File init.db6............................... 167File Format ................................................................................................167File init.db6 on UNIX .................................................................167File init.db6 on Windows ..........................................................169

    Appendix E: References ................................................................... 170DB2 UDB for UNIX and Windows V7 - Additional Documentation .......170

    Glossary and Index ........................................................................... 172

  • 1 Introduction

    May 2002 7

    1 Introduction

    1.1 About this GuideThis guide supplies information specific to the SAP environment and describes dailyadministration tasks using both product tools and the SAP-specific administration tools. Theguide was written based on DB2 UDB Version 7 as the underlying database release. Theconcepts described in this guide are also expected to apply to other DB2 UDB databaseversions.

    The information in this guide has been collected from a variety of sources such as previousadministration guides, SAP Notes and customer experience and gives the administrator asingle point of reference. The information is presented in a task-oriented form, separatinginformation frequently needed from that which the administrator only requires, for example, inan emergency. It also includes a new troubleshooting section giving advice about solvingproblems before contacting SAP, or what information to send to SAP if no solution can befound.

    This guide, originally rewritten for SAP Web AS Release 6.10, now alsoincludes information for SAP Basis Release 4.6D. The latest 4.6D Admin Toolpatches provide almost identical functionality to the current 6.10 Admin Toolversion. The major differences involve directory paths, as these werechanged for SAP Web AS Release 6.10, to simplify administration.Care should be therefore taken when using the guide, to make sure that thecorrect release-specific sections are read.

    1.1.1 Who Should Use this GuideThis book is intended primarily for Database Administrators and SAP system administratorswho need to install and maintain a SAP system running on DB2 UDB for UNIX and Windows.It is structured to be of use to both people new to database administration and experiencedSAP administrators alike, including those with experience with other database products.

    It will also be of use to a range of customer support functions when planning, installing, andmaintaining systems, or assisting in these tasks.

  • 1 Introduction

    8 May 2002

    1.1.2 How this Guide is StructuredThis guide is divided into the following sections:

    Chapters1. Introduction

    Provides general information about the guide, its targeted audience, interfaces, namingconventions and new features.

    2. Basic ConceptsDescribes administration and Admin Tools and the related concepts, including DB2 UDB-specific information on installing and configuring servers and clients for the SAP system.

    3. Installation and SetupExplains how to install Admin Tool patches and deal with upgrades. It also covers manual(re)installation of the tools if required.

    4. ConfigurationDescribes the available options and steps required to configure the Admin Tools.

    5. Regular AdministrationLists and describes tasks that system administrators need to perform on a regular basissuch as storage administration, backup and log file management.

    6. Advanced TasksCovers one-time or rarely needed tasks not related to configuration. Some tasks may beprerequisites for other day-to-day tasks, which must be performed before log files can bestored to tape.

    Also includes monitoring and performance considerations.

    7. Emergency TasksTasks that administrators may need to perform after a database failure.

    AppendicesA. Tool command line parameters

    Detailed command line syntax for each command.

    B. TroubleshootingWhat to do when tools do not work as expected.

    C. Implementation detailsInternal tool information, especially for support personnel.

    D. Example of the configuration file init.db6E. ReferencesF. Glossary and Index

  • 1 Introduction

    May 2002 9

    1.2 Naming ConventionsTerminology

    For information on terminology used in this guide, see Glossary and Index[Page 172].

    Product NamesIn this guide the following naming conventions apply:

    SAP Web Application Server / SAP SystemSAP Web Application Server is referred to as SAP Web AS or SAP System. Additionally theterm SAP System also refers to other components of mySAP.com.

    DB2 / EE / EEE / IBM DB2 Universal Database for UNIX and WindowsIBM DB2 Universal Database for UNIX and Windows is referred to as DB2 UDB for UNIX andWindows, DB2 or EE-systems.

    IBM DB2 Universal Database Enterprise Edition for UNIX and Windows is referred to as DB2UDB EE.

    IBM DB2 Universal Database Enterprise Edition - Extended for UNIX and Windows isreferred to as DB2 UDB EEE or EEE-systems.

    Tivoli Storage Management (TSM) / ADSMThe IBM storage product ADSM has been renamed to TSM (Tivoli Storage Manager) in themost recent versions. The names are often used interchangeably, but in this guide theproduct is referred to as TSM. The term ADSM is normally only used in this guide to indicateprogram parameters or configuration parameter names.

    Tivoli (IBM) no longer supports the product ADSM. Customers still usingADSM are strongly advised to upgrade to TSM Client Version 4.1 or higher.Serious problems have been experienced when using the Admin Tools withTSM Version 3.7. This version is also now out of service, so an upgrade isalso strongly advised.

    WindowsThe term Windows refers to Windows 95, Windows 98, Windows NT, or Windows 2000.

    Servers can only be installed on Windows NT or Windows 2000. Clients can be installed onany Windows platform.

  • 1 Introduction

    10 May 2002

    1.3 New FeaturesThis section is only intended for experienced users wishing to understand how the AdminTools and related aspects of DB2 have changed compared to earlier versions.

    1.3.1 Admin Tools: Enhancements and ChangesThis section refers to the Admin Tools release and not the SAP system release, which do notneed to be the same.

    The 4.6D Admin Tools should be used on all SAP 3.1I to 4.6D systems whereDB2 UDB for UNIX and Windows Version 6 or higher is installed.The 6.10 Admin Tools should be used with all SAP system releases aboveand including 6.10.

    The log file management tools for a given release and patch level now allhave the same patch number.

    Release-Independent Changes to the Admin ToolsThe following items are entirely or almost release-independent. Differences between releasesare described in subsections with the same name in the release-specific sections below:

    Installation program sddb6ins

    The command line syntax has been simplified by extracting information from theenvironment. The sddb6ins program now also contains the remaining Admin Tools,which it installs. sddb6ins therefore no longer requires a separate DBATOOLS.SAR file,and the shared library path environment variable must no longer be set before starting it.

    The Admin Tool installation program sddb6ins now checks many aspects of theenvironment to locate the majority of problems experienced by customers. A difficultywith the Admin Tools in the past has been the runtime environment. Admin Tool files anddirectories may have been unintentionally removed or were given the wrong ownership orpermissions; Environment variables may have been set to non-existent directories, andso on.

    For more information, see Installing the Admin Tools Manually [Page 38].

    Deleting unknown TSM files with brrestore

    The log file management tool brrestore now allows removal of files from TSM, whichare not known to the Admin Database. This is done by specifying a file pattern, either tomatch log files (*.LOG and *.LOG.*), or Admin Database safety files (*.SAR).

    The syntax is as follows:brrestore delete [file pattern]

  • 1 Introduction

    May 2002 11

    Support for SAP Feature MCODTypically, only a single SAP system (component) is installed on a single database. SAPnow supports the installation of multiple components on one database (MCOD).

    The Admin Tools have been modified to support this SAP feature. They are only installedwith the first SAP system, that is, only once per database. As log files are shared by allthe SAP systems using the same single database, the user db2 and alladm users can perform log file management tasks.

    It is necessary to differentiate between the SAP system ID and the SAPsystem database name , as these are no longer necessarily the same.Additionally, user IDs and directory names may be affected. If and have the same value, as is often the case for the first SAP system installed on adatabase, the old terminology still applies.

    However, there is a limitation in SAP 4.6x releases, that the initial SAP system musthave the same ID as the SAP database. Further SAP systems have different IDs.

    The following terminology conversions must be used:

    SAP System and Database Name Descriptions

    ID Old New

    SAP system ID , ,

    SAP databasename

    , ,

    User ID Descriptions

    User Old ID New ID

    Database instanceowner

    db2 db2

    SAP databaseadministrator

    adm adm

    Database connectuser

    sapr3 sap

    sapr3 is still usedfor the first SAPsystem in a 4.6Dsystem environment.

    Directory Names Descriptions

    Directory Old Name New Name

    SAP system relateddirectories

    db2 homedirectory andsubdirectories

  • 1 Introduction

    12 May 2002

    The following are examples of how the descriptions of directory names havechanged compared to earlier versions of this guide (on UNIX systems). If and are the same, the real directory name aftersubstitution remains unchanged:

    Old New/usr/sap//sys/exe/run

    /usr/sap//sys/exe/run

    /db//log_dir /db//log_dir

    If the original SAP system is removed, certain Admin Tools are no longer fullyfunctional. This restriction only applies to 4.6D SAP systems.From SAP release 6.10 and higher, it is only necessary to verify that thedb2 user is set up correctly. Use sddb6ins checkonly to verifythis. This user may require changes to his environment.

    For more information on released platforms and availability, choose Platform Availabilityfor mySAP.com Multiple Components on one Database (MCOD) in the SAP ServiceMarketplace at: http://service.sap.com/platforms

    64-bit supportThe Admin Tools have been modified to work with 64-bit platforms.

    4.6 D Admin Tools - Patch 19 and HigherThis section provides information on the enhancements and changes that have beenspecifically implemented for the 4.6D Admin Tools (patch 19 and higher):

    Support for SAP Feature MCODThere is a limitation in SAP 4.6x releases, that the initial SAP system must have the same IDas the SAP database. Additional SAP systems have different IDs.

    The database connect user is still sapr3 for the first SAP system in a 4.6D systemenvironment.

    6.10 Admin Tools Patch 8 and HigherThe following list provides information on the enhancements and changes to the 6.10 AdminTools that have been implemented for the 6.10 Admin Tools (patch 8 and higher):

    New directory structureTo reduce the dependencies between the almost release-independent Admin Tools andrelease-dependent SAP products, the Admin Tools, their configuration file, protocol andtrace files have been moved. For example, unlike Admin Tool versions up to 4.6D, the6.10 Admin Tools no longer need to be reinstalled after an SAP system upgrade.

    For more information, see Installing the Admin Tools [Page 38].

  • 1 Introduction

    May 2002 13

    Support for multiple components on one database (MCOD)The 6.10 Admin Tools fully support the installation of several SAP systems on onedatabase.

    Unlike SAP Basis Release 4.6D, the initial SAP system must not necessarilyhave the same ID as the SAP database . Additionally, the new connect user forthe database sap replaces the user sapr3.

    If a MCOD system is removed, you must make sure that the db2 userenvironment still points to a valid MCOD system using the same database.

    ADM database mirroring no longer required

    In the past, the Admin DB ADM was mirrored to the SAP database to reduce therisk of losing data. This has proven to be unnecessary. Thus, the program sddb6mirthat was used to perform this action is no longer required. When SAP System log filesare stored directly by the User Exit to TSM, the administration database is not requiredand so no backup (mirror) of this database is needed. If log files are stored usingbrarchive, a safety copy of the Admin Database is stored to the same medium as thelog file(s) at the end of each brarchive run.

    For more information on how to recover the Admin Database, see Recovery of the AdminDatabase [Page 107].

    Update table and index statisticsFor information on how to update table and index statistics from a SAP transaction, seethe SAP Online Documentation in the SAP Library: SAP Web Application Server Computing Center Management System Computing Center Management System CCMS: SAP/DB2 UDB for UNIX and Windows

    1.3.2 DB2 UDB for UNIX and Windows Version 7: EnhancementsThe following are the major new features in Version 7.1 and Version 7.2, which are relevantto the Admin Tools:

    Version 7.1 Closing the Active Log File after Backup

    After an online backup is complete, DB2 forces the currently active log file to be closedand as a result it will be archived. This ensures that an online backup has a complete setof archived log files available for recovery.For more information, see the IBM documentation DB2 Administration Guide:Implementation

    On Demand Log Archive SupportIt is now possible to force the currently active log file closed, which is then automaticallyarchived by DB2 if the User Exit is enabled. This feature gives database administratorsmore granular control over their backup and restore strategy.For more information, see the IBM documentation DB2 Administration Guide:Implementation.

  • 1 Introduction

    14 May 2002

    Increased Log Limit to 32 GBThe maximum size of (the sum of) all log files has been increased from 4 GB to 32 GB.This enables applications to perform extremely large amounts of work within a singletransaction.For more information, see the IBM documentation DB2 Administration Guide:Implementation.

    Rename a TablespaceWhen creating a tablespace, you specify its name. In previous versions, it was notpossible to change that name again during the lifetime of the tablespace object. Now, anadministrator can rename a tablespace with the RENAME TABLESPACE statement.For more information, see the IBM documentation DB2 Administration Guide:Implementation.

    Version 7.2 Block Transactions When Log Directory is Full

    DB2 Version 7.2 provides a new registry variable DB2_BLOCK_ON_LOG_DISK_FULL,which is used to prevent disk full errors from being generated when DB2 cannot create anew log file in the active log path. DB2 attempts to create the log file every five minutesand writes a message to file db2diag.log after each attempt. This file indicates if yourapplication is hanging.

    For more information on the DB2 instance variable DB2_BLOCK_ON_LOG_DISK_FULL ,see the DB2 Release Notes.

    Suspended I/OSupports continuous system availability, while allowing online split mirror handling of thedatabase. By momentarily suspending I/O to disk, DB2 will ensure that the split mirrorcopy maintains its integrity. A new utility db2inidb has been created that operates onsplit mirror copies.

    For more information, see the DB2 Release Notes.

    Backup from Split ImageDB2 Version 7.2 allows you to perform a backup from a split image, following the use ofthe db2inidb utility:

    When you use the snapshot option, the database will perform crash recovery, start a newlog chain and will not be able to roll forward through any of the logs from the originaldatabase. The database is available for any operation including backup.

    When you use the standby or mirror option, crash recovery is not performed. Thedatabase remains in an inconsistent state, with in-flight transactions still outstanding. Thedatabase is placed in roll-forward recovery.

    The ability to backup from the split mirror allows the administrator to perform an offlinebackup of the entire database, while the original database remains online.

  • 1 Introduction

    May 2002 15

    Log file management tools limitation:The split image option normally results in no further standard backups beingtaken on the primary (non-mirror) SAP system database. Backups taken onthe mirror database are not seen on the primary system and the SAP log filemanagement tools are unable to fully administer the data in the Admin DB.Therefore, the Admin Tools currently only fully support log file managementusing Direct archiving to TSM (without the Admin DB) on SAP systems whereno standard backup is being performed. For more information, see ArchivingDirectly to TSM [Page 67].

    Dual loggingDB2 now has the capability to mirror the active log files to protect databases fromaccidental deletion of an active log and data corruption caused by a hardware failure. Anew registry variable DB2_NEWLOGPATH2 instructs the database to write an identicalcopy of the log files to a different path on a physically separate disk.

    Parallel RecoveryDB2 now uses multiple agents to perform both crash recovery and database roll-forwardrecovery. This may improve performance on SMP machines.

    Incremental and Delta BackupsTwo types of incremental backup are supported:

    Incremental backup:

    Only contains pages modified since the last full database or tablespace backup.

    Delta backup:

    Only contains data that has changed since the last tablespace backup (full,incremental, or delta backup).

  • 2 Basic Concepts

    16 May 2002

    2 Basic Concepts

    2.1 IntroductionThis chapter describes the concepts relating to the Admin Tools, and terminology usedthroughout this guide. Much of this terminology is described in Glossary and Index [Page172].

    This guide includes new and updated information that was not available inprevious versions.

    We recommend that all readers read at least the notes and warnings .

    2.1.1 The SAP DB2 Admin ToolsThe Admin Tools, officially known as the SAP DB2 Administration tools, are a collection oftools specific to the SAP environment, which supplement standard DB2 tools. They can bedivided into the following categories:

    Log file management tools

    Database backup and restore support tools

    Performance related tools

    In addition to the tools themselves, a graphical interface has been created that simplifiesaccess to several of the Admin Tools: The DB2 Control Center Extensions. These areextra menu options and windows that are available in the DB2 Control Center after theextensions are installed. The following graphic shows the relationship between the AdminTools and the DB2 Control Center Extensions plus the SAP system and database.

    SAP database

    SAP System

    SAP processes

    DB2 Control Center+ SAP Extensions

    Mon

    itor

    + Ex

    ecut

    e

    Monitor+ Execute

    Admin databaseADM

    Protocol+ Query

    Execute

    Admin Tools

    Configure+ Query

  • 2 Basic Concepts

    May 2002 17

    2.1.2 User InterfacesSystem administrators can perform the DBA tasks using the following interfaces:

    DB2 Command Line Processor (CLP)Used to execute database utilities, SQL statements and get online help. It offers a varietyof command options, and can be started in interactive input mode, command mode andbatch mode. For more information, see the DB2 Command Reference.

    DB2 Control Center (DB2CC)DB2 tool offering a graphical user interface that simplifies administrative tasks such asconfiguring the database, backup and recovery, scheduling jobs, and managing media.To start the DB2 Control Center use the db2cc command on the command line, or useStart panels on Windows platforms. The DB2 Control Center can be extended with theSAP Admin Tool Control Center extensions to support SAP-specific tasks related to logfile management. You can also access tools such as DB2 Visual Explain and DB2Performance Monitor from the DB2 Control Center.For introductory help, choose Help Getting Started.

    Operating System Command LineThis can be used to perform the majority of tasks described in this guide. Generally this isthe fastest and most flexible method, but may require user knowledge of complexcommand syntax. The system administrator can also use this interface to automatetasks, for example, by writing scripts or batch files.

    SAP TransactionsThese provide an additional graphical interface for starting specific tasks. The number ofavailable tasks is limited, but they are often neither platform nor database-specific and socan be used in a mixed environment.

  • 2 Basic Concepts

    18 May 2002

    2.2 SAP Log File ManagementThis section explains why log file management is an essential part of system administration,and how the Admin Tools assist in this task. It covers the following topics:

    Recovery (The need for log files)

    Recovering log files (User Exit, brarchive and brrestore)

    The life cycle of log files

    Deletion of log files

    Protocols

    Raw device log files

    Log file states

    Special cases Non-standard behavior of log files

    2.2.1 Recovery - The Need for Log FilesOnce a database is up and running, one of the most essential tasks for a databaseadministrator is the management of database backups and log files to ensure that databasescan be recovered after a serious failure. The DB2 Database Manager generates log files tokeep track of changes made to the database. These log files are required for the followingpurposes:

    Explicit and implicit roll-backWhen a database transaction is rolled back all changes are undone.

    Explicit roll-backAn application indicates that changes that it started to make to the database areinvalid.

    Implicit roll-backA program making changes to the database does not commit changes before exiting,either through incorrect programming or a crash.

    In both cases the database needs log file information to return the database to the state itwas in before the changes were made.

    Database recoveryThe DB2 Database Manager may be forced to restart without applications being able toclose all open transactions. The log files containing the information about changes madeby these transactions are required to perform database recovery when the databasemanager is started again. This involves rolling back (undoing) all open transactions for allapplications.

  • 2 Basic Concepts

    May 2002 19

    Database restoreA database can be recreated by restoring a previous backup. A backup represents thestate of a database at the time the backup was performed, but does not containinformation about transactions completed after this time. Therefore, after a backup imageis used to restore a database, log file data generated after the backup was taken must beadded to the database again, to bring the database completely up-to-date. This processis known as roll-forward recovery. The command to add the log file information is DB2ROLLFORWARD.

    Restoring from an offline backup image

    Such a database is immediately usable after the ROLLFORWARD STOP sub-command. Alternatively, log files can be first applied to bring the database up to date(to end of logs).

    Restoring from an online backup image

    In the case of an online backup, the log files generated while the backup operationwas running are also required, as transactions may have modified the databasecontents during the time of the backup. Without this additional data the restoreddatabase cannot be activated. The database must be rolled forward to at least thepoint in time when the backup operation completed, to ensure that the data isconsistent throughout the database.

    Roll-back and database recovery do not normally require user intervention. The DB2Database Manager retains all log files as long as they contain information from opentransactions. User intervention is only required if the directory where the database managerstores log files is damaged or lost. This directory is known both as the LOGPATH andlog_dir. In case of loss or damage, you can recover at least those files that have beensuccessfully archived with the tools described below.

    If the LOGPATH directory is changed and then the subdirectory or any requiredlog files in that subdirectory are removed, DB2 will look for log files in thedefault log path (SQLOGDIR) when the database is activated. If the log filesare not found, the database will enter a backup pending state.

    In connection with roll-forward operations, DB2 version 7 supports a log overflow directory.The roll-forward operation first checks for logs in the location specified by the LOGPATHdatabase configuration parameter. If you have moved any logs from the location specified bythe log path parameter, use the ROLLFORWARD overflow directory parameter to specifythe path to the logs that you moved. This is especially important in connection with recoverywhen logging to raw devices.

  • 2 Basic Concepts

    20 May 2002

    2.2.2 Recovering Log Files (User Exit, brarchive, brrestore)The tools db2uext2 (the User Exit), brarchive and brrestore were developed as the logfile management component of the Admin Tools. Their main purposes are:

    To archive log files

    To assist database administrators perform database roll-forward operations after adatabase restore.

    The Admin Tools are automatically installed as part of an SAP system installation withR3SETUP. If you install your SAP system with SAPinst, the Admin Tools are no longerautomatically installed. You can manually (re)install, upgrade or patch the Admin Tools usingthe sddb6ins program. For more information, see Installing the Admin Tools Manually [Page38].

    Roll-forward recovery is not enabled by default. Unless otherwise configured, the DB2Database Manager reuses a fixed number of log files in a circular fashion, for example,0,1,2,3,0,1,2,3,1 and so on. This behavior can be modified so that the database manageruses log files in an ascending order, for example, 0,1,2,3,4,,9999999. By default, thedatabase manager also does not start any application (User Exit) to independently archivefull log files for later recovery.

    Database administrators are strongly recommended to activate both these items in the SAPenvironment. This is done by setting the following database configuration parameters to ON:

    LOGRETAIN

    Roll-forward recovery is enabled by turning on this parameter. That is, circular loggingis turned off and each new log file has a higher number.

    Each time the LOGRETAIN parameter is turned off and on again, the databasemanager resets log file numbers and starts from zero again. This can result inseveral log files having the same log file number on a given node. The logfiles management tools only directly support recovery of the most recentversion of log files. Recovery of older versions must be done manually.

    USEREXIT

    The User Exit mechanism is enabled by turning on this parameter. The User Exit isautomatically started by the DB2 engine each time a log file becomes full.

    A backup is required after setting the LOGRETAIN parameter (or both), after which thedatabase can be started again.

    To perform online backups, the database must be operated in roll-forwardrecovery mode. To restore the database from an online backup, all log files inuse during the online backup operation must be available to complete therestore operation.

  • 2 Basic Concepts

    May 2002 21

    Once these parameters have been turned on and a backup has been performed, the AdminTools can be used to archive log files. The User Exit (db2uext2) is then automaticallystarted by the database each time a log file is filled. Depending on how it is configured, theUser Exit either archives log files directly to a storage management product, or it copies thelog files to the directory referred to as LOG ARCHIVE (as defined by theDB2DB6_ARCHIVE_PATH environment variable). Groups of files in the LOG ARCHIVEdirectory can then be archived to tape or TSM using brarchive later.

    The database can be recovered later using the DB2 commands RESTORE andROLLFORWARD. Dependent on the configuration, the User Exit either retrieves log filesdirectly from the chosen repository, or from the LOG ARCHIVE and/or LOG RETRIEVEdirectories. The latter is the directory (defined by the DB2DB6_RETRIEVE_PATH environmentvariable) to which log files are restored using brrestore. To complete a roll-forwardoperation (other than stop), brrestore and ROLLFORWARD operations may need to beperformed repeatedly until all required log files have been retrieved and rolled into thedatabase.

    If the database is not rolled forward to the end of all logs when restarted, thedatabase manager will create new log files starting with the numberimmediately following the last log file that was rolled into the database. Thiscan result in several log files having the same log file number on a givennode. The tools only directly support recovery of the most recent version oflog files. Recovery of older versions must be done manually.

    Running the User Exit, brarchive and brrestoreThe User Exit does not need to be started by a user it is automatically called by DB2 ifconfigured correctly. Both brarchive and brrestore can be called from within the DB2Control Center or can be started from the command line. brarchive can also be scheduledto be (regularly) started using the DBA Planning Calendar (SAP transaction DB13), orotherwise automated using scripts or batch files.

  • 2 Basic Concepts

    22 May 2002

    2.2.3 Log File Life Cycle (Archive and Restore)The following section covers the standard scenarios known as indirect and direct archiving.There is a third scenario, which is a variation of direct archiving, where the SAP User Exit isconfigured to call a vendor (foreign) User Exit. The log file cycle is similar to direct archivingwith the log files being copied elsewhere but the target and exact behavior are dependent onthe vendor User Exit.

    The graphic describes the possible life cycle of a log file when using the log file managementtools.

    S0000003.LOGS0000004.LOG

    /log_dir . User Exit offline retainedS0000005.LOG TSM or TAPES0000006.LOG S0000002.LOGS0000007.LOG archived retained

    online active User Exit restored retainedonline retained S0000000.LOG

    S0000001.LOG

    DirectTSM only

    /log_dir . S0000000.LOGS0000005.LOG S0000001.LOGS0000006.LOG User Exit S0000002.LOGS0000007.LOG S0000003.LOG

    online active S0000004.LOGonline retained archived retained

    ArchiveRestore

    /log_retrieve/

    LOGPATH DBM Parameter .

    DB2DB6_ARCHIVE_PATH

    LOGPATH DBM Parameter .

    brarchive

    brrestore

    DB2DB6_RETRIEVE_PATH

    /log archive/Indirect (default)

    (A)(B)

    (C)(D)

    (D)

    (A)

    (D)

    When the USEREXIT database configuration parameter is set, the database engineautomatically starts the User Exit program to archive each log file as soon as it is full or it isclosed . The location the file is moved to depends on the configuration of the User Exit. Bydefault, log files are archived indirectly by first copying the file to the LOG ARCHIVEdirectory. The User Exit can be reconfigured to archive directly using TSM or via analternative User Exit.

    The Admin Tools can only administer the latest version of a log file with agiven number per node, that is, you cannot administer two log files with thenumber 25 on node 0.

  • 2 Basic Concepts

    May 2002 23

    Indirect Archive and Restore (Default)Single log files are copied into the LOG ARCHIVE directory by the User Exit (see (A)).brarchive is then used to archive groups of offline log files into an archive repository (alsoknown as backend repository) (see (B)). File archival using the LOG ARCHIVE directory isreferred to as indirect archiving. TSM is the preferred solution for the backend repository.

    brrestore retrieves archived log files from the repository if they are no longer in the LOGARCHIVE directory, and places them in the LOG RETRIEVE directory (see (C)) where theUser Exit can access them.

    When requested by a ROLLFORWARD operation in connection with a database restore action,the User Exit retrieves log files from the LOG ARCHIVE and/or the LOG RETRIEVE directory(see (D)).

    Only indirect archive supports the cheaper tape option. However, before youdecide to use this solution you should take the following disadvantages intoconsideration: Log files are not immediately archived to long-term storage. Therefore,

    log files copied by the User Exit but so far not yet archived withbrarchive can be lost if the disk containing the log_archive directoryfails.

    The complexity of the solution, including additional storage directories andan extra Admin database, slightly increases the risk of failure..

    Direct Archive and RestoreDirect archive is the recommended method for log file archival, as it is the simplest andtherefore most reliable. Log files are archived immediately and directly to long-term storage.However, either TSM or another storage management product with its own User Exit isrequired.

    The User Exit can be configured to archive directly to TSM, or to call a vendor User Exit foran alternative storage product. The latter provides support for any products which provide aUser Exit, whilst ensuring that SAP tables containing log file information are also updated. Alater ROLLFORWARD operation, after restoring the database, results in the files beingautomatically restored from the same source. Log files are not renamed during directarchive or restore.

    We recommend that Database Administrators use direct archival for largersystems as it performs well and requires minimal maintenance.ROLLFORWARD operations after a database restore normally require no userinteraction when using direct archive.

    For more information on how to configure the User Exit and the Admin Tools in general, seeChanging the Admin Tools Configuration [Page 58].

  • 2 Basic Concepts

    24 May 2002

    Log File Naming ConventionThe log file names in the graphic above are simplified for readability depending on the waythey are archived:

    Direct archivingFiles are stored to the backend without their names being modified.

    Indirect archiving

    When the User Exit copies log files from the LOG DIR to the LOG ARCHIVE DIR, thefiles are renamed by appending the file-closure timestamp (14 digits) and the nodenumber (NODExxxx). In ROLLFORWARD mode, when the User Exit moves files from theLOG ARCHIVE PATH and/or LOG RETRIEVE PATH back to the LOG PATH, the originalname is restored. Otherwise, the files will not be recognized by DB2.

    For example, during archive, the copy of the file S0000001.LOG put in the LOGARCHIVE directory might be renamed toS0000001.LOG.20001130140536.NODE0000.A file restored by brrestore (in the LOG RETRIEVE directory) still has the extended filename.

    The name is first truncated back to its original form in the copy returned to the LOGPATHdirectory by the User Exit when it is called to retrieve files for a ROLLFORWARDoperation.

    DB2 log file names are of the format Snnnnnnn.LOG, where nnnnnnn is a seven digitnumber ranging from 0000000 to 9999999. When a database is first created, log filesstarting from S0000000.LOG are created. DB2 restarts the log file numbering sequence atS0000000.LOG under the following conditions:

    When the database configuration file is changed to enable archive logging

    When the database configuration file is changed to disable archive logging

    When the log file sequence wraps, that is after log S9999999.LOG is used

    The states a log file passes through, which appear in the above graphic (for example onlineactive), are described in the section Log File States in this chapter.

    Admin Tool Log File Management ModelWhenever a log file is archived, the User Exit also associates it with a database backuptimestamp (that is, the date and time of the most recent SAP system database backup orrestore operation whichever was performed most recently). The Admin Tools are then ableto tell the Database Administrator which log files are needed to roll forward a database after aspecific backup image has been restored. For more information, see Log File Restore andRoll Forward of the SAP Database [Page 103].

    In combination with the log file-close timestamp (another log file attribute), the backuptimestamp allows the Admin Tools to keep track of the restorable backup/log filecombinations. The Admin Tool GUI (DB2 Control Center extensions) also supports this.

  • 2 Basic Concepts

    May 2002 25

    Normally, only the Admin Tools should be used to manage log files. The filesshould not be moved or deleted manually as this will lead to datainconsistencies. The only exception to this is when restoring log files whichare no longer supported by the tools (see Invalid in the section Log File States[Page 27] in this chapter). Such files must have the timestamp and nodeextension removed from their names when they are put back in the LOGPATHdirectory.

    2.2.4 Log File DeletionLog Files on DiskLog files in the DB2 log file directory (log_dir) should not be deleted. The databasemanager automatically deletes or reuses these files after they have been successfullyarchived by the User Exit. Depending on the archiving method you choose, the followinghappens:

    If you chose direct archiving , no log file copies are made on disk and no deletion isneeded.

    If you chose indirect archiving, log files copied to the log_archive directory by the UserExit and later successfully archived using brarchive are only deleted from thelog_archive directory if this is explicitly requested. The same applies to log filesrestored to the log_retrieve directory by brrestore.

    In the latter cases deletion is requested by:

    Indicating deletion as part of a brarchive/brrestore operation (options -sd and ssd).

    Explicitly deleting log files in a later call to an Admin Tool (options -ds and dr). Logfiles no longer required on the backend should also be deleted using these tools.

    Be aware that the available disk space will eventually be exhausted if theUser Exit is unable to successfully archive log files over a long period of time.The same will happen if log files archived using brarchive and restoredusing brrestore are not deleted using the same tools.Tapes can be reused, but other backend storage should be cleaned upregularly using the Admin Tools. Storage management products often supplytheir own tools for doing this or can be configured to automatically remove oldfiles. However, it is essential that you use the Admin Tools to delete fileswhen using indirect archiving, as the Admin database is then also updated.

    Log Files in Long-Term Storage (Tape and TSM)Log files do not need to be explicitly deleted from tape. As soon as a tape is initialized orreused using brarchive, the previous files are no longer available and their Admindatabase entries are automatically removed.

  • 2 Basic Concepts

    26 May 2002

    You can delete log files as follows:

    Log files archived directly by the User Exit to TSM can be deleted using the tooldb6adutl.

    Log files archived using brarchive can be deleted from TSM using brrestore (option-delete).

    brrestore delete requires a backup timestamp as argument. This is notavailable on systems where no direct backup is taken, such as on certainsplit-mirror systems. In this case, only direct archiving is fully supported.

    2.2.5 ProtocolsThe User Exit (db2uext2), brarchive and brrestore generate protocol information torecord the actions that have been performed. Protocol information is also written into theAdmin Database by the log file management tools. This information can be used by the DB2Control Center Extensions. The Admin Database protocols are eventually deleted bybrarchive. The frequency can be configured using the DB2 Control Center Extensions.

    Protocol files should only be deleted by the system database administrator.The protocol files have the following form and are written to the following directories:

    Tool Protocol file(s) Location

    User Exit db2uext2.log.NODExxxxdb2uext2.err.NODExxxx

    (Files are appended)

    Directory defined by the DIAGPATHconfiguration parameter(db2 get dbm cfg )

    brarchive brarchive..lfa

    (One file per run) For 4.6 D Admin Tools:

    /saparch

    For 6.10 Admin Tools:/admintools/protocols

    brrestore brrestore..lfr

    (One file per run) For 4.6D Admin Tools

    /saprest

    For 6.10 Admin Tools:/admintools/protocols

    These tools can also write more detailed traces, normally only for use by support anddevelopment. For more information, see Appendix B - Troubleshooting [Page 137].

  • 2 Basic Concepts

    May 2002 27

    2.2.6 Raw Device Log FilesTo achieve maximum performance, it may be advisable to use raw devices for storing logdata. This has the effect of bypassing possible file system management overhead and allowsDB2 to manage the log data with optimum efficiency. However, it is generally easier to workwith log files in file systems, as these can be maintained and manipulated using standardoperating system tools.

    The Admin Tools fully support raw logs. The differences between file system-based loggingand raw device logging are hidden by the User Exit. The User Exit extracts raw data intoindividual files that then behave identically to non-raw log files.

    If you decide to use raw device logging, the following is necessary to enable roll-forwardduring database recovery. If logging information cannot be obtained from the log extentsavailable on the raw device, DB2 expects the logs to be in the log overflow directory. Toallow the User Exit to put missing logs into the log overflow directory, the ROLLFORWARDutility must specify the overflow log path parameter.

    2.2.7 Log File States

    This section is mainly written for system administrators and support personnelonly for use if problems involving the Admin Database occur.

    Within a SAP environment, in order for the tools to know what operations have beenperformed on a log file, it is defined to pass though the following states during its life cycle.This state information is stored in the Admin Database, so it is only relevant to systems usingthe (default) indirect archiving method. This information is consequently not stored onsystems performing direct archiving.

    The state names, which are used in the document, do not always correspondexactly with the DB2 literature.

    Online activeThe log file is currently being used to log transactions. The location of the log file isdefined in the LOGPATH configuration parameter of the database. This can be either a filesystem path or a raw device.

    Online retainedThe log file is no longer being written to by the database, but may contain informationabout transactions that the database engine has not yet written from the buffer pool todisk. The log file is located in the LOGPATH directory, and will also be in the LOGARCHIVE directory after the User Exit has run.

    Offline retainedThe log file is no longer being used and does not contain transactions with unwritten datapages. The log file is in the LOG ARCHIVE directory.

    The original log file will also remain in LOGPATH until the database is stoppedor the DB2 Database Manager reuses the file. However, the tools have noinfluence on this and so assume that the file is no longer there.

  • 2 Basic Concepts

    28 May 2002

    Archived retained

    The log file has been archived using brarchive. The location of the archived log file is astorage management product, for example, TSM (Tivoli Storage Manager) or tape. If notexplicitly deleted, the original log file is also still in the LOG ARCHIVE directory andno restore is possible (or necessary) as long as this original log file has not been deletedusing brrestore.

    Restored retained

    The log file has been restored using brrestore. The location of the restored log file isthe LOG RETRIEVE directory. If not explicitly deleted by using the -delete option in asubsequent operation, the archived log file is also still available on the backend.

    InvalidThe Admin Tools can only administer the latest version of a log file with a given numberper node. If the database generates a second log file with a number already used, theUser Exit marks previous versions as INVALID. This can occur after a database restoreif the ROLLFORWARD operation does not use all log files, or by turning the LOGRETAINdatabase configuration parameter off and on again. Older log files that have beenarchived can still be manually retrieved from the backend using system or storageproduct tools but the Admin Tools only support the retrieval of the newest version.

    GoneThis state is only used internally to indicate that a log file could not be found in thelocation where it was expected, for example if a customer uses MOVE, RENAME orDELETE. This state can also occur when storage products, such as TSM, automaticallydelete files after a certain period of time. A delete operation will delete such entries.

    2.2.8 Special Cases - Non-Standard Behavior of Database SystemsCertain systems are set up in a slightly non-standard way. These are, for example:

    Split-mirror

    Homogeneous system copy

    In both cases the Admin Tools are either restricted or must be configured differently.

    Split-mirror for backup purposesDB2 has introduced a new concept known as split-mirror. This can be used to rapidly createa mirror copy of a production system database without the need to take the system down.This copy can then be used to perform an offline backup without affecting the performance ofthe original system, which continues processing as usual.

    In this case, where no further backup is taken on the primary database system, the AdminTools do not support deletion of log files and the associated information. This can result in theAdmin Database becoming very large and log files taking up too much space on the long-term storage medium.

    We strongly recommend customers to only use the direct archiving option.This requires either TSM or a vendor product that provides its own User Exit.

  • 2 Basic Concepts

    May 2002 29

    Homogenous System CopyIt is possible to create new SAP systems from existing system backups. In this case, theAdmin Tools must be newly installed on the new system as the system name has changed.

    Do not attempt to copy Admin Database information from the source systemto the new target system.

    Although DB2 does not force a backup in this situation, as LOGRETAIN is normally alreadyactive, it is essential that you take a new backup before you use the Admin Tools on the newSAP system.

    Sometimes a system copy is used to overwrite another system or a previous system copywhere the Admin Tools were already installed. In this case, the old Admin Database shouldbe dropped before the Admin Tools are reinstalled. Additionally, the backup history file mustbe pruned to remove all previous backup information before a new backup is taken andbefore the Admin Tools are used.

    2.3 SAP Security ConceptGeneral informationIn an SAP environment, DB2 runs with authentication set to the valueserver_encrypt. This means that the user ID and password provided to connect todatabases or attach to database instances are verified by DB2 using operating systemservices from within the database server.

    The user IDs and passwords for SAP system users are maintained and stored in the file:

    UNIX: /usr/sap//SYS/global/dscdb6.conf

    Windows: \\%DSCDB6HOME%\sapmnt\\SYS\global\dscdb6.conf

    In an exclusively Windows environment, the environment variableDSCDB6HOME contains the name of the database server. In a systemenvironment where the database server operates under an operating systemother than Windows, DSCDB6HOME should contain the name of the serverwhere the file dscdb6.conf can be accessed with the path listed above.

    File dscdb6.conf must be accessible from all application and database servers using NFS(UNIX) or Windows shares. Passwords are stored in encrypted form. This file is protectedfrom unauthorized access using file system access permissions.

    For all the dscdb6.conf accesses described in this guide, the environment variableDB2DB6EKEY is used to encrypt or decrypt the requested password.

  • 2 Basic Concepts

    30 May 2002

    The value of DB2DB6EKEY must be identical on all application servers, thecentral instance, and on the SAP system database servers (all systems withthe same ).DB2DB6EKEY is requested and set during SAP system installations. Thedefault value is , but will needmodifying for all but the central database server. The administrator can change this value at any time, but this requires that thevalue be updated on all other related systems, and the passwords in the filedscdb6.conf be changed (see below).

    UNIX:

    The DB2DB6EKEY variable is set in the SAP profiles dbenv_.csh and.dbenv_.sh, which are read when adm or db2 logs on.

    Windows:

    The variable DB2DB6EKEY is set in the system environment.

    Managing Passwords for Database Standard UsersDB2 uses operating system users to maintain system security. The Admin Tools need accessto the user passwords to access the database. These are stored in encrypted form in aspecial file and must be updated using the dscdb6up tool.

    Do not change user passwords using (only) operating system methods. Toolsthat read the password file dscdb6.conf will no longer be able to connect tothe database until tool dscdb6up has been used.

    For information on how to set and update passwords for SAP system users, see Setting andUpdating Passwords [Page 90].

    2.4 Multi-Node Systems (DB2 UDB EEE for UNIX and Windows)The Admin Tools are also enabled to work with DB2 UDB EEE for UNIX and Windows. AEEE-database can be configured to consist of more than one database node. In this case, inthe SAP implementation, certain directories found in the EE environment are extended tobecome node-specific in a EEE environment and other directories are moved.

    On UNIX the home directory of the db2 user changes from/db2/ (EE) to /db2/db2 (EEE).

    For this reason it is important that all user scripts do not make assumptions about directorylocations. Instead environment variables (such as $INSTHOME or %INSTHOME%) must beused. Also tools, such as brarchive and brrestore should be used with the additionalparameternode. For more information on the syntax of brarchive and brrestore, see brarchive -Log File Archive Tool [Page 110] and brrestore - Log File Retrieval Tool [Page 117].

  • 3 Installation and Setup

    May 2002 31

    3 Installation and Setup

    3.1 IntroductionThis section is intended for administrators who wish to check their environment, or need to(re)install or upgrade the Admin Tools manually.

    The installation of the Admin Tools depends on the SAP installation tool. You can install theSAP System using:

    R3SETUP

    The Admin Tools are automatically installed as part of the SAP system installation.R3SETUP creates the directories, user, groups and user environment that are required tobe successfully install the Admin Tools using the sddb6ins program.

    SAPinst

    The Admin Tools are not automatically installed during the SAP system installation withSAPinst. However, you can install the Admin Tools after installing the SAP system.SAPinst creates users and groups that are required to successfully install the AdminTools using the sddb6ins program. Version 6.10 of sddb6ins and higher creates thedirectories and adds variables to the user environment that are required to run the AdminTools.

    The 6.10 (or higher) Admin Tools must be used on SAP systems release 6.10or higher. They do not perform correctly on SAP systems at 4.6D or lower,and the 4.6D Admin Tools do not perform correctly on SAP systems atrelease 6.10 or higher.

    Installation OverviewThe following list provides an overview of the steps that you have to perform to install theAdmin Tools and enable the SAP system database for recovery:

    1. Check the SAP system environment [Page 33] to make sure that the SAP system wasinstalled correctly.

    2. Check the prerequisites for the installation of the Admin Tools [Page 39].

    3. Install or upgrade to the latest Admin Tools. For more information, see one of thefollowing sections:

    Upgrading the Admin Tools [Page 42] if you want to upgrade the Admin Tools to thelatest version.

    Installing the Latest Admin Tools [Page 42]if you want to install the latest version ofthe Admin Tools or apply the latest patch.

    4. Check the Admin Tools environment [Page 43] after installation.

    5. Install the DB2 Control Center on the SAP database server or one or more workstations.For more information, see Installation of the DB2 Control Center [Page 52].

    This step may already have been performed as part of the database installation.Otherwise, this can be delayed until step 7 if roll-forward recovery enabling (step 6) willbe performed on the command line.

  • 3 Installation and Setup

    32 May 2002

    6. Enable the database for roll-forward recovery [Page 48].

    7. Catalogue the databases to be administered. For more information, see Setting Up theDB2 Control Center [Page 53].

    8. Check that the DB2 Control Center Extensions are working correctly. For moreinformation, see Using the DB2 Control Center Extensions [Page 57].

    See also: For information on installing IBM DB2 Universal Database for UNIX and Windows with

    the SAP system, see:

    For SAP release 6.10 and higher:SAP Web Application Server Installation on UNIX: IBM DB2 Universal Database forUNIX and Windows

    SAP Web Application Server Installation on Windows 2000: IBM DB2 UniversalDatabase for UNIX and Windows

    You can find this documentation in the SAP Service Marketplace at:http://service.sap.com/instguides SAP Web Application Server

    For SAP Basis release 4.6D:SAP Basis Installation on UNIX: IBM DB2 Universal Database for UNIX and Windows

    SAP Basis Installation on Windows: IBM DB2 Universal Database for UNIX andWindows

    You can find this documentation in the SAP Service Marketplace at:

    http://service.sap.com/instguides SAP Basis

    For SAP R/3 release 4.6x and lower:You can find the corresponding installation documentation in the SAP ServiceMarketplace at:

    http://service.sap.com/instguides SAP R/3

    For additional information on installing the Admin Tools, see the following SAP Notes:

    SAP Note 410252DB6: Installing the latest 4.6D DB2 Admin Tools

    SAP Note 455506DB6: Installing the latest 6NN DB2 Admin Tools

    You can find the SAP Notes in the SAP Service Marketplace at:http://service.sap.com/notes

  • 3 Installation and Setup

    May 2002 33

    3.2 SAP System EnvironmentThe following sections explain the SAP system environment that is a prerequisite for thesuccessful installation of the Admin Tools.

    3.2.1 SAP System Users and GroupsSAP System Users

    User Descriptiondb2 Database administrator

    This operating system user is the DB2 instanceowner and the SAP database administrator.

    adm SAP system administratorThis operating system user is authorized to start andstop the SAP system and the DB2 DatabaseManager (instance). adm has the DB2authorizations DBADM and SYSCTRL. DB2-specificmonitoring functions invoked by SAP applicationserver functions require SYSCTRL authorization. Thisuser belongs to the operating system groupdbctl.

    sapr3

    First installed SAP systems atRelease 4.6D or lower

    sap

    SAP systems based on SAPKernel Release 6.10 or higherand additional MCOD 4.6DSAP systems

    Database userThese operating system users own all SAP databaseobjects (tables, indexes and views). All databaseconnection and instance access operations for a SAPapplication server are performed using these users.

    These users belong to the operating system groupSAPSYS and are only created on SAP systems thathave the SAP system database installed (not onremote application servers). These users havethe following database authorizations: CREATETAB,BINDADD, CONNECT, and IMPLICIT_SCHEMA.

    Windows only:sapse

    SAP Service Account UserThis operating system user is a virtual user. Ingeneral, on Windows the SAP system is started withthis user account, but there is no need to log on to theSAP system with it.

    This user account must have the local user rights toLog on as a service and has to be a member ofthe local administrator group. The name of this usermust be sapse.

  • 3 Installation and Setup

    34 May 2002

    SAP System Groups

    Groups Descriptiondbadm Database System Administration Group

    Each member of this group has SYSADMauthorization for the DB2 Database Managerinstance. This is the highest level of authorizationwithin the database manager and controls alldatabase objects.

    dbctl Database System Control GroupEach member of this group has SYSCTRLauthorization for the DB2 Database Managerinstance. SYSCTRL has privileges allowingoperations affecting system resources, but notallowing direct access to data.

    Windows only:SAP__GlobalAdmin

    Domain-Level SAP System AdministrationGroupThis group is used for grouping the SAP systemadministrators. The sole function of a global groupis to gather users together at domain level so thatthey can be placed in the appropriate local groups.The members of this group are the domain usersadm and sapse.

    The group SAP__GlobalAdmin is onlyused when the SAP System belongs to a Windowsdomain. The groupSAP__GlobalAdmin is not required fora local installation.

    Windows only:SAP__LocalAdmin

    Local group on an application serverOnly local groups are created and maintained onan application server. A local group can only begiven permissions and rights to the system where itis located. If the system is part of the domain, thelocal group can contain users and global groupsfrom the domain.

  • 3 Installation and Setup

    May 2002 35

    3.2.2 User Environment

    In the following table the Set In column shows the location where thevariables are set and where they need to be changed.

    General Environment Variables

    EnvironmentVariable

    Value Set In

    DB2INSTANCE DB2 UNIX:~/.dbenv_.csh

    and~/.dbenv_.sh

    Windows:User environment

    DB2DBDFT Same as relevant locationfor variableDB2INSTANCE asdescribed in this table.

    DB2DB6EKEY (default)

    Same as relevant locationfor variableDB2INSTANCE asdescribed in this table.

    DB2DB6_ARCHIVE_PATH

    UNIX:/db2//log_archive(default)

    Windows:Default for DB2 UDB EE::\db2\\log_archiveDefault for DB2 UDB EEE:\\%DSCDB6HOME%\log_archive

    init.db6 file

    DB2DB6_RETRIEVE_PATH

    UNIX:/db2//log_retrieve (default)

    Windows:Default for DB2 UDB EE::\db2\\log_retrieve

    Default for DB2 UDB EEE:\\%DSCDB6HOME%\log_retrieve

    init.db6 file

  • 3 Installation and Setup

    36 May 2002

    DB2DB6_TEMP_DIR UNIX:/tmp (default)

    Windows:value of %TEMP% (default)

    init.db6 file

    INSTHOME UNIX:Home directory of user db2

    Windows:Default for DB2 UDB EE::\DB2Default for DB2 UDB EEE:\\%DSCDB6HOME%\db2

    UNIX:~/.dbenv_.csh

    and~/.dbenv_.sh

    Windows:User environment

    SAPSYSTEMNAME UNIX:~/.sapenv_.csh

    and~/.sapenv_.sh

    Windows:User environment

    dbs_db6_schema

    Valid for all SAPsystems with SAPWeb AS release 6.10or higher and MCOD4.6D SAP systems

    Database schema:

    sap or sapr3 depending onthe SAP system release you haveinstalled.

    Same as relevant locationfor variableSAPSYSTEMNAME asdescribed in this table.

    Additional Environment Variables for Windows

    Environment Variable ValueDSCDB6HOME Database server name

    SAPMNT :\usr\sap\

    SAPEXE :\usr\sap\\SYS\exe\run

  • 3 Installation and Setup

    May 2002 37

    3.2.3 Access Privileges for Admin Tool-Related DirectoriesAccess Privileges for Directories and Files under UNIX

    DB2 Directory or File AccessPrivilege inOctal Form

    Owner Group

    Home directory of userdb2 (/db2/or /db2/db2)

    755 db2 dbadm

    /db2//log_dir 750 db2 dbadm

    /db2//log_retrieve 750 db2 dbadm

    /db2//log_archive 750 db2 dbadm

    /db2//db2dump 750 db2 dbadm

    /usr/sap//SYS/exe 755 adm sapsys

    /usr/sap//SYS/global

    For SAPWeb ASRelease6.10 orhigher:

    750

    For SAPBasisRelease4.6D:

    710

    adm dbadm

    /usr/sap//SYS/exe/run/dscdb6up

    4750 root dbadm

    /usr/sap//SYS/global/dscdb6.conf 640

    adm dbadm

    All permissions can be checked using the checkonly option of thesddb6ins program.

  • 3 Installation and Setup

    38 May 2002

    Access Privileges for Directories and Files under Windows

    Directory AccessPrivilege

    Owner For User or Group

    :\db2 FullControl

    Administrator

    SAP__LocalAdmin, SYSTEM

    :\db2 FullControl

    Administrator

    Everyone

    :\db2\\log_dir

    FullControl

    Administrator

    db2, SYSTEM

    :\db2\\log_retrieve

    FullControl

    Administrator

    SAP__LocalAdmin, SYSTEM

    :\db2\\log_archive

    FullControl

    Administrator

    SAP__LocalAdmin, SYSTEM

    :\db2\\db2dump

    FullControl

    Administrator

    SAP__LocalAdmin, SYSTEM

    3.3 Installing the Admin Tools Manually

    The 4.6D Admin Tools must be used on all SAP 3.1I 4.6D systems whereDB2 UDB for UNIX and Windows Version 6 or higher is installed.

    The Admin Tools are installed on the database server using the program sddb6ins. Duringnormal installation of a SAP system with R3SETUP, sddb6ins is called automatically.

    The administrator only needs to execute sddb6ins manually in the following cases:

    If an SAP system was installed with SAPinst

    If you want to use the 4.6D Admin Tools and your SAP system is between Release 3.1Iand 4.6C

    After completion of a SAP system upgrade and you have not yet installed the latestAdmin Tools

    When applying a downward compatible kernel and you have not yet installed the latestAdmin Tools

    When manually installing the Admin Tools or applying an Admin Tool patch

    When checking the installation of the Admin Tools

  • 3 Installation and Setup

    May 2002 39

    3.3.1 Prerequisites for the Admin Tool InstallationBefore you can install the Admin Tools, you must make sure that certain prerequisites aremet. Some are general, some apply to a certain patch level of the sddb6ins program ordepend on your operating system.

    General Prerequisites Sufficient space

    Make sure that you have sufficient space (approx. 4 MB) in the directory containing theAdmin Tools executables. sddb6ins installs the executables in the following directory:

    For 6.10 Admin Tools or higher:

    UNIX: $INSTHOME/admintools/binWindows: %INSTHOME%\admintools\bin

    For 4.6D Admin Tools

    UNIX: /usr/sap//SYS/exe/run

    Windows: :\usr\sap\\SYS\exe\run

    In the indirect mode (-NODADMDB not used during installation), the Admin DBrequires additional space. The directory where the database manager configurationparameter DFTDBPATH is pointing at, must be large enough to hold the Admin DBand its log files (approx. 4 MB).

    Availability of database instance

    The SAP database instance DB2 must be running when the installation programsddb6ins is executed.

    Correct user environment

    The sddb6ins program must be executed in the correct user environment.

    Windows

    If the database runs on Windows, log on to the database server as user adm tostart sddb6ins.exe.

    When working with Microsoft Cluster, sddb6ins.exe must be executed on allcluster nodes. For this, set the environment variable DB2INSTANCE todb2 (instead of db2l) in the local command window. Thedatabase resource has to run on the actual cluster node.

    UNIX

    On UNIX systems, you require root authorization with the db2 user environmentto run sddb6ins. Log on as db2 and then change to user root using su.

    Do not use su to change to root because the db2 userenvironment is then lost.

  • 3 Installation and Setup

    40 May 2002

    UNIX ONLY: For SAP Systems < 4.6xIf you want to install the 4.6D Admin Tools for the first time on SAP systems < 4.6x, you haveto perform additional actions as the group concept changed with release 4.6A. Perform thefollowing steps:

    1. Create two new groups called dbctl and dbadm if they do notalready exist.

    2. Add user db2 to the dbadm group and user adm to thedbctl group.

    Do not change the user's primary groups.3. Extract the dscdb6up program using CAR from SAP Service Marketplace at:

    http://service.sap.com/swcenter-main. Enter:CAR-xvf dscdb6up_XX.CAR

    where XX always means the highest available version.

    4. Copy the dscdb6up program to /usr/sap//SYS/exe/run.

    5. Use chmod and chown to set the permissions as follows:

    File Permission Owner Group/SYS/exe/run/dscdb6up 4755 root dbadm

    /SYS/global 750 adm dbadm

    SYS/global/dscdb6.conf 640 adm dbadm

    where acts as place holder for /usr/sap/

    Prerequisites for Earlier Versions of Program sddb6insThe following sections provides information on the prerequisites for certain patch levels of thesddb6ins program that must be met if you want to use previous versions of sddb6ins.

    Before patch 19 of the 4.6D and patch 8 of the 6.10 Admin Tools and higher

    Before this patch level, the installation of the Admin Tools requires two files:sddb6ins.exe and DBATOOLS.SAR

    The sddb6ins program must be located in the same directory as theDBATOOLS.SAR file. The DBATOOLS.SAR file contains the executables that areinstalled by the installation tool. Both files must be taken from the same source at thesame time. You can find them either on the kernel CD or in the SAP ServiceMarketplace at: http://servic.sap.com/swcenter-main

    Otherwise, the installation may appear to be successful but deliver incorrect results.For more information, see Downloading Admin Tool Patches from SAP ServiceMarketplace [Page 140].

    The -s option and parameter are required for sddb6insversions earlier than the above mentioned patch level.

  • 3 Installation and Setup

    May 2002 41

    UNIX Only: Before patch 16 of the 4.6D and patch 2 of the 6.10 Admin Tools andhigherThe command su causes the loss of the shared library search path environment variable.We therefore recommend that you set the variable manually as follows after using su(assuming the c-shell csh is being used):

    AIX: setenv LIBPATH $INSTHOME/sqllib/libSolaris: setenv LD_LIBRARY_PATH $INSTHOME/sqllib/libLinux: setenv LD_LIBRARY_PATH $INSTHOME/sqllib/libHP-UX: setenv SHLIB_PATH $INSTHOME/sqllib/lib

    3.3.2 General InformationReturn Codes of sddb6insThe sddb6ins program writes information about the steps it performs to standard output.The return code of the sddb6ins program depends on the success of the installation. Thefollowing table describes the possible return codes:

    Return Code Description0 No error detected

    1 Severe errors detected, the installation is not complete.For more information, see Appendix B: Troubleshooting[Page 137].

    2 Warning. Errors have occurred during the installationbut the installation is complete. Check the outputmessages

    The values listed in the table above differ from other Admin Tools.

    Abbreviation of sddb6ins OptionsThe following options of the sddb6ins program are not listed in detail in the sectionsUpgrading the Admin Tools [Page 41], Installing the Latest Admin Tools [Page 42] andChecking the Admin Tool Environment [Page 43]. Instead, {common option} acts as aplaceholder for the following three options:

    [-s ]

    [-db2dbnamepwd ] [-db2dbnamedomain ]

    [-sidadmpwd ] [-sidadmdomain ]

    [-NOADMDB]

    [-DEB []]For a detailed description of these options, see Appendix A: Tool Command Line Parameters[Page 110].

  • 3 Installation and Setup

    42 May 2002

    3.3.3 Upgrading the Admin ToolsThis section describes the -u option of the sddb6ins program that you use to upgrade theAdmin Tools. The following conditions apply:

    An upgrade to the latest 4.6D Admin Tools is strongly recommended if you haveperformed an upgrade to an SAP system with Release 4.6D or lower but you are stillusing a version of the Admin Tools from before 4.6D

    An upgrade to the 6.10 Admin Tools is required if you upgrade to a SAP Release 6.10 orhigher

    Admin Tool upgrades are not supported where you are using a SAP systemwith Release 4.6D or lower and you want to use the 6.10 Admin Tools orhigher.

    To upgrade the Admin Tools, enter the following command:sddb6ins -u [] {common options}

    where is a placeholder for the release of the previously installed AdminTools.

    The following command is an example of how to upgrade the Admin Toolsfrom 4.6D to 6.10 using the 6.10 sddb6ins executable:UNIX: sddb6ins u 46DWindows: sddb6ins u 46D db2dbnamepwd If the -NOADMDB option is used, the Admin Database will not be installed or will be dropped ifit already exists. In this case log file archiving is only performed directly by the User Exitprogram db2uext2. For more information, see Archiving Directly to TSM [Page 67].Otherwise the Admin Database will be installed (if not already present) and brarchive andbrrestore are then also available.

    See also:Actions Performed by the sddb6ins