Database Administration Guide
®
SAP on IBM DB2 Universal Universal Database for UNIX and Windows Document Version 1.00 - August 15, 2003
SAP AG Neurottstraße 16 69190 Walldorf Germany T +49/18 05/34 34 24 F +49/18 05/34 34 20 www.sap.com
© Copyright 2003 SAP AG. All rights reserved.
JAVA® is a registered trademark of Sun Microsystems, Inc.
No part of this publication may be reproduced or transmitted in any
J2EE™ is a registered trademark of Sun Microsystems, Inc.
form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior
JAVASCRIPT® is a registered trademark of Sun Microsystems, Inc.,
notice.
used under license for technology invented and implemented by Netscape.
Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.
MarketSet and Enterprise Buyer are jointly owned trademarks of SAP AG and Commerce One.
Microsoft®, WINDOWS®, NT®, EXCEL®, Word®, PowerPoint® and SQL Server® are registered trademarks of Microsoft Corporation.
SAP, SAP Logo, R/2, R/3, mySAP, mySAP.com, xApps, mySAP Business Suite, and other SAP products and services mentioned herein
®
®
®
®
IBM , DB2 , DB2 Universal Database, OS/2 , Parallel Sysplex ,
as well as their respective logos are trademarks or registered
MVS/ESA, AIX®, S/390®, AS/400®, OS/390®, OS/400®, iSeries,
trademarks of SAP AG in Germany and in several other countries all ®
pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner, WebSphere , TM
Netfinity®, Tivoli®, Informix and Informix® Dynamic Server
are
over the world. All other product and service names mentioned are the trademarks of their respective companies.
trademarks of IBM Corp. in USA and/or other countries. ORACLE® is a registered trademark of ORACLE Corporation.
Disclaimer Some components of this product are based on Java™. Any code
®
®
®
®
UNIX , X/Open , OSF/1 , and Motif are registered trademarks of
change in these components may cause unpredictable and severe
the Open Group.
malfunctions and is therefore expressively prohibited, as is any decompilation of these components.
LINUX is a registered trademark of Linus Torvalds and others. Any Java™ Source Code delivered with this product is only to be used Citrix®, the Citrix logo, ICA®, Program Neighborhood ®, MetaFrame®, ®
®
®
WinFrame , VideoFrame , MultiWin and other Citrix product names
by SAP’s Support Services and may not be modified or altered in any way.
referenced herein are trademarks of Citrix Systems, Inc. HTML, DHTML, XML, XHTML are trademarks or registered ®
Documentation in the SAP Service Marketplace
trademarks of W3C , World Wide Web Consortium, Massachusetts
You can find this documentation at the following Internet address:
Institute of Technology.
service.sap.com/instguides
Typographic Conventions
Icons
Type Style
Represents
Icon
Meaning
Example Text
Words or characters that appear on the screen. These include field names, screen titles, pushbuttons as well as menu names, paths and options.
Caution
Cross-references to other documentation
Recommendation
Example text
Emphasized words or phrases in body text, titles of graphics and tables
Syntax
EXAMPLE TEXT
Names of elements in the system. These include report names, program names, transaction codes, table names, and individual key words of a programming language, when surrounded by body text, for example, SELECT and INCLUDE.
Example text
Screen output. This includes file and directory names and their paths, messages, names of variables and parameters, source code as well as names of installation, upgrade and database tools.
Example text
Exact user entry. These are words or characters that you enter in the system exactly as they appear in the documentation.
Variable user entry. Pointed brackets indicate that you replace these words and characters with appropriate entries.
EXAMPLE TEXT
Keys on the keyboard, for example, function keys (such as F2) or the Enter key.
Example Note
SAP Database Administration Guide: IBM DB2 Universal Databas
Contents SAP Database Administration Guide: IBM DB2 Universal Database for UNIX and Windows 1 Introduction......................................................................................... 8 1.1 About this Documentation.....................................................................8 1.1.1 Who Should Use this Documentation ...........................................................................8 1.1.2 How this Documentation is Structured ..........................................................................9
1.2 Naming Conventions............................................................................10 1.3 Admin Tools: Enhancements and Changes.......................................11 1.3.1 New Features ..............................................................................................................13 1.3.2 Differences Between 4.6D and 6.NN Admin Tools .....................................................16
1.4 DB2 UDB for UNIX and Windows Version 7: Enhancements............17 1.5 DB2 UDB for UNIX and Windows Version 8: Enhancements............19
2 Basic Concepts ................................................................................ 21 2.1 Introduction...........................................................................................21 2.1.1 The SAP DB2 Admin Tools.........................................................................................21 2.1.2 User Interfaces ............................................................................................................22
2.2 SAP Log File Management...................................................................23 2.2.1 Recovery - The Need for Log Files .............................................................................23 2.2.2 Recovering Log Files ..................................................................................................25 2.2.3 Log File Life Cycle (Archive and Restore) ..................................................................27 2.2.4 Log File Deletion .........................................................................................................30 2.2.5 Protocols .....................................................................................................................31 2.2.6 Raw Device Log Files .................................................................................................32 2.2.7 Log File States ............................................................................................................32 2.2.8 Special Cases - Non-Standard Behavior of Database Systems.................................33
2.3 SAP Security Concept..........................................................................34 2.4 Multi-Partitioned Systems....................................................................35
3 Installation and Setup ...................................................................... 36 3.1 Introduction...........................................................................................36 3.2 SAP System Environment....................................................................38 3.2.1 SAP System Users and Groups..................................................................................38 3.2.2 User Environment........................................................................................................40 3.2.3 Access Authorizations for Admin Tool-Related Directories ........................................41
3.3 Installing the Admin Tools Manually ..................................................42 3.3.1 Prerequisites for the Admin Tools Installation.............................................................43 3.3.2 General Information ....................................................................................................45 3.3.3 Upgrading the Admin Tools.........................................................................................45 3.3.4 Installing the Latest Admin Tools ................................................................................46 3.3.5 Checking the Admin Tools Environment.....................................................................47 3.3.6 Actions Performed by the sddb6ins Program .............................................................48 3.3.7 Special Configurations ................................................................................................51 3.3.8 Enabling the Database for Rollforward Recovery .......................................................52 3.3.8.1 Enabling Rollforward Recovery for a Single-Partitioned Database.......................53 3.3.8.2 Enabling Rollforward Recovery for a Multi-Partitioned Database .........................54
4
August 2003
SAP Database Administration Guide: IBM DB2 Universal Databas
3.4 Installation and Setup of the DB2 Control Center Extensions .........55 3.4.1 Installation of the DB2 Control Center ........................................................................55 3.4.2 Installing the DB2 Control Center Extensions.............................................................55 3.4.3 Setting Up the DB2 Control Center .............................................................................56 3.4.4 Using the DB2 Control Center Extensions ..................................................................63
4 Configuration .................................................................................... 64 4.1 Changing the Admin Tools Configuration..........................................64 4.1.1 Parameters Affecting Log File Management Storage .................................................64 4.1.2 Configuring the Admin Tools Using Environment Files ..............................................67
4.2 Configuring the System for Archiving Log Files ...............................71 4.2.1 Archiving Directly to TSM............................................................................................73 4.2.2 Archiving Directly to Disk ............................................................................................74 4.2.3 Archiving to an Alternative Storage Management Product .........................................75 4.2.4 Indirect Archiving to Tape ...........................................................................................75 4.2.5 Indirect Archiving to TSM ............................................................................................81 4.2.6 Indirect Archiving Using a Customer Script ................................................................81
4.3 Configuring TSM (Tivoli Storage Management).................................83 4.3.1 Configuring TSM Files dsm.opt and dsm.sys .............................................................84 4.3.2 Configuring TSM Environment Variables ....................................................................85 4.3.3 Configuration Considerations......................................................................................87
4.4 DB2 Configuration Parameters ...........................................................88 4.5 Disk Space Considerations for Running the Admin Tools ...............89
5 Regular Administration.................................................................... 91 5.1 DB2 Log File Management...................................................................91 5.1.1 Archiving Log Files from Disk to Backend ..................................................................91 5.1.2 Deleting Log Files .......................................................................................................94
5.2 Storage Management ...........................................................................96 5.2.1 Checking the Space Available in a File System..........................................................97 5.2.2 Checking the Space Available in a Tablespace..........................................................97 5.2.3 Checking the Size of Tables and Indexes...................................................................99
5.3 Performance Monitoring ......................................................................99 5.3.1 Monitoring Database Performance ...........................................................................100 5.3.2 Monitoring Dynamic SQL Statements .......................................................................101 5.3.3 Updating Statistics for Database Tables and Checking for Reorganization .............102 5.3.4 Job Monitoring...........................................................................................................103
5.4 Database Backup................................................................................103 5.4.1 Backup Considerations .............................................................................................103 5.4.2 Performing the Backup..............................................................................................104 5.4.3 Integrity of Backups...................................................................................................105 5.4.4 Frequency of Backups and Time Required...............................................................106 5.4.5 Advanced Backup Techniques..................................................................................106
6 Advanced Tasks ............................................................................. 107 6.1 The db6util Tool..................................................................................107 6.2 Setting and Updating Passwords......................................................108 6.3 Using the Journal in the DB2 Control Center Extensions...............108 6.4 Advanced Log File Management Tasks............................................109 6.4.1 Deleting Special Log Files.........................................................................................110 6.4.2 Deleting Tapes from the Admin DB...........................................................................112
6.5 Reorganization of Tables and Tablespaces .....................................112 6.6 Redirected Restore.............................................................................114
August 2003
5
SAP Database Administration Guide: IBM DB2 Universal Databas
6.6.1 Usage of Tool brdb6brt .............................................................................................115
6.7 Command Line Tasks Using db6clp .................................................118 6.8 Monitoring Database Alerts ...............................................................120 6.9 Monitoring Lock Waits and Deadlocks .............................................120 6.10 Managing Backups and Logs Archived on TSM............................121 6.11 The db2inidb Tool.............................................................................122 6.11.1 db2inidb Option: as mirror.......................................................................................123 6.11.2 db2inidb Option: as snapshot..................................................................................126 6.11.3 db2inidb Option: as standby for Backups ...............................................................127 6.11.4 db2inidb Option: as standby for Hot-Standby Database.........................................129
6.12 Dual Logging.....................................................................................135 6.13 Adjusting the Content of the Admin DB .........................................135
7 Emergency Tasks ........................................................................... 137 7.1 SAP Database Recovery ....................................................................137 7.2 Log File Restore of the SAP Database..............................................138 7.3 Recovery of the Admin DB ................................................................143 7.3.1 General Information ..................................................................................................143 7.3.2 Recovery Process .....................................................................................................144
Appendix A: Tool Command Line Parameters ............................... 147 brarchive - Log File Archive Tool............................................................147 brdb6brt - Redirected Restore Tool ........................................................150 brrestore - Log File Retrieval Tool ..........................................................153 db2adutl - DB2 TSM Management Tool ..................................................156 db2ckbkp - DB2 Check Backup Utility....................................................158 db2trc - DB2 Trace....................................................................................159 db2uext2 - DB2 User Exit.........................................................................162 db6adutl - SAP TSM Management Tool ..................................................163 db6util - Tool to Assist Database Administration..................................164 dmdb6bkp - Database Backup Tool........................................................165 dmdb6srp - Update Statistics Tool .........................................................166 dmdb6rts - Table Reorganization Tool ...................................................167 sddb6ins - Admin Tools Installation Program .......................................168 sddb6mir - Admin DB Creation and Mirror Tool Utility .........................170
Appendix B: Troubleshooting.......................................................... 171 DB2 Traces................................................................................................171 DB2 Trace Facility db2trc ...................................................................................................171 DB2 CLI Trace....................................................................................................................172
Admin Tools Traces .................................................................................173 Downloading Admin Tool Patches from the SAP Service Marketplace.............................174 General Troubleshooting Comments .................................................................................176 Installation (sddb6ins) Troubleshooting .............................................................................177 User Exit Troubleshooting ..................................................................................................178 brarchive/brrestore Troubleshooting ..................................................................................181 DB2 Control Center Extensions Troubleshooting ..............................................................196 Collecting Diagnostic Information for SAP Support ...........................................................197
6
August 2003
SAP Database Administration Guide: IBM DB2 Universal Databas
Appendix C: Implementation Details............................................... 198 Admin DB Structure .................................................................................198 brarchive and brrestore backend Library Architecture .......................................................202
DB2 Control Center Extensions Architecture ........................................203
Appendix D: Example of File init.db6............................... 204 File init.db6 on UNIX .................................................................204 File init.db6 on Windows ..........................................................206
Appendix E: Example of Customer Script db6sctsm.smp ............ 208 Appendix F: References ................................................................... 210 DB2 UDB for UNIX and Windows V7 - Additional Documentation .......210 DB2 UDB for UNIX and Windows V8 - Additional Documentation .......212
Glossary and Index ........................................................................... 214
August 2003
7
1 Introduction
1 Introduction 1.1 About this Documentation This documentation supplies information specific to the SAP environment and describes daily administration tasks using both product tools and the SAP-specific administration tools. The documentation is written based on DB2 UDB Version 7 as the underlying database release. The concepts described in this documentation are also expected to apply to other DB2 for UNIX and Windows database versions. The information in this documentation has been collected from a variety of sources such as previous administration documentations, SAP Notes and customer experience and gives the administrator a single point of reference. The information is presented in a task-oriented way, separating information frequently needed from that which the administrator only requires, for example, in an emergency. It also includes a new troubleshooting section giving advice about solving problems before contacting SAP, or what information to send to SAP if no solution can be found.
The information provided in this documentation applies to all SAP kernel releases starting from 3.1I and higher as well as IBM DB2 Universal Database for UNIX and Windows Version 7 and higher. If you would like to give feedback on this documentation, we would ask you to use the following email address: [email protected]
1.1.1 Who Should Use this Documentation This documentation is intended primarily for database administrators and SAP system administrators who 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 experienced SAP 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, and maintaining systems, or assisting in these tasks.
8
August 2003
1 Introduction
1.1.2 How this Documentation is Structured This documentation is divided into the following sections:
Chapters ...
1.
Introduction Provides general information about the guide, its targeted audience, interfaces, naming conventions and new features.
2.
Basic Concepts Describes 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 Setup Explains how to install Admin Tool patches and deal with upgrades. It also covers manual (re)installation of the tools if required. 4. Configuration Describes the available options and steps required to configure the Admin Tools. 5. Regular Administration Lists and describes tasks that system administrators need to perform on a regular basis such as storage administration, backup and log file management. 6. Advanced Tasks Covers one-time or rarely needed tasks not related to configuration. Some tasks may be prerequisites for other day-to-day tasks, which must be performed before log files can be stored to tape. Also includes monitoring and performance considerations. 7. Emergency Tasks Tasks that administrators may need to perform after a database failure.
Appendices A. Tool Command Line Parameters Contains detailed command line syntax for each command. B. Troubleshooting Describes what to do when tools do not work as expected. C. Implementation Details Contains internal tool information, especially for support personnel. D. Example of the File init.db6 E. Example of Customer Script db6sctsm.smp F. References G Glossary and Index
August 2003
9
1 Introduction
1.2 Naming Conventions Terminology For information on terminology used in this documentation, see Glossary and Index [Page 214].
Product Names In this documentation the following naming conventions apply: SAP Web Application Server / SAP system SAP Web Application Server is referred to as SAP Web AS or SAP system. Additionally the term SAP system also refers to other components of mySAP.com. IBM DB2 Universal Database for UNIX and Windows IBM DB2 Universal Database for UNIX and Windows is referred to as DB2 UDB for UNIX and Windows or DB2. IBM DB2 Universal Database Enterprise Server Edition for UNIX and Windows IBM DB2 Universal Database Enterprise Server Edition for UNIX and Windows is referred to as DB2 UDB ESE for UNIX and Windows. single-partitioned system / EE system The term single-partitioned system replaces the term EE system. multi-partitioned system / EEE system The term multi-partitioned system replaces the term EEE system. 6.NN Admin Tools / 6.10 Admin Tools The term 6.NN Admin Tools replaces the term 6.10 Admin Tools, as these Admin Tools can be used for any SAP system release starting from 6.10 and higher. Tivoli Storage Management (TSM) / ADSM The IBM storage product ADSM has been renamed to TSM (Tivoli Storage Manager) in the most recent versions. The names are often used interchangeably, but in this documentation the product is referred to as TSM. The term ADSM is normally only used in this guide to indicate program parameters or configuration parameter names.
Tivoli (IBM) no longer supports the product ADSM. Customers still using ADSM are strongly advised to upgrade to TSM Client Version 4.1 or higher. Serious problems have occurred when using the Admin Tools with TSM Version 3.7. This version is also out of service now, so an upgrade is also strongly advised. Windows The 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 on any Windows platform.
10
August 2003
1 Introduction
1.3 Admin Tools: Enhancements and Changes The following sections summarize recent changes to the Admin Tools.
Within these sections, we refer to the Admin Tools release and not the SAP system release, which do not need to be the same. For example, the 4.6D Admin Tools should be used on all SAP 3.1I to 4.6D systems where DB2 UDB for UNIX and Windows Version 7 or higher is installed. The 6.10 Admin Tools or higher should be used with all SAP system releases above and including 6.10. The following changes are informational or not patch-specific: •
Installation Program sddb6ins The command line syntax of sddb6ins has been simplified by extracting information from the environment. 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 Tools installation program sddb6ins now checks many aspects of the environment to locate the majority of problems experienced by customers. In the past a difficulty with the Admin Tools has been the runtime environment. Admin Tools files and directories may have been unintentionally removed or were given the wrong ownership or authorizations; environment variables may have been set to non-existent directories, and so on. For more information, see Installing the Admin Tools Manually [Page 42].
•
Admin Tools in an MCOD Environment The Admin Tools have been modified to support this SAP feature. They are only installed with the first SAP system, that is, only once per database. As log files are shared by all the SAP systems using the same single database, user db2 and all adm users can perform log file management tasks. It is necessary to differentiate between the SAP system ID and the SAP system 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 a database, the old terminology still applies as described in the table below. However, there is a limitation in SAP 4.6x releases, that the initial SAP system must have the same ID as the SAP database. Further SAP systems have different IDs. The database connect user for the first SAP system in a 4.6D system environment is still sapr3. If an MCOD system is removed, you must make sure that the db2 user environment still points to another valid MCOD system using the same database.
August 2003
11
1 Introduction
The following terminology conversions must be used: SAP System and Database Name Descriptions ID
Old ID
New ID
SAP system ID
,
,
SAP database name
,
,
User
Old ID
New ID
Database instance owner
db2
db2
SAP database administrator
adm
adm
Database connect user
sapr3
sap
User ID Descriptions
sapr3 is still used for the first SAP system in a 4.6D system environment.
Directory Names Descriptions Directory
Old Name
New Name
SAP system related directories
db2 home directory and subdirectories
The following are examples of how the descriptions of directory names have changed on UNIX systems compared to earlier versions of this documentation on. If and are the same, the real directory name after substitution 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 fully functional. This restriction only applies to 4.6D SAP systems. From SAP system Release 6.10 and higher, it is only necessary to verify that the db2 user is set up correctly. Use sddb6ins –checkonly to verify this. This user may require changes to his environment.
12
August 2003
1 Introduction
For more information on released platforms and availability, see the SAP Service Marketplace at the Internet address service.sap.com/platforms and choose → Multiple Components in One Database (MCOD). •
64-bit Support The Admin Tools have been modified to work with 64-bit platforms.
Some changes were specifically implemented for the 4.6D and 6.NN Admin Tools and delivered as patches. For more detailed information, see New Features [Page 13]. For information on the main differences between the 4.6D and 6.NN Admin Tools, see Differences Between 4.6D and 6.NN Admin Tools [Page 16].
1.3.1 New Features This section provides information on new features that have been specifically implemented for the 4.6D and 6.NN Admin Tools.
6.NN stands as a placeholder for all Admin Tools releases starting from 6.10 and higher.
New Features of 4.6D Patch 20 and 6.NN Patch 9 •
brarchive/brrestore customer script interface You can now write your own individual backend interface. For more information, see Archiving Log Files from Disk to Backend [Page 91].
•
Option brarchive –GAL/-DMP You use this option to adjust the Admin DB to a file system. For more information, see Adjusting the Content of the Admin DB [Page 135].
•
Option sddb6ins –r You use this option to recreate the Admin DB from a SAR file. For more information, see Recovery of the Admin DB [Page 143].
•
Support of two TSM management classes The User Exit and brarchive can now archive log files to two TSM management classes. For more information, see Archiving Directly to TSM [Page 73].
•
Restore of log files excluding the Admin DB The User Exit restores log files from log_archive or log_retrieve without any information on those log files in the Admin DB. You activate this feature by setting configuration variable DB2DB6_UEXIT_RETRIEVE_WO_DB in file init.db6.
•
Admin Tools and DB2 Version 8 The Admin Tools are now supported for DB2 UDB for UNIX and Windows Version 8.
For more detailed information on 4.6D patch 22 and 6.NN patch 11, see SAP Note 533979.
August 2003
13
1 Introduction
New Features of 4.6D Patch 22 and 6.NN Patch 11 •
Option brarchive –dt You use this option to delete tapes using the command line. For more information, see Deleting Log Files [Page 94].
•
Option brarchive –do You use this option to delete obsolete log files using the command line. For more information, see Advanced Log File Management Tasks [Page 109].
•
Support of TSM LANFREE The Admin Tools have been modified to support the TSM LANFREE feature. You activate this feature by setting configuration variable DB2DB6_TSM_MULTITHREADED in file init.db6. For more information, see Configuring TSM (Tivoli Storage Management) [Page 83].
For more detailed information on 4.6D patch 22 and 6.NN patch 11, see SAP Note 597356.
New Features of 4.6D Patch 23 and 6.NN Patch 12 •
Indirect archiving without accessing the Admin DB If you are using indirect archiving, the User Exit is now able to archive without accessing the Admin DB. The necessary tasks to update the Admin DB content are moved from the User Exit to brarchive. You activate or deactivate this feature of the User Exit by setting configuration variable DB2DB6_UEXIT_ARCHIVE_WO_DB to ON or OFF. Program sddb6ins automatically sets variable DB2DB6_UEXIT_ARCHIVE_WO_DB to ON if during the installation of the Admin Tools the new version of transaction DB12 is recognized by the Admin Tools.
•
Archiving directly to disk If you are using direct archiving, the User Exit is now able to archive log files directly to disk. For more information, see Configuring the System for Archiving Log Files [Page 71].
For more detailed information on 4.6D patch 23 and 6.NN patch 12, see SAP Note 597416.
New Features of 4.6D Patch 25 and 6.NN Patch 14 •
Indirect archiving without accessing the Admin DB is now the default for all releases. Before mirroring, the sddb6mir tool also adds missing log files. This updates the information in the old version of transaction DB12. Archiving without the Admin DB causes less problems. For this reason, this is now the default for all SAP system releases. To turn archiving without the Admin DB off, set DB2DB6_UEXIT_ARCHIVE_WO_DB to OFF in the init file.
14
August 2003
1 Introduction
New Features of Other Administrative Tools •
Backup restore tool brdb6brt patch 5
New comments starting with SET IGNORE ROLLFORWARD The script created by brdb6brt patch 2 or higher contains new comments starting with SET IGNORE ROLLFORWARD. You might have to use this feature if the log files contain information on container change operations and the operations cannot be applied during the rollforward recovery. This may occur in a redirected restore scenario because the container layout is then different to the one when the backup was made. You activate this feature by removing the two dashes (−−) at the beginning of the corresponding comment line.
Support of striped containers Striped containers are created if you are using DB2 Version 7 and instance registry variable DB2_STRIPED_CONTAINERS is set to ON. For DB2 Version 8, this variable is set to ON by default.
Backup information in brdb6brt brdb6brt automatically contains the information from the latest full backup. It retrieves the information from the backup history file.
Option –bm RETRIEVE RELOCATE You use this option to create scripts that can be used for database relocation. These scripts can be used as a template in db2relocatedb with command relocate DB or in db2inidb with command RELOCATE USING.
Option –replace You use this option to modify the generated scripts for redirected restore and relocation. For example, you can replace the database name .
For more detailed information on patch 5 of brdb6brt, see SAP Note 599121. •
DB2 Control Center Extensions patch 3:
You can now use the DB2 Control Center Extensions for the 4.6D and 6.NN Admin Tools.
The DB2 Control Center Extensions have been modified to support the customer script option of brarchive.
The DB2 Control Center Extensions are supported for DB2 UDB for UNIX and Windows Version 8.
For more detailed information on patch 3 of the DB2 Control Center Extensions, see SAP Note 599123.
August 2003
15
1 Introduction
1.3.2 Differences Between 4.6D and 6.NN Admin Tools Since the implementation of the 6.NN Admin Tools, the main differences to the 4.6D Admin Tools are: •
ADM database mirroring no longer required In the past, the Admin DB ADM was mirrored to the SAP database to reduce the risk of data loss. This has proven to be unnecessary. Thus, the program sdd6mir, which was used to perform this action, is no longer required. When SAP system log files are stored directly by the User Exit to TSM, the Admin DB is not required and so no backup (mirror) of this database is needed. If log files are stored using brarchive, a backup copy of the Admin DB is stored to the same medium as the log file(s) at the end of each brarchive run. For more information on how to recover the Admin DB, see Recovery of the Admin DB [Page 143]. This implies that the 6.NN Admin Tools delivery does not contain program sddb6mir any more.
•
New location for Admin Tools executables To reduce the dependencies between the almost release-independent Admin Tools and the release-dependent SAP products, the Admin Tools, their configuration, protocol and trace files have been moved. This means that, for example, unlike Admin Tool versions up to 4.6D, the 6.10 Admin Tools no longer need to be re-installed after an SAP system upgrade. For more information, see Installing the Admin Tools Manually [Page 42]. The following table shows the location of the Admin Tools files and variables for 4.6D and 6.NN:
Executables and libraries: brarchive/ brrestore, db6adutl, libdb6* Protocol files
Trace files
4.6D
6.NN
UNIX: /usr/sap/SYS/ exe/run
UNIX: /admintools/ bin
Windows: :\usr\sp\\SYS\ exe\run
Windows: \admintools\ bin
UNIX: /db2//saparch /db2//saprest
UNIX: /admintools/ protocols
Windows: :\db2\db2\ saparch :\db2\db2\ saprest
Windows: \admintools\ protocols
UNIX: /tmp/TraceFiles
UNIX: /admintools/ TraceFiles
Windows: \ TraceFiles
16
Windows: \admintools\ TraceFiles
August 2003
1 Introduction
TSM environment variables
UNIX: in.dbenv_.csh/sh Windows: user environment
UNIX: /admintools/ bin/dbaenv_.csh/ sh Windows: user environment
1.4 DB2 UDB for UNIX and Windows Version 7: Enhancements The following are the major new features in Version 7.1 and Version 7.2, which are relevant to 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 closed and as a result it will be archived. This ensures that an online backup has a complete set of archived log files available for recovery. For more information, see the IBM documentation DB2 Administration Guide: Implementation
•
On Demand Log Archive Support You can now force the currently active log file closed, which is then automatically archived by DB2 if the User Exit is enabled. This feature gives database administrators more granular control over their backup and restore strategy. For more information, see the IBM documentation DB2 Administration Guide: Implementation.
•
Log Limit Increased to 32 GB The 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 single transaction. For more information, see the IBM documentation DB2 Administration Guide: Implementation.
•
Renaming a Tablespace When creating a tablespace, you specify its name. In previous versions, you were not allowed to change that name again during the lifetime of the tablespace object. Now, an administrator can rename a tablespace with the RENAME TABLESPACE statement. For more information, see the IBM documentation DB2 Administration Guide: Implementation.
August 2003
17
1 Introduction
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 a new log file in the active log directory. DB2 attempts to create the log file every five minutes and writes a message to file db2diag.log after each attempt. This file indicates if your application is hanging. For more information on the DB2 instance variable DB2_BLOCK_ON_LOG_DISK_FULL , see the DB2 Release Notes.
•
Suspended I/O Supports continuous system availability, while allowing online split mirror handling of the database. By momentarily suspending I/O to disk, DB2 will ensure that the split mirror copy maintains its integrity. A new tool db2inidb has been created that operates on split mirror copies.
If you want to use the db2inidb tool, we strongly recommend that you read The db2inidb Tool [Page 122] before you start using it. •
Dual Logging DB2 now has the capability to mirror the active log files to protect databases from accidental deletion of an active log and data corruption caused by a hardware failure. A new registry variable DB2_NEWLOGPATH2 instructs the database to write an identical copy of the log files to a different path on a physically separate disk.
•
Parallel Recovery DB2 now uses multiple agents to perform both crash recovery and database rollforward recovery. This may improve performance on SMP machines.
•
Incremental and Delta Backups There are two backup types supported:
Incremental backup: Only contains pages that have been 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).
18
August 2003
1 Introduction
1.5 DB2 UDB for UNIX and Windows Version 8: Enhancements All new features of DB2 UDB for UNIX and Windows Version 8 are described in the IBM documentation IBM DB2 Universal Database Version 8 - What’s New. This section briefly summarizes new features that affect log file management and database administration in an SAP environment.
Logging Enhancements •
Dual Logging Restrictions of this feature, which was introduced in DB2 Version 7.2, have been removed. This feature is now supported on Windows as well. You can choose the mirror log directory by setting database configuration parameter mirrorlogpath.
•
Infinite Logging It allows an active unit of work to span the primary logs and archive logs, effectively allowing a transaction to use an infinite number of log files. Without infinite active log enabled, the log records for a unit of work must fit in the primary log space. Infinite active log is enabled by setting logsecond to -1. Infinite active logging can be used to support environments with large jobs that require more log space than you would normally allocate to the primary logs.
Be aware that if you activate this feature, rollbacks may take a long time if the log files containing the rollback information need to be retrieved by the User Exit. We strongly recommend that you use this feature only if you are using direct archiving. If you use indirect archiving, it is possible that the User Exit cannot retrieve required log files for a rollback, because they have already been archived and deleted from log_archive by brarchive. In addition, you should set the new database configuration parameters MAX_LOG and NUM_LOG_SPAN to avoid that transactions run indefinitely. •
Block Transactions when Log Directory is Full The block on log disk full function, which was introduced in DB2 Version 7, is now set using database configuration parameter blk_log_dsk_ful.
•
Increased Log Space The maximum amount of log space, which can be defined, has increased from 32 GB to 256 GB.
Backup and Recovery Enhancements •
XBSA Support Backup can now interface with solutions from storage vendors that have implemented the XBSA industry standard interface.
•
Point in Time Rollforward Recovery to Local Time When using point in time (PIT) rollforward recovery, you can now specify the time as local time. This makes it easier to roll forward to a specific point in time and eliminates potential errors due to the translation of local to GMT time.
August 2003
19
1 Introduction
•
Database Maintenance Mode: QUIESCE Using the new QUIESCE command, you can force all users off an instance or a database and put it into a quiesced mode for database maintenance activities. The quiesce mode of the database is ideal to create an offline backup without the need to stop the SAP application servers.
Availability Enhancements •
Online Table Reorganization Online table reorganization allows applications to access the table during the reorganization. In addition, online table reorganization can be paused and resumed later by anyone with the appropriate authorization by using the schema and table name. Online table reorganization is allowed only on tables with type-2 indexes and without extended indexes.
•
Online Index Reorganization A table and its existing indexes can be read and updated during an index reorganization using the new REORG INDEXES command.
•
Online Configuration Parameters Over 50 configuration parameters can now be set online. Changes to these online configuration parameters take immediate effect without the need to stop and start the instance, or deactivate and activate the database. You no longer have to disconnect users when you fine tune your system, which gives you more flexibility to decide when to change the configuration.
•
DMS Container Operations If you use database-managed tablespaces, DB2 Version 8 will allow you to drop a container from a tablespace, reduce the size of existing containers, and add new containers to a tablespace in a way that a rebalance does not occur.
Usability Enhancements DB2 Control Center and 64-bit Instances The DB2 Control Center can now be used to administer 32-bit and 64-bit instances.
20
August 2003
2 Basic Concepts
2 Basic Concepts 2.1 Introduction This chapter describes the concepts relating to the Admin Tools, and the terminology used throughout this documentation. Much of this terminology is described in Glossary and Index [Page 214].
This documentation includes new and updated information that was not available in previous versions.
2.1.1 The SAP DB2 Admin Tools The SAP DB2 Admin Tools are a collection of tools specific to the SAP environment, which supplement standard DB2 tools. They can be divided 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, the DB2 Control Center Extensions, has been created that simplifies access to several of the Admin Tools. These are extra menu options and windows that are available in the DB2 Control Center after the extensions are installed.
August 2003
21
2 Basic Concepts
SAP System
SAP database
Monit o + Exe r cute
+
SAP processes
M o Ex nit ec or ut e Admin Tools
Proto c + Qu o l ery
cute Ex e DB2 Control Center + SAP Extensions
Configure + Query
Admin database ADM
The following graphic shows the relationship between the Admin Tools and the DB2 Control Center Extensions plus the SAP system and database.
2.1.2 User Interfaces System administrators can perform the DBA tasks using the following interfaces: •
DB2 Command Line Processor (CLP) DB2 tool used to execute database utilities, SQL statements and get online help. It offers a variety of command options, and can be started in interactive input mode, command mode and batch 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 as configuring 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 use Start panels on Windows platforms. The DB2 Control Center can be extended with the SAP Admin Tools Control Center extensions to support SAP-specific tasks related to log file management. You can also access tools such as DB2 Visual Explain and DB2 Performance Monitor from the DB2 Control Center. For introductory information, choose Help → Getting Started.
22
August 2003
2 Basic Concepts
•
Operating System Command Line This can be used to perform the majority of tasks described in this documentation. Generally this is the fastest and most flexible method, but may require user knowledge of complex command syntax. The system administrator can also use this interface to automate tasks, for example, by writing scripts or batch files.
•
SAP Transactions These provide an additional graphical interface for starting specific tasks. The number of available tasks is limited, but they are often neither platform nor database-specific and can therefore be used in a mixed environment.
2.2 SAP Log File Management This 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 [Page 23]
•
Recovering Log Files [Page 25]
•
Log File Life Cycle (Archive and Restore) [Page 27]
•
Log File Deletion [Page 30]
•
Protocols [Page 31]
•
Raw Device Log Files [Page 32]
•
Log File States [Page 32]
•
Special Cases – Non-Standard Behavior of Database Systems [Page 33]
2.2.1 Recovery - The Need for Log Files Once a database is up and running, one of the most essential tasks for a database administrator is the management of database backups and log files to ensure that databases can be recovered after a serious failure. The DB2 Database Manager generates log files to keep track of changes made to the database. These log files are required for the following purposes: •
Explicit and implicit rollback When a database transaction is rolled back all changes are undone.
Explicit rollback An application indicates that changes that it started to make to the database are invalid.
Implicit rollback A 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 it was in before the changes were made.
August 2003
23
2 Basic Concepts
•
Database recovery The DB2 Database Manager may be forced to restart without applications being able to close all open transactions. The log files containing the information about changes made by these transactions are required to perform database recovery when the database manager is started again. This involves rolling back (undoing) all open transactions for all applications.
•
Database restore A database can be recreated by restoring a previous backup. A backup represents the state of a database at the time the backup was performed, but does not contain information about transactions completed after this time. Therefore, after a backup image is used to restore a database, log file data generated after the backup was taken must be added to the database again, to bring the database completely up-to-date. This process is known as rollforward recovery. The command to add the log file information is as follows: DB2 ROLLFORWARD.
Restoring from an offline backup image Such a database is immediately usable after the ROLLFORWARD STOP subcommand. 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 operation was running are also required, as transactions may have modified the database contents during the time of the backup. Without this additional data the restored database cannot be activated. The database must be rolled forward to at least the point in time when the backup operation completed to ensure that the data is consistent throughout the database.
Rollback and database recovery do not normally require user intervention. The DB2 Database Manager retains all log files as long as they contain information from open transactions. User intervention is only required if the directory where the database manager stores log files is damaged or lost. This directory is known both as the LOGPATH and log directory. In case of loss or damage, you can recover at least those files that have been successfully archived with the tools described below.
If the log directory is changed and then the subdirectory or any required log files in that subdirectory are removed, DB2 will look for log files in the default log directory (SQLOGDIR) when the database is activated. If the log files are not found, the database will enter a backup pending state. In connection with rollforward operations, DB2 version 7 supports a log overflow directory. The rollforward operation first checks for logs in the location specified by the LOGPATH database configuration parameter. If you have moved any logs from the location specified by the log path parameter, use the ROLLFORWARD overflow directory parameter to specify the path to the logs that you moved. This is especially important in connection with recovery when logging to raw devices.
24
August 2003
2 Basic Concepts
2.2.2 Recovering Log Files The tools db2uext2 (the User Exit), brarchive and brrestore were developed as the log file management component of the Admin Tools. Their main purposes are: •
To archive log files.
•
To assist database administrators performing database rollforward operations after a database restore.
The Admin Tools are automatically installed as part of an SAP system installation with R3SETUP. If you install your SAP system with SAPinst, the Admin Tools are no longer automatically installed. You can manually (re)install, upgrade or patch the Admin Tools using the sddb6ins program. For more information, see Installing the Admin Tools Manually [Page 42]. Rollforward recovery is not enabled by default. Unless otherwise configured, the DB2 Database Manager reuses a fixed number of log files in a circular fashion, for example, 0,1,2,3,0,1,2,3,0 and so on. This behavior can be modified so that the database manager uses log files in an ascending order, for example, 0,1,2,3,4,…,9999999. By default, the database manager also does not start any application (User Exit) to independently archive full log files for later recovery. Database administrators are strongly recommended to set the following database parameters in the SAP environment to ON: •
LOGRETAIN Rollforward recovery is enabled by turning on this parameter. That is, circular logging is turned off and each new log file has a higher number.
Each time the LOGRETAIN parameter is turned off and on again, the database manager resets log file numbers and starts from zero again. This can result in several log files having the same log file number on a given node. The log files management tools only directly support recovery of the most recent version 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 is automatically 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 the database can be started again.
To perform online backups, the database must be operated in rollforward recovery mode. To restore the database from an online backup, all log files in use during the online backup operation must be available to complete the restore operation.
August 2003
25
2 Basic Concepts
Once these parameters have been turned on and a backup has been performed, the Admin Tools can be used to archive log files. The User Exit (db2uext2) is then automatically started by the database each time a log file is filled. Depending on how it is configured, the User Exit either archives log files directly to a storage management product, or it copies the log files to the directory referred to as archive directory (as defined by the DB2DB6_ARCHIVE_PATH environment variable). Groups of files in the archive directory can then be archived to tape, TSM or with an individual script using brarchive later. The database can be recovered later using the DB2 commands RESTORE and ROLLFORWARD. Dependent on the configuration, the User Exit either retrieves log files directly from the chosen repository, or from the archive directory and/or retrieve directories. The latter is the directory (defined by the DB2DB6_RETRIEVE_PATH environment variable) to which log files are restored using brrestore. To complete a rollforward operation (other than stop), brrestore and ROLLFORWARD operations may need to be performed repeatedly until all required log files have been retrieved and rolled into the database.
If the database is not rolled forward to the end of all logs when restarted, the Database Manager will create new log files starting with the number immediately following the last log file that was rolled into the database. This can result in several log files having the same log file number on a given node. The log file management tools only directly support recovery of the most recent version of log files. Recovery of older versions must be done manually.
Running the User Exit, brarchive and brrestore The User Exit does not need to be started by a user – it is automatically called by DB2 if configured correctly. Both brarchive and brrestore can be called from within the DB2 Control Center or can be started from the command line. brarchive can also be scheduled to be (regularly) started using the DBA Planning Calendar (SAP transaction DB13), or otherwise automated using scripts or batch files.
26
August 2003
2 Basic Concepts
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 is configured to call a vendor User Exit. The log file cycle is similar to direct archiving with the log files being copied elsewhere but the target and exact behavior depend on the vendor User Exit. The graphic describes the possible life cycle of a log file when using the log file management tools. …/log_archive/ S0000003.LOG (A) LOGPATH DB Parameter S0000004.LOG (B) …/log_dir . User Exit offline retained brarchive S0000005.LOG (D) S0000006.LOG S0000007.LOG brrestore online active User Exit restored retained online retained S0000000.LOG (C) (D) S0000001.LOG DB2DB6_RETRIEVE_PATH …/log_retrieve/ Indirect
Direct LOGPATH DB Parameter …/log_dir . S0000005.LOG S0000006.LOG S0000007.LOG
.
TSM, TAPE or SCRIPT S0000002.LOG archived retained
online active
TSM, DISK or VENDOR S0000000.LOG S0000001.LOG S0000002.LOG S0000003.LOG S0000004.LOG
online retained
archived retained
(A) User Exit (D)
Archive Restore
When the USEREXIT database configuration parameter is set, the database engine automatically starts the User Exit program to archive each log file as soon as it is full or it is closed. The location the file is moved to depends on the configuration of the User Exit. By default, log files are archived indirectly by first copying the file to the archive directory. The User Exit can be reconfigured to archive directly using TSM, archive to disk or via an alternative User Exit.
The Admin Tools can only administer the latest version of a log file with a given number per node, that is, you cannot administer two log files with the number 25 on node 0.
August 2003
27
2 Basic Concepts
Indirect Archiving and Restore (Default) Single log files are copied into the archive directory by the User Exit (A). brarchive is then used to archive groups of offline log files into an archive repository (also known as backend repository) (B). File archiving using the archive directory is referred to as indirect archiving. brrestore retrieves archived log files from the repository if they are no longer in the archive directory, and places them in the retrieve directory (C) where the User 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 archive or the retrieve directory (D).
Only indirect archiving supports archiving to tape without a vendor storage management product. However, before you decide to use this solution you should take the following disadvantages into consideration: • Log files are not immediately archived to long-term storage. Therefore, log files copied by the User Exit but not yet archived with brarchive can be lost if the disk containing the archive directory fails. • The complexity of the solution, including additional storage directories and an extra Admin DB slightly increases the risk of failure.
Direct Archiving and Restore Direct archiving is the recommended method for log file archiving, as it is the simplest and therefore most reliable method. Log files are archived immediately and directly to long-term storage. However, either TSM or another storage management product with its own User Exit is required. You can use these products not only to archive log files but also to archive backups. The User Exit can be configured to archive directly to TSM, archive to disk or to call a vendor User Exit for an alternative storage product. The latter provides support for any products which provide a User Exit, whilst ensuring that SAP tables containing log file information are also updated. A later ROLLFORWARD operation, after restoring the database, results in the files being automatically restored from the same source. Log files are not renamed during direct archiving or restore.
We recommend that database administrators use direct archiving as it performs well and requires minimal maintenance. ROLLFORWARD operations after a database restore normally require no user interaction when using direct archiving. For more information on how to configure the User Exit and the Admin Tools in general, see Changing the Admin Tools Configuration [Page 64].
Log File Naming Convention The log file names in the graphic above are simplified for readability depending on the way they are archived: •
Direct archiving Files are stored to the backend without their names being modified except if you are using direct archiving to disk. In this case, the node number NODEXXXX is appended to avoid problems in a multi-partitioned environment.
28
August 2003
2 Basic Concepts
•
Indirect archiving When the User Exit copies log files from the log directory to the archive directory, the files are renamed by appending the file-closure timestamp (14 digits) and the node number (NODExxxx). In ROLLFORWARD mode, when the User Exit moves files from the archive or retrieve directory back to the log directory, the original name is restored. Otherwise, the files will not be recognized by DB2. For example, during archiving, the copy of the file S0000001.LOG put in the archive directory might be renamed to S0000001.LOG.20001130140536.NODE0000. A file restored by brrestore (in the LOG RETRIEVE directory) still has the extended file name. The name is first truncated back to its original form in the copy returned to the log directory by the User Exit when it is called to retrieve files for a ROLLFORWARD operation.
DB2 log file names are of the format Snnnnnnn.LOG, where nnnnnnn is a seven digit number ranging from 0000000 to 9999999. When a database is first created, log files starting from S0000000.LOG are created. DB2 restarts the log file numbering sequence at S0000000.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, online active, are described in Log File States [Page 32].
Admin Tool Log File Management Model – Indirect Archiving Only Whenever a log file is archived, the Admin Tools also associate it with a database backup timestamp (that is, the date and time of the most recent SAP system database backup operation – whichever was performed most recently). The Admin Tools are then able to tell the database administrator which log files are needed to roll forward a database after a specific backup image has been restored. For more information, see Log File Restore of the SAP Database [Page 138]. In combination with the log file close timestamp (another log file attribute), the backup timestamp allows the Admin Tools to keep track of the restorable backup or log file combinations. The Admin Tools GUI (DB2 Control Center Extensions) also supports this.
Normally, only the Admin Tools should be used to manage log files. The files should not be moved or deleted manually as this will lead to data inconsistencies. The only exception to this is when log files that are no longer supported by the tools (see Invalid in the section Log File States [Page 32]), are restored. Those files must have the timestamp and node extension removed from their names when they are moved back to the log directory.
August 2003
29
2 Basic Concepts
2.2.4 Log File Deletion Log Files on Disk Log files in the DB2 log directory should not be deleted. The database manager automatically deletes or reuses these files after they have been successfully archived by the User Exit. Depending on the archiving method you choose, the following happens: •
If you chose direct archiving, no log file copies are made on disk and no deletion is needed.
•
If you chose indirect archiving, log files copied to the archive directory by the User Exit and later successfully archived using brarchive will only be deleted from the archive directory if this is explicitly requested. The same applies to log files restored to the 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). Log files 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 the User 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 restored using brrestore are not deleted using the same tools. Tapes can be reused, but other backend storage should be cleaned up regularly using the Admin Tools. Storage management products often supply their own tools for doing this or can be configured to automatically remove old files. However, it is essential that you use the Admin Tools to delete files when using indirect archiving, as the Admin DB is then also updated.
Log Files in Long-Term Storage •
Tape If you use a tape as a long-term storage, the Admin DB should always reflect the content of the tapes (in the Admin DB, there is an entry for each log file that is stored on tape). If you reuse a tape that already contains log files, all entries in the Admin DB will automatically be removed before the tape is overwritten with new log files. Therefore the Admin DB does not grow. If you lose a tape or if a tape becomes unreadable, you should delete the tape from the Admin DB to reflect this lost or unreadable tape in the Admin DB. For more information, see Deleting Tapes from the Admin DB [Page 112].
•
TSM If TSM is configured correctly and if you use an archive copy group for storing log files, the log files will automatically be deleted from TSM. If you use indirect archiving, the Admin DB does not recognize the automatic deletion and runs out of sync. To synchronize the Admin DB, you should use brrestore –delete. For more information, see Deleting Log Files [Page 94].
30
August 2003
2 Basic Concepts
If you use a backup copy group, you need to delete the log files manually. If you use indirect archiving, use brrestore –delete. For more information, see Deleting Log Files [Page 94]. If you use direct archiving, you may use db6adutl to delete the log files. •
Customer script If you use a customer script, you should use brrestore –delete to delete log files. For more information, see Deleting Log Files [Page 94].
2.2.5 Protocols The User Exit (db2uext2), brarchive and brrestore generate protocol information to record the actions that have been performed. Protocol information is also written into the Admin DB by the log file management tools. This information can be used by the DB2 Control Center Extensions. The Admin DB protocols and the protocol files of brarchive and brrestore are eventually deleted by brarchive. The frequency can be configured by setting configuration parameter delete_protocols using the DB2 Control Center Extensions.
Protocol files should only be deleted by the database system administrator. The protocol files have the following form and are written to the following directories: Tool
Protocol File(s)
Location
User Exit
db2uext2.log.NODExxxx db2uext2.err.NODExxxx
Directory defined by the DIAGPATH configuration parameter (db2 get dbm cfg …)
(Files are appended) brarchive
brarchive..lfa
•
For 4.6 D Admin Tools: /saparch
•
For 6.NN Admin Tools: /admintools/ protocols
•
For 4.6D Admin Tools /saprest
•
For 6.NN Admin Tools: /admintools/ protocols
(One file per run)
brrestore
brrestore..lfr (One file per run)
These tools can also write more detailed traces, normally only for use by support and development. For more information, see Appendix B: Troubleshooting [Page 171].
August 2003
31
2 Basic Concepts
2.2.6 Raw Device Log Files To achieve maximum performance, we recommend that you use raw devices for storing log data. This has the effect of bypassing a possible file system management overhead and allows DB2 to manage the log data with optimum efficiency. However, it is generally easier to work with log files in file systems, as these can be maintained and manipulated using standard operating system tools. The Admin Tools fully support raw logging. The differences between file system-based logging and raw device logging are hidden by the User Exit. The User Exit extracts raw data into individual files that then behave identically to non-raw log files. If you decide to use raw device logging, the following is necessary to enable rollforward during database recovery. If logging information cannot be obtained from the log extents available on the raw device, DB2 expects the logs to be in the log overflow directory. To allow the User Exit to put missing logs in the log overflow directory, the ROLLFORWARD utility must specify the overflow log path parameter.
2.2.7 Log File States This section is mainly written for system administrators and support personnel only for use if problems involving the Admin DB occur. Within an SAP environment, in order for the tools to know what operations have been performed on a log file, the log file is defined to pass though the following states during its life cycle. This state information is stored in the Admin DB, so it is only relevant to systems using the (default) indirect archiving method. This information is consequently not stored on systems performing direct archiving. •
Online active The log file is currently being used to log transactions. The location of the log file is defined in the LOGPATH database configuration parameter. This can be either a file system path or a raw device.
•
Online retained The log file is no longer being written to by the database, but may contain information about transactions that the database engine has not yet written from the buffer pool to disk. The log file is located in the log directory, and will also be in the archive directory after the User Exit has run.
•
Offline retained The log file is no longer being used and does not contain transactions with unwritten data pages. The log file is in the archive directory.
The original log file will also remain in LOGPATH until the database is stopped or the DB2 Database Manager reuses the file. However, the tools have no influence on this and so assume that the file is no longer there.
32
August 2003
2 Basic Concepts
•
Archived retained The log file has been archived using brarchive. The location of the archived log file is a storage management product, for example, TSM (Tivoli Storage Manager) or tape. If not explicitly deleted, the original log file is also still in the archive directory and no restore is possible (or necessary) as long as this original log file has not been deleted using brrestore.
•
Restored retained The log file has been restored using brrestore. The location of the restored log file is the retrieve directory. If not explicitly deleted by using the -delete option in a subsequent operation, the archived log file is also still available on the backend.
•
INVALID The Admin Tools can only administer the latest version of a log file with a given number per node. If the database generates a second log file with a number already used, the User Exit marks previous versions as INVALID. This can occur after a database restore if the ROLLFORWARD operation does not use all log files, or by turning the LOGRETAIN database configuration parameter off and on again. Older log files that have been archived can still be manually retrieved from the backend using system or storage product tools, but the Admin Tools only support the retrieval of the newest version.
•
Gone This state is only used internally to indicate that a log file could not be found in the location where it was expected, for example, if a customer uses MOVE, RENAME or DELETE. This state can also occur when storage products, such as TSM, automatically delete files after a certain period of time. A delete operation will delete such entries.
2.2.8 Special Cases - Non-Standard Behavior of Database Systems Certain systems are set up in a slightly non-standard way, for example: •
As split-mirror
•
As homogeneous system copy
In both cases the Admin Tools are either restricted or must be configured differently.
Split-Mirror for Backup Purposes DB2 has introduced a new concept known as split-mirror using the db2inidb tool. With this tool, you can rapidly create a mirror copy of a production system database without the need to shut down the system. This copy can then be used to perform an offline backup without affecting the performance of the original system, which continues processing as usual.
For this feature, we strongly recommend customers to only use direct archiving. This requires either TSM or a vendor product that provides its own User Exit. For more information, see The db2inidb Tool [Page 122].
August 2003
33
2 Basic Concepts
Homogenous System Copy You can create new SAP systems from existing system backups. In this case, the Admin Tools must be newly installed on the new system as the system name has changed.
Do not attempt to copy Admin DB information from the source system to the new target system. Although DB2 does not force a backup in this situation, as LOGRETAIN is normally already active, it is essential that you take a new backup before you use the Admin Tools on the new SAP system. Sometimes a system copy is used to overwrite another system or a previous system copy where the Admin Tools were already installed. In this case, the old Admin DB should be dropped before the Admin Tools are reinstalled. Additionally, the backup history file must be pruned to remove all previous backup information before a new backup is taken and before the Admin Tools are used.
2.3 SAP Security Concept General Information In an SAP environment, DB2 runs with authentication set to the value server_encrypt. This means that the user ID and password provided to connect to databases or attach to database instances are verified by DB2 using operating system services 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, environment variable DSCDB6HOME contains the name of the database server. In a system environment where the database server operates under an operating system other than Windows, DSCDB6HOME should contain the name of the server where 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 protected from unauthorized access using file system access authorizations. For all the dscdb6.conf accesses described in this documentation, environment variable DB2DB6EKEY is used to encrypt or decrypt the requested password.
34
August 2003
2 Basic Concepts
The value of DB2DB6EKEY must be identical on all application servers, the central instance, and on the SAP system database servers (all systems with the same ). DB2DB6EKEY is requested and set during SAP system installations. The default value is , but will need modifying for all but the central database server. The administrator can change this value at any time, but this requires that the value be updated on all other related systems, and the passwords in the file dscdb6.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 DB2DB6EKEY variable is set in the system environment.
Managing Passwords for Database Standard Users DB2 uses operating system users to maintain system security. The Admin Tools need access to the user passwords to access the database. These are stored in encrypted form in a special file and must be updated using the dscdb6up tool.
Do not change user passwords only using operating system methods. Tools that read password file dscdb6.conf will no longer be able to connect to the database until tool dscdb6up has been used. For information on how to set and update passwords for SAP system users, see Setting and Updating Passwords [Page 108].
2.4 Multi-Partitioned Systems The Admin Tools are also enabled to work with multi-partitioned systems. A multi-partitioned database can be configured to consist of more than one database node. In this case, in the SAP implementation, certain directories found in the single-partitioned environment are extended to become node-specific in a multi-partitioned environment and other directories are moved.
On UNIX, the home directory of the db2 user changes from /db2/ (single-partitioned system) to /db2/db2 (multipartitioned system). Also tools such as brarchive and brrestore should be used with the additional parameter –node. For more information on the syntax of brarchive and brrestore, see brarchive - Log File Archive Tool [Page 147] and brrestore - Log File Retrieval Tool [Page 153].
August 2003
35
3 Installation and Setup
3 Installation and Setup 3.1 Introduction This chapter is intended for administrators who want 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 the SAP 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 to successfully install the Admin Tools using the sddb6ins program.
•
SAPinst The Admin Tools are not automatically installed during the SAP system installation with SAPinst. However, you can install the Admin Tools after installing the SAP system. SAPinst creates the users and groups that are required to successfully install the Admin Tools using the sddb6ins program. Version 6.10 of sddb6ins and higher creates the directories and adds variables to the user environment that are required to run the Admin Tools.
The 6.NN Admin Tools must be used on SAP systems with release 6.10 or higher. They do not perform correctly on SAP systems with release 4.6D or lower, and the 4.6D Admin Tools do not perform correctly on SAP systems with release 6.10 or higher.
Installation Overview The following list provides an overview of the steps that you have to perform to install the Admin Tools and enable the SAP system database for recovery: ...
1. Check the SAP system environment [Page 38] to make sure that the SAP system was installed correctly. 2. Check the prerequisites for the installation of the Admin Tools [Page 43]. 3. Install or upgrade to the latest Admin Tools. For more information, see one of the following sections:
Upgrading the Admin Tools [Page 45] if you want to upgrade the Admin Tools to the latest version.
Installing the Latest Admin Tools [Page 46]if you want to install the latest version of the Admin Tools or apply the latest patch.
4. Check the Admin Tools environment [Page 47] 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 55]. You may have already performed this step as part of the database installation. Otherwise, this can be delayed until step 7 if rollforward recovery enabling (step 6) will be performed on the command line.
36
August 2003
3 Installation and Setup
6. Enable the database for rollforward recovery [Page 52]. 7. Catalog the databases to be administered. For more information, see Setting Up the DB2 Control Center [Page 56]. 8. Check that the DB2 Control Center Extensions are working correctly. For more information, see Using the DB2 Control Center Extensions [Page 63].
See also: •
For information on installing IBM DB2 Universal Database for UNIX and Windows with the SAP system, see the following documentation:
For SAP Web AS 6.10 and higher: SAP Web Application Server Installation on UNIX: IBM DB2 Universal Database for UNIX and Windows SAP Web Application Server Installation on Windows 2000: IBM DB2 Universal Database for UNIX and Windows You can find this documentation in the SAP Service Marketplace at the Internet address 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 and Windows To find this documentation, see the SAP Service Marketplace at the Internet address service.sap.com/instguides → SAP Basis.
For SAP R/3 Release 4.6x and lower: To find the corresponding documentation, see the SAP Service Marketplace at the Internet address service.sap.com/instguides → SAP R/3.
•
For additional information on installing the Admin Tools, see the following SAP Notes:
SAP Note 410252 DB6: Installing the latest 4.6D DB2 Admin Tools
SAP Note 455506 DB6: Installing the latest 6.NN DB2 Admin Tools
To find the SAP Notes, see the SAP Service Marketplace at the Internet address service.sap.com/notes.
August 2003
37
3 Installation and Setup
3.2 SAP System Environment The following sections explain the SAP system environment that is a prerequisite for the successful installation of the Admin Tools.
3.2.1 SAP System Users and Groups The following tables list the users and groups that are automatically created by the installation tool during the SAP system installation. SAP System Users User
Description
db2
Database administrator This operating system user is the DB2 instance owner and the SAP database administrator.
adm
SAP system administrator This operating system user is authorized to start and stop the SAP system and the DB2 Database Manager (instance). adm has the DB2 authorizations DBADM and SYSCTRL. DB2-specific monitoring functions invoked by SAP application server functions require SYSCTRL authorization. This user belongs to the operating system group dbctl.
sapr3
Database user These operating system users own all SAP database objects (tables, indexes and views). All database connection and instance access operations for an SAP application server are performed using these users.
First installed SAP system with Release 4.6D or lower
sap SAP systems based on SAP Web AS kernel Release 6.10 or higher and additional MCOD 4.6D SAP systems
Windows only: sapse
These users belong to the operating system group SAPSYS and are only created on SAP systems on which the SAP system database has been installed (not on remote application servers). These users have the following database authorizations: CREATETAB, BINDADD, CONNECT, and IMPLICIT_SCHEMA SAP service account user This operating system user is a virtual user. In general, on Windows the SAP system is started with this user account, but there is no need to log on to the SAP system with it. This user account must have the local user authorizations to Log on as a service and has to be a member of the local administrator group. The name of this user must be sapse.
38
August 2003
3 Installation and Setup
SAP System Groups Groups
Description
dbadm
Database system administration group Each member of this group has SYSADM authorization for the DB2 Database Manager instance. This is the highest level of authorization within the database manager and controls all database objects.
dbctl
Database system control group Each member of this group has SYSCTRL authorization for the DB2 Database Manager instance. SYSCTRL has authorizations allowing operations affecting system resources, but not allowing direct access to data.
Windows only:
Domain-level SAP system administration group This group is used for grouping the SAP system administrators. The sole function of a global group is to gather users together at domain level so that they can be placed in the appropriate local groups. The members of this group are the domain users adm and sapse.
SAP__GlobalAdmin
The group SAP__GlobalAdmin is only used when the SAP System belongs to a Windows domain. The group SAP__GlobalAdmin is not required for a local installation. Windows only:
Local group on an application server
SAP__LocalAdmin
Only local groups are created and maintained on an application server. A local group can only be given authorizations to the system where it is located. If the system is part of the domain, the local group can contain users and global groups from the domain.
August 2003
39
3 Installation and Setup
3.2.2 User Environment In the following table, the Set In column shows the location where the variables are set and where they need to be changed. General Environment Variables Environment Variable
Value
Set In
DB2INSTANCE
DB2
UNIX: ~/.dbenv_ .csh and ~/.dbenv_ .sh Windows: User environment
DB2DBDFT
Same as relevant location for variable DB2INSTANCE as described in this table
DB2DB6EKEY
(default value)
Same as relevant location for variable DB2INSTANCE as described in this table
INSTHOME
UNIX: Home directory of user db2
UNIX: ~/.dbenv_ .csh
Windows: Default value for a singlepartitioned system: :\DB2 Default value for a multipartitioned system: \\%DSCDB6HOME%\db2
and
UNIX: ~/.sapenv_ .csh
SAPSYSTEMNAME
~/.dbenv_ .sh Windows: User environment
and ~/.sapenv_ .sh Windows: User environment
40
August 2003
3 Installation and Setup
dbs_db6_schema
Database schema:
Valid for all SAP systems with SAP Web AS 6.10 or higher and MCOD 4.6D SAP systems
sap or sapr3 depending on the SAP system release you have installed.
Same as relevant location for variable SAPSYSTEMNAME as described in this table
Additional Environment Variables for Windows Environment Variable
Value
DSCDB6HOME
Database server name
SAPMNT
:\usr\sap\
SAPEXE
:\usr\sap\\SYS\exe\run
3.2.3 Access Authorizations for Admin Tool-Related Directories Access Authorizations for Directories and Files under UNIX DB2 Directory or File
Access Privilege in Octal Form
Home directory of user
755
Owner
db2
Group
dbadm
db2 (/db2/ or /db2/db2) /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
750
adm
dbadm
4750
root
dbctl
adm
dbadm
/usr/sap//SYS/exe/ run/dscdb6up /usr/sap//SYS/ global/dscdb6.conf
640
All authorizations can be checked using the –checkonly option of the sddb6ins program.
August 2003
41
3 Installation and Setup
Access Authorizations for Directories and Files under Windows Directory
Access Privileg e
Owner
For User or Group
:\db2
Full Control
Administrator
SAP__LocalAdmin, System
:\db2
Full Control
Administrator
Everyone
:\db2\\ log_dir
Full Control
Administrator
db2, System
:\db2\\ log_retrieve
Full Control
Administrator
SAP__LocalAdmin, System
:\db2\
Full Control
Administrator
SAP__LocalAdmin, System
:\db2\\ db2dump
Full Control
Administrator
SAP__LocalAdmin, System
3.3 Installing the Admin Tools Manually The 4.6D Admin Tools must be used on all SAP systems with release 3.1I − 4.6D where DB2 UDB for UNIX and Windows Version 7 or higher is installed. The Admin Tools are installed on the database server using program sddb6ins. During normal installation of an SAP system with R3SETUP, sddb6ins is called automatically. The administrator only needs to execute sddb6ins manually in the following cases:
42
•
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.1I and 4.6C
•
After completion of an SAP system upgrade and if you have not yet installed the latest Admin Tools
•
When applying a downward compatible kernel and if you have not yet installed the latest Admin Tools
•
When manually installing the Admin Tools or applying an Admin Tools patch
•
When checking the installation of the Admin Tools
August 2003
3 Installation and Setup
3.3.1 Prerequisites for the Admin Tools Installation Before you can install the Admin Tools, you must make sure that certain prerequisites are met. Some are general, some apply to a certain patch level of the sddb6ins program or depend on your operating system.
General Prerequisites •
Sufficient space Make sure that you have sufficient space (approx. 4 MB) in the directory containing the Admin Tools executables. sddb6ins installs the executables in the following directory:
For 6.NN Admin Tools: UNIX: $INSTHOME/admintools/bin Windows: %INSTHOME%\admintools\bin
For 4.6D Admin Tools UNIX: /usr/sap//SYS/exe/run Windows: :\usr\sap\\SYS\exe\run
If you are using indirect archiving (that is parameter -NODADMDB is not used during installation), the Admin DB requires additional space. The directory to which the database manager configuration parameter DFTDBPATH is pointing must be large enough to hold the Admin DB and its log files (approx. 4 MB). •
Availability of the database instance The SAP database instance DB2 must be running when installation program sddb6ins is executed.
•
Correct user environment Program sddb6ins must be executed in the correct user environment. Windows: To start sddb6ins.exe, log on to the database server as user adm.
When working with Microsoft Cluster, sddb6ins.exe must be executed on all cluster nodes. For this, set the environment variable DB2INSTANCE to db2 (instead of db2l) in the local command window. The database resource has to run on the actual cluster node. UNIX To run sddb6ins, you require root authorization with the adm user environment. Log on as adm and then change to user root using su.
Do not use su - to change to user root because the db2 user environment is then lost.
August 2003
43
3 Installation and Setup
UNIX only: For SAP Systems lower than 4.6x If you want to install the 4.6D Admin Tools for the first time on SAP systems lower than 4.6x, you have to perform the following additional steps as the group concept changed with Release 4.6A: ...
1. Create two new groups called dbctl and dbadm if they do not already exist. 2. Change the primary group of user db to dbadm and keep group sysadm as the secondary group. 3. Add group dbctl as the secondary group to user adm. 4. Update the database manager configuration. To do so, log on to the database server as user db2 and enter the following commands: db2 update dbm cfg using SYSADM_GROUP dbadm db2 update dbm cfg using SYSCTRL_GROUP dbctl 5. Perform an instance update to correct the file authorizations of executables, for example, db2start: a. Log on to the database server as user db2 and stop the DB2 instance. Enter the following command: db2stop force b. As user root, switch to the instance directory and update the DB2 instance. Enter the following commands: cd /instance ./db2iupdt db2 c. Log on again as user db2 and restart the DB2 instance. Enter the following command: db2start 6. Download the dscdb6up program from the SAP Service Marketplace at the Internet address service.sap.com/patches. 7. To extract dscdb6up using CAR, enter the following command: CAR -xvf dscdb6up.CAR 8. Copy the dscdb6up program to directory /usr/sap//SYS/exe/run. 9. Use chmod and chown to set the authorizations as follows: File /SYS/exe/run/dscdb6up
Permission 4750
Owner
Group
root
dbctl
/SYS/global
750
adm
dbadm
/SYS/global/dscd6.conf
640
adm
dbadm
acts as a place holder for /usr/sap/.
44
August 2003
3 Installation and Setup
3.3.2 General Information Return Codes of sddb6ins The 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. The following table describes the possible return codes: Return Code
Description
0
No error detected
1
Severe errors detected, the installation is not complete. For more information, see Appendix B: Troubleshooting [Page 171].
2
Warning. Errors have occurred during the installation but the installation is complete. Check the output messages.
The values listed in the table above differ from other Admin Tools.
Abbreviation of sddb6ins Options The following options of the sddb6ins program are not listed in detail in the sections Upgrading the Admin Tools [Page 45], Installing the Latest Admin Tools [Page 46] and Checking the Admin Tool Environment [Page 47]. Instead, {common option} acts as a placeholder for the following three options: •
[-s ]
•
[-db2dbnamepwd ] [-db2dbnamedomain ]
•
[-sidadmpwd
•
[-NOADMDB]
•
[-DEB []]
] [-sidadmdomain
]
For a detailed description of these options, see Appendix A: Tool Command Line Parameters [Page 147].
3.3.3 Upgrading the Admin Tools Use You use the -u option of the sddb6ins program to upgrade the Admin Tools. The following conditions apply: •
If you have performed an upgrade to an SAP system with Release 4.6D or lower but you are still using a version of the Admin Tools from before 4.6D, an upgrade to the latest 4.6D Admin Tools is strongly recommended.
•
If you upgrade to an SAP system Release 6.10 or higher, an upgrade to the 6.NN Admin Tools is required.
August 2003
45
3 Installation and Setup
If you are using a SAP system with Release 4.6D or lower and you want to use the 6.NN Admin Tools, Admin Tools upgrades are not supported.
Procedure To upgrade the Admin Tools, enter the following command: sddb6ins -u [] {common options} is a placeholder for the release of the previously installed Admin Tools.
For example, to upgrade the Admin Tools from 4.6D to 6.10 using the 6.10 sddb6ins executable: UNIX: sddb6ins –u 46D Windows: sddb6ins –u 46D –db2dbnamepwd > If the -NOADMDB option is used, the Admin DB will not be installed or will be dropped if it already exists. In this case log file archiving is only performed directly by the User Exit program db2uext2 (for more information, see Archiving Directly to TSM [Page 73]). Otherwise, the Admin DB will be installed (if not already present) and brarchive and brrestore are then also available. See also: Actions Performed by the sddb6ins Program [Page 48]
3.3.4 Installing the Latest Admin Tools Use You use the -i option in the following cases: •
You have to install the latest Admin Tools manually after an SAP system installation of Release 6.10 or higher.
•
You want to apply an Admin Tools patch for the currently installed Admin Tools. However, you must make sure that you are using a patch that is valid for the same release of the currently installed Admin Tools.
Procedure To manually install the latest Admin Tools or to apply an Admin Tools patch, enter the following command: sddb6ins -i [] {common options}
For example, to install the current version of the Admin Tools, enter the following command: UNIX:
46
sddb6ins –i
August 2003
3 Installation and Setup
Windows: sddb6ins –i –db2dbnamepwd > If the -NOADMDB option is used, the Admin DB will not be installed or will be dropped if it already exists. In this case log file archiving is only performed directly by the User Exit program db2uext2 (for more information, see Archiving Directly to TSM [Page 73]). Otherwise, the Admin DB will be installed (if not already present) and brarchive and brrestore are then also available.
The -a option of sddb6ins, which was used to install the latest Admin Tools after the installation of a downward-compatible kernel (DCK), no longer exists. Use the -i option instead. See also: Actions Performed by the sddb6ins Program [Page 48]
3.3.5 Checking the Admin Tools Environment Use You use option –checkonly to verify the Admin Tools installation. The verification routine checks if: •
The environments for user db2 and adm are set correctly.
•
The necessary files and directories exist and have the correct authorizations.
•
The DB2 instance variable DB2ENVLIST is set correctly.
•
The database configuration parameters LOGRETAIN and USEREXIT are set to ON for the SAP database .
•
UNIX only: Users and groups are set up correctly.
•
Windows only: The required shares exist.
Procedure To check the environment of the Admin Tools, enter the following command: sddb6ins –checkonly [] {common options}
For example, to check the Admin Tools, enter the following command: UNIX: sddb6ins –checkonly Windows: sddb6ins –checkonly –db2dbnamepwd >
August 2003
47
3 Installation and Setup
With the sddb6ins version 6.10 or higher, this verification is also performed automatically at the end of an installation (–i) or upgrade (-u) operation. The output contains useful information about the environment in which the Admin Tools operate. The verification tool writes the following message types: Message Type
Description
[I]
Provides information on the current configuration.
[E]
Severe configuration errors have occurred during the installation.
[W]
Warnings if possible inconsistencies have been detected
3.3.6 Actions Performed by the sddb6ins Program The following section describes the actions performed by the sddb6ins program during the installation (option -i) or upgrade (option -u) of the Admin Tools:
Actions Performed During Installation (-i) The sddb6ins program performs the following actions: •
6.NN Admin Tools only: The following table lists the directories that are created by sddb6ins: Directory
•
Description
•
UNIX: $INSTHOME/admintools
•
Windows: %INSTHOME%\admintools
•
UNIX: $INSTHOME/admintools/bin
•
Windows: %INSTHOME%\admintools\bin
•
UNIX: $INSTHOME/admintools/TraceFiles
•
Windows: %INSTHOME%\admintools\TraceFiles
•
UNIX: $INSTHOME/admintools/protocols
Contains brarchive and brrestore protocol files.
•
Windows: %INSTHOME%\admintools\protocols
User Exit protocol files are in the DIAGPATH directory.
Admin Tools directory, also contains the environment file init.db6.
Contains the Admin Tools executables and libraries.
Contains the trace files created by all Admin Tools.
6.NN Admin Tools on Windows only: In a multi-partitioned system, sddb6ins creates the following shares on the node where hostname matches the contents of the variable DSCDB6HOME:
48
log_archive
log_retrieve
August 2003
3 Installation and Setup
•
Extracts the executables stored in sddb6ins to the following directory:
For 6.NN Admin Tools: /admintools/bin
For 4.6D Admin Tools: /usr/sap//SYS/exe/run
•
•
•
Copies the User Exit program db2uext2 to the DB2 directory:
UNIX: $INSTHOME/sqllib/adm
Windows: \sqllib\bin
Copies the stored procedure sddb6jds, which is required for the DB2 Control Center Extensions, to the DB2 directory.
UNIX: $INSTHOME/sqllib/function
Windows: \sqllib\function
6.NN Admin Tools only: Removes executables installed with previous versions, which are no longer required. The Admin Tools up to 4.6D were stored in the same directory as the standard SAP system executables and were therefore deleted during an SAP system upgrade.
•
Creates or updates the environment file init.db6 in the following directory:
For 6.NN Admin Tools: /admintools directory (see table above)
For 4.6D Admin Tools: /usr/sap//SYS/global
For an example of the environment file, see Appendix D: Example of File init.db6 [Page 204]. •
By default, sddb6ins creates the Admin DB ADM if it does not already exist. If the –NOADMDB flag is used and the Admin DB exists, it is dropped. If –NOADMDB is not used, sddb6ins performs the following actions:
Customizes a multi-partitioned system.
Grants the access authorizations to the Admin DB ADM.
If required, it creates the tables in the Admin DB and fills the configuration table with default values if this table is empty.
4.6D Admin Tools only: Creates mirror tables in the database.
•
4.6D Admin Tools only: Creates a user defined function (UDF) entry in the database.
•
6.NN Admin Tools only: Adds Admin Tools-specific environment variables, for example for TSM, to the environment of db2 and adm.
•
Sets the DB2 instance variable DB2ENVLIST, so that the stored procedure works properly.
•
UNIX only: Sets the access authorizations on the Admin Tools directories and files as follows:
August 2003
49
3 Installation and Setup
6.NN Admin Tools Directory or File
Access Privileg e in Octal Form
Owner
Group
$INSTHOME/admintools
0755
db2
dbadm
$INSTHOME/admintools/bin
0755
db2
dbadm
$INSTHOME/admintools/protocols
0755
db2
dbadm
$INSTHOME/admintools/TraceFiles
0755
db2
dbadm
$INSTHOME/admintools/init.db6
0644
db2
dbadm
$INSTHOME/admintools/bin/brarchive
6755
db2
dbadm
$INSTHOME/admintools/bin/brrestore
6755
root
dbadm
$INSTHOME/admintools/bin/libdb6tp.[o|so|sl]
0755
db2
dbadm
$INSTHOME/admintools/bin/libdb6ds.[o|so|sl]
0755
db2