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. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft®, WINDOWS®, NT®, EXCEL®, Word®, PowerPoint® and SQL Server® are registered trademarks of Microsoft Corporation. IBM , DB2 , DB2 Universal Database, OS/2 , Parallel Sysplex , MVS/ESA, AIX®, S/390®, AS/400®, OS/390®, OS/400®, iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner, WebSphere , Netfinity®, Tivoli®, Informix and Informix® Dynamic Server trademarks of IBM Corp. in USA and/or other countries. ORACLE® is a registered trademark of ORACLE Corporation. UNIX , X/Open , OSF/1 , and Motif are registered trademarks of the Open Group. LINUX is a registered trademark of Linus Torvalds and others.
® ® ® ® TM ® ® ® ® ®

JAVA® is a registered trademark of Sun Microsystems, Inc. J2EE™ is a registered trademark of Sun Microsystems, Inc. JAVASCRIPT® is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MarketSet and Enterprise Buyer are jointly owned trademarks of SAP AG and Commerce One. SAP, SAP Logo, R/2, R/3, mySAP, mySAP.com, xApps, mySAP Business Suite, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies.

are

Disclaimer Some components of this product are based on Java™. Any code change in these components may cause unpredictable and severe malfunctions and is therefore expressively prohibited, as is any decompilation of these components. 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 referenced herein are trademarks of Citrix Systems, Inc. HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C , World Wide Web Consortium, Massachusetts Institute of Technology.
® ® ® ®

by SAP’s Support Services and may not be modified or altered in any way.

Documentation in the SAP Service Marketplace You can find this documentation at the following Internet address:
service.sap.com/instguides

Typographic Conventions
Type Style Example Text Represents Words or characters that appear on the screen. These include field names, screen titles, pushbuttons as well as menu names, paths and options. Cross-references to other documentation Example text Emphasized words or phrases in body text, titles of graphics and tables 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. 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. 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. Keys on the keyboard, for example, function keys (such as F2) or the Enter key.

Icons
Icon Meaning Caution Example Note Recommendation Syntax

EXAMPLE TEXT

Example text

Example text

<Example text>

EXAMPLE TEXT

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

...............................................................1 Configuring TSM Files dsm.............1 The db6util Tool.3 Checking the Size of Tables and Indexes........................................2..................107 6............1........4 Indirect Archiving to Tape ...............2...........1 Checking the Space Available in a File System.64 4.........................103 5..............................................................4..............4......4......................3..............................106 5.....2 Performing the Backup..........................4 Installation and Setup of the DB2 Control Center Extensions ..........104 5....................................................................................................1 Archiving Log Files from Disk to Backend ..................................110 6.81 4.....5 Indirect Archiving to TSM . 64 4.1 Backup Considerations .....................3 Configuration Considerations.......................96 5................................................4 Advanced Log File Management Tasks.......................................................2 Configuring TSM Environment Variables .2 Monitoring Dynamic SQL Statements ..............................109 6..............................................75 4.................sys ........................3................1 Monitoring Database Performance .......4..........6 Indirect Archiving Using a Customer Script ...........3 Using the Journal in the DB2 Control Center Extensions..........................................4..................56 3....1.................................................................1...2 Configuring the System for Archiving Log Files ............5 Reorganization of Tables and Tablespaces ................4...........55 3.........3...............................1 Parameters Affecting Log File Management Storage ....................................3 Setting Up the DB2 Control Center ...............................................................81 4..............97 5.......................................................2 Deleting Tapes from the Admin DB......................4 Frequency of Backups and Time Required...67 4................73 4.............................55 3.................................94 5.............2 Deleting Log Files ...63 4 Configuration ......................................................................99 5......................................1 DB2 Log File Management..................99 5.................103 5......................................................................................105 5.......................4....................3 Performance Monitoring ...74 4............................................................55 3...2 Storage Management .................................................2 Installing the DB2 Control Center Extensions....................................1.........................SAP Database Administration Guide: IBM DB2 Universal Databas 3.3.....1 Archiving Directly to TSM......88 4.....................................................................87 4.............2...4 DB2 Configuration Parameters .......1 Changing the Admin Tools Configuration.......2............................3...3 Configuring TSM (Tivoli Storage Management)........2 Checking the Space Available in a Tablespace........91 5............4 Job Monitoring....................................85 4......108 6.....................................3 Integrity of Backups...........4.............................................................................5 Advanced Backup Techniques.....3 Archiving to an Alternative Storage Management Product ..................2 Setting and Updating Passwords.......................................................................................112 6..........................................................................................101 5.2.....opt and dsm.....................3.........................1 Installation of the DB2 Control Center .112 6..................6 Redirected Restore.............3 Updating Statistics for Database Tables and Checking for Reorganization .....................................................................................................64 4................................................................4 Using the DB2 Control Center Extensions ..................................4......................... 91 5...............................................................................108 6.................................................2.......2.......114 August 2003 5 ............................................................83 4...............................84 4...........................75 4...............................4..............2 Archiving Directly to Disk ....................89 5 Regular Administration..................................................................106 6 Advanced Tasks ..................2..............1 Deleting Special Log Files..........................2....................97 5.. 107 6...2 Configuring the Admin Tools Using Environment Files ..................4.............5 Disk Space Considerations for Running the Admin Tools ..........................................103 5...........91 5.......................................................................................................100 5....4 Database Backup...3....................71 4.....102 5......................................................

.........................................................................................127 6......................................Tool to Assist Database Administration.......167 sddb6ins ..............123 6.........168 sddb6mir ..........................................Table Reorganization Tool .........................1 General Information .........................................................................................4 db2inidb Option: as standby for Hot-Standby Database.........................11 The db2inidb Tool......129 6.........................1 db2inidb Option: as mirror...........................................................................................................196 Collecting Diagnostic Information for SAP Support ...........................................................181 DB2 Control Center Extensions Troubleshooting ............................121 6...10 Managing Backups and Logs Archived on TSM......................178 brarchive/brrestore Troubleshooting ..........SAP Database Administration Guide: IBM DB2 Universal Databas 6...................................................173 Downloading Admin Tool Patches from the SAP Service Marketplace...........................................................................137 7.....................................................................................................7 Command Line Tasks Using db6clp ................165 dmdb6srp ...Redirected Restore Tool .................................................................................SAP TSM Management Tool ....................................197 6 August 2003 .................................................................................................................Log File Archive Tool..........Admin Tools Installation Program .2 Log File Restore of the SAP Database.DB2 User Exit.................................................171 DB2 CLI Trace........................ 137 7............................................................ 147 brarchive ......................153 db2adutl ..............................................................Admin DB Creation and Mirror Tool Utility .........................................................................................................................................................122 6..................................9 Monitoring Lock Waits and Deadlocks ............................172 Admin Tools Traces ........................................13 Adjusting the Content of the Admin DB ....................................8 Monitoring Database Alerts ..............3 Recovery of the Admin DB ................................163 db6util .................126 6.........................159 db2uext2 ..............................................................Update Statistics Tool ...........................Log File Retrieval Tool ......177 User Exit Troubleshooting ............................2 Recovery Process ...........11...............................................................................................120 6..................118 6........6............171 DB2 Trace Facility db2trc ...........................................DB2 Check Backup Utility................................................................................................1 SAP Database Recovery .............................................................2 db2inidb Option: as snapshot...........1 Usage of Tool brdb6brt ......................................................150 brrestore ..................................DB2 TSM Management Tool ...................................................................11.....................................DB2 Trace.........................................158 db2trc ...................................156 db2ckbkp .120 6.......................................................................11.....170 Appendix B: Troubleshooting.......3...12 Dual Logging...............174 General Troubleshooting Comments ................144 Appendix A: Tool Command Line Parameters ...................................164 dmdb6bkp ...............................162 db6adutl ..................................3.....................................................................135 7 Emergency Tasks ....................................................115 6.........................................................147 brdb6brt ..138 7...........176 Installation (sddb6ins) Troubleshooting ...........135 6................3 db2inidb Option: as standby for Backups .....................166 dmdb6rts .......11...143 7...........Database Backup Tool.....143 7.................. 171 DB2 Traces..............................

.......203 Appendix D: Example of File init<DBSID>.............................................202 DB2 Control Center Extensions Architecture ........................ 198 Admin DB Structure ..................................... 210 DB2 UDB for UNIX and Windows V7 .............212 Glossary and Index ..............................206 Appendix E: Example of Customer Script db6sctsm..................................smp ................................................210 DB2 UDB for UNIX and Windows V8 ..... 208 Appendix F: References ................................. 214 August 2003 7 ..204 File init<DBSID>.................SAP Database Administration Guide: IBM DB2 Universal Databas Appendix C: Implementation Details....db6 on Windows ....................db6.........Additional Documentation ..............................................................................db6 on UNIX .................................................................... 204 File init<DBSID>.......................198 brarchive and brrestore backend Library Architecture ......................Additional Documentation .................................

The information provided in this documentation applies to all SAP kernel releases starting from 3. separating information frequently needed from that which the administrator only requires. It is structured to be of use to both people new to database administration and experienced SAP administrators alike. and maintaining systems. in an emergency. The information in this documentation has been collected from a variety of sources such as previous administration documentations. It will also be of use to a range of customer support functions when planning. or what information to send to SAP if no solution can be found. It also includes a new troubleshooting section giving advice about solving problems before contacting SAP.1I and higher as well as IBM DB2 Universal Database for UNIX and Windows Version 7 and higher. including those with experience with other database products. installing.1. SAP Notes and customer experience and gives the administrator a single point of reference. The information is presented in a task-oriented way. we would ask you to use the following email address: feedback.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. 8 August 2003 .com 1. The documentation is written based on DB2 UDB Version 7 as the underlying database release. or assisting in these tasks.1 Introduction 1 Introduction 1.db6@sap.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. If you would like to give feedback on this documentation. for example. The concepts described in this documentation are also expected to apply to other DB2 for UNIX and Windows database versions.

Example of the File init<DBSID>. interfaces.1 Introduction 1. 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. Troubleshooting Describes what to do when tools do not work as expected. its targeted audience. Advanced Tasks Covers one-time or rarely needed tasks not related to configuration. 7.db6 E. 6. Configuration Describes the available options and steps required to configure the Admin Tools.smp F. References G Glossary and Index August 2003 9 .2 How this Documentation is Structured This documentation is divided into the following sections: Chapters . 4. including DB2 UDB-specific information on installing and configuring servers and clients for the SAP system. Installation and Setup Explains how to install Admin Tool patches and deal with upgrades. B. Introduction Provides general information about the guide. Also includes monitoring and performance considerations. especially for support personnel. C. Emergency Tasks Tasks that administrators may need to perform after a database failure. naming conventions and new features. which must be performed before log files can be stored to tape. 3. 2. It also covers manual (re)installation of the tools if required. Tool Command Line Parameters Contains detailed command line syntax for each command.. 5. Implementation Details Contains internal tool information. Some tasks may be prerequisites for other day-to-day tasks. Basic Concepts Describes administration and Admin Tools and the related concepts. Example of Customer Script db6sctsm. 1. Appendices A.1. D.

or Windows 2000. but in this documentation the product is referred to as TSM. Windows The term Windows refers to Windows 95. The term ADSM is normally only used in this guide to indicate program parameters or configuration parameter names.10 Admin Tools The term 6.10 and higher.NN Admin Tools / 6. Serious problems have occurred when using the Admin Tools with TSM Version 3. single-partitioned system / EE system The term single-partitioned system replaces the term EE system. see Glossary and Index [Page 214]. Tivoli (IBM) no longer supports the product ADSM. 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.1 or higher.com.7. 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. 10 August 2003 . Additionally the term SAP system also refers to other components of mySAP. 6. so an upgrade is also strongly advised. Servers can only be installed on Windows NT or Windows 2000. Windows 98.NN Admin Tools replaces the term 6. Windows NT. The names are often used interchangeably. This version is also out of service now. as these Admin Tools can be used for any SAP system release starting from 6.2 Naming Conventions Terminology For information on terminology used in this documentation.10 Admin Tools. Tivoli Storage Management (TSM) / ADSM The IBM storage product ADSM has been renamed to TSM (Tivoli Storage Manager) in the most recent versions. multi-partitioned system / EEE system The term multi-partitioned system replaces the term EEE system. Customers still using ADSM are strongly advised to upgrade to TSM Client Version 4. 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.1 Introduction 1. Clients can be installed on any Windows platform.

environment variables may have been set to non-existent directories. only once per database. user db2<dbsid> and all <sapsid>adm users can perform log file management tasks. If an MCOD system is removed.3 Admin Tools: Enhancements and Changes The following sections summarize recent changes to the Admin Tools. It is necessary to differentiate between the SAP system ID <SAPSID> and the SAP system database name <DBSID>.1 Introduction 1. which do not need to be the same. as is often the case for the first SAP system installed on a database. The 6. 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. that is. If <SAPSID> and <DBSID> have the same value.6D systems where DB2 UDB for UNIX and Windows Version 7 or higher is installed. The database connect user for the first SAP system in a 4. Admin Tools files and directories may have been unintentionally removed or were given the wrong ownership or authorizations. that the initial SAP system must have the same ID as the SAP database. as these are no longer necessarily the same. the old terminology still applies as described in the table below. As log files are shared by all the SAP systems using the same single database. see Installing the Admin Tools Manually [Page 42]. However. August 2003 11 .6D system environment is still sapr3. you must make sure that the db2<dbsid> user environment still points to another valid MCOD system using the same database. which it installs. They are only installed with the first SAP system.10 Admin Tools or higher should be used with all SAP system releases above and including 6. Further SAP systems have different IDs.6x releases. and so on. the 4. we refer to the Admin Tools release and not the SAP system release.SAR file. user IDs and directory names may be affected. For example. 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. Additionally. The sddb6ins program now also contains the remaining Admin Tools.1I to 4. sddb6ins therefore no longer requires a separate DBATOOLS.6D Admin Tools should be used on all SAP 3. • Admin Tools in an MCOD Environment The Admin Tools have been modified to support this SAP feature. and the shared library path environment variable must no longer be set before starting it. Within these sections.10. there is a limitation in SAP 4. For more information.

it is only necessary to verify that the db2<dbsid> user is set up correctly.6D system environment. This user may require changes to his environment. certain Admin Tools are no longer fully functional. <sapsid> <DBSID>. the real directory name after substitution remains unchanged: Old New /usr/sap/<SID>/sys/exe/run /db/<SID>/log_dir /usr/sap/<SAPSID>/sys/exe/run /db/<DBSID>/log_dir If the original SAP system is removed. <sid> New ID <SAPSID>.6D SAP systems. <sid> <SID>. If <SAPSID> and <DBSID> are the same. Use sddb6ins –checkonly to verify this. From SAP system Release 6. Directory Names Descriptions Directory SAP system related directories db2<dbsid> home directory and subdirectories Old Name <SID> <SID> New Name <SAPSID> <DBSID> The following are examples of how the descriptions of directory names have changed on UNIX systems compared to earlier versions of this documentation on.10 and higher.1 Introduction The following terminology conversions must be used: SAP System and Database Name Descriptions ID SAP system ID SAP database name Old ID <SID>. 12 August 2003 . This restriction only applies to 4. <dbsid> User ID Descriptions User Database instance owner SAP database administrator Database connect user Old ID db2<sid> <sid>adm sapr3 New ID db2<dbsid> <sapsid>adm sap<sapsid> sapr3 is still used for the first SAP system in a 4.

3.6D Patch 20 and 6. For information on the main differences between the 4.6D and 6.NN Admin Tools.10 and higher. see Adjusting the Content of the Admin DB [Page 135]. August 2003 13 .NN stands as a placeholder for all Admin Tools releases starting from 6.6D and 6.1 Introduction For more information on released platforms and availability. • Admin Tools and DB2 Version 8 The Admin Tools are now supported for DB2 UDB for UNIX and Windows Version 8. 1. see New Features [Page 13]. see Archiving Directly to TSM [Page 73]. 6. • Option sddb6ins –r You use this option to recreate the Admin DB from a SAR file. • Option brarchive –GAL/-DMP You use this option to adjust the Admin DB to a file system. Some changes were specifically implemented for the 4. For more information.6D patch 22 and 6.NN Patch 9 • brarchive/brrestore customer script interface You can now write your own individual backend interface. see SAP Note 533979. • Support of two TSM management classes The User Exit and brarchive can now archive log files to two TSM management classes. • 64-bit Support The Admin Tools have been modified to work with 64-bit platforms.NN patch 11.NN Admin Tools and delivered as patches. For more detailed information on 4. For more information.6D and 6. see Archiving Log Files from Disk to Backend [Page 91].db6.sap. You activate this feature by setting configuration variable DB2DB6_UEXIT_RETRIEVE_WO_DB in file init<DBSID>.NN Admin Tools. see Recovery of the Admin DB [Page 143]. • 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.1 New Features This section provides information on new features that have been specifically implemented for the 4.6D and 6. For more information. see the SAP Service Marketplace at the Internet address service.NN Admin Tools [Page 16].com/platforms and choose → Multiple Components in One Database (MCOD). For more detailed information. For more information. New Features of 4. see Differences Between 4.

the sddb6mir tool also adds missing log files.NN patch 12.6D Patch 22 and 6. • Support of TSM LANFREE The Admin Tools have been modified to support the TSM LANFREE feature. New Features of 4.6D Patch 25 and 6. Archiving without the Admin DB causes less problems.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. This updates the information in the old version of transaction DB12. the User Exit is now able to archive log files directly to disk. see Configuring TSM (Tivoli Storage Management) [Page 83]. 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. For more detailed information on 4. For more information. For more information. set DB2DB6_UEXIT_ARCHIVE_WO_DB to OFF in the init file. see SAP Note 597416. The necessary tasks to update the Admin DB content are moved from the User Exit to brarchive.6D patch 23 and 6. For more information. see Advanced Log File Management Tasks [Page 109]. see Configuring the System for Archiving Log Files [Page 71]. • Archiving directly to disk If you are using direct archiving. For this reason. Before mirroring. For more information. see SAP Note 597356.6D Patch 23 and 6. • Option brarchive –do You use this option to delete obsolete log files using the command line.NN Patch 11 • Option brarchive –dt You use this option to delete tapes using the command line. see Deleting Log Files [Page 94]. New Features of 4. 14 August 2003 .NN Patch 14 • Indirect archiving without accessing the Admin DB is now the default for all releases. You activate this feature by setting configuration variable DB2DB6_TSM_MULTITHREADED in file init<DBSID>. You activate or deactivate this feature of the User Exit by setting configuration variable DB2DB6_UEXIT_ARCHIVE_WO_DB to ON or OFF.NN patch 11.6D patch 22 and 6.db6. For more detailed information on 4.1 Introduction New Features of 4. To turn archiving without the Admin DB off. this is now the default for all SAP system releases.

This may occur in a redirected restore scenario because the container layout is then different to the one when the backup was made. see SAP Note 599121. These scripts can be used as a template in db2relocatedb with command relocate DB or in db2inidb with command RELOCATE USING. You activate this feature by removing the two dashes (−−) at the beginning of the corresponding comment line. see SAP Note 599123. The DB2 Control Center Extensions are supported for DB2 UDB for UNIX and Windows Version 8. For more detailed information on patch 5 of brdb6brt. this variable is set to ON by default. Option –bm RETRIEVE RELOCATE You use this option to create scripts that can be used for database relocation. 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. It retrieves the information from the backup history file.NN Admin Tools.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. • DB2 Control Center Extensions patch 3: You can now use the DB2 Control Center Extensions for the 4. For more detailed information on patch 3 of the DB2 Control Center Extensions. 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. you can replace the database name <DBSID>. For example.6D and 6. Option –replace <replace definition> You use this option to modify the generated scripts for redirected restore and relocation. For DB2 Version 8. Backup information in brdb6brt brdb6brt automatically contains the information from the latest full backup. August 2003 15 . The DB2 Control Center Extensions have been modified to support the customer script option of brarchive.

The following table shows the location of the Admin Tools files and variables for 4. their configuration. Thus. the main differences to the 4. the program sdd6mir. libdb6* Protocol files UNIX: /usr/sap/<SAPSID>SYS/ exe/run Windows: <drive>:\usr\sp###BOT_TEXT###lt;SAPSID>\SYS\ exe\run UNIX: /db2/<DBSID>/saparch /db2/<DBSID>/saprest Windows: <drive>:\db2\db2<dbsid>\ saparch <drive>:\db2\db2<dbsid>\ saprest Trace files UNIX: /tmp/TraceFiles Windows: <DB2DB6_TEMP_DIR>\ TraceFiles 6. For more information.10 Admin Tools no longer need to be re-installed after an SAP system upgrade. is no longer required. For more information on how to recover the Admin DB. 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.3. This implies that the 6.6D and 6. the Admin Tools. unlike Admin Tool versions up to 4.NN Admin Tools delivery does not contain program sddb6mir any more. If log files are stored using brarchive.6D Executables and libraries: brarchive/ brrestore.1 Introduction 1. which was used to perform this action.6D and 6. db6adutl. When SAP system log files are stored directly by the User Exit to TSM. the 6. the Admin DB ADM<DBSID> was mirrored to the SAP database to reduce the risk of data loss. protocol and trace files have been moved.6D Admin Tools are: • ADM<DBSID> database mirroring no longer required In the past. the Admin DB is not required and so no backup (mirror) of this database is needed. • New location for Admin Tools executables To reduce the dependencies between the almost release-independent Admin Tools and the release-dependent SAP products. see Installing the Admin Tools Manually [Page 42]. This has proven to be unnecessary.NN Admin Tools Since the implementation of the 6. see Recovery of the Admin DB [Page 143].NN: 4.NN UNIX: <INSTHOME>/admintools/ bin Windows: <INSTHOME>\admintools\ bin UNIX: <INSTHOME>/admintools/ protocols Windows: <INSTHOME>\admintools\ protocols UNIX: <INSTHOME>/admintools/ TraceFiles Windows: <INSTHOME>\admintools\ TraceFiles 16 August 2003 .2 Differences Between 4.NN Admin Tools. This means that.6D. for example.

For more information. This ensures that an online backup has a complete set of archived log files available for recovery.csh/ sh Windows: user environment 1. For more information. For more information. you specify its name.1 Introduction TSM environment variables UNIX: in. which is then automatically archived by DB2 if the User Exit is enabled.2. an administrator can rename a tablespace with the RENAME TABLESPACE statement. For more information.1 • Closing the Active Log File after Backup After an online backup is complete. In previous versions. • Renaming a Tablespace When creating a tablespace. see the IBM documentation DB2 Administration Guide: Implementation. DB2 forces the currently active log file to be closed and as a result it will be archived. see the IBM documentation DB2 Administration Guide: Implementation. see the IBM documentation DB2 Administration Guide: Implementation • On Demand Log Archive Support You can now force the currently active log file closed.1 and Version 7.csh/sh Windows: user environment UNIX: <INSTHOME>/admintools/ bin/dbaenv_<host>. Now. • 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.4 DB2 UDB for UNIX and Windows Version 7: Enhancements The following are the major new features in Version 7. which are relevant to the Admin Tools: Version 7. This feature gives database administrators more granular control over their backup and restore strategy. you were not allowed to change that name again during the lifetime of the tablespace object. August 2003 17 .dbenv_<host>. see the IBM documentation DB2 Administration Guide: Implementation.

• 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. incremental. or delta backup). By momentarily suspending I/O to disk.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 will ensure that the split mirror copy maintains its integrity. A new tool db2inidb has been created that operates on split mirror copies. see the DB2 Release Notes. while allowing online split mirror handling of the database. DB2 attempts to create the log file every five minutes and writes a message to file db2diag. If you want to use the db2inidb tool. Delta backup: Only contains data that has changed since the last tablespace backup (full. 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.2 • Block Transactions When Log Directory is Full DB2 Version 7. • 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. This may improve performance on SMP machines.1 Introduction Version 7. • Parallel Recovery DB2 now uses multiple agents to perform both crash recovery and database rollforward recovery. • Suspended I/O Supports continuous system availability. This file indicates if your application is hanging. For more information on the DB2 instance variable DB2_BLOCK_ON_LOG_DISK_FULL .log after each attempt. 18 August 2003 . we strongly recommend that you read The db2inidb Tool [Page 122] before you start using it.

Be aware that if you activate this feature. has increased from 32 GB to 256 GB. • Block Transactions when Log Directory is Full The block on log disk full function. effectively allowing a transaction to use an infinite number of log files. have been removed. • Point in Time Rollforward Recovery to Local Time When using point in time (PIT) rollforward recovery.1 Introduction 1. 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. Without infinite active log enabled. • Increased Log Space The maximum amount of log space. 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. Logging Enhancements • Dual Logging Restrictions of this feature. Infinite active log is enabled by setting logsecond to -1. you should set the new database configuration parameters MAX_LOG and NUM_LOG_SPAN to avoid that transactions run indefinitely. the log records for a unit of work must fit in the primary log space.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 . rollbacks may take a long time if the log files containing the rollback information need to be retrieved by the User Exit. • Infinite Logging It allows an active unit of work to span the primary logs and archive logs. This section briefly summarizes new features that affect log file management and database administration in an SAP environment.What’s New. 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. Backup and Recovery Enhancements • XBSA Support Backup can now interface with solutions from storage vendors that have implemented the XBSA industry standard interface. This feature is now supported on Windows as well. which was introduced in DB2 Version 7.2. You can choose the mirror log directory by setting database configuration parameter mirrorlogpath. which can be defined. We strongly recommend that you use this feature only if you are using direct archiving. August 2003 19 . If you use indirect archiving. you can now specify the time as local time. In addition. is now set using database configuration parameter blk_log_dsk_ful. which was introduced in DB2 Version 7.

reduce the size of existing containers.1 Introduction • Database Maintenance Mode: QUIESCE Using the new QUIESCE command. 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. In addition. or deactivate and activate the database. online table reorganization can be paused and resumed later by anyone with the appropriate authorization by using the schema and table name. The quiesce mode of the database is ideal to create an offline backup without the need to stop the SAP application servers. • Online Index Reorganization A table and its existing indexes can be read and updated during an index reorganization using the new REORG INDEXES command. DB2 Version 8 will allow you to drop a container from a tablespace. you can force all users off an instance or a database and put it into a quiesced mode for database maintenance activities. Availability Enhancements • Online Table Reorganization Online table reorganization allows applications to access the table during the reorganization. and add new containers to a tablespace in a way that a rebalance does not occur. • Online Configuration Parameters Over 50 configuration parameters can now be set online. • DMS Container Operations If you use database-managed tablespaces. You no longer have to disconnect users when you fine tune your system. Changes to these online configuration parameters take immediate effect without the need to stop and start the instance. Online table reorganization is allowed only on tables with type-2 indexes and without extended indexes. 20 August 2003 . which gives you more flexibility to decide when to change the configuration.

2 Basic Concepts 2 Basic Concepts 2. 2. These are extra menu options and windows that are available in the DB2 Control Center after the extensions are installed. the DB2 Control Center Extensions. 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. Much of this terminology is described in Glossary and Index [Page 214]. has been created that simplifies access to several of the Admin Tools. and the terminology used throughout this documentation. which supplement standard DB2 tools.1 Introduction This chapter describes the concepts relating to the Admin Tools.1 The SAP DB2 Admin Tools The SAP DB2 Admin Tools are a collection of tools specific to the SAP environment.1. This documentation includes new and updated information that was not available in previous versions. a graphical interface. August 2003 21 .

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. or use Start panels on Windows platforms. use the db2cc command on the command line. You can also access tools such as DB2 Visual Explain and DB2 Performance Monitor from the DB2 Control Center. and can be started in interactive input mode. 2. SQL statements and get online help. 22 August 2003 . backup and recovery. • DB2 Control Center (DB2CC) DB2 tool offering a graphical user interface that simplifies administrative tasks such as configuring the database.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. It offers a variety of command options. command mode and batch mode. and managing media. To start the DB2 Control Center. choose Help → Getting Started. For more information.1.2 Basic Concepts SAP System <SAPSID> SAP database <DBSID> M o Ex nit ec or ut e Admin Tools SAP processes + Monit o + Exe r cute Proto c + Qu o l ery cute Ex e DB2 Control Center + SAP Extensions Configure + Query Admin database ADM<DBSID> The following graphic shows the relationship between the Admin Tools and the DB2 Control Center Extensions plus the SAP system and database. scheduling jobs. For introductory information. see the DB2 Command Reference.

In both cases the database needs log file information to return the database to the state it was in before the changes were made. These log files are required for the following purposes: • Explicit and implicit rollback When a database transaction is rolled back all changes are undone.1 Recovery . for example. August 2003 23 . The system administrator can also use this interface to automate tasks. Implicit rollback A program making changes to the database does not commit changes before exiting.2 SAP Log File Management This section explains why log file management is an essential part of system administration. 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.2. but may require user knowledge of complex command syntax. Explicit rollback An application indicates that changes that it started to make to the database are invalid. Generally this is the fastest and most flexible method. The DB2 Database Manager generates log files to keep track of changes made to the database. 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. and how the Admin Tools assist in this task.2 Basic Concepts • Operating System Command Line This can be used to perform the majority of tasks described in this documentation.The Need for Log Files Once a database is up and running. either through incorrect programming or a crash. 2. 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. • SAP Transactions These provide an additional graphical interface for starting specific tasks. by writing scripts or batch files.

This is especially important in connection with recovery when logging to raw devices. Alternatively. use the ROLLFORWARD overflow directory parameter to specify the path to the logs that you moved.2 Basic Concepts • Database recovery The DB2 Database Manager may be forced to restart without applications being able to close all open transactions. The command to add the log file information is as follows: DB2 ROLLFORWARD. If the log directory is changed and then the subdirectory or any required log files in that subdirectory are removed. This process is known as rollforward recovery. log file data generated after the backup was taken must be added to the database again. 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. In case of loss or damage. Restoring from an online backup image In the case of an online backup. If you have moved any logs from the location specified by the log path parameter. • Database restore A database can be recreated by restoring a previous backup. Therefore. Without this additional data the restored database cannot be activated. The DB2 Database Manager retains all log files as long as they contain information from open transactions. but does not contain information about transactions completed after this time. The rollforward operation first checks for logs in the location specified by the LOGPATH database configuration parameter. 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. the database will enter a backup pending state. This directory is known both as the LOGPATH and log directory. the log files generated while the backup operation was running are also required. Restoring from an offline backup image Such a database is immediately usable after the ROLLFORWARD STOP subcommand. 24 August 2003 . A backup represents the state of a database at the time the backup was performed. log files can be first applied to bring the database up to date (to end of logs). DB2 will look for log files in the default log directory (SQLOGDIR) when the database is activated. as transactions may have modified the database contents during the time of the backup. This involves rolling back (undoing) all open transactions for all applications. If the log files are not found. you can recover at least those files that have been successfully archived with the tools described below. Rollback and database recovery do not normally require user intervention. In connection with rollforward operations. User intervention is only required if the directory where the database manager stores log files is damaged or lost. DB2 version 7 supports a log overflow directory. after a backup image is used to restore a database. to bring the database completely up-to-date.

2.1. Each time the LOGRETAIN parameter is turned off and on again. the database manager also does not start any application (User Exit) to independently archive full log files for later recovery. If you install your SAP system with SAPinst.2. 0. The log files management tools only directly support recovery of the most recent version of log files. This behavior can be modified so that the database manager uses log files in an ascending order. To restore the database from an online backup. By default.2 Recovering Log Files The tools db2uext2 (the User Exit). all log files in use during the online backup operation must be available to complete the restore operation.2. The User Exit is automatically started by the DB2 engine each time a log file becomes full. August 2003 25 . upgrade or patch the Admin Tools using the sddb6ins program. Recovery of older versions must be done manually.2 Basic Concepts 2. Unless otherwise configured. 0. brarchive and brrestore were developed as the log file management component of the Admin Tools.0 and so on.9999999.1. 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. the Admin Tools are no longer automatically installed.2. after which the database can be started again. the database must be operated in rollforward recovery mode. To assist database administrators performing database rollforward operations after a database restore.0. • USEREXIT The User Exit mechanism is enabled by turning on this parameter. Their main purposes are: • • To archive log files. Rollforward recovery is not enabled by default. To perform online backups. circular logging is turned off and each new log file has a higher number.3. A backup is required after setting the LOGRETAIN parameter (or both). The Admin Tools are automatically installed as part of an SAP system installation with R3SETUP. for example.3. This can result in several log files having the same log file number on a given node. That is. You can manually (re)install. the DB2 Database Manager reuses a fixed number of log files in a circular fashion.4. For more information. see Installing the Admin Tools Manually [Page 42].1. the database manager resets log file numbers and starts from zero again.…. for example.3.

The database can be recovered later using the DB2 commands RESTORE and ROLLFORWARD. or from the archive directory and/or retrieve directories.2 Basic Concepts Once these parameters have been turned on and a backup has been performed. or it copies the log files to the directory referred to as archive directory (as defined by the DB2DB6_ARCHIVE_PATH environment variable). Depending on how it is configured. Both brarchive and brrestore can be called from within the DB2 Control Center or can be started from the command line. the Admin Tools can be used to archive log files. the Database Manager will create new log files starting with the number immediately following the last log file that was rolled into the database. the User Exit either archives log files directly to a storage management product. Recovery of older versions must be done manually. the User Exit either retrieves log files directly from the chosen repository. Running the User Exit. Groups of files in the archive directory can then be archived to tape. This can result in several log files having the same log file number on a given node. Dependent on the configuration. The User Exit (db2uext2) is then automatically started by the database each time a log file is filled. or otherwise automated using scripts or batch files. To complete a rollforward operation (other than stop). 26 August 2003 . If the database is not rolled forward to the end of all logs when restarted. The latter is the directory (defined by the DB2DB6_RETRIEVE_PATH environment variable) to which log files are restored using brrestore. TSM or with an individual script using brarchive later. The log file management tools only directly support recovery of the most recent version of log files. brarchive can also be scheduled to be (regularly) started using the DBA Planning Calendar (SAP transaction DB13). brarchive and brrestore The User Exit does not need to be started by a user – it is automatically called by DB2 if configured correctly. brrestore and ROLLFORWARD operations may need to be performed repeatedly until all required log files have been retrieved and rolled into the database.

The User Exit can be reconfigured to archive directly using TSM.LOG archived retained .LOG (D) S0000006.LOG S0000006. DISK or VENDOR S0000000. you cannot administer two log files with the number 25 on node 0.2. The Admin Tools can only administer the latest version of a log file with a given number per node.LOG (A) LOGPATH DB Parameter S0000004.LOG archived retained Archive Restore When the USEREXIT database configuration parameter is set.LOG (B) …/log_dir . …/log_archive/<DBSID> S0000003. log files are archived indirectly by first copying the file to the archive directory.2 Basic Concepts 2.LOG S0000002.LOG (C) (D) S0000001. (A) User Exit (D) TSM. where the SAP User Exit is configured to call a vendor User Exit. that is. 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 location the file is moved to depends on the configuration of the User Exit. By default. User Exit offline retained brarchive S0000005. There is a third scenario.LOG S0000004.3 Log File Life Cycle (Archive and Restore) The following section covers the standard scenarios known as indirect and direct archiving.LOG S0000007.LOG S0000003. the database engine automatically starts the User Exit program to archive each log file as soon as it is full or it is closed. August 2003 27 . which is a variation of direct archiving.LOG S0000001. archive to disk or via an alternative User Exit. S0000005. The graphic describes the possible life cycle of a log file when using the log file management tools. TAPE or SCRIPT S0000002.LOG S0000007.LOG brrestore online active User Exit restored retained online retained S0000000.LOG online active online retained TSM.LOG DB2DB6_RETRIEVE_PATH …/log_retrieve/<DBSID> Indirect Direct LOGPATH DB Parameter …/log_dir .

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. after restoring the database. Therefore. A later ROLLFORWARD operation. as it is the simplest and therefore most reliable method. For more information on how to configure the User Exit and the Admin Tools in general. The latter provides support for any products which provide a User Exit.2 Basic Concepts Indirect Archiving and Restore (Default) Single log files are copied into the archive directory by the User Exit (A). Log files are archived immediately and directly to long-term storage. log files copied by the User Exit but not yet archived with brarchive can be lost if the disk containing the archive directory fails. ROLLFORWARD operations after a database restore normally require no user interaction when using direct archiving. Log files are not renamed during direct archiving or restore. The User Exit can be configured to archive directly to TSM. the User Exit retrieves log files from the archive or the retrieve directory (D). brarchive is then used to archive groups of offline log files into an archive repository (also known as backend repository) (B). including additional storage directories and an extra Admin DB slightly increases the risk of failure. Only indirect archiving supports archiving to tape without a vendor storage management product. 28 August 2003 . 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. However. the node number NODEXXXX is appended to avoid problems in a multi-partitioned environment. results in the files being automatically restored from the same source. In this case. whilst ensuring that SAP tables containing log file information are also updated. When requested by a ROLLFORWARD operation in connection with a database restore action. You can use these products not only to archive log files but also to archive backups. either TSM or another storage management product with its own User Exit is required. 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. Direct Archiving and Restore Direct archiving is the recommended method for log file archiving. We recommend that database administrators use direct archiving as it performs well and requires minimal maintenance. see Changing the Admin Tools Configuration [Page 64]. However. archive to disk or to call a vendor User Exit for an alternative storage product. File archiving using the archive directory is referred to as indirect archiving. • The complexity of the solution.

during archiving. the files are renamed by appending the file-closure timestamp (14 digits) and the node number (NODExxxx). DB2 log file names are of the format Snnnnnnn. The files should not be moved or deleted manually as this will lead to data inconsistencies. For more information.LOG. the original name is restored. DB2 restarts the log file numbering sequence at S0000000.2 Basic Concepts • Indirect archiving When the User Exit copies log files from the log directory to the archive directory. online active. August 2003 29 . for example.NODE0000. 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. the Admin Tools also associate it with a database backup timestamp (that is. Normally. The Admin Tools GUI (DB2 Control Center Extensions) also supports this. are described in Log File States [Page 32].LOG put in the archive directory might be renamed to S0000001. Admin Tool Log File Management Model – Indirect Archiving Only Whenever a log file is archived. that is after log S9999999. Those files must have the timestamp and node extension removed from their names when they are moved back to the log directory. Otherwise. when the User Exit moves files from the archive or retrieve directory back to the log directory. For example.LOG are created. log files starting from S0000000. the date and time of the most recent SAP system database backup operation – whichever was performed most recently). only the Admin Tools should be used to manage log files. When a database is first created.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. A file restored by brrestore (in the LOG RETRIEVE directory) still has the extended file name. In combination with the log file close timestamp (another log file attribute).LOG is used The states a log file passes through. 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.LOG. the backup timestamp allows the Admin Tools to keep track of the restorable backup or log file combinations. In ROLLFORWARD mode. the files will not be recognized by DB2.20001130140536. which appear in the above graphic. see Log File Restore of the SAP Database [Page 138]. 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]). the copy of the file S0000001. where nnnnnnn is a seven digit number ranging from 0000000 to 9999999. are restored.

there is an entry for each log file that is stored on tape). Depending on the archiving method you choose. Therefore the Admin DB does not grow. it is essential that you use the Admin Tools to delete files when using indirect archiving. the following happens: • • If you chose direct archiving.4 Log File Deletion Log Files on Disk Log files in the DB2 log directory should not be deleted. • TSM If TSM is configured correctly and if you use an archive copy group for storing log files. 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.2 Basic Concepts 2. If you use indirect archiving. The database manager automatically deletes or reuses these files after they have been successfully archived by the User Exit. 30 August 2003 . If you chose indirect archiving. If you lose a tape or if a tape becomes unreadable. For more information. as the Admin DB is then also updated. all entries in the Admin DB will automatically be removed before the tape is overwritten with new log files. no log file copies are made on disk and no deletion is needed. Tapes can be reused. the Admin DB does not recognize the automatic deletion and runs out of sync. The same applies to log files restored to the retrieve directory by brrestore. the Admin DB should always reflect the content of the tapes (in the Admin DB. Explicitly deleting log files in a later call to an Admin Tool (options -ds and –dr). the log files will automatically be deleted from TSM. However. In the latter cases deletion is requested by: • • Indicating deletion as part of a brarchive/brrestore operation (options -sd and – ssd). you should delete the tape from the Admin DB to reflect this lost or unreadable tape in the Admin DB. Log Files in Long-Term Storage • Tape If you use a tape as a long-term storage. Log files no longer required on the backend should also be deleted using these tools. Storage management products often supply their own tools for doing this or can be configured to automatically remove old files. For more information.2. see Deleting Tapes from the Admin DB [Page 112]. To synchronize the Admin DB. see Deleting Log Files [Page 94]. but other backend storage should be cleaned up regularly using the Admin Tools. you should use brrestore –delete. The same will happen if log files archived using brarchive and restored using brrestore are not deleted using the same 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. If you reuse a tape that already contains log files.

you need to delete the log files manually.NODExxxx (Files are appended) brarchive brarchive. you may use db6adutl to delete the log files. If you use indirect archiving. • Customer script If you use a customer script.2.6D Admin Tools <INSTHOME>/saprest For 6.lfa (One file per run) • Location Directory defined by the DIAGPATH configuration parameter (db2 get dbm cfg …) • For 4. This information can be used by the DB2 Control Center Extensions.5 Protocols The User Exit (db2uext2). The Admin DB protocols and the protocol files of brarchive and brrestore are eventually deleted by brarchive. normally only for use by support and development. For more information.log.2 Basic Concepts If you use a backup copy group.err. you should use brrestore –delete to delete log files.<timestamp>. see Deleting Log Files [Page 94].NODExxxx db2uext2.NN Admin Tools: <INSTHOME>/admintools/ protocols For 4. The frequency can be configured by setting configuration parameter delete_protocols using the DB2 Control Center Extensions. use brrestore –delete. For more information. brarchive and brrestore generate protocol information to record the actions that have been performed. If you use direct archiving. The protocol files have the following form and are written to the following directories: Tool User Exit Protocol File(s) db2uext2. 2. Protocol files should only be deleted by the database system administrator. see Appendix B: Troubleshooting [Page 171]. For more information. see Deleting Log Files [Page 94].<timestamp>.lfr (One file per run) • • These tools can also write more detailed traces. August 2003 31 . Protocol information is also written into the Admin DB by the log file management tools.NN Admin Tools: <INSTHOME>/admintools/ protocols brrestore brrestore.6 D Admin Tools: <INSTHOME>/saparch For 6.

The log file is in the archive directory. the log file is defined to pass though the following states during its life cycle. in order for the tools to know what operations have been performed on a log file. 32 August 2003 . the tools have no influence on this and so assume that the file is no longer there. • Offline retained The log file is no longer being used and does not contain transactions with unwritten data pages. If you decide to use raw device logging. This can be either a file system path or a raw device. but may contain information about transactions that the database engine has not yet written from the buffer pool to disk. However. Within an SAP environment. the following is necessary to enable rollforward during database recovery. • Online active The log file is currently being used to log transactions. DB2 expects the logs to be in the log overflow directory. it is generally easier to work with log files in file systems. This has the effect of bypassing a possible file system management overhead and allows DB2 to manage the log data with optimum efficiency. the ROLLFORWARD utility must specify the overflow log path parameter. This state information is stored in the Admin DB. and will also be in the archive directory after the User Exit has run. The original log file will also remain in LOGPATH until the database is stopped or the DB2 Database Manager reuses the file.2. 2. The log file is located in the log directory.2 Basic Concepts 2. so it is only relevant to systems using the (default) indirect archiving method. This information is consequently not stored on systems performing direct archiving. If logging information cannot be obtained from the log extents available on the raw device. However. To allow the User Exit to put missing logs in the log overflow directory. The location of the log file is defined in the LOGPATH database configuration parameter. • Online retained The log file is no longer being written to by the database. as these can be maintained and manipulated using standard operating system tools. The Admin Tools fully support raw logging. we recommend that you use raw devices for storing log data.6 Raw Device Log Files To achieve maximum performance. The differences between file system-based logging and raw device logging are hidden by the User Exit.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. The User Exit extracts raw data into individual files that then behave identically to non-raw log files.2.

If not explicitly deleted. The location of the restored log file is the retrieve directory. RENAME or DELETE. if a customer uses MOVE. • Gone This state is only used internally to indicate that a log file could not be found in the location where it was expected. August 2003 33 . 2. we strongly recommend customers to only use direct archiving.Non-Standard Behavior of Database Systems Certain systems are set up in a slightly non-standard way. For this feature. for example. 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. automatically delete files after a certain period of time. which continues processing as usual. for example: • • As split-mirror As homogeneous system copy In both cases the Admin Tools are either restricted or must be configured differently.8 Special Cases . This state can also occur when storage products. A delete operation will delete such entries. or by turning the LOGRETAIN database configuration parameter off and on again. you can rapidly create a mirror copy of a production system database without the need to shut down the system. This requires either TSM or a vendor product that provides its own User Exit. If not explicitly deleted by using the -delete option in a subsequent operation. for example. such as TSM. Split-Mirror for Backup Purposes DB2 has introduced a new concept known as split-mirror using the db2inidb tool.2 Basic Concepts • Archived retained The log file has been archived using brarchive.2. Older log files that have been archived can still be manually retrieved from the backend using system or storage product tools. This can occur after a database restore if the ROLLFORWARD operation does not use all log files. see The db2inidb Tool [Page 122]. This copy can then be used to perform an offline backup without affecting the performance of the original system. but the Admin Tools only support the retrieval of the newest version. the User Exit marks previous versions as INVALID. The location of the archived log file is a storage management product. For more information. • Restored retained The log file has been restored using brrestore. the archived log file is also still available on the backend. With this tool. If the database generates a second log file with a number already used. • INVALID The Admin Tools can only administer the latest version of a log file with a given number per node. TSM (Tivoli Storage Manager) or tape.

conf can be accessed with the path listed above. DSCDB6HOME should contain the name of the server where file dscdb6. it is essential that you take a new backup before you use the Admin Tools on the new SAP system. the Admin Tools must be newly installed on the new system as the system name has changed.conf must be accessible from all application and database servers using NFS (UNIX) or Windows shares.conf accesses described in this documentation. Sometimes a system copy is used to overwrite another system or a previous system copy where the Admin Tools were already installed. the old Admin DB should be dropped before the Admin Tools are reinstalled. In this case.conf Windows: \%DSCDB6HOME%\sapmnt###BOT_TEXT###lt;SAPSID>\SYS\global\dscdb6. environment variable DB2DB6EKEY is used to encrypt or decrypt the requested password. Additionally. Do not attempt to copy Admin DB information from the source system to the new target system. In this case. For all the dscdb6. 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. In a system environment where the database server operates under an operating system other than Windows. The user IDs and passwords for SAP system users are maintained and stored in the file: UNIX: /usr/sap/<SAPSID>/SYS/global/dscdb6. 34 August 2003 . Passwords are stored in encrypted form. 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. DB2 runs with authentication set to the value server_encrypt.conf In an exclusively Windows environment. 2.2 Basic Concepts Homogenous System Copy You can create new SAP systems from existing system backups. as LOGRETAIN is normally already active.3 SAP Security Concept General Information In an SAP environment. Although DB2 does not force a backup in this situation. environment variable DSCDB6HOME contains the name of the database server. This file is protected from unauthorized access using file system access authorizations. File dscdb6.

and on the SAP system database servers (all systems with the same <SAPSID>). certain directories found in the single-partitioned environment are extended to become node-specific in a multi-partitioned environment and other directories are moved.Log File Retrieval Tool [Page 153]. Windows: The DB2DB6EKEY variable is set in the system environment. 2. DB2DB6EKEY is requested and set during SAP system installations.4 Multi-Partitioned Systems The Admin Tools are also enabled to work with multi-partitioned systems. These are stored in encrypted form in a special file and must be updated using the dscdb6up tool.csh and . which are read when <sapsid>adm or db2<dbsid> logs on. For more information on the syntax of brarchive and brrestore. see Setting and Updating Passwords [Page 108]. see brarchive . The administrator can change this value at any time. but this requires that the value be updated on all other related systems. The default value is <DBSID><db_server_hostname>. August 2003 35 . A multi-partitioned database can be configured to consist of more than one database node. but will need modifying for all but the central database server.sh. and the passwords in the file dscdb6. Managing Passwords for Database Standard Users DB2 uses operating system users to maintain system security.Log File Archive Tool [Page 147] and brrestore . Also tools such as brarchive and brrestore should be used with the additional parameter –node. UNIX: The DB2DB6EKEY variable is set in the SAP profiles dbenv_<hostname>. On UNIX.dbenv_<hostname>. For information on how to set and update passwords for SAP system users. in the SAP implementation. the home directory of the db2<dbsid> user changes from /db2/<DBSID> (single-partitioned system) to /db2/db2<dbsid> (multipartitioned system). the central instance.conf be changed (see below). 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.2 Basic Concepts The value of DB2DB6EKEY must be identical on all application servers. The Admin Tools need access to the user passwords to access the database. In this case.

10 of sddb6ins and higher creates the directories and adds variables to the user environment that are required to run the Admin Tools. 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: . or need to (re)install or upgrade the Admin Tools manually. The 6.10 or higher. You may have already performed this step as part of the database installation. 36 August 2003 . see Installation of the DB2 Control Center [Page 55]. However. 5.6D or lower. Check the Admin Tools environment [Page 47] after installation.1 Introduction This chapter is intended for administrators who want to check their environment.NN Admin Tools must be used on SAP systems with release 6.10 or higher.3 Installation and Setup 3 Installation and Setup 3. 1. Installing the Latest Admin Tools [Page 46]if you want to install the latest version of the Admin Tools or apply the latest patch. user. Install or upgrade to the latest Admin Tools. You can install the SAP system using: • R3SETUP The Admin Tools are automatically installed as part of the SAP system installation. groups and user environment that are required to successfully install the Admin Tools using the sddb6ins program. The installation of the Admin Tools depends on the SAP installation tool. For more information. this can be delayed until step 7 if rollforward recovery enabling (step 6) will be performed on the command line. 4. Check the SAP system environment [Page 38] to make sure that the SAP system was installed correctly. For more information. Version 6.. Otherwise. 2. • SAPinst The Admin Tools are not automatically installed during the SAP system installation with SAPinst. you can install the Admin Tools after installing the SAP system. Check the prerequisites for the installation of the Admin Tools [Page 43]. Install the DB2 Control Center on the SAP database server or one or more workstations. R3SETUP creates the directories. SAPinst creates the users and groups that are required to successfully install the Admin Tools using the sddb6ins program. and the 4. see one of the following sections: Upgrading the Admin Tools [Page 45] if you want to upgrade the Admin Tools to the latest version. They do not perform correctly on SAP systems with release 4. 3.6D Admin Tools do not perform correctly on SAP systems with release 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. August 2003 37 .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. 7. For more information.NN DB2 Admin Tools To find the SAP Notes.sap.6D DB2 Admin Tools SAP Note 455506 DB6: Installing the latest 6. • For additional information on installing the Admin Tools.sap. Check that the DB2 Control Center Extensions are working correctly.sap. See also: • For information on installing IBM DB2 Universal Database for UNIX and Windows with the SAP system. see the SAP Service Marketplace at the Internet address service. Enable the database for rollforward recovery [Page 52].com/instguides → SAP R/3. see the SAP Service Marketplace at the Internet address service. see Setting Up the DB2 Control Center [Page 56]. For SAP Basis Release 4. For SAP R/3 Release 4. 8. see the following SAP Notes: SAP Note 410252 DB6: Installing the latest 4.3 Installation and Setup 6.com/instguides → SAP Basis. see the following documentation: For SAP Web AS 6.6x and lower: To find the corresponding documentation. Catalog the databases to be administered. see the SAP Service Marketplace at the Internet address service.com/notes.sap. For more information. see Using the DB2 Control Center Extensions [Page 63].com/instguides → SAP Web Application Server.

but there is no need to log on to the SAP system with it.6D SAP systems Windows only: sapse<sapsid> 38 August 2003 . and IMPLICIT_SCHEMA SAP service account user This operating system user is a virtual user. <sapsid>adm sapr3 First installed SAP system with Release 4.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. All database connection and instance access operations for an SAP application server are performed using these users. Database user These operating system users own all SAP database objects (tables. SAP System Users User db2<dbsid> Description Database administrator This operating system user is the DB2 instance owner and the SAP database administrator.3 Installation and Setup 3. CONNECT.2. In general. on Windows the SAP system is started with this user account. 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). SAP system administrator This operating system user is authorized to start and stop the SAP system and the DB2 Database Manager (instance). The name of this user must be sapse<sapsid>. These users have the following database authorizations: CREATETAB. 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.10 or higher and additional MCOD 4.6D or lower sap<sapsid> SAP systems based on SAP Web AS kernel Release 6. indexes and views).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. BINDADD. This user belongs to the operating system group db<dbsid>ctl. DB2-specific monitoring functions invoked by SAP application server functions require SYSCTRL authorization. <sapsid>adm has the DB2 authorizations DBADM and SYSCTRL.

The group SAP_<SAPSID>_GlobalAdmin is only used when the SAP System belongs to a Windows domain. The members of this group are the domain users <sapsid>adm and sapse<sapsid>. Windows only: SAP_<SAPSID>_LocalAdmin Local group on an application server Only local groups are created and maintained on an application server.3 Installation and Setup SAP System Groups Groups db<dbsid>adm Description Database system administration group Each member of this group has SYSADM authorization for the DB2 Database Manager instance. The group SAP_<SAPSID>_GlobalAdmin is not required for a local installation. Database system control group Each member of this group has SYSCTRL authorization for the DB2 Database Manager instance. db<dbsid>ctl Windows only: SAP_<SAPSID>_GlobalAdmin August 2003 39 . but not allowing direct access to data. the local group can contain users and global groups from the domain. 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. This is the highest level of authorization within the database manager and controls all database objects. A local group can only be given authorizations to the system where it is located. SYSCTRL has authorizations allowing operations affecting system resources. If the system is part of the domain.

sh Windows: User environment DB2DBDFT <DBSID> Same as relevant location for variable DB2INSTANCE as described in this table DB2DB6EKEY <SAPSID><database server name> (default value) UNIX: Home directory of user db2<dbsid> Windows: Default value for a singlepartitioned system: <drive>:\DB2<DBSID> Default value for a multipartitioned system: \%DSCDB6HOME%\db2<dbsid> Same as relevant location for variable DB2INSTANCE as described in this table UNIX: ~/.2 User Environment In the following table. General Environment Variables Environment Variable DB2INSTANCE Value DB2<DBSID> Set In UNIX: ~/.3 Installation and Setup 3.sapenv_<hostname> .dbenv_<hostname> .sh Windows: User environment UNIX: ~/.dbenv_<hostname> .csh and ~/.2.csh and ~/.sh Windows: User environment INSTHOME SAPSYSTEMNAME <SAPSID> 40 August 2003 . the Set In column shows the location where the variables are set and where they need to be changed.dbenv_<hostname> .dbenv_<hostname> .sapenv_<hostname> .csh and ~/.

Same as relevant location for variable SAPSYSTEMNAME as described in this table Additional Environment Variables for Windows Environment Variable DSCDB6HOME SAPMNT SAPEXE Value Database server name <drive>:\usr\sap###BOT_TEXT###lt;SAPSID> <drive>:\usr\sap###BOT_TEXT###lt;SAPSID>\SYS\exe\run 3. August 2003 41 .3 Installation and Setup dbs_db6_schema Valid for all SAP systems with SAP Web AS 6.2.conf db2<dbsid> db<dbsid>adm 750 750 750 750 755 750 db2<dbsid> db2<dbsid> db2<dbsid> db2<dbsid> <sapsid>adm <sapsid>adm db<dbsid>adm db<dbsid>adm db<dbsid>adm db<dbsid>adm sapsys db<dbsid>adm 4750 root <sapsid>adm db<dbsid>ctl db<dbsid>adm 640 All authorizations can be checked using the –checkonly option of the sddb6ins program.10 or higher and MCOD 4.6D SAP systems Database schema: sap<sapsid> or sapr3 depending on the SAP system release you have installed.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 755 Owner Group Home directory of user db2<dbsid> (/db2/<DBSID> or /db2/db2<dbsid>) /db2/<DBSID>/log_dir /db2/<DBSID>/log_retrieve /db2/<DBSID>/log_archive /db2/<DBSID>/db2dump /usr/sap/<SAPSID>/SYS/exe /usr/sap/<SAPSID>/SYS/ global /usr/sap/<SAPSID>/SYS/exe/ run/dscdb6up /usr/sap/<SAPSID>/SYS/ global/dscdb6.

3 Installation and Setup Access Authorizations for Directories and Files under Windows Directory Access Privileg e Full Control Full Control Full Control Full Control Full Control Full Control Owner For User or Group <drive>:\db2<dbsid> <drive>:\db2 <drive>:\db2###BOT_TEXT###lt;dbsid>\ log_dir <drive>:\db2###BOT_TEXT###lt;dbsid>\ log_retrieve <drive>:\db2###BOT_TEXT###lt;dbsid\ log_archive <drive>:\db2###BOT_TEXT###lt;dbsid>\ db2dump Administrator Administrator Administrator Administrator Administrator Administrator SAP_<SAPSID>_LocalAdmin. During normal installation of an SAP system with R3SETUP.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 42 August 2003 . System Everyone db2<dbsid>. The administrator only needs to execute sddb6ins manually in the following cases: • • • • • • If an SAP system was installed with SAPinst If you want to use the 4. System SAP_<SAPSID>_LocalAdmin.6D Admin Tools and your SAP system is between Release 3.3 Installing the Admin Tools Manually The 4. sddb6ins is called automatically.6D where DB2 UDB for UNIX and Windows Version 7 or higher is installed. System SAP_<SAPSID>_LocalAdmin.6D Admin Tools must be used on all SAP systems with release 3. System SAP_<SAPSID>_LocalAdmin. The Admin Tools are installed on the database server using program sddb6ins.1I − 4. System 3.1I and 4.

some apply to a certain patch level of the sddb6ins program or depend on your operating system.6D Admin Tools UNIX: /usr/sap/<SAPSID>/SYS/exe/run Windows: <drive>:\usr\sap###BOT_TEXT###lt;SAPSID>\SYS\exe\run If you are using indirect archiving (that is parameter -NODADMDB is not used during installation). For this. Do not use su . 4 MB) in the directory containing the Admin Tools executables. UNIX To run sddb6ins. Some are general.exe. the Admin DB requires additional space. • Correct user environment Program sddb6ins must be executed in the correct user environment. General Prerequisites • Sufficient space Make sure that you have sufficient space (approx. When working with Microsoft Cluster.exe must be executed on all cluster nodes. The database resource has to run on the actual cluster node. August 2003 43 .3 Installation and Setup 3. Windows: To start sddb6ins. you must make sure that certain prerequisites are met. • Availability of the database instance The SAP database instance DB2<DBSID> must be running when installation program sddb6ins is executed. sddb6ins. 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. log on to the database server as user <sapsid>adm.3. sddb6ins installs the executables in the following directory: For 6. set the environment variable DB2INSTANCE to db2<dbsid> (instead of db2l<dbsid>) in the local command window.NN Admin Tools: UNIX: $INSTHOME/admintools/bin Windows: %INSTHOME%\admintools\bin For 4.to change to user root because the db2<dbsid> user environment is then lost. Log on as <sapsid>adm and then change to user root using su. 4 MB).1 Prerequisites for the Admin Tools Installation Before you can install the Admin Tools. you require root authorization with the <sapsid>adm user environment.

6x If you want to install the 4.. Enter the following command: db2start 6.CAR 8. switch to the instance directory and update the DB2 instance. enter the following command: CAR -xvf dscdb6up..com/patches. 7. 1.6x. for example. db2start: a. Download the dscdb6up program from the SAP Service Marketplace at the Internet address service. 4.conf Permission 4750 750 640 Owner root <sapsid>adm <sapsid>adm Group db<dbsid>ctl db<dbsid>adm db<dbsid>adm <SAPMNT> acts as a place holder for /usr/sap/<SAPSID>. Log on to the database server as user db2<dbsid> and stop the DB2 instance. 3. Enter the following commands: cd <DB2 installation directory>/instance .sap.6A: . 9. Enter the following command: db2stop force b. you have to perform the following additional steps as the group concept changed with Release 4. Create two new groups called db<dbsid>ctl and db<dbsid>adm if they do not already exist. Copy the dscdb6up program to directory /usr/sap/<SAPSID>/SYS/exe/run.3 Installation and Setup UNIX only: For SAP Systems lower than 4./db2iupdt db2<dbsid> c. 44 August 2003 . Perform an instance update to correct the file authorizations of executables.6D Admin Tools for the first time on SAP systems lower than 4. Log on again as user db2<dbsid> and restart the DB2 instance. Use chmod and chown to set the authorizations as follows: File <SAPMNT>/SYS/exe/run/dscdb6up <SAPMNT>/SYS/global <SAPMNT>/SYS/global/dscd6. Change the primary group of user db<dbsid> to db<dbsid>adm and keep group sysadm as the secondary group. Add group db<dbsid>ctl as the secondary group to user <sapsid>adm. To extract dscdb6up using CAR. 2. log on to the database server as user db2<dbsid> and enter the following commands: db2 update dbm cfg using SYSADM_GROUP db<dbsid>adm db2 update dbm cfg using SYSCTRL_GROUP db<dbsid>ctl 5. To do so. As user root. Update the database manager configuration.

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]. 3. The following table describes the possible return codes: Return Code 0 1 Description No error detected Severe errors detected. • August 2003 45 . see Appendix B: Troubleshooting [Page 171].3 Upgrading the Admin Tools Use You use the -u option of the sddb6ins program to upgrade the Admin Tools. an upgrade to the latest 4.3 Installation and Setup 3. 2 The values listed in the table above differ from other Admin Tools. The following conditions apply: • If you have performed an upgrade to an SAP system with Release 4.NN Admin Tools is required. The return code of the sddb6ins program depends on the success of the installation.2 General Information Return Codes of sddb6ins The sddb6ins program writes information about the steps it performs to standard output. Installing the Latest Admin Tools [Page 46] and Checking the Admin Tool Environment [Page 47].6D or lower but you are still using a version of the Admin Tools from before 4.6D. {common option} acts as a placeholder for the following three options: • • • • • [-s <SAPSID>] [-db2dbnamepwd <pwd>] [-db2dbnamedomain <domain>] [-sidadmpwd [-NOADMDB] [-DEB [<level>]] <pwd>] [-sidadmdomain <domain>] For a detailed description of these options. Warning. see Appendix A: Tool Command Line Parameters [Page 147].3. Instead. an upgrade to the 6. Check the output messages. Errors have occurred during the installation but the installation is complete.3. If you upgrade to an SAP system Release 6. For more information.10 or higher.6D Admin Tools is strongly recommended. the installation is not complete.

Procedure To manually install the latest Admin Tools or to apply an Admin Tools patch. In this case log file archiving is only performed directly by the User Exit program db2uext2 (for more information.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. See also: Actions Performed by the sddb6ins Program [Page 48] 3. enter the following command: sddb6ins -u <start release> [<target release>] {common options} <start release> is a placeholder for the release of the previously installed Admin Tools. to upgrade the Admin Tools from 4. Admin Tools upgrades are not supported. see Archiving Directly to TSM [Page 73]). You want to apply an Admin Tools patch for the currently installed Admin Tools.6D or lower and you want to use the 6.6D to 6. you must make sure that you are using a patch that is valid for the same release of the currently installed Admin Tools. the Admin DB will be installed (if not already present) and brarchive and brrestore are then also available. to install the current version of the Admin Tools. enter the following command: UNIX: sddb6ins –i 46 August 2003 .10 using the 6.NN Admin Tools. Procedure To upgrade the Admin Tools. However. enter the following command: sddb6ins -i [<target release>] {common options} For example. For example. Otherwise. the Admin DB will not be installed or will be dropped if it already exists.3.10 or higher.3 Installation and Setup If you are using a SAP system with Release 4.10 sddb6ins executable: UNIX: sddb6ins –u 46D Windows: sddb6ins –u 46D –db2dbnamepwd <password of user db2<dbsid>> If the -NOADMDB option is used.

Windows only: The required shares exist. the Admin DB will be installed (if not already present) and brarchive and brrestore are then also available. The verification routine checks if: • • • • • • The environments for user db2<dbsid> and <sapsid>adm are set correctly. the Admin DB will not be installed or will be dropped if it already exists. The database configuration parameters LOGRETAIN and USEREXIT are set to ON for the SAP database <DBSID>. see Archiving Directly to TSM [Page 73]).3 Installation and Setup Windows: sddb6ins –i –db2dbnamepwd <password of user db2<dbsid>> If the -NOADMDB option is used.3. See also: Actions Performed by the sddb6ins Program [Page 48] 3. Procedure To check the environment of the Admin Tools. enter the following command: UNIX: sddb6ins –checkonly Windows: sddb6ins –checkonly –db2dbnamepwd <password of user db2<dbsid>> August 2003 47 . The -a option of sddb6ins. In this case log file archiving is only performed directly by the User Exit program db2uext2 (for more information. The DB2 instance variable DB2ENVLIST is set correctly. which was used to install the latest Admin Tools after the installation of a downward-compatible kernel (DCK). no longer exists. The necessary files and directories exist and have the correct authorizations. Use the -i option instead. Otherwise. UNIX only: Users and groups are set up correctly. enter the following command: sddb6ins –checkonly [<target release>] {common options} For example.5 Checking the Admin Tools Environment Use You use option –checkonly to verify the Admin Tools installation. to check the Admin Tools.

Description Admin Tools directory. Contains the trace files created by all Admin Tools.NN Admin Tools on Windows only: In a multi-partitioned system. 6. this verification is also performed automatically at the end of an installation (–i) or upgrade (-u) operation.NN Admin Tools only: The following table lists the directories that are created by sddb6ins: Directory • • • • • • • • • 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 Windows: %INSTHOME%\admintools\protocols Contains brarchive and brrestore protocol files.db6.3 Installation and Setup With the sddb6ins version 6. User Exit protocol files are in the DIAGPATH directory.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. also contains the environment file init<DBSID>. Warnings if possible inconsistencies have been detected 3. sddb6ins creates the following shares on the node where hostname matches the contents of the variable DSCDB6HOME: log_archive<DBSID> log_retrieve<DBSID> 48 August 2003 . Severe configuration errors have occurred during the installation. The verification tool writes the following message types: Message Type [I] [E] [W] Description Provides information on the current configuration.3. The output contains useful information about the environment in which the Admin Tools operate.10 or higher. Contains the Admin Tools executables and libraries.

If –NOADMDB is not used. • Creates or updates the environment file init<DBSID>.6D Admin Tools only: Creates a user defined function (UDF) entry in the <DBSID> database. If the –NOADMDB flag is used and the Admin DB exists. to the DB2 directory.NN Admin Tools: <INSTHOME>/admintools/bin For 4.NN Admin Tools: <INSTHOME>/admintools directory (see table above) For 4.6D were stored in the same directory as the standard SAP system executables and were therefore deleted during an SAP system upgrade.NN Admin Tools only: Removes executables installed with previous versions.3 Installation and Setup • Extracts the executables stored in sddb6ins to the following directory: For 6. so that the stored procedure works properly. for example for TSM. which is required for the DB2 Control Center Extensions. The Admin Tools up to 4. 6. If required. • • Sets the DB2 instance variable DB2ENVLIST. Grants the access authorizations to the Admin DB ADM<DBSID>. • • 4. sddb6ins creates the Admin DB ADM<DBSID> if it does not already exist. sddb6ins performs the following actions: Customizes a multi-partitioned system. it is dropped.NN Admin Tools only: Adds Admin Tools-specific environment variables.6D Admin Tools only: Creates mirror tables in the <DBSID> database. to the environment of db2<dbsid> and <sapsid>adm. 4.db6 in the following directory: For 6.6D Admin Tools: /usr/sap/<SAPSID>/SYS/exe/run • Copies the User Exit program db2uext2 to the DB2 directory: UNIX: $INSTHOME/sqllib/adm Windows: <DB2_install_dir>\sqllib\bin • Copies the stored procedure sddb6jds.db6 [Page 204]. UNIX only: Sets the access authorizations on the Admin Tools directories and files as follows: August 2003 49 . it creates the tables in the Admin DB and fills the configuration table with default values if this table is empty.6D Admin Tools: /usr/sap/<SAPSID>/SYS/global For an example of the environment file. UNIX: $INSTHOME/sqllib/function Windows: <DB2_install_dir>\sqllib\function • 6. which are no longer required. • By default. see Appendix D: Example of File init<DBSID>.

smp <SAPEXE>/db6adutl db2<dbsid> db<dbsid>adm 0755 0640 6755 6755 0755 0755 0755 0755 6755 db2<dbsid> db2<dbsid> db2<dbsid> root db2<dbsid> db2<dbsid> db2<dbsid> db2<dbsid> root db<dbsid>adm db<dbsid>adm db<dbsid>adm db<dbsid>adm db<dbsid>adm db<dbsid>adm db<dbsid>adm db<dbsid>adm db<dbsid>adm 50 August 2003 .smp $INSTHOME/admintools/bin/db6adutl $INSTHOME/sqllib/adm/db2uext2 $INSTHOME/sqllib/function/sddb6jds db2<dbsid> db2<dbsid> db2<dbsid> db2<dbsid> db2<dbsid> db2<dbsid> root db2<dbsid> db2<dbsid> db2<dbsid> db2<dbsid> root db2<dbsid> db2<dbsid> db<dbsid>adm db<dbsid>adm db<dbsid>adm db<dbsid>adm db<dbsid>adm db<dbsid>adm db<dbsid>adm db<dbsid>adm db<dbsid>adm db<dbsid>adm db<dbsid>adm db<dbsid>adm db<dbsid>adm db<dbsid>adm 4.[o|so|sl] <SAPEXE>/libdb6ds.NN Admin Tools Directory or File Access Privileg e in Octal Form 0755 0755 0755 0755 0644 6755 6755 0755 0755 0755 0755 6755 0755 0755 Owner Group $INSTHOME/admintools $INSTHOME/admintools/bin $INSTHOME/admintools/protocols $INSTHOME/admintools/TraceFiles $INSTHOME/admintools/init<DBSID>.[o|so|sl] <SAPEXE>/db6sctsm.db6 $INSTHOME/admintools/bin/brarchive $INSTHOME/admintools/bin/brrestore $INSTHOME/admintools/bin/libdb6tp.[o|so|sl] <SAPEXE>/libdb6sc.[o|so|sl] $INSTHOME/admintools/bin/libdb6ds.db6 <SAPEXE>/brarchive <SAPEXE>/brrestore <SAPEXE>/libdb6tp.3 Installation and Setup 6.[o|so|sl] $INSTHOME/admintools/bin/libdb6sctsm.6D Admin Tools Directory or File Access Privileg e in Octal Form 0755 Owner Group $INSTHOME/saparch $INSTHOME/saprest /tmp/TraceFiles /usr/sap/<SAPSID>/SYS/global/ init<DBSID>.[o|so|sl] $INSTHOME/admintools/bin/libdb6sc.

3 Installation and Setup $INSTHOME/sqllib/adm/db2uext2 $INSTHOME/sqllib/function/sddb6jds 0755 0755 db2<dbsid> db2<dbsid> db<dbsid>adm db<dbsid>adm <SAPEXE> is a placeholder for /usr/sap/<SAPSID>/SYS/exe/run. The Admin Tools do not support any additionally installed SAP system .3.6A Admin Tools The log archive location must be changed. which is the default for an SAP BW installation.1I init<DBSID>. you must call sddb6ins on each host where a database node of the database <DBSID> exists.sap configuration file content is moved to the Admin DB. • 3. The sddb6ins program performs the following additional actions: • • If starting with 3. 4.6D: The Admin Tools are only enabled for the main SAP system.0B − 4. • Multi-partitioned database systems If you are using a multi-partitioned database system.1I Admin Tools: The 3. which is described in Appendix A: Tool Command Line Parameters [Page 147] and Appendix B: Troubleshooting [Page 171]. 3. and more than one database node is used.6C Admin Tools The executables and libraries are exchanged.10 Admin Tools only: Checks the installation of the Admin Tools using. August 2003 51 . some actions depend on the <start release> parameter. Any log files in the old location are moved and the Admin DB is updated. that is the firstly installed SAP system. • • Inserts the Admin Tools release into the Admin DB.7 Special Configurations This section provides information on special configurations that apply in the case of multiple SAP systems on one database (MCOD) or if you are using a multi-partitioned database system: • MCOD For SAP systems with Release 4.10 or higher: Call the sddb6ins program for all <sapsid>adm users to enable the Admin Tools environment for all SAP systems that are installed on one database. 6. For SAP systems with Release 6. Actions Performed During Upgrade (-u) The actions performed during upgrade are similar to the actions performed during installation. However. the –checkonly option.1I − 4. for example.

You need to use the same path on all nodes for the archive and retrieve directory. are archived by the User Exit program db2uext2 when they are no longer needed for processing transactions. Log file numbering increases with each new log file (up to 9999999). 3. SAP and IBM recommend that the database system be operated in rollforward recovery mode (LOGRETAIN) with the USEREXIT database parameter turned on. A new backup must be performed before the User Exit is called. In this mode. There are ways of forcing the database out of BACKUP PENDING mode after setting these parameters without performing a backup first. The procedures differ depending whether you are using a single-partitioned or multi-partitioned system. Unlike with an offline backup. Rollforward recovery is not enabled by default. An offline backup of the database must be performed after setting these parameters. You must export the archive and retrieve directories on one node and mount these directories on all other nodes using NFS. See also: Enabling Rollforward Recovery for a Single-Partitioned Database [Page 53] Enabling Rollforward Recovery for a Multi-Partitioned Database [Page 54] 52 August 2003 . that is LOGRETAIN must be set to ON. The archive and retrieve directories must be mounted on all nodes using NFS. System copies created by restoring a database backup will also not force a new backup if the LOGRETAIN parameter was already ON for the original database. the active log files.3 Installation and Setup • Multi-partitioned database systems on UNIX only: If you want to use indirect archiving. the database must be in rollforward recovery mode. as the Admin Tools will not operate correctly until a backup has been performed. You enable rollforward recovery and the User Exit mechanism by setting the database configuration parameters LOGRETAIN and USEREXIT to ON.8 Enabling the Database for Rollforward Recovery As outlined in Basic Concepts [Page 21]. if you want to perform online backups.3. you have to split the database installation over several nodes (computers). in which all database changes are recorded. Do not do this.

In the value area. Choose Logs of the notebook. Restart the database instance. 3.. see Performing the Backup [Page 104]. 2. see Installation of the DB2 Control Center [Page 55] and Setting Up the DB2 Control Center [Page 56].1 Enabling Rollforward Recovery for a SinglePartitioned Database Updating Database Parameters You can perform these actions either using the command line or the DB2 Control Center. 6... For more information.. DB2 Command Line on the Database server . 1. Start the DB2 Control Center. . . August 2003 53 . 1. 5. 7. 4. enter the following commands: db2 update db cfg for <DBSID> using USEREXIT ON db2 update db cfg for <DBSID> using LOGRETAIN ON 4. Log on to the database server as user db2<dbsid>. To confirm. From the context menu of the <DBSID> database icon. For more information. choose OK to confirm.. select the Yes radio button. To update the database configuration parameters. back up your database. Backing Up the Database After having updated the database configuration parameters.. 2. choose Configure.3 Installation and Setup 3. Windows only: Start the DB2 Command Window. DB2 Control Center Make sure that you have installed and set up the DB2 Control Center before performing these steps.8. 3. Choose Retain log files for roll-forward recovery from the list.3. Restart the database instance.

3. enter the following commands: db2_all "db2 update db cfg for <DBSID> using LOGRETAIN ON" db2_all "db2 update db cfg for <DBSID> using USEREXIT ON" 3.3. Restart the database instance. From the menu that appears. . 8.3 Installation and Setup 3. 6. select Configure….8. 1. 5. Select Retain log files for roll-forward recovery from the list. 4. From the context menu of the <DBSID> database icon. 2. Restart the database instance. Backing Up the Database After having updated the database configuration parameters. choose OK. see Performing the Backup [Page 104]. DB2 Command Line on the Database server . . 1.. In the table Database Partitions. DB2 Control Center Make sure that you have installed and set up the DB2 Control Center before performing these steps. 54 August 2003 . For more information. back up your database. 9.. choose Open → Database Partitions…... Log on to the database server as user db2<dbsid>. To update the database configuration parameters. see Installation of the DB2 Control Center [Page 55] and Setting Up the DB2 Control Center [Page 56]. For more information. choose the Yes radio button. In the value area.2 Enabling Rollforward Recovery for a Multi-Partitioned Database Updating Database Parameters You can perform these actions either using the command line or the DB2 Control Center. To confirm.. Start the DB2 Control Center. 2. Select all nodes. Choose Logs of the notebook. 7.

2 Installing the DB2 Control Center Extensions The DB2 Control Center Extensions can only be installed after the DB2 Control Center has been installed. To be able to use this interface. 4. On Windows.. On Windows: . Extract file DB6CCEXT.1 Installation of the DB2 Control Center The DB2 Control Center is part of the DB2 Client Software called the DB2 Administration Client. such as on a PC.. Insert the SAP kernel CD. In order to work with 64-bit systems. Invoke setup. and also part of the DB2 server installation. On the CD. On all other systems. install DB2 Connect in addition. As it is Java-based. there is also a menu entry in the DB2 group in the Start menu.3 Installation and Setup 3.exe and follow the instructions. August 2003 55 . If you use the direct archiving mode to archive the log files.4. 2. 3. it is available on all platforms which support Java. 6. It can be run remotely.4 Installation and Setup of the DB2 Control Center Extensions The Admin Tools have a user interface that is integrated into the DB2 Control Center as a set of extensions. To install it. On a UNIX based operating system. the DB2 Control Center Extensions are not required. you must install the DB2 Control Center first. The DB2 Control Center of DB2 Version 7 or lower does not support 64-bit instances in general.4.and multi-partitioned systems. you can start the DB2 Control Center by executing command db2cc. the DRDA protocol must be used. 3. Change to the temporary directory. 1. change to the directory NT\I386\DBTOOLS. Log on to the machine where you want to install the Admin Tools as a user with local administration authorizations. follow the standard DB2 installation process and make sure that you select the option Control Center for installation. This is available with all single.SAR to a temporary directory by using tool SAPCAR.. 3. 5.

Log on to the machine where you want to install the DB2 Control Center Extension as user root. the DB2 Administration instance (db2das) may not be running on the computer being cataloged or communication may not be set up correctly. it is necessary to catalog the remote computer. change to the directory UNIX/<Unix platform>/DBTOOLS. 2. These tasks have to be performed by an user with administrative authorizations. 56 August 2003 .. 6. On UNIX: . 1. the DB2 variable DB2INSTANCE must have the same value in the system environment and the environment of the user who starts the DB2 Control Center.3 Installation and Setup For the DB2 Control Center Extensions to perform correctly.. the SAP database and its instance. Insert the SAP kernel CD.4. If the DB2 Control Center is not running on the same machine as the SAP database. 7. Refer to the DB2 documentation for setting up and starting the DB2 Administration instance and the DB2 Messages Reference. 5. Change to the temporary directory.3 Setting Up the DB2 Control Center The DB2 Control Center Extensions are available for SAP databases and instances. 3. On the CD.SAR to a temporary directory by using SAPCAR. Extract file DB6CCEXT. Cataloging Databases on 32-Bit DB2 Instances If communication error messages appear while performing actions in this section. Invoke the shell script install and follow the instructions 3. Mount the CD. 4.

choose Apply. Otherwise. choose the system on which the SAP database server is located. 4.3 Installation and Setup Cataloging a Remote Computer: . In the navigation frame of the DB2 Control Center. choose Refresh. To add this and further systems. To retrieve a list of DB2 systems located in the network. choose Systems from the context menu. If the system is not listed. 5. Choose Add from the menu. 1. If available. confirm with OK. enter the name of the server in the System Name field. The Add System dialog box appears. Fill out or modify the remaining fields. 3. August 2003 57 .. 2..

4. 3. If available. choose Apply. 2. 58 August 2003 .. The Add Instance dialog box appears. expand the node with the name of the system where the DB2 server is located. 5. If the instance is not listed. select the instance from the list in the Remote Instance field. choose Add. The service name should have the value sapdb2<DBSID> and is defined in file /etc/services on the database server. choose Refresh.. Otherwise. To retrieve a list of instances on the chosen system. To add this and further instances.3 Installation and Setup Cataloging a Database Manager Instance: . enter the name of the instance in the Remote Instance field and fill out the remaining fields. confirm with OK. 1. From the context menu of the Instances subnode. In the navigation frame of the DB2 Control Center.

2. cataloging databases on 64-bit DB2 instances is the same process as on 32-bit DB2 instances.. To retrieve the list of databases created on the instance. Cataloging Databases to Use Communication Protocol DRDA To be able to use communication protocol DRDA. and the <instance name> node. On UNIX. you can only catalog the databases using the command line. Cataloging Databases on 64-Bit DB2 Instances With DB2 Version 8. enter the name of the database in the Database Name field. the DB2 Control Center does not provide all functions on 64-bit DB2 instances. then the instances node. 7. 5. If available. The DB2 Control Center of DB2 Version 8 provides the same functionality for both instance types as long as your database is DB2 Version 8. If the database is not listed. 6. From the context menu of the Databases node. choose Refresh. you can use the Client Configuration Assistant or the command line processor. 1. expand the <system name> node. or enter the name by overwriting the previous entry. To use the DB2 Control Center for DB2 Version 7 for the administration of 64-bit DB2 instances.3 Installation and Setup Cataloging the Databases <DBSID> and ADM<DBSID>: . the SAP database <DBSID> and Admin DB ADM<DBSID> must be cataloged in a special procedure. Be aware. 4. you must configure the DRDA communication protocol to enable communication. select the Admin DB ADM<DBSID> in the Database Name field. you must use the communication protocol DRDA. In the same way. If you want to access a DB2 Version 7 64-bit instance using DB2 Control Center Version 8. On Windows. however. Confirm the entries with OK. choose the SAP database <DBSID> in the Database Name field. The Add Database dialog box appears.. Confirm the entry by choosing Apply. choose Add. With DB2 Version 7. 3. that in this case only limited functionality is available. The other fields are optional. In the navigation frame of the DB2 Control Center. August 2003 59 .

The Add Database Wizard . 1. To continue. choose Next. Protocol screen appears. If this option does not appear. 6..1.. In the Port Number field. Log on as a user with administrative authorizations. In the Host Name field. select The database physically resides on a host or AS/400 system. To continue. enter the DB2 instance name. The Client Configuration Assistant dialog box appears. Select TCP/IP. enter the port number of the database instance.3. Node Option screen appears. Choose Add. The location depends on the host operating system: • Windows: <WindowsSystemDirectory>\system32\drivers\etc\services • UNIX: /etc/services Look for the entry sapdb2<DBSID>.2. 60 August 2003 . 14. choose Next. Select Connect directly to the server. To continue. enter the host name where the SAP database is running. In the Instance Name field.4. choose Next. In the System Name field. The Add Database Wizard . Start the Client Configuration Environment by choosing Start → Programs → IBM DB2 → Client Configuration Assistant. The Add Database Wizard .3 Installation and Setup Using the DB2 Version 7 Client Configuration Assistant . 7. Choose Manually configure a connection to a database. 8. enter the name of the database host. 5. 11. Enter the name of the SAP database and choose Next twice. you have not installed DRDA support on the client. The Add Database Wizard . The Add Database Wizard . If the computer is a member of a domain. 10. 4. 12.6. Database screen appears. the user must have domain administrator authorizations. 3. TCP/IP screen appears. 9. Source screen appears. 2. To be able to connect to the server. 13. 15. You can find the port number in the following file on the database host.

7. Select Manually configure a connection to a database. The Client Configuration Assistant dialog box appears. Log on as a user with administrator authorizations. 3. Start the client configuration environment by choosing Start → Programs → IBM DB2 → Set-up Tools → Configuration Assistant. 13. Data Source screen appears. The Add Database Wizard – 5. Choose Finish. To continue. To continue. Choose Selected → Add Database Using Wizard… The Add Database Wizard – 1. August 2003 61 . 12. enter the user ID and password. 18. Source screen appears. 11. If this option does not appear. 17. choose Next. 4.3 Installation and Setup 16. the user must have domain administrator authorizations. Choose the corresponding operating system. Protocol screen appears. Enter the name of the SAP database and choose Next. Select Connect directly to the server. select The database physically resides on a host or AS/400 system. To continue. In the Host name field. Select TCP/IP. choose Next. you have not installed DRDA support on the client. and choose OK. In the Port number field. choose Add and repeat steps 13 to 17. enter the port number of the database instance. TCP/IP screen appears. 9. The Confirmation dialog box appears. 6. enter the host name where the SAP database is running. The Add Database Wizard – 2. choose Test Connection. To repeat the procedure for the Admin DB ADM<DBSID>. You can find the port number on the database host in the following file: • UNIX: /etc/services • Windows: <Windows_system_directory>\system32\drivers\etc\servic es Look for the entry sapdb2<DBSID>. The Add Database Wizard – 3. If the computer is a member of a domain. 5. 8. To be able to connect to the server. 2. 10. Database screen appears. To test the connection. Using the DB2 Version 8 Configuration Client Assistant 1. choose Next. The Add Database Wizard – 4.

Enter the following commands in the sequence given (use db2<dbsid> as <nodeName>) db2 catalog tcpip node <nodeName> remote <dbHostName> server <portNumber> You can find the port number on the database host in the following file: UNIX: /etc/services Windows: %SystemRoot%\system32\drivers\etc\services Look for the entry sapdb2<DBSID>...3 Installation and Setup 14. for example. 25. Select User authentication value in server’s DBM configuration. To check for a successful test connection... To continue. In the Remote instance name field.. 22. In case of a success.. The Add Database Wizard – 7.. Select Configure DCS options.' db2 catalog db ADM<DBSID> at node <nodeName> authentication dcs db2 catalog dcs db ADM<DBSID> parms '. 24. 21.INTERRUPT_ENABLED. The Add Database Wizard – 6. Select CLI and enter the user ID and password. To add the Admin DB ADM<DBSID>. Deselect Register this database for ODBC and choose Next. repeat steps 1 to 22.. Security Options screen appears. 15. the following message is displayed: CLI connection tested successfully 26. db2<dbsid>. The Add Database Wizard – 8 DCS Options screen appears. System Options screen appears. 17.. Choose Finish. 23. choose Next. 2. Log on as a user with SYSADM authorization. The Test Connection dialog box appears.. Using the Command Line . The Add Database Wizard – 8.' 62 August 2003 . enter the DB2 instance name and choose Next.. choose the Results tab.. Node Option screen appears. choose Next. 18. db2 catalog db <DBSID> at node <nodeName> authentication dcs db2 catalog dcs db <DBSID> parms '. Choose Test Connection. 16.INTERRUPT_ENABLED. 20. Choose the corresponding operating system. Select Disconnect if client generates an interrupt (INTERRUPT_ENABLED). To continue. 19. 1.

For more information on how to use the option SAP Log File Management. see Parameters Affecting Log File Management Storage [Page 64]. For more information on how to use the option SAP Option Management. SAP Log File Management and SAP Tape Management. You can access the DB2 Control Center Extensions using new context menu entries.3 Installation and Setup 3.4. August 2003 63 .4 Using the DB2 Control Center Extensions After cataloging the databases. see Advanced Log File Maintenance Tasks [Page 109]. the DB2 Control Center Extensions can now be used. which have been added to the standard DB2 Control Center menus at the instance and database levels. The <DBSID> database context menu contains three entries: SAP Options Management.

1 Changing the Admin Tools Configuration The following sections describes how you can change the configuration of the Admin Tools. The Admin DB keeps track of the location and states of all log files. you choose the database instance db2<dbsid> (containing the <DBSID> database) using context menu.. There are two locations where parameters may need to be changed: • In the DB2 Control Center Extensions (only necessary for indirect archiving). Furthermore. 2.db6 For more information. The following is an example from an AIX system. To view or to change the parameters. see Parameters Affecting Log File Management Storage [Page 64]. see Configuring the Admin Tools Using Environment Files [Page 67]. • In the environment file init<DBSID>. 64 August 2003 . 4. If you are using the DB2 Control Center Extensions with a patch level lower than 3. Choose SAP Option Management. In the navigation frame of the DB2 Control Center. proceed as follows: .4 Configuration 4 Configuration 4.1 Parameters Affecting Log File Management Storage If you have decided to use the default behavior of archiving log files indirectly via disk. the Admin DB will have been created. For more information. choose the database <DBSID> using the context menu.. it contains several configuration parameters for the log file management tools.1. The Options dialog box appears. 1.

4 Configuration

When you select a parameter, its description is displayed in the field at the bottom of the dialog box. 3. To change the value of a selected parameter, double-click on the Value field. 4. Enter the new values. The following parameters can be set in the Options dialog box: Parameter backup_dev_type Description Default storage management product, if not given on the command line. Initially set to tape, but can be set to adsm for TSM. Do not set this value to tsm. cpio_flags Flags used to modify the cpio command when archiving files to tape. These may need modifying if a non-standard block size is used. For more information, see Indirect Archiving to Tape [Page 75] section Modifying the Tape Block Size. Flags used to modify the cpio command when restoring files from tape. These may need modifying if a non-standard block size is used. For more information, see Indirect Archiving to Tape [Page 75] section Modifying the Tape Block Size.

cpio_in_flags

August 2003

65

4 Configuration

rewind

Command used to rewind a tape. The $ is replaced by the tape device name. This value should not normally be changed. Command used to rewind a tape and then place it offline (some devices eject the tape). The $ is replaced by the tape device name. This value should not normally be changed. Command used to a spool a tape forwards. The first $ is replaced by the tape device name. The second $ is replaced by a number indicating the number of files to spool forward by. This value should not be changed. Indicates the default size of tapes. It is only used to suggest how much data might fit on a tape, but may be ignored. M indicates megabytes. This value is used to set the default value for all user-defined tape devices. Non-rewind address of the default tape device. Using this address ensures that the tape is not rewound at the end of each tape operation. For more information on non-rewind addresses, see brrestore - Log File Retrieval Tool [Page 153]. Standard address of the default tape device. Using this address results in the tape being rewound at the end of each tape operation. Number of weeks that must pass before a used tape can be re-used without the need to explicitly reinitialize it. The default is value 6. Number of times a tape can be re-initialized before warning messages appear requesting that the tape be replaced. The default value is 100. Do not use operating system tools to modify tapes or this information will be lost resulting in tapes being used too often, risking loss of data. Flags used to modify the dd command when archiving files to tape. These may need modifying if a non-standard block size is used. Flags used to modify the dd command when restoring files from tape. These may need modifying if a non-standard block size is used. Number of days to retain tool protocol entries in the Admin DB, before they are deleted. The default value is 30. Name of the default TSM management class.

rewind_offline

tape_pos_cmd

tape_size

tape_address

tape_address_rew

expir_period

tape_use_count

dd_flags

dd_in_flags

delete_protocols adsm_mc

5. To cancel changes, choose Escape. To confirm the changes, choose Enter. A dialog box appears asking for confirmation of the changes. 6. To confirm the changes, choose Yes.

66

August 2003

4 Configuration

4.1.2 Configuring the Admin Tools Using Environment Files
The environment files init<DBSID>.db6 and init<SAPSID>.db6 are the primary source for configuring the Admin Tools. The redirected restore tool brdb6brt and the CCMS tools (for example, dmdb6rdi, dmdb6rts, dmdb6srp, dmdb6snp and db6clp) can be configured in the init<SAPSID>.db6 file. The Admin Tools (for example, db2uext2, brarchive, brrestore, db6adutl, sddb6mir) can be configured in the init<DBSID>.db6 file.

Location of the Environment Files
• The init<DBSID>.db6 file is located in the following directory: For SAP system releases lower and including 4.6D UNIX: /usr/sap/<SAPSID>/SYS/global Windows: <drive>:\usr\sap###BOT_TEXT###lt;SAPSID>\SYS\global For SAP Web AS 6.10 or higher UNIX: <INSTHOME>/admintools Windows: <INSTHOME>\admintools

Be aware that for SAP system releases lower and including 4.6D, <SAPSID> equals <DBSID> and the global directory is used as the location for the environment files. Thus, all the variables are contained in the same file that is located in the global directory. • The init<SAPSID>.db6 file is located in the following directory: UNIX: /usr/sap/<SAPSID>/SYS/global Windows: <drive>:\usr\sap###BOT_TEXT###lt;SAPSID>\SYS\global

Format of File Content
The following is a brief description of the format of the file content: • • • A # introduces comments; the rest of the line is ignored. Empty lines are ignored. To set a variable, you have to specify a line like <variable name> = <value>, for example, DB2DB6_TEMP_DIR = c:\temp.

Activation of Variables
All recognized variables are listed in the file and are inactive as long as they appear after the comment sign (#). You activate a variable by removing the comment sign (#) and by adapting the value of the variable according to your requirements.

We strongly recommend that you use only these files for configuring the Admin Tools-specific environment variables.

August 2003

67

4 Configuration

Admin Tools Configuration Variables
The following table lists the configuration variables of the Admin Tools, which are listed in file init<DBSID>.db6 or init<SAPSID>.db6 respectively, and their values.

Variable INSTHOME (4.6D Admin Tools only)

Value UNIX: Points to the db2<dbsid> home directory. Windows: Points to <CD-drive>:\db2\db<dbsid>.

DB2DB6_ARCHIVE_PATH

Points to the archive directory. UNIX: /db2/<DBSID>/log_archive (default value) Windows: Default value for a single-partitioned database: <drive>:\db2<DBSID>\log_archive Default value for a multi-partitioned database: \<instance_owning_machine>\log_archive<DBSID>

DB2DB6_RETRIEVE_PATH

Points to the retrieve directory. UNIX: /db2/<DBSID>/log_retrieve (default value) Windows: Default value for a single-partitioned database: <drive>:\db2###BOT_TEXT###lt;DBSID>\log_retrieve Default value for a multi-partitioned system: \<instance_owning_machine>\log_retrieve<DBSID>

DB2DB6_TEMP_DIR

UNIX: /tmp (default value) Windows: Value of %TEMP% (default value)

DB2DB6_STANDBY_DIR

This variable is not set by default. If this variable is used, the User Exit creates an additional copy of the log file in the standby directory during the archiving operation. If you want to set up a hot-standby system, you can use this variable For more information, see The db2inidb Tool [Page 122].

DB2DB6_STANDBY_DIR_NOERR

By default, this variable is not set or set to OFF. If the variable is set to ON, operations that fail in the standby directory do not cause the executable, which accesses the standby directory, to abort with an error.

DB2DB6_STANDBY_DIR_ADMDBSAR

By default, this variable is not set or set to OFF. If the variable is set to ON, brarchive creates an additional copy of the Admin DB backup SAR file in standby directory DB2DB6_STANDBY_DIR.

68

August 2003

If this variable is set to ON. this variable is not set. In addition. If you have configured DB2DB6_UEXIT_DIRECT=VENDOR. For archiving directly to disk. sddb6mir updates the Admin DB as well. this variable is not set. this variable is not set or set to ON. For SAP system releases lower and including 4. We strongly recommend that you do not set this variable to ON unless you are asked to do so by SAP support. set the variable as follows: DB2DB6_UEXIT_DIRECT=DISK. the User Exit does not update the Admin DB during indirect archiving operations. this variable is not set or set to OFF. DB2DB6_UEXIT_RETRIEVE_WO_DB By default. see Archiving to an Alternative Storage Management Product [Page 75]. you need to set the variable as follows: DB2DB6_VENDOR_UEXIT=<path to vendor User Exit>. you must configure variable DB2DB6_VENDOR_UEXIT. DB2DB6_CORE By default. If this variable is set to ON. For more information. DB2DB6_VENDOR_UEXIT By default. the User Exit tries to retrieve log files from log_archive or log_retrieve even if the Admin DB does not exist or is not up-to-date. For TSM: To activate archiving to TSM. the Admin Tools executables write a core file in UNIX instead of trying to handle exceptions internally. DB2DB6_UEXIT_ARCHIVE_WO_DB By default. For more information. set variable as follows: DB2DB6_UEXIT_DIRECT=TSM:<mgmt class1>[+<mgmt class 2>] For direct archiving to an alternative storage product.4 Configuration DB2DB6_UEXIT_DIRECT • • For indirect archiving: This variable is not set or set to OFF. to activate direct archiving to an alternative storage product. the value of the variable must be set to the fully qualified path of the customer script. see Indirect Archiving Using a Customer Script [Page 81]. see Configuring the System for Archiving Log Files [Page 71]. August 2003 69 . set the variable as follows: DB2DB6_UEXIT_DIRECT=VENDOR. • • For more information. DB2DB6_LIBDB6SC_SCRIPT By default. brarchive updates the Admin DB only during the next archiving operation.6D where program sddb6mir is used. this variable is not set or set to OFF. If this variable is set to ON. If you want to archive log files using a customer script with brarchive.

you can specify how often the Admin DB is reorganized : • • –1 = never 7 = default value DB2DB6_TRC_<TOOL> By default. The default value of seven days applies. If you want to use the TSM LANFREE feature. For more information.trc are created. you must set this variable to ON.4 Configuration DB2DB6_TSM_MULTITHREADED By default. this variable is not set or set to OFF. DB2DB6_ADMDB_REORG_FREQUENCY By default. DB2DB6_TSM_SLIB By default. which is set to the fully qualified path of the trace file. You only have to set this variable if the currently shown shared library version changes in newer versions of TSM. By setting this variable. Overrides DB2DB6_TRC_<TOOL>_PATH. see Configuring TSM (Tivoli Storage Management) [Page 83]. 70 August 2003 .<timestamp>. the same trace is used for all runs of <TOOL>. We strongly recommend that you do not set this variable to ON unless you are asked to do so by SAP Support. this variable is not set or set to OFF. this variable is not set. If you set this variable to ON. the tracing for <TOOL> is activated. If this variable is used. this variable is not set or set to OFF. DB2DB6_TRC_<TOOL>_LEVEL Values between 1 and 9 are allowed and specify the level of detail: • • • 1 = less detailed 3 = default 9 = maximum DB2DB6_TRC_<TOOL>_PATH DB2DB6_TRC_<TOOL>_FILE Specifies the path where the trace files of format <TOOL>.

DB2DB6_DMDB6BkP_TAPE_PATTERN (Windows only) \ DB2DB6_DMDB6BKP_BLOCK_SIZE DB2DB6_DBDM6SRP_UPDATE_THRESHOLD 1024 15 DB2DB6_DMDB6SRP_TABLESIZE_THRESHOLD 1000 See also: Appendix D: Example of File init<DBSID>.2 Configuring the System for Archiving Log Files As outlined in Basic Concepts [Page 21]. log files can be archived directly or indirectly. In case of TSM the User Exit utilizes the TSM APIs to archive and retrieve log files. which are contained in file init<SAPSID>. that is log files are immediately copied from the system to a safe backend and do no longer reside on the local system.db6 [Page 204]. August 2003 71 . Archiving log files directly to a storage vendor product means that the User Exit program uses the indicated storage management product to manage DB2 log files. Variable DB2DB6_DMDB6BKP_RETRIES Default Value 10 Description Backup retries in case of offline backups. Legato Networker from Legato System. All other storage products (for example. 4. The User Exit program can be configured to support one of these options. Inc. Pattern which distinguishes tapes from normal directories Backup block size for tapes Updates threshold in percent to flag tables for RUNSTATS.db6. and their values. Direct Archiving The User Exit archives log files either directly to disk (DB2DB6_ARCHIVE_PATH).4 Configuration Configuration Variables of Other Tools The following table lists the configuration variables of the redirected restore tool brdb6brt and the CCMS tools.) deliver their own implementation of the User Exit program. to TSM or to another vendor storage management product. Minimum table size in rows to flag tables for RUNSTATS.

However. Tape access and management using storage management systems are easy to handle and no tape space is wasted. Backups can also be archived with the storage management product. 72 August 2003 . In addition. Then brarchive is used to archive the copied files. problems will arise. ROLLFORWARD operations after a database restore normally require no user interaction when using direct archiving. Furthermore. an overflow of the log_directory can occur due to network outage or unavailability of the storage management system. you are still able to restore and rollforward the database as long as all log files and backups are still available on the local system. tape or using a customer script.2) or the corresponding database configuration variable parameter BLK_LOG_DSK_FULL=YES (DB2 Version 8) also reduces the risk of database failure. you can archive log files to TSM. Indirect Archiving This is the default configuration. If it is not available. In this case. You can avoid an overflow of the log directory by increasing the space of the log directory using the space you saved by not needing an archive directory. Indirect archiving offers the following advantages: • Log files are stored on the local system until deleted by brarchive. Thus. We recommend that database administrators use direct archiving as it performs well and requires minimal maintenance. • • • Simple tape support is provided by the Admin Tools. You only need extra space if you archive directly to disk. In case your storage management system is unavailable. The time of the archiving operation can freely be chosen. Option brrestore –delete allows deletion of log files that were created before a specific timestamp. network traffic can be avoided during the day by archiving during the night. During a rollforward recovery of the database the storage management system must be available. setting DB2 registry variable DB2_BLOCK_ON_LOG_DISK_FULL=ON (DB2 Version 7. With direct archiving this function is not available. The User Exit automatically copies log files to the directory specified in the DB2DB6_ARCHIVE_PATH variable. You also may consider to use infinite logging. You can avoid this situation by setting variable DB2DB6_STANDBY_DIR to keep local copies of log files until they are no longer required on the local system. No extra space for an archive directory is needed when archiving to TSM or any other storage management product.4 Configuration Direct archiving offers the following advantages: • • • • System configuration is less complex as no Admin DB or DB2 Control Center Extensions are required. when using direct archiving you have to take into considerations that some constraints apply.

For example. For more information on how to set up the TSM client. you have to take into consideration that there are a few disadvantages. The following syntax is used to set variable DB2DB6_UEXIT_DIRECT: DB2DB6_UEXIT_DIRECT = TSM:[<Mgmt Class>] To use the TSM management class MLOG1: DB2DB6_UEXIT_DIRECT = TSM:MLOG1 If you do not want to create and use a specific TSM management class. In both cases the necessary environment variable(s) must be set to indicate to the User Exit program that direct archiving to the data storage is required. see Configuring TSM (Tivoli Storage Management) [Page 83]. slightly increases the risk of failure.4 Configuration However. the TSM client software must be installed on the DB2 database server and a TSM server must be available. either: • Call the installation program sddb6ins with the parameters: -i [<target release>] -NOADMDB The Admin DB is automatically removed. see the following sections: • • • • • • Archiving Directly to TSM [Page 73] Archiving Directly to Disk [Page 74] Archiving to an Alternative Storage Management Product [Page 75] Indirect Archiving to Tape [Page 75] Indirect Archiving to TSM [Page 81] Indirect Archiving Using a Customer Script [Page 81] 4. including additional storage directories and an extra Admin DB. To indicate direct archiving to TSM. when using indirect archiving. set the DB2DB6_UEXIT_DIRECT variable in the environment file init<DBSID>. specify either of the following: • DB2DB6_UEXIT_DIRECT = TSM • DB2DB6_UEXIT_DIRECT = TSM:DEFAULT To switch the User Exit program to direct archiving of log files.db6 (make sure that it is not commented out). See also: For detailed information on direct and indirect archiving. DB2DB6_UEXIT_DIRECT. • Drop the ADM<DBSID> database manually. log files located in the archive directory are unsafe until stored to a safe backend by brarchive.2. The complexity of the solution.1 Archiving Directly to TSM In order to use the Tivoli Storage Manager to manage DB2 log files and/or DB2 backups. for example. August 2003 73 . Especially the existence of the Admin DB can cause problems in split-mirror scenarios and when performing a homogeneous system copy.

where yyyy is the node number Low level file name. We recommend that you define an archive copy group. where zzzzzzz is the log file number For the database BIN on node NODE0000.db6. the User exit can directly archive or retrieve log files to or from disk. you specify both management classes. the archive copy group is used by default. you have to configure environment variable DB2DB6_ARCHIVE_PATH.2 Archiving Directly to Disk Since Admin Tools patch 23 (6. 4.LOG For storing the log files. you have to activate variable DB2DB6_TSM_MULTITHREADED in file init<DBSID>. 74 August 2003 . you have to create two management classes in TSM. During the archiving operation the User Exit appends the partition number to the log file to avoid that log files from other DB2 partitions will be overwritten. for example. MC1 and MC2.LOG Meaning TSM file space name TSM file space type High level file identifier. archiving log file S0000599. To define the archive directory.2.NN Admin Tools) or patch 12 (4. During the retrieve operation the log file is transferred back to the log directory and the partition number is removed automatically.4 Configuration The following naming conventions on the TSM server apply: TSM Variable /<DBSID> DB2 /NODEyyyy /Szzzzzzz. a backup copy group is used. To do so. in the User Exit variable DB2DB6_UEXIT_DIRECT. If no archive copy group is defined. DB2DB6_UEXIT_DIRECT = TSM:MC1+MC2 Archiving Using TSM Option LANFREE To make sure that the Admin Tools work in a TSM LANFREE environment.LOG would result in the following values: • • • • • File space name: /BIN File space type: DB2 Object name file space: /BIN Object high-level name: /NODE0000 Object low-level name: /S0000599. Archiving to Two TSM Management Classes For duplicated archiving of log files to TSM.6D Admin Tools).

All tapes and tape devices used for log file archiving must be registered here.3 Archiving to an Alternative Storage Management Product In order to choose an alternative storage manager product to manage DB2 log files or DB2 backups.db6 using the following syntax: DB2DB6_UEXIT_DIRECT = VENDOR DB2 DB6_VENDOR_UEXIT = <vendor user exit program name> If the vendor User Exit program is not in the path of the DB2 instance owner db2<dbsid>. Be aware that you cannot use brarchive or brrestore to archive or restore these log files.2. Initializing (naming) tapes. the specific client software must be installed and configured on the DB2 database server. the Admin Tools include a tape management facility. Set the DB2DB6_UEXIT_DIRECT and DB2DB6_VENDOR_UEXIT variables in the environment file init<DBSID>.4 Configuration The log files in the archive directory need to be manually archived to disk using tools of your choice. refer to the vendor’s documentation. 4. The basic steps in tape management include: • • • Defining device classes. The Admin Tools User Exit must also be installed. specify the program with the fully qualified path. For this purpose. Defining devices. For setup and error handling relating to the vendor User Exit program. August 2003 75 . Each tape and tape device is assigned to a tape device class.2.4 Indirect Archiving to Tape You can only archive log files to tape in indirect archiving mode. Make sure that the vendor User Exit program is renamed and does not overwrite the User Exit program delivered by SAP. 4.

5. 2 and so on to address them. From the context menu of the SAP database <DBSID> icon. 2. For example. If you have more than one tape device. log on as user db2<dbsid>. replace the 0 with 1. a default device class is defined. 76 August 2003 . Working with Tape Device Classes . Choose Tapes. read the following sections. This device class initially contains one defined device: Windows: AIX: Solaris: Linux: HP-UX: /dev/mt0 /dev/rmt0 /dev/rmt/0 /dev/st0 /dev/rmt/0m We recommend that you update or replace default entries according to your requirements. To define device classes. In the navigation frame of the DB2 Control Center.4 Configuration Initially. The Tape Management dialog box appears. To display a list of all known device classes. expand the <system name> node until the database names are visible.. 1. choose SAP Tape Management.. devices and tapes. expand the <System name> node in the tree. the second tape on Solaris is /dev/rmt/1. 3. 4. If required.

Overrides the rewind configuration parameter. Optional field that describes the device class. Most fields have a corresponding configuration parameter as described in the table under Parameters Affecting Log File Management Storage [Page 64]. Describes the device type you can choose from the menu. All devices and tapes of that class will also be removed by the delete action. 8. Required but can be freely chosen. Choose Add or Change depending whether you want to add a new device class or change existing data. Field Name Capacity Type Description Rewind Description Name of the device class. Enter or change the fields as required. The fields in the Add/Change Device Class dialog box describe a tape device class. choose Delete from the context menu of the <device class> node. the Add/Change Device Class dialog box appears. To remove a device class definition. Overrides the tape_size configuration parameter.4 Configuration 6. You can choose from the following actions: To add a new device class. To change an existing device class definition. choose Add Device Class from the context menu of the <system name> node. For the first two actions. 7. The fields are described in detail in the table following this procedure. August 2003 77 . choose Edit from the context menu of the <device class> node.

7. Expand the Devices node.4 Configuration Rewind Offline Eject Positioning Overrides the rewind_offline configuration parameter. Choose Add or Change depending on whether you want to add a new tape or change existing data. Set this field to the same value. For the first two actions the Add/Change Device dialog box appears. log on as user db2<dbsid>. You can choose from the following actions: To add a new tape. 6. Description is optional. To change an existing Device definition. Working with Tape Devices . 78 August 2003 . 4. 1... 3. Identical to Rewind offline. choose Edit from the context menu of the <device> node. In the navigation frame of the DB2 Control Center. choose SAP Tape Management from the context menu of the SAP database <DBSID>. If required. 2. choose Add Device… from the context menu of the <device class> node. Enter or change the fields as required. choose Delete from the context menu of the <device> node. To remove a device definition. Expand the <system name> node. 5. A list of known device classes is displayed. choose Retrieve Tape Label from the context menu of the <device> node. Overrides the tape_pos_cmd configuration parameter. To retrieve the label of a tape currently located in a tape drive. and the <device class> node to which the device definition will be added.

Initializing Tapes Using the DB2 Control Center . Tapes must normally then be re-initialized before new log files can be archived to them. the bs value must be changed to the block size in bytes. it is sometimes necessary to modify the block size used to read and write tapes. Enter the name of the new tape. From the context menu of the Tapes node. For cpio. such changes apply to all tape classes and tape devices. 3. The Initialize Tape dialog box appears 5. the option ‘B‘ must be replaced with ‘C‘ followed by the block size divided by 512. log on as user db2<dbsid>. Expand the <system name> node. 2. This involves writing a header file to each tape. 1.. tapes can be re-used if the log files go out of date as defined by the expir_period configuration parameter. Initializing Tapes Tapes must be initialized before files can be archived to them. and the <device class> node to which the tape to be initialized belongs. As described in Changing the Admin Tools Configuration [Page 64]. For dd. choose Initialize Tape…. The flags supplied to cpio and dd will need modifying if a non-standard block size is used.. containing information such as volume name. If required. choose SAP Tape Management from the context menu of the SAP database <DBSID>. Only a single archive operation involving one or more log files is permitted on an initialized tape.4 Configuration Modifying the Tape Block Size To improve performance. In the navigation frame of the DB2 Control Center. August 2003 79 . SAP system ID and tape usage count. The Tape Management dialog box appears. 4. Due to a limitation in the Admin DB design.

enter the following command: brarchive -i force -v D4XA01 –t/dev/rmt/0 The complete syntax is explained in Appendix A: Tool Command Line Parameters [Page 147]. the initialization is not permitted unless the Force initialization box is selected. If the tape has never been initialized before or was used to archive files less than expir_period weeks ago.from the context menu of the tape icon. To initialize an already registered tape again. choose Delete from the context menu of the tape icon. The following command initializes a tape with the name D4XA01 without checking whether the tape has already been used or initialized. choose Init. 80 August 2003 . 7. All tape actions and their results can be seen by choosing Journal tab. To initialize the tape. the Force initialization option must be selected. You can change the value of the expir_period parameter in the SAP Option Management dialog box.4 Configuration 6. To initialize a tape the first time. Choose the device where the tape is located. To initialize the tape. choose Re-initialize …. To remove a tape. Initializing Tapes with brarchive brarchive is the command that the DB2 Control Center uses to initialize tapes. Messages are only written to a protocol file. Calling brarchive on the command line gives the administrator access to all command line options and may therefore be more flexible than the DB2 Control Center interface.

YYYYMMDDHHMMSS. You can find more general information about TSM configuration in Configuring TSM (Tivoli Storage Management) [Page 83].6 Indirect Archiving Using a Customer Script brarchive und brrestore currently only support archiving to two backends: TSM and tape. Then a backup copy group is used. By using your own script. you enable the Admin Tools to archive log files to any backend.LOG.LOG would result in the following values: • File space name: /BIN • File space type: DB2 • High-level name: /NODE0000 • Low-level name: /S0000599. where yyyy is the node number Low level file name. you have to activate variable DB2DB6_TSM_MULTITHREADED in file init<DBSID>.5 Indirect Archiving to TSM For indirect archiving to TSM. retrieve or delete log files.db6 to enable the Admin Tools to work in a TSM-LANFREE environment.2. Archiving Using the TSM Option LANFREE If you want to use this option. archiving the log file S0000599.20010606103645. August 2003 81 . The script needs to be able to archive.LOG.NODE0000 For storing the log files the archive copy group is used by default if no archive copy group is defined. We recommend that you define an archive copy group. which means any other storage product or storage device.NODEyyyy Description TSM file space name TSM file space type High level file identifier. The following naming conventions apply on the TSM server: TSM Variable /<DBSID> DB2 /NODEyyyy /Szzzzzzz. no special tasks must be performed other than configuring TSM itself. where • • • zzzzzzz is the log file number YYYYMMDDHHMMSS is the file that was closed by DB2 yyyy is the node number For the database BIN on node NODE0000.2. according to your requirements.4 Configuration 4. 4.

to write your own script. retrieve or delete log files. . If you are deleting log files.NODExxxx The sequence of the parameters in the script must be the same as in the table. In the sample script the TSM client dsmc is used to archive.. Indicates failure of the action performed. The log file has the following format: Snnnnnnn.smp. Defines the log file that is to be used. The shell script is designed for UNIX.. you have to write a batch file or an executable. if the script returns LFM_STATUS_OK (although the action has failed) brarchive and brrestore assume that the action was completed successfully. which is not the case. The following table lists the return codes the script must issue for every action performed so that brarchive and brrestore can determine a success or failure: Return Code LFMVND_STATUS_OK=0 LFMVND_RC_ERROR=64 LFMVND_COMMAND_NOT_SUPPORTED=71 Description Indicates success of the action performed. 82 August 2003 .LOG<TS>. If you are retrieving log files. If your system is running on Windows. directory points to the directory where the log files were originally archived from. For example. the content of the Admin DB becomes inconsistent and you risk to lose log files. The following table lists the parameters that the script needs to support: Parameter action Description You can set the parameter to perform the following actions: • • • directory • • • file ARCHIVE RETRIEVE DELETE If you are archiving log files. you have to make sure the script accepts the parameters and return codes provided by brarchive and brrestore.4 Configuration What Does the Script Need to Support? If you want to use your own script to archive log files to any other backend than TSM or tape. You must make sure that you specify the correct return codes for every action performed − as described in the table. which is part of the Admin Tools delivery. Thus. directory points to the directory where the log files to be archived are located. Writing Your Own Script You use the sample script db6sctsm. Indicates that the action specified in the script is not supported. directory points to the directory where the log files should be retrieved to.

Install the TSM client and API on the DB2 server.3 Configuring TSM (Tivoli Storage Management) Use When issuing DB2 BACKUP or RESTORE commands. you can enter your archive. August 2003 83 . DSMI_DIR. DSM_LOG and DSMI_LOG as described in Configuring TSM Environment Variables [Page 85]. restart DB2 with db2start.opt and dsm. 5.4 Configuration We strongly recommend that you copy the sample script to avoid overwriting during the next Admin Tool installation.sys (UNIX only) as described in Configuring TSM Files dsm. Activating the Script You activate the script by setting parameter DB2DB6_LIBDB6SC_SCRIPT=<path to customer script> in file init<DBSID>. to manage the database or tablespace backup). DSMI_CONFIG. We recommend that you use at least TSM Version 4. Configure the TSM files dsm. 4. You can also use TSM to manage archived DB2 log files. After having copied the script. 3. you have to perform the following steps: . Procedure Before the DB2 Database Manager db2<dbsid> can use TSM. To generate the password.. run the TSM client dsmc once.opt (UNIX and Windows) and dsm.db6. 1.1. see Configuring the Admin Tools Using Environment Files [Page 67]. Configure the TSM environment variables DSM_DIR. see SAP Note 82029 ADSM/TSM Installation in DB2 Environment. To make the environment variable visible to DB2. retrieve or delete commands. 4. For more information on how to set parameters in file init<DBSID>db6. For more detailed information on steps 2 and 3. 2. you can specify Tivoli Storage Manager (TSM product..sys [Page 84]. DSM_CONFIG.

opt and dsm.opt file must fit the value SERVERNAME in the dsm.1 Configuring TSM Files dsm. Make sure that this directory has the appropriate authorizations.sys file.4 Configuration 4.sys On UNIX systems. Windows File dsm. On Windows systems.sys Parameter SERVERNAME COMMETHOD TCPPORT TCPSERVERADDRESS PASSWORDACCESS PASSWORDDIR Value <TSM server name> TCP/IP 1500 <TSM server IP address or host name and domain name> Generate /etc/adsm Value <TSM server name> The entry of SERVERNAME in the dsm. The files must contain the following parameters: UNIX File dsm.opt and dsm.opt Parameter SERVERNAME File dsm.3. the TSM file dsm.sys must be configured.opt Parameter COMMMETHOD TCPPORT NODENAME TCPSERVERADDRESS PASSWORDACCESS Value TCP/IP 1500 <TSM client> <TSM server IP address or host name and domain name> Generate 84 August 2003 .opt must be configured. For parameter PASSWORDDIR: The users root and db2<dbsid> must be able to access directory /etc/adsm. the TSM files dsm.

DSM_CONFIG. DSMI_CONFIG. DSMI_DIR. The following list provides additional information on these variables that you have to take into consideration depending on the Admin Tools version you are using: • 4. The values.dbenv_<hostname>. Windows The above mentioned variables are not set during installation and must be added manually to the user environment of db2<dbsid> and <sapsid>adm. DSMI_CONFIG and DSMI_LOG. which installs the Admin Tools. work on all standard TSM installations and generally do need not to be corrected. August 2003 85 .cshrc and . If you install the TSM software afterwards.dbenv_<hostname>.6D Admin Tools UNIX During the installation of the SAP system with R3SETUP the files . sh add the TSM API-specific environment variables DSMI_DIR. The shell script dbaenv_<hostname>. which are set there. Windows If the TSM software is installed on the database server before the sddb6ins program is called.3.login scripts in the home directories of db2<dbsid> and <sapsid>adm. which are not valid in most cases and which must be corrected. you can rerun sddb6ins with the –i option and sddb6ins will add these variables.NN Admin Tools or higher UNIX The sddb6ins program. • 6.csh and dbaenv_<hostname>. These files contain some default values for the TSM variables. DSMI_CONFIG and DSMI_LOG to appropriate values in the user environment of users db2<dbsid> and <sapsid>adm.csh and dbaenv_<hostname>. DSM_LOG and DSMI_LOG are needed to tell TSM where TSM resides and on which TSM server the database backup and the log files should be stored.4 Configuration 4. which call the dbaenv_<hostname>. sddb6ins detects this and sets the TSM API-specific environment variables DSMI_DIR. DSM_CONFIG and DSM_LOG.sh script.sh are created in the home directory of db2<dbsid> and <sapsid>adm.2 Configuring TSM Environment Variables TSM environment variables DSM_DIR. adds an entry to the profile.csh and . . as well as the TSM client-specific environment variables DSM_DIR.

csh ~/. DSMI_CONFIG Location of dsm.sh 86 August 2003 .4 Configuration Environment Variables for TSM: The following table provides an overview of all environment variables you should check: Variable DSMI_DIR Value Location of TSM API library with the following default: Windows: <drive>:\progra~1\Tivoli\ tsm\api UNIX: For 6.csh $INSTHOME/admintools/bin For 4.sh Log directory for TSM API with the following default: Windows: <drive>:\progra~1\Tivoli \tsm\api UNIX: $INSTHOME/errors Same as for variable DSMI_DIR as described in this table.sh Set In Windows: User environment of db2<dbsid> and <sapsid>adm UNIX: For 6.opt Same as relevant location for variable DSMI_DIR as described in this table UNIX only: DSM_DIR Location of TSM client with the following default: For 6.sh For 4.sh UNIX only: For 6.6D Admin Tools: ~/.NN Admin Tools: • • • • $INSTHOME/admintools/bin/dbaenv_ <hostname>.csh ~/.csh dbaenv_<hostname>.dbenv_<hostname>.6D Admin Tools: ~/.6D Admin Tools: ~/.opt UNIX: $INSTHOME/sqllib/adsm /dsm.opt file with the following default: Windows: <drive>:\progra~1\Tivoli \tsm\baclient\dsm.csh ~/.dbenv_<hostname>.sh For 4.dbenv_<hostname>.sh For 4.NN Admin Tools: • • • • DSMI_LOG dbaenv_<hostname>.dbenv_<hostname>.csh ~/.NN Admin Tools: • • • • dbaenv_<hostname>.dbenv_<hostname>.NN Admin Tools: • • • • $INSTHOME/admintools/bin/dbaenv_ <hostname>.csh dbaenv_<hostname>.dbenv_<hostname>.dbenv_<hostname>.6D Admin Tools: ~/.csh dbaenv_<hostname>.dbenv_<hostname>.

The default is $INSTHOME/errors Location of dsm.opt UNIX only: Same as for variable DSM_DIR as described in this table UNIX only: Same as for variable DSM_DIR as described in this table 4. you can use an older backup and still perform a rollforward recovery. For backups. If the DB2 backup image does not fit into this disk storage pool. The preferable solution. If you only lose a backup. • • We recommend that for archiving log files you use a disk storage pool. is that you use a management class for backups different from the one you use for log files. If log files are deleted from tape by TSM. August 2003 87 .opt file for TSM client. With log files missing. you not only lose a backup but also the log files. The performance during rollforward recovery is limited because log files are widely spread on the tape if stored on the same tape as backups.4 Configuration UNIX only: DSM_LOG UNIX only: DSM_CONFIG Log directory for TSM client. however. backups and log files might be archived to the same tape. the following disadvantages have to be taken into consideration: • If you lose a tape. you cannot reuse the whole tape because backups still reside on that tape and space reclamation drastically affects the system performance. The default is: $INSTHOME/sqllib/adsm/ dsm. TSM will fail. we recommend that you do not use such a disk storage pool. this is not possible. In this case.3.3 Configuration Considerations With TSM. you can use the same or different management classes for archiving backups and log files. With this pool. If you use the same management class. however. Sometimes you might be forced to keep offline backups longer than log files. you can achieve a better system and rollforward performance if caching on the disk storage pool is switched on. An extremely large disk storage pool would be necessary to avoid this problem.

log and db2uext2.NODEyyyy.4 DB2 Configuration Parameters DB2 variables are configured by the SAP installation to ensure that DB2 and the Admin Tools work. Directory where DB2 writes log files to. DB2 Instance Registry Variables Instance Registry Variable DB2ENVLIST Description Default value: • • Windows: INSTHOME SAPSYSTEMNAME dbs_db6_schema AIX: LIBPATH INSTHOME SAPSYSTEMNAME dbs_db6_schema Linux: LD_LIBRARY_PATH INSTHOME SAPSYSTEMNAME dbs_db6_schema Solaris: LD_LIBRARY_PATH INSTHOME SAPSYSTEMNAME dbs_db6_schema HP-UX: SHLIB_PATH INSTHOME SAPSYSTEMNAME dbs_db6_schema • • • Setting these variables ensures that the User Exit program db2uext2 and the stored procedure sddb6jds get the appropriate environment. 88 August 2003 . <DBSID> Database Configuration Database Configuration Parameter LOGRETAIN USEREXIT LOGPATH LOGFILSIZ Database Manager Configuration Database Manager Configuration Parameter DIAGPATH Description Location where DB2 writes the db2diag.log. This section lists parameters. refer to the DB2 documentation. Default value in an SAP environment is 64 MB. If it is necessary to change them. Description Must be set to ON that rollforward recovery is possible. with a brief description. The sddb6ins installation program sets this value appropriately. which influence the Admin Tools directly.err to this directory. The User Exit program db2uext2 writes the files db2uext2.NODEyyyy. Must be set to ON that the User Exit db2uext2 is called. Defines the size of each log file.4 Configuration 4.

NN Admin Tools: <INSTHOME>/admintools/protocols For 4. They are moved to the protocols directory at the end of the brarchive/brrestore run.NODExxxx.5 Disk Space Considerations for Running the Admin Tools The following section provides additional information on the directories that are needed if you want to install the Admin Tools. • brarchive/brrestore protocols These log files are initially generated in the directory where DB2DB6_TEMP_DIR points to.4 Configuration 4. The free space in the directory where DB2DB6_TEMP_DIR is pointing to needs to be dimensioned. Protocols • User Exit protocols The User Exit writes its protocol files db2uext2.NODExxxx. • Indirect archiving The free space in the directory where DB2DB6_ARCHIVE_PATH is pointing to. depending on the log file size and the period of time between two brarchive calls and the amount of log files that accumulate between two brarchive calls. Otherwise. August 2003 89 . brarchive fails to store the Admin DB. needs to be dimensioned. The given information refers to disk space considerations for: • • • • Log files Protocols Trace files Admin DB Log Files • Direct archiving Make sure that the log directory provides sufficient space to avoid problems if your storage management system might be temporarily unavailable.log and dbuext2.6D Admin Tools: brarchive: <INSTHOME>/saparch brrestore: <INSTHOME>/saprest These directories need to be dimensioned to hold the small protocol files.err to the directory where the database manager configuration parameter DIAGPATH points to. so that two exports of the Admin DB fit into it. The directories differ for the Admin Tools version as follows: For 6.

6D Admin Tools: <DB2DB6_TEMP_DIR>/TraceFiles Admin DB (Indirect Archiving) The Admin DB is relatively small and its size increases slowly. All methods to keep the Admin DB small are described in Regular Administration [Page 91]. The trace file directory can be configured in the init<DBSID>.4 Configuration Trace Files Trace files are only generated if the user has explicitly enabled trace file generation in the init<DBSID>. The default directories are: • • For 6.db6 file.db6 file for each executable separately.NN Admin Tools: <INSTHOME>/admintools/TraceFiles For 4. The trace files are only required to determine defects or by the SAP support to fix problems. 90 August 2003 .

5 Regular Administration

5 Regular Administration
5.1 DB2 Log File Management
The concepts and terminology used in this chapter are described in Basic Concepts [Page 21]. For more detailed information on how to configure the log file management tools, see Configuration [Page 64]. If you are archiving directly, all archive processes will run automatically. You may need to delete old log files from the storage product occasionally. For indirect archiving (the default), the main daily action is archiving log files to tape or TSM after they have been processed by the User Exit. If files are not deleted from the disk during these archive operations, the files remaining on the disk will also need deleting regularly. The other less regular log file management action is deleting log files from the storage product.

5.1.1 Archiving Log Files from Disk to Backend
The log files are copied to a temporary disk location by the User Exit, as specified by the environment variable DB2DB6_ARCHIVE_PATH. Log file management information is stored in the Admin DB ADM<DBSID>. The log files written to the DB2DB6_ARCHIVE_PATH location can by archived using the brarchive tool, either to tape, TSM or any other backend using a customer script. You can start brarchive on the command line or using the DB2 Control Center Extensions, or using the DBA Planning Calendar (transaction DB13).

Archiving with DB2 Control Center
...

1. In the navigation frame of the DB2 Control Center, choose your system and log on as a user with administrator authorizations. 2. On the subnode Database, from the context menu of the database <DBSID>, choose SAP Log File Management. 3. If required, log on as user <sapsid>adm or db2<dbsid>. The Log File Management dialog box appears. 4. Choose Archive. 5. In the Archive Log Files of Node field, choose the node from which log files should be archived. 6. In the Log Files to be Archived field, choose the log file up to which you want to archive. All older log files up to the one you have selected will be selected for archiving.

August 2003

91

5 Regular Administration

If you do not want the log files to be deleted from the archive directory after archiving, select Keep Log Files in File System. Select TSM, Tape or Script: TSM: In the TSM Management Class field, select a TSM management class. The possible entries for the management class are maintained using the SAP Option Management dialog box. The corresponding keyword is adsm_mc. Under Value, a list of management classes is specified, separated by commas. For more information, see Changing the Admin Tools Configuration [Page 64]. Tape: i. Select Name of First Tape. The list of devices next to this box is then recalculated to only contain the matching devices for that tape. ii. Select a device. Alternatively, you can start by choosing a device name and afterwards choose an appropriate tape.

If you want to save to two tapes simultaneously, follow the same procedure for the Name of the Second Tape and its device. If these fields do not contain any entries, log files are saved to a single tape. Once you have selected an entry in one of the four boxes, the entries in the remaining boxes are limited to those entries that match the selection. iii. To display the full list of possible entries, start the selection process again by choosing Reset Selection. If the tape is not initialized or the device you want to use is not displayed (not defined), go to the SAP Tape Management by choosing Tape. For more information, see Indirect Archiving to Tape [Page 75].

After archiving log files to a tape, the same tape cannot be used to archive additional log files in a later operation until the number of weeks specified in the expir_period configuration parameter has elapsed or the tape is initialized again. For more information, see Parameters Affecting Log File Management Storage [Page 64]. 7. To start the archive process, choose Archive. A dialog box appears indicating that the archiving process was just started. After the archiving has finished, another dialog box appears indicating if it was successful.

You can see all archiving actions and their results in the Journal page.

92

August 2003

5 Regular Administration

Archiving with Command Line Tool brarchive
brarchive is the command that the DB2 Control Center uses to archive log files. Calling brarchive from the command line gives the administrator access to all command line options and may therefore be more flexible than the DB2 Control Center interface. The following syntax describes the most common usage of brarchive.

Tapes must be initialized before brarchive can use them. For more information, see Indirect Archiving to Tape [Page 75]. Archiving Log Files to Single Tape Command syntax Description brarchive -sd -d tape -v D4XA01 –t /dev/rmt/0 -out n 25 Archives 25 log files to the tape D4XA01, and deletes them from the file system if processing completes successfully. Messages are written to the standard output and a protocol file.

Archiving Log Files to Two Tapes (Double Store) Command syntax Description brarchive -ssd -d tape -v D4XA01 D4XA02 –t /dev/rmt/0 /dev/rmt/1 -out -n 10 Archives the same ten log files to both the tapes D4XA01 and D4XA02, and deletes them from the file system if processing completes successfully. Messages are written to the standard output file and a protocol file.

Archiving Log Files to TSM Without Delete Command syntax Description brarchive -s -d tsm –out Archives all available log files to the default management class in TSM, without deleting them from the file system. Messages are written to the standard output file and a protocol file. You might not want to delete log files immediately to allow them to be processed using other tools. These must be deleted later using the –ds option.

Archiving Log Files to Two TSM Management Classes Command syntax Description brarchive –ssd –d tsm MC1+MC2 –out As of 4.6D Admin Tool patch 20 or 6.NN Admin Tool patch 9, you can archive log files to two different management classes. You have to create two management classes, for example, MC1 and MC2, in TSM before you call brarchive.

For more information on the barchive syntax, see brarchive - Log File Archive Tool [Page 147].

August 2003

93

5 Regular Administration

Setting Parameter Default Values in the Admin DB
To avoid the necessity to specify all command line options, you can set some values in the SAP Option Management using the DB2 Control Center Extensions. For more information, see Parameters Affecting Log File Management Storage [Page 64]. Setting the values for the following configuration variables will help you to minimize the required command line options: • • backup_dev_type Specify the value that you normally specify using the –d command line option. adsm_mc Specify the TSM management class(es) that you want to use by default.

Archiving Using Customer Script
To activate the script support, you have to set variable DB2DB6_LIBDB6SC_SCRIPT=<path_to_customer_script> in file init<DBSID>.db6. However, before you call brarchive and brrestore using the command line, you must make sure that option –d script is specified in the script as described in the following example.

If you want to archive all log files, you enter the following command: brarchive –s –d script –out • If you want to retrieve up to ten log files, you enter the following command: brrestore –a –d script –n 10 –out • If you want to delete log files for a specified backup timestamp, you enter the following command: brrestore –delete 20020107120000 –d script –out For more information, see Appendix E: Example of Customer Script db6sctsm.smp [Page 208].

5.1.2 Deleting Log Files
Log files may need to be deleted regularly depending on how often backups are taken, the number of log files generated each day, and the size of available storage. Log files are stored in the following locations: • • • • • Log directory Archive directory Tape Storage Products Any other backend using a customer script

94

August 2003

you cannot do so since the log files were re-used.LOG. If only –s and –ss are used.LOG. the files previously stored on the tape are removed from the Admin DB. the delete stored action (-ds) must be run separately to delete these files from the disk. For example.5 Regular Administration Deleting Log Files from the Log Directory Normally there is no need to delete files from this directory. You can identify the original log files easily by their timestamp if they have the following format: Snnnnnnn. This is done by specifying a file pattern.LOG and *.SAR). the log files are removed again when the files have been successfully stored. This action deletes all log files in the current log path directory. use the PRUNE LOG FILE command. If any log files have been moved to another path. either to match log files (*. they will not be considered by this command.LOG. the remainder of log file 35 and the whole of log files 36 and onwards will be re-used. Log files will be deleted from the log directory if you: • Drop a database.*). for future recovery purposes.LOG This command will delete all log files in the active log path up to and including S0000099. It will only do so from the active log path. If you need to restore again past the point in time used earlier.NODExxxx. Do not delete files that are still needed by the database. You may need to back up these log files beforehand. if a rollforward operation only needs log data up to the middle of log file 35 and you restart the database. or Admin DB safety files (*. PRUNE LOGFILE PRIOR to S0000100. Retrieve the original set of log files manually to a different location and copy them back for the restore action. To actively delete log files. The syntax is as follows: brrestore –delete <timestamp> [file pattern] August 2003 95 . • Recover the database to a point in time. Deleting Log Files from Tape It is neither possible nor necessary to explicitly delete log files from tapes. If brarchive is then used with the –sd or –ssd archive actions. As soon as a tape is re-initialized or re-used. Deleting Log Files from the Archive Directory Log files are placed here by the User Exit in indirect mode (default). Deleting Unknown TSM files with brrestore The log file management tool brrestore now allows removal of files from TSM that are not known to the Admin DB. This DB2 command deletes all log files in the log directory created prior to a nominated log file. When recovering the database to a point in time. log files chronologically past the point in time are re-used and therefore lost.<timestamp>.

Deleting Log Files Archived with a Customer Script You delete log files. Running out of storage may cause the database or system to fail.6x. one essential task for system administrators is storage management. see the corresponding product documentation.10 or higher. by entering the following command: brrestore –d script –delete. see brrestore – Log File Retrieval Tool [Page 153]. • Other storage management products Files directly archived using an additional User Exit must be managed with tools made available by that product. Therefore.2 Storage Management Approaching the limit of available storage can degrade overall performance. The information provided for the DBA Cockpit is valid for SAP Web AS 6. which were archived using a customer script. adding or resizing. refer to Archiving Directly to TSM [Page 73] for a description of where the files are stored.1I and 4. for SAP system Release 3.5 Regular Administration Deleting Log Files from Storage Products You can delete log files from either: • TSM Only use the Admin Tools to work with files stored indirectly to TSM. To delete old log files created with recent tools. you must make sure that you have installed the DBA Cockpit as described in SAP Note 300828. 96 August 2003 . For more information. 5.Log File Retrieval Tool [Page 153]. For more information on the syntax of brrestore. Managing (for example. For SAP system Release 4. The tasks described in the following sections can be performed either using the DB2 Control Center or the DBA Cockpit. Checking the size of tables and indexes. enter the following command: brrestore –delete.0A) can be deleted using the db6adutl tool or the TSM utility dsmc. For more information on the syntax of brrestore.) these storage elements to deal with changing requirements. The section DELETE must be implemented in the script. which consists of tasks such as: • • • • Checking the free space in file systems. Checking the space available in tablespaces. Files stored directly to TSM or archived indirectly with older tools (for example. see brrestore . In this case.

proceed as follows: From the SAP Performance Monitor You can access the information by calling transaction DB6COCKPIT and choosing Configuration → File Systems in the navigation frame of the DBA Cockpit. From the Operating System: Use the command df on UNIX systems and the program Explorer on Windows systems. see the SAP Online Documentation in the SAP Library.. Space is measured in pages where one page is 4 KB.2. In the contents pane a list of all tablespaces is displayed. Double-click on Tablespaces.5 Regular Administration 5. see the SAP Online Documentation in the SAP Library. August 2003 97 . 3. Size used and Percentage used to see details related to the amount of space available in a tablespace.1 Checking the Space Available in a File System To check the available free space of the log directory and the archive directory. The information displayed on this screen helps you to determine how much free space is available in your file systems. Open the database tree. When a DMS tablespace reaches the threshold capacity (depending on the usage of the tablespace. 1. For more information. 5. 2. you should add more space to it. For more information. Adding More Space to a Tablespace The capacity for a DMS tablespace is the total size of all containers allocated to this tablespace. From the SAP Performance Monitor (SAP Web AS 6. proceed as follows: From the SAP Performance Monitor You can access information on space for tablespaces by calling transaction DB02 and choosing Space → Tablespaces in the navigation frame of the DBA Cockpit.2. From the DB2 Control Center . 90% is a possible threshold). Scroll to columns Allocated size.20 or higher) You can add more space to tablespaces by calling transaction DB02 and choosing Space → Tablespaces in the navigation frame of the DBA Cockpit and choosing Add.2 Checking the Space Available in a Tablespace To check the amount of space available in a DMS tablespace..

During rebalancing. The space that you have added will be available immediately. enter the following SQL command: alter tablespace <tablespace name> begin new stripe set (file ‘<container name>’ <number of pages>) This does not cause rebalancing. During rebalancing. Container sizes can only be increased. enter the following SQL command: alter tablespace <tablespace name> extend (all containers <number additional pages> ) Resize one or more existing tablespace containers to a new size. data in the tablespace remains accessible. data in the tablespace remains accessible. From DB2 CLP You can reduce the size of a tablespace using the following SQL command: alter tablespace <tablespace name> resize (all containers <new container size in pages>) 98 August 2003 . To do so. see the IBM documentation DB2 Universal Database SQL Reference. To do so. Extend one or more existing tablespace container by a specific size.5 Regular Administration From DB2 CLP Using the following SQL commands you can: • Add a new container to a DMS tablespace. • DB2 Version 8 From the SAP Performance Monitor (SAP Web AS 6. To do so. For more detailed information on the command syntax. and then restoring it using a new physical layout. enter the following SQL command: alter tablespace <tablespace name> add ( file '<container name>' <number of pages> ) • Increase the size of one or more containers in the DMS tablespace. To add a new container. The DB2 database manager will automatically rebalance the tables in the DMS tablespace across all available containers. enter the following SQL command: alter tablespace <tablespace name> resize (all containers <new container size in pages> ) The database manager will automatically rebalance the tables in the DMS tablespace across all available containers if necessary. • DB2 Version 8 Increase the size of a DMS tablespace by adding a new stripe set. backing up the tablespace. Reducing the Size of a Tablespace • DB2 Version 7 You can reduce the size of tablespaces by reorganizing all the tables in the tablespace.20 or higher) You can reduce the space of a tablespace by calling transaction DB02 and choosing Space → Tablespaces in the navigation frame of the DBA Cockpit and choosing Delete.

the following check on the system catalog tables is performed: • • Are there tables that do not yet have an entry in the CCMS control table DB6TREORG? (This table is always filled by CCMS programs after REORGCHK. see the SAP Online Documentation in the SAP Library.2. choose Continue. The information provided for the DBA Cockpit is valid for SAP Web AS 6. August 2003 99 . you must make sure that you have installed the DBA Cockpit as described in SAP Note 300828. When you call this transaction for the first time. a dialog box appears listing these tables that require reorganization.6x. which is divided at the top level into the main task areas of database administration. 5. For SAP system releases lower and including 4. Be aware that running a REORGCHK on the listed tables may take a long time and affect the database performance.) Are there tables that have entries in the CCMS control table DB6TREORG and that are not up-to-date with the system catalog? If any tables are found. The DBA Cockpit is a navigation frame that holds a tree structure. for example.5 Regular Administration 5. performance monitoring. For more information.10 or higher. To adjust the tables. choose REORGCHK.3 Checking the Size of Tables and Indexes You can access information on space for tables and indexes by calling transaction DB02 and choosing Space → Tables and Indexes in the navigation frame of the DBA Cockpit.3 Performance Monitoring Performance monitoring consists of the following tasks: • • • • Monitoring database performance Monitoring SQL statements Updating statistics for database tables and checking for reorganization Monitoring jobs You can access all monitoring and database administration tasks using the DBA Cockpit. Otherwise.

If an object’s data page is placed in a buffer pool. This is the default buffer pool for the database. see the SAP Online Documentation in the SAP Library. For more information. overflows and the performance of sorts. 100 August 2003 . The values of Overall Buffer Quality. Checking Locks and Deadlocks DB2 captures information for locks held by applications against a database and records each deadlock event (by means of deadlock event monitors).6C and higher. SAP provides a graphical performance monitor for DB2 to analyze the database activity basis of the DB2 monitor switches. see the SAP Online Documentation in the SAP Library. Checking Sort Overflows The DB2 Snapshot Monitor provides cumulative information about the number of heaps used.1 Monitoring Database Performance DB2 monitors are used to collect detailed resource usage information.5 Regular Administration 5. physical I/O access to disks is avoided. Deadlocks Detected and Lock Timeouts should be almost zero. For more information. Otherwise. Data Hit Ratio and Index Hit Ratio should be more the 95 percent.6C and higher. deadlocks and lock timeouts by calling transaction ST04 and choosing Performance → Database → Buffer Pools in the navigation frame of the DBA Cockpit. These snapshots are used in the SAP performance monitor to display sort overflows. DB2 defines the IBMDEFAULTBP buffer pool. The value of Lock Escalations. We recommend that you keep the monitor switches turned on. The information provided in this paragraph is only valid for SAP system Release 4.3. Buffer pools can be assigned to cache only data of a particular tablespace. You can access information on the buffer pool quality by calling transaction ST04 and choosing Performance →Database → Buffer Pools in the navigation frame of the DBA Cockpit. Buffer pool related information is displayed. This is assigned within the tablespace definition. You can access information on lock escalation. The information provided in this paragraph is only valid for SAP system Release 4. Every DB2 database must have a buffer pool. For each new database created. Checking Buffer Pool Quality Buffer pools are database objects used to cache database data pages in memory. contact SAP remote services Early Watch to improve the values. The monitor switches can be turned on and off at the instance level (DBM configuration) or at the application level (using the UPDATE MONITOR SWITCHES command). contact SAP remote services Early Watch to improve the values. Otherwise.

if you had already chosen Refresh at least once. see the SAP Online Documentation in the SAP Library. 5. Using this information. By examining the contents of this cache.6C and higher. that is. you can identify the dynamic SQL statements that are most frequently executed and the queries that consume the most resource. see the SAP Online Documentation in the SAP Library. For more information. Checking Cache Quality You can access information on catalog cache and package cache by calling transaction ST04 and choosing Performance → Database → Cache in the navigation frame of the DBA Cockpit. contact SAP remote services Early Watch to improve the values.3. a Selection Criteria dialog box appears where you can limit the result set displayed. Otherwise.5 Regular Administration The information provided in this paragraph is only valid for SAP system Release 4. For more information.2 Monitoring Dynamic SQL Statements Use The DB2 statement cache stores packages and statistics for frequently used SQL statements. The value of Sort Overflows divided by Total Sorts should result in less than 0. If a snapshot already exists. Otherwise. you can examine the most commonly executed and most expensive SQL operations. contact SAP remote services Early Watch to improve the values. The values of Catalog Cache Quality and Package Cache Quality should be more the 95 percent. You can retrieve the latest cached SQL statement by choosing Refresh. see the SAP Online Documentation in the SAP Library. August 2003 101 . you can display the last snapshot taken by choosing Set Selection Criteria.01. For more information. which might lead to a very large result set. Procedure You can access information on the dynamic SQL cache by calling transaction ST04 and choosing Performance → SQL Cache in the navigation frame of the DBA Cockpit. the snapshot can give you a wide range of information. You can access information on sort overflows by calling transaction ST04 and choosing Performance → Database → Sorts in the navigation frame of the DBA Cockpit. to determine if SQL tuning could result in better database performance. If you retrieve data for the first time. Depending on your system.

statistics are collected based on the table data that is located on the database partition where the command is executed. Choose Explain. choose Explain to list the access plan for the statement execution. To reorganize tables we recommend that you use the jobs provided in the DBA Planning Calendar. The results are stored in SAP internal tables. These formulas are general recommendations that show the relationship between the allocated space and the space that is being used for the data in tables.3. on how DB2 accesses the data to resolve the SQL statements. 5. The global statistics information is stored in the catalog tables. Follow the procedure as described above. The REORGCHK formulas help to decide if tables and indexes require physical reorganization. see the IBM documentation Administration Guide: Chapter 26. These jobs begin by updating the database statistics (using the DB2 RUNSTATS utility) and then check whether tables need to be reorganized (using the six formulas of the REORGCHK utility as described in the IBM documentation IBM DB2 Universal Database Command Reference). for example. To display the access plan of a statement from the SAP performance monitor: . 3.3 Updating Statistics for Database Tables and Checking for Reorganization Regular updates of statistics on the physical characteristics of the database tables and indexes provide the necessary information for the DB2 optimizer to determine the access path to the data. Three formulas are used for tables.. The Explain function provides a detailed analysis of expensive SQL statements. 102 August 2003 . SQL Explain Facility. 2. Select a statement. For more information. These jobs automatically update the table and index statistics afterwards. Global table statistics for an entire partitioned table are derived by multiplying the values obtained at a database partition by the number of database partitions on the node group over which the table is partitioned.5 Regular Administration Explain Function If a statement is displayed. you can use the jobs Update Statistics + Reorgchk all tables or Update Statistics and Reorgchk (DBSTATC) in the DBA Planning Calendar (transaction DB13).. and three are used for indexes. To update database tables statistics and to check whether tables need to be reorganized. In a partitioned database system. 1.

For more information. you do not need to explicitly start the DB2 Database Manager.1 Backup Considerations You cannot back up a database that is not in a usable state except for a database in the backup pending or the rollforward pending state. you can either use the BACKUP DATABASE command. The database can be restored without log files. you must make sure that you have installed the DBA Cockpit as described in SAP Note 300828. In either case.6x. SYSCTRL. If you want to use the DB2 Control Center.3. You can schedule background jobs to display information on protocol records on all jobs that were executed by the SAP performance monitor by calling transaction DB6COCKPIT and choosing Jobs → DBA Log in the navigation frame of the DBA Cockpit. August 2003 103 . You must start the database manager (db2start) before taking a database backup. To perform both online and offline backups of the database. If you want to display details on a single protocol record. You can perform backups in online or offline mode: • Online mode Access to the database is not blocked.4.10 and higher.4 Database Backup Backups are complete copies of the database. The following is necessary to perform a backup: • • You must have SYSADM. The users can continue to work normally during the backup. 5. You must perform backups on a regular basis in order to be able to restore the database to a consistent state that is as up-to-date as possible. double-click it. For SAP system Release 4. • Offline mode The backup process connects to the database in exclusive mode. the database can be restored completely and brought up-to-date by rolling in the log files generated after the backup was taken. 5.4 Job Monitoring The information provided in this section is valid for SAP Web AS 6. the DB2 Control Center or the DBA Planning Calendar within the SAP system.5 Regular Administration 5. see the SAP Online Documentation in the SAP Library. or SYSMAINT authorization to use the BACKUP DATABASE command.

This ensures that an online backup has a complete set of archived log files available for recovery. 1. From the context menu of <DBSID> choose Backup → Database… . Log on to the database server as user db2<dbsid>. see Installation of the DB2 Control Center [Page 55] and Setting Up the DB2 Control Center [Page 56]. 104 August 2003 . 2. Fore more information. Start the DB2 Control Center 2.cfg file with any backup copies you take. a tape. or a location managed by TSM or another vendor storage management product. 3. The database may be local or remote.5 Regular Administration • In a partitioned database system. The backup remains on the database server unless a storage management product. This copy is as a protection against possible damage to this file. After an online backup.4. including the correct backup target. such as Tivoli Storage Manager (TSM). DB2 Control Center Make sure that you have installed and set up the DB2 Control Center before performing these steps. keep a copy of the db2nodes. You can back up a database to a specified disk. DB2 forces the currently active log file to be closed and as a result it will be archived. DB2 Command Line 1. Enter the following command: db2 backup db <DBSID>… For the complete syntax of this command check the DB2 documentation. is used. enter the required values. In the dialog box that appears. 5. Choose Backup now.2 Performing the Backup Backing Up a Single-Partitioned Database You can perform these actions either using the DB2 command line or the DB2 Control Center. A job will be generated that can be monitored using the DB2 Control Center Journal. 4.

3. 6.3 Integrity of Backups The db2ckbkp utility allows the user to test the integrity of a backup image on disk or tape and determine whether or not it can be restored.. Start the DB2 Control Center 2. 4. Choose Backup now. From the context menu of <DBSID> choose Open → Database Partitions…. Fore more information. One or more parts of an image can be checked.. From the context menu of the node number where the system catalog resides (default: 0). It can also be used to display the meta data stored in the backup header in order to determine information about a particular backup image. A job will be generated that can be monitored using the DB2 Control Center Journal. 1. When checking multiple parts of an image. Enter the backup command for the catalog node: db2_all “<<+n< db2 backup db <DBSID> …” For the complete syntax check the DB2 documentation and replace n wit the catalog node number (the default value is 0). enter the required values. see Installation of the DB2 Control Center [Page 55] and Setting Up the DB2 Control Center [Page 56].. " DB2 Control Center Make sure that you have installed and set up the DB2 Control Center before performing these steps. enter the following command: db2_all "<<-n< db2 backup db <DBSID> . the first backup image object (. You can use the utility as follows: If the full backup consists of multiple objects. the validation will only succeed if db2ckbkp is used to validate all of the objects at the same time..4.0. choose Backup….001) must be specified first.NODE0000. DB2 Command Line 1. 5. Repeat steps 4 to 7 for all other nodes. In the dialog box that appears. db2ckbkp SAMPLE.5 Regular Administration Backing Up a Multi-Partitioned Database You can perform these actions either using the DB2 command line or the DB2 Control Center. 2.CTN0000.19990817150714.krodger.* August 2003 105 . Log on to the database server as user db2<dbsid>. including the correct backup target. 5. . 3. To back up all other nodes in parallel.

4. see the IBM documentation Data Recovery and High Availability Guide and Reference. consider using online backups. you can use incremental or delta backups. To reduce the amount of time that the database is not available. see The db2inidb Tool [Page 122]. • Backup by file system copy For information on using tool db2inidb as a mirror for a file system-based backup.5 Regular Administration If the backup resides on TSM. see db2ckbkp .4.5 Advanced Backup Techniques The following list provides information on advanced backup techniques: • Incremental or delta backups To reduce the backup and restore time. For more information on the db2ckbkp utility. regardless of how often log files are archived.4 Frequency of Backups and Time Required You should take full database backups regularly. 5. 5. • Standby database for backup purposes For information on using tool db2inidb as a standby database for a backup. 106 August 2003 . You can only use an online backup for recovery if the database log files that are created during the online backup are available. For more information. see The db2inidb Tool [Page 122]. It also reduces the chance of a log file not being available (corruption or loss). refer to the information on db2adutl and db6adutl provided in Managing Backups and Logs Archived on TSM [Page 121]. which reduces the amount of time required by the ROLLFORWARD utility to recover the database. A recent full backup means that there are fewer archived log files to apply to the database in case of recovery.DB2 Check Backup Utility [Page 158].

enter the following command: db6util –rv Tables that are marked with an N in the ACTIVE column in table DBSTATC are not affected by this option. The results or messages generated by all db6util commands may be redirected by the command options [ -o <log file> ] or [ -w <resultfile> ] . Detailed information about those processes. Tablespace Free Space To generate a free space list for all tablespaces. • To display processes that are only involved in a deadlock situation. create a file containing a list of tables and enter the following command: db6util –rf <filename> • To perform RUNSTATS on all tables that were temporarily marked as VOLATILE in the database and to remove the VOLATILE attribute from the tables after RUNSTATS has run. Database Lock Overview db6util helps to analyze database lock wait situations by extracting all involved processes from a snapshot for applications and displaying their dependencies in the form of a syntax diagram. is displayed. such as the last SQL statement that was executed or lock types. enter the following command: db6util –sl August 2003 107 . enter the following command: db6util –f DB2 RUNSTATS Options • • To perform RUNSTATS on a single table. The following db6util options are also useful for database administration and troubleshooting and can be entered using the command line. enter the following command: db6util –sd • To display all processes that are involved in a lock wait situation. To generate a complete list of all db6util options.6 Advanced Tasks 6 Advanced Tasks 6. enter the following command: db6util -r <tabname> To perform RUNSTATS on all tables specified in the file. you can call db6util –h from the command line.1 The db6util Tool The db6util tool contains a collection of utility routines that are mainly used during the SAP system upgrade.

2 Setting and Updating Passwords You can set and update the password of the users <sapsid>adm and sap<sapsid> or sapr3 (for systems up to and including 4. 6. 3. 6.. 108 August 2003 .. such as archiving or restoring log files.conf. Log on as user <sapsid>adm. If you inadvertently delete or destroy file dscdb6. 2. initializing tapes and also display tasks still running. which must not be modified manually.Tool to Assist Database Administration [Page 164]. return code (RC).3 Using the Journal in the DB2 Control Center Extensions Most tasks in the DB2 Control Center Extensions are logged in the Admin DB. this must be done on all database nodes. You can display completed tasks. To access the journal: .conf file. and the operating system password. Enter the following command: dscdb6up <user> <password> This command updates the contents of the dscdb6.6D) using the command line: . In addition. Choose the radio button with the category of actions you want to browse. 1. In the Log File Management. Tape Management or Log File Maintenance dialog box. Enter: db6util –sd [sleep time] [number of snapshots] db6util –sl [sleep time] [number of snapshots] For more information on the syntax of db6util. choose Journal. 1. you can recreate it by entering the following command: dscdb6up –create <sap<sapsid>/sapr3 password> <<sapsid>adm password> The operating system passwords are not changed when you use the -create option. A list of actions is displayed with start and end time. You can access these logs by choosing Journal. you can display the logs of the user exit. If you want to see an action that took place more than seven days ago. category and return message. On multi-partitioned systems. 2.. see db6util .6 Advanced Tasks Both commands can be executed with additional parameters to take snapshots periodically.. you can use the Back button to go back in steps of seven days.

If you need archived log files for a rollforward recovery. As outlined in Deleting Log Files [Page 94].4 Advanced Log File Management Tasks As outlined in Basic Concepts [Page 21]. you can archive log files either automatically using the User Exit or let the User Exit copy them to the archive directory.6 Advanced Tasks 4. From this directory you have to archive them as described in Archiving Log Files from Disk to Tape or TSM [Page 91]. you have to restore them into the retrieve directory as described in Log File Restore of the SAP Database [Page 138]. The Admin DB ADM<DBSID> keeps track of the current location of the log files. To update the list of actions with the most current data. Choose an action from the list. archive directory. choose Refresh. tape. 6. you can delete log files from the log directory. August 2003 109 . The detailed output of that action is displayed in the Description group box. storage management products and any other backend using a customer script.

there are two special cases that require advanced log file management skills: • Log files can have special states that can be maintained in special dialog boxes. Tapes can become unreadable or can be lost. Procedure You can delete (or maintain) these special log files using either the DB2 Control Center Extensions or the DB2 command line.. they have two locations assigned. 4.4. These particular log files need to be deleted manually from the Admin DB.. If required. 1.1 Deleting Special Log Files Use You use the following procedure to delete log files that can have a special status. see Deleting Tapes from the Admin DB [Page 112]. In the Admin DB the old log files are marked as invalid. Using the DB2 Control Center Extensions . 3. If you retrieve log files. enter user <sapsid>adm or db2<dbsid> and the corresponding password. they have two locations assigned − the retrieve directory (DB2DB6_RETRIEVE_PATH) and the archive location (for example. This can happen if you restore a database without rolling it forward to the end of the logs. you must manually delete the entry for the tape from the Admin DB. In this case log files with the same sequence number are created again. For details on how to delete these log files. • 6. For more information. The log files can be maintained in special dialogs. From the context menu of <DBSID> choose SAP Logfile Management. The Log File Management dialog box appears.6 Advanced Tasks However. on tape). 110 August 2003 . Choose Log File Maintenance… . In this case. 2. The status of these log files can be as follows: • • • If you archive log files and choose at the same time to leave them in the archive directory (DB2DB6_ARCHIVE_PATH). A log file has the status invalid. In the DB2 Control Center select the SAP database <DBSID>. see Deleting Special Log Files [Page 110]. The Logfile Maintenance dialog box appears.

Using the DB2 Command Line • To delete log files from the archive directory that have already been archived but not removed from the archive directory. from database Displays log files known to the Admin DB and which are marked as INVALID. enter the following command: brarchive –ds –out • To delete log files from the retrieve directory that have been restored but not removed from the retrieve directory. 6. Choose the node where you want to delete or maintain log files. 7. restored Displays log files previously restored.6 Advanced Tasks 5. 8. enter the following command: brrestore –dr – out • To delete log files that are marked as INVALID. Select a range of log files you want to delete. Choose Delete. Choose one of the three radio buttons: archived Displays log files previously archived and not deleted from the archive directory. enter the following command: brarchive –do -out August 2003 111 .

6 Advanced Tasks 6.4. Confirm the operation by choosing Yes. Therefore. In the navigation tree of the Tape Management dialog box select the tape that you want to delete. 2. 3. In the DB2 Control Center choose the SAP database <DBSID>.. enter the following command: brrestore –dt –v PRD01 -out 6. consequently.2 Deleting Tapes from the Admin DB Use You use this procedure to delete tapes that have become unreadable or were lost from the Admin DB to keep the content of the Admin DB up-to-date. From the context menu of <DBSID> choose SAP Tape Management. 1. 112 August 2003 . In general. you should use the DB2 reorganization utility (REORG) to rearrange the data in the tables and indexes and to remove the free space that is inherent in fragmented data.5 Reorganization of Tables and Tablespaces Reorganization of Tables A table can become fragmented as a result of large numbers of updates. enter the following command: brrestore –dt –v <tape> -out To delete tape PRD01 from the Admin DB. 6. Using the DB2 Command Line To delete tapes from the Admin DB. causing performance to deteriorate. 5. If required. improvements in performance. because logically sequential data may be on different physical pages that are not sequential. 4. Procedure Using the DB2 Control Center Extensions . newly inserted rows cannot be placed in the physical sequence corresponding to the logical sequence defined by an index. The Attention dialog box appears. The result will be faster accessing of data and. The Tape Management dialog box appears.. deletes or inserts. From the context menu choose Delete. This means that the DB2 Database Manager has to perform additional read operations to access the data. enter user <sapsid>adm or db2<dbsid>.

The job uses the external program dmdb6rts to reorganize all tables of a tablespace and to subsequently update the table statistics. This job displays a maximum of 100 tables recommended for reorganization as well as additional data. for example. You choose which of the proposed tables to reorganize. the DB2 Database Manager stores a working copy of the table in the tablespace in which the table being reorganized resides. • REORG and RUNSTATS for Single Table Yon can use this job to reorganize one single table In all jobs you can specify the temporary tablespace where the DB2 Database Manager can temporarily store the table that is being reconstructed. Whether or not it would be beneficial to reorganize a table is calculated by the Update Statistics Job described in Updating Statistics for Database Tables and Checking for Reorganization [Page 102]. which is used during the reorganization. table size or runtime. The table statistics are subsequently updated. so you must make sure that the tablespace used for reorganization has at least sufficient free space to hold the original table. thus increasing the free space. • REORG of Tables in Tablespace(s) Sometimes. particularly those for which reorganization is recommended. This job is additionally controlled by user-defined limitations such as. Keep in mind that you may be reorganizing a table within a temporary tablespace that is using pages larger than 4 KB (for example. The selected tables are reorganized according to the order of the primary index using the DB6CLP tool. 8 KB. During the reorganization. • Automatic REORG This job can be used to do automatic reorganizations of tables according to REORGCHK recommendations. see the SAP Online Documentation in the SAP Library. must have the same size pages as the base tablespace.6 Advanced Tasks The DBA Planning Calendar (transaction DB13) provides the following jobs for the reorganization of tables and tablespaces: • REORG and RUNSTATS of Flagged Tables You can use this job to reorganize tables. the temporary tablespace. For more information. This temporary table will be at least as large as the original table. If no temporary tablespace is entered. you may want to reorganize all the tables of a particular tablespace to remove fragmented data. The DBA Planning Calendar (transaction DB13) provides a utility allowing you to do this. August 2003 113 . 16 KB or 32 KB). such as delta table size and the duration of the last reorganization.

The script can then be adapted to the needs of the database to be restored (4). 114 August 2003 . In this way. It reports any failure the restore process might encounter. for example.6 Redirected Restore The redirected restore tool brdb6brt retrieves a database backup and creates a CLP script for the restore of this backup image. This script corresponds to the container layout of the database at the time of the backup. This can involve changes to the number. change the name and structure of the database. back up the database and retrieve data on the container layout (1) using tool brdb6brt. First of all. Another possibility is to perform a homogeneous system copy (9) that normally requires major changes to the script to match the new machine setup (5). size or location of the containers for a restore to the same database (6 + 8). failures can be avoided before they occur. The tool creates a backup of the database (3) and a CLP script for restoring this backup (2). 2 Create brdb6brt 1 Retrieve Data & Backup DB Restore Script Create 3 Edit 4 Backup Image Redirected Restore 9 for homgeneous system copy Source DB Redirected Restore 8 DB Copy Customized Restore Script User 5 Create brdb6brt to change container layout Check 7 Create 6 Customized Restore Script The graphic above illustrates the tasks relevant to a redirected restore process. brdb6brt can serve to check the script (7). Additionally. you can modify it. Before you run the script.6 Advanced Tasks 6.

For more information on the syntax of brdb6brt. Check the restore script. it has to be executed from the command line. Move existing containers do other directories. To do so for database SAMPLE as instance owner db2user with password PASS123.6. The DB2 Command Line Processor (DB2 CLP) provides an option allowing DB2 to read statements from a file. The backup is made online. Change text during script generation if required. see brdb6brt .6 Advanced Tasks 6. You can also use this script for a restore operation if you have taken a backup of the database separately. Change the container layout. The following sections provide example commands. Perform a redirected restore. you can create a restore script only.Redirected Restore Tool [Page 150]. enter the following command: brdb6brt –s SAMPLE –bm RETRIEVE –user db2user –using PASS123 The script contains the current time as the backup timestamp. Performing a Simple Backup You want to make a backup of the entire database to TSM with two sessions.1 Usage of Tool brdb6brt You can use the brdb6brt redirected restore tool to: • • • • • • • • • Perform simple backups. Perform a homogeneous system copy. Enter the following command: brdb6brt –s SAMPLE –bm BACKUP –bpt ADSM 2 –ol Retrieving an Overview of the Container Layout If you want to have an overview of the layout of the database containers. Enter the following command: db2 –tvf <script file> August 2003 115 . You will have to change the script to the timestamp of the backup image you created separately. The source database is called SAMPLE. Performing a Redirected Restore After the script has been edited. This is called background mode. Retrieve an overview of the container layout. Create a script for restoring certain tablespaces only.

. 1. enter the following command: brdb6brt –s SDB –bpt Y:\BACKUPS1 Y:\BACKUPS2 Y:\BACKUPS3 Since the database is rather large. Forces the CLP to read the statements from the specified file..) as terminating character for an SQL statement. -v -f <file> If a backup and restore script of the database SAMPLE was created. 3.scr and change the container’s location. This can be accomplished by copying them to the machine via ftp. the script should now be executed. To change the container layout. 2. proceed as follows: . Restore the database by entering: db2 –tvf SDB. You also need to adapt the location of the backup image to the directory where the containers are available on the target machine. Change the container’s locations. To create the backup and the restore script. For this purpose the container locations have to be adapted.. To create the backup and the restore script.6 Advanced Tasks The parameters have the following meaning: Parameter -t Meaning Forces the CLP to use a semicolon (. Make the backup images and the script available on the target machine. 4. changing their sizes or their location in the file system. 2.. size and number. The use of this option is mandatory for the execution of the script. the brdb6brt tool creates a script file of the name <DBSID>scr. Forces the CLP to print each statement on the screen. By default. Enter the following command: db2 –tvf SAMPLE. Log on to the target machine and edit the script SDB.scr Performing a Homogeneous System Copy You want to copy your database to another machine. This can comprise changing the number of containers of a tablespace.scr.scr Changing the Container Layout You want to change the layout of the containers of your current database. Edit the script SDB. To do so for the database SDB. 3. the backup is divided into three pieces. enter the following command: brdb6brt –s SDB –bpt Y:\BACKUPS1 Y:\BACKUPS2 Y:\BACKUPS3 Since the database is rather large. restore the database using the following command: db2 –tvf SDB. proceed as follows: . where <DBSID> is the name of the source database. 1. To do so for the database SDB.scr 116 August 2003 . the backup is divided into three pieces.

in most cases the DB2 instance owner (db2<DBSID>). The tablespaces for backup have the names USERSPACE1. August 2003 117 . the database administrator now should be able to find errors in the script or on the database server system. The file name is the script name replaced by the file ending . for example. out of space situations. directories and links to get sound check output.chk. Also. If you have a multi-partitioned database. enter the following command: brdb6brt –bm CHECK -ip SAMPLE. In this example. The database name is SAMPLE.chk. Additional information on the used file systems is provided. restoring to a new or existing database is considered. the script can be checked whether it would succeed on that machine. So before running brdb6brt. duplicated file names. missing write authorizations. The check allows scripts that perform full database or tablespace level restores. To do so. The output is also saved to a file in the current directory. use the –nn <node number> parameter. the check output would be written to file SAMPLE.6 Advanced Tasks Creating a Script for Restoring Certain Tablespaces Only You want to back up one or more tablespaces rather than of the entire database. the tablespace container layout (distribution of tablespace containers in the file system(s)) should be implemented by creating file systems. The user running the check should be the user that will later run the script with DB2 CLP. Possible errors start with [E]. warnings and information about the redirected restore operation that the script will perform. Enter the following command: brdb6brt –s SAMPLE –bpt ADSM 3 –tbs USERSPACE1 TBSPACE TESTSP2 Checking the Restore Script After the script has been edited. which prevents existing scripts from other database partitions from being overwritten. you need to run brdb6brt for all partitions of your database. The restore script is created to restore only the specified tablespaces. which is mainly error and warning messages. The backup is done to TSM (three sessions). With the content of the check output. The scripts created include the partition number. TBSPACE and TESTSP2. warnings with [W] and informational messages with [I].scr The output from the check run shows possible errors. To run a check on the SAMPLE.scr script. such as: • • • • • List of tablespace containers Information on used space Information on free space Information on missed space Information on required space in the DB2 log directory Especially on UNIX database servers you should be aware that new tablespace containers will be placed in the topmost existing directory and therefore in the underlying file system.

The reason is that you can only access CLP on Windows by using a special command shell installed with DB2. With brdb6brt patch 5 or higher. CLP accepts certain administrative commands like BACKUP DATABASE and SQL commands like SELECT. You need to modify it according to your requirements. 1. On Windows you need a special environment to use CLP. 2. enter the following command: db2relocatedb –f SAMPLE scr 3. To create the relocate script.scr Changing Text During Script Generation brdb6brt creates the scripts that are used to perform a redirected restore and to relocate the database (relocate DB script). Furthermore./db2/sample=/db2/sam 6. The script then needs to be adapted according to your requirements.7 Command Line Tasks Using db6clp DB2 UDB for UNIX and Windows provides the command line tool Command Line Processor (CLP) that allows you to administer your databases and instances as well as to access your databases via SQL. Tool db6clp was developed specifically for this reason.6 Advanced Tasks Moving Existing Containers to Other Directories With brdb6brt patch 5 or higher. enter the following command: db2inidb SAMPLE as snapshot relocate using SAMPLE. for example. To move containers using the db2relocatedb tool. to create a database snapshot using the db2inidb tool. For example. It is actually a wrapper of the original CLP. you can create relocate scripts to move existing containers to other directories using the db2relocatedb tool. a new parameter –replace <ReplaceDefinition> was introduced. You can use this parameter to adjust the script output during its generation instead of adapting the output manually afterwards. enter the following command: brdb6brt –s SAMPLE –bm RETRIEVE_RELOCATE Script SAMPLE is generated. To initialize the mirrored database. 118 August 2003 . you cannot chain commands on the command line. However. you can use this parameter to change the destination database name from SAMPLE to SAM and the container location from /db2/sample to /db2/sam: brdb6brt –s SAMPLE –bm RETRIEVE –replace SAMPLE=SAM. you can use these scripts to initialize mirrored databases with a modified container layout using the db2inidb tool and its parameter RELOCATE USING.

-p -V <command> August 2003 119 . or sapse<sapsid> on Windows. The password is retrieved using the password services of SAP systems for DB2. or sapse<sapsid> on Windows. This switch can only be used if the caller is one of the users db2<dbsid> or<sapsid>adm. If this switch is specified without one of the –a and –c switches.6 Advanced Tasks It allows you to chain commands by separating them with semicolons. Option -a Meaning Explicitly attaches to the database instance before the command execution. This is applicable in multi-partitioned environments. Sets the partition of the database to which the command applies. The environment variable DB2NODE is set to the given value before the command execution. If –db switch is omitted. <DBSID> is assumed as the database name. Thus the correct environment must exist for a successful run (DB2DB6EKEY must be set). Prints out version and patch information of the tool. an explicit connection to the database is only made if it is cataloged remotely. If –db switch is omitted. This switch can only be used if the caller is one of the users db2<dbsid> or <sapsid>adm. The tool is defined as an external command in the SAP system and can be used on all platforms. -l -db Sets the environment DB2INSTANCE to this value before execution of the CLP command. <DBSID> is assumed as the database name. For specification of S or A the same comments as for the –a switch apply. the attachment is made using user sap<sapsid>. Multiple commands can be specified by separating them with semicolons. user <sapsid>adm will be used. There are other additional functions. which are presented in the following table. If A is specified. If S is specified. The command to be executed by DB2 CLP. Furthermore. -c Explicitly connects to the database given with the –db switch. The instance is the one to which the database given with the –db switch belongs. it is not necessary to call it in the special DB2 command shell on Windows.

see the SAP Online Documentation in the SAP Library. For more information. the second application gets the status lock wait. • • 6. see the SAP Online Documentation in the SAP Library.6 Advanced Tasks The formal syntax of the command is as follows: db6clp -V | [-a S|A [-db <db name>] | -c S|A [–db <db name>] | -i <instance> | -db <db name>] [-p <partition>] <command> See also: • For more information on external commands. 6. For more information on SQL. see the SAP Online Documentation in the SAP Library at SAP Web Application Server → Computing Center Management System → Background Processing. see the IBM DB2 documentation SQL Reference. 120 August 2003 . see the IBM DB2 administration documentation Command Reference.9 Monitoring Lock Waits and Deadlocks Monitoring Lock Waits A lock wait is a situation when one application updates or inserts a row without COMMIT and a second application tries to access this row. If you want to display data for the first time. You can choose between the display layouts by using the list box Layout.8 Monitoring Database Alerts For information on how to monitor database alerts. For more information on DB2 CLP and administrative commands. choose Refresh. As a result. You can access information on lock waits by calling transaction ST04 and choosing Performance → Lock Waits in the navigation frame of the DBA Cockpit.

DB2 Backup TSM Copy Group TSM backup copy group brarchive Default: TSM archive copy group. Then application 1 tries to access the rows that are locked by application 2. The definition of kept versions and days must be performed on the TSM server and cannot be changed by the TSM client.10 Managing Backups and Logs Archived on TSM TSM distinguishes between: • • TSM backup copy group A defined number of versions of each file is kept on the TSM server. each waiting for the other(s) to release a lock. you should use the following tools: DB Backups Log Files saved with brarchive Log Files saved using the User Exit in Direct Mode db6adutl db6adutl TSM Backup Mode TSM Archive Mode db2adutl -- brarchive brarchive August 2003 121 . 6. for example. You can display all deadlocks that occurred in the past by choosing Show History. extract and delete backups and log files. For more information. If not present on the TSM server then TSM backup copy group To query. and application 2 tries to access rows that are locked by application 1. TSM archive copy group Each file is kept on the TSM server for a defined number of days. If not present on the TSM server then TSM backup copy group User Exit in Direct Mode Default: TSM archive copy group. You can access the Deadlocks screen by calling transaction ST04 and choosing Performance → Deadlocks in the navigation frame of the DBA Cockpit. application 1 and application 2 update or insert different rows without COMMIT. The following table shows which type of TSM copy group is used by DB2 and the Admin Tools. see the SAP Online Documentation in the SAP Library.6 Advanced Tasks Monitoring Deadlocks Deadlocks are situations where two or more applications block each other.

For more information.2. for example. tape. that is create a split image of a file system. For more information on TSM. 6. • as snapshot You use this option to create database clones for quality assurance or test systems. use the instance owning user db2<dbsid>.com/support/storage_mgt/adsm/pubs/ For more information on where log files are archived to on the TSM server. Tool db2inidb in combination with hardware technologies like EMC Timefinder® or IBM ESS® provides the basis for fast backups or database clone creation. see Indirect Archiving to TSM [Page 81] and Archiving Directly to TSM [Page 73]. db2adutl allows you to check backups. With these technologies you can split up an entire file system very fast.6D Admin Tools UNIX: /usr/sap/<SAPSID>/SYS/exe/run Windows: <drive>:\usr\sap###BOT_TEXT###lt;SAPSID>\SYS\exe\run The syntax of this command is provided in Appendix A: Tool Command Line Parameters [Page 147]. see the TSM documentation at: http://www. see db2inidb Option: as mirror [Page 123]. For more information.6 Advanced Tasks To run the program db6adutl.NN Admin Tools UNIX: $INSTHOME/admintools/bin Windows: %INSTHOME%\admintools/bin • For 4. This utility is installed in the following directory: UNIX: $INSTHOME/sqllib/misc Windows: <DB2 install path>\sqllib\misc The syntax of this command is shown in Appendix A: Tool Command Line Parameters [Page 147]. Additionally. The db2inidb tool provides the following options: • as mirror You use this option to create fast backups and fast database restores with nearly no system outage. see db2inidb Option: as snapshot [Page 126] 122 August 2003 . EMC Timefinder® or IBM ESS® also provide functions to archive a split image to storage devices. db6adutl is part of the Admin Tools and is installed in the following directory: • For 6.tivoli.11 The db2inidb Tool DB2 tool db2inidb and the write suspend feature are new features of DB2 UDB for UNIX and Windows Version 7. logs. This split image can be mounted on a different machine. and load copy images saved using TSM. in a different directory on the same machine where the original file system is located or replace the current content of the original file system in case of failure.

The mount time of the split image is very fast compared to a normal database restore.6 Advanced Tasks • as standby You use this option to: Create normal DB2 backups with nearly no system outage. All storage management systems are able to archive files from the file systems. For more detailed information on the db2inidb tool. Build up a hot-standby system that is synchronized over log files. This means you have nearly no system outage during the backup of the split image. For more information. With DB2. August 2003 123 . • Store log files to any storage management system.11. 6. The procedures provided in the following sections are only intended for experienced DB2 database administrators. For more information. The creation of the split image is very fast if you are using hardware technologies such as EMC Timefinder or IBM ESS. To restore the database. you may cause irrevocable data loss or unexpected system behavior. Thus. If you do not use these tools. problems with the log file management tools might occur. This means you save the time for a normal database restore from a normal DB2 backup image.1 db2inidb Option: as mirror Use You use the db2inidb tool option as mirror to: • Perform fast backups or restores. • Compress backups with the standard system command compress before archiving. see db2inidb Option: as standby for Hot-Standby Database [Page 129]. The split image is created while the database is in write suspend mode. see the IBM DB2 documentation Data Recovery and High Availability Guide and Reference. the split image can be compressed before you archive it to tape. You use this function to store all important DB2 files and database containers. see db2inidb Option: as standby for Backups [Page 127]. Using this function you are not restricted to the destinations provided by the DB2 backup command. tape space and I/O bandwidth are saved. Be aware that when using these options. For example. archiving and restoring the database files and database containers is only allowed in conjunction with the write suspend feature and the db2inidb tool for the regular DB2 backup and restore function. you mount the split image and roll forward the database.

Archive the split image. This is important because... To restore the split image using the storage management system tools. Restore the latest Admin DB backup SAR file using brrestore –ex or use the SAR file located in directory <DB2DB6_TEMP_DIR>\adminDB_<DBSID> using program sddb6ins. 1. log on to the database server as user db2<dbsid> and enter the following command: db2 set write suspend for database The database only allows read access now. Make sure that the log files required for rollforward recovery are available: For direct archiving: The User Exit retrieves log files as required during rollforward recovery directly from the storage management product. Delete the Admin DB using the following command: db2 drop db ADM<DBSID> ii. Performing a Restore 1. 4. To switch the database mode back to normal operation. 2. For indirect archiving: You have to recreate the Admin DB and restore required log files. which are contained in these directories. 3. enter the following command: db2 set write resume for database The database now allows full access again. proceed as follows: i. The split image must include: All database containers (sapdata*) The database directory: UNIX: /db2/<DBSID>/db<dbsid> Windows: <drive>:\db2###BOT_TEXT###lt;DBSID>\db<dbsid> Make sure that the image does not include log directory. 124 August 2003 . To switch the database mode to write suspend. To do so. the current log files. archive directory and retrieve directory. 2.6 Advanced Tasks Procedure Performing a Backup Ll. Log on to the database server as user db2<dbsid>. if the split image is mounted for a database restore. Create the split image. enter the following command: db2inidb <DBSID> as mirror The database is now in rollforward pending mode. will be overwritten with the old log files contained in the split image. 3.

the backup timestamp is not known to the Admin Tools. You can avoid the recreation of the Admin DB in this scenario if the Admin DB uses a file system that is not located in the default database path /db2/<DBSID>. the usability of the brrestore –delete option. This affects. for example. As an example. for example. Alternatively. you have to consider the following: If no normal database backup (that is a regular online or offline backup) was performed on the system. Check if the rollforward recovery is complete using the following command: db2 rollforward database <DBSID> query status If the rollforward recovery is not complete. a. the Admin DB is created in the path specified by the database manager configuration parameter DFTDBPATH. Restore log files required for rollforward recovery using brrestore.6 Advanced Tasks To do so. If you use –force in conjunction with –delete <TS>. the following command would delete all log files before 1 January 2003: brrestore –delete 20030101000000 –force Since indirect archiving is very complex and thus very error prone in conjunction with db2inidb tool option as mirror. c. brrestore option –force was introduced. you have to correct the problem. you can specify a timestamp that is not a backup timestamp. August 2003 125 . 4. by providing missing log files and repeating step a. the log files are assigned to the last backup made on the system. Since no normal backup is performed. The brrestore –delete option requires that you specify a backup timestamp. for example. Perform a rollforward recovery to the end of logs. By default. Start the rollforward recovery using the following command: db2 rollforward database <DBSID> to end of logs b. you can set the database manager configuration parameter DFTDBPATH to a different directory. if the Admin DB has not existed so far. enter the following command: sddb6ins –r <latest_Admin_DB_backup_SAR_file> iii. we strongly recommend that you use direct archiving. Then the Admin DB is not contained in the split image and contains up-to-date information after the split image has been mounted. to /db2/ADM<DBSID> before calling sddb6ins –i. You can use the redirected restore tool to move an existing Admin DB. You should reset parameter DFTDBPATH after sddb6ins –i was called. Log File Management Considerations If you want to use indirect archiving. To avoid the log file deletion problem. the database should now be in the most current state and can be accessed again. Complete the rollforward recovery using the following command: db2 rollforward database <DBSID> to end of logs and complete If the operation was successful.

Create the split image. log on to the database server as user db2<dbsid> and enter the following command: db2 set write suspend for database The database only allows read access now. Mount the split image using the storage system tools.2 db2inidb Option: as snapshot Use You use the db2inidb option as snapshot to create a database clone for test or quality assurance systems from your production system. To switch the database mode back to normal operation.. enter the following command: db2 set write resume for database The database now allows full access again. 3..11. 2.6 Advanced Tasks 6. you can use the following command: db2inidb <DBSID> as snapshot using relocate <relocate db script> 126 August 2003 . The split image must include: All database containers (sapdata*) The database directory: UNIX: /db2/<DBSID>/db<dbsid> Windows: <drive>:\db2###BOT_TEXT###lt;DBSID>\db<dbsid> Log directory log_dir The log files are required to roll back open transactions when db2inidb option as snapshot is called on the target system. Prepare a standard SAP system environment for SAP databases using homogeneous system copy methods. This procedure can be timeconsuming if your source system is very large (for example. 1. 3. if you want to change the container layout on the target system to distinguish it from the one on the source system. To switch the database mode to write suspend. Make sure that the split image does not include the archive and retrieve directory. The db2inidb tool option as snapshot allows you to perform a homogeneous system copy for large databases very fast. Procedure On the source system: . 2. On the target system: 1. The homogeneous system copy requires a full database backup and a redirected restore on the target system. To initialize the database. several 100 MB). In the past it was necessary to copy a SAP system using the homogeneous system copy. enter the following command: db2inidb <DBSID> as snapshot Alternatively.

for example to build up a quality assurance or test system on a new database version. All open transaction are rolled back and the target database can be accessed now. To delete the Admin DB.: a. but the db2inidb <DBSID> as snapshot command only supports databases where LOGRETAIN is switched ON. is included in the split image. which uses circular logging (that is. you must delete the Admin DB on the target system. enter the following command: db2 drop db ADM<DBSID> b.3 db2inidb Option: as standby for Backups Use You use the db2inidb tool option as standby to perform fast backups with nearly no system outage. where split images are used to back up the database. especially if you are using hardware technologies such as EMC Timefinder or IBM ESS. Log File Management Considerations If you want to use the target system for quality assurance or test purposes. The normal DB2 backup images offer the following advantages: • • • The backup image can be used to restore the database on a different hardware platform. for example. Backups and restores are simply performed with standard DB2 commands. LOGRETAIN is switched OFF). 6. The backup image can be used to perform a redirected restore.11. The reason is that the Admin DB. online backups and rollforward recovery are not supported. August 2003 127 .6 Advanced Tasks You can easily create the <relocate db script> using the brdb6brt option –bm RETRIEVE_RELOCATE on the source system. you should perform the following tasks to clean up the target system. normal DB2 backup images are created. you should consider to set parameter LOGRETAIN to OFF and to use circular logging instead. however. you do not need to use the log file management tools. To do so. Thus. Prune the backup history file as the information included in that file is valid for the source system. The backup image can be used to restore the database into a newer DB2 version. you must reinstall and reconfigure the log file management tools on the target system.. Before accessing the target database. enter the following command: db2 prune history force . Be aware that all databases using circular logging are subject to some restrictions. In comparison to the db2inidb option as mirror. If the source system was configured for indirect archiving. If you require these features on the target system.

1.. Recreate the database from the split image: a. Mount the split image. Archive the split image.6 Advanced Tasks Procedure Performing a Backup On the source system: . Initialize the standby database using the following command: db2inidb <DBSID> as standby 5. enter the following command: db2 set write resume for database The database now allows full access again. The backup performed on the standby system is not listed in the backup history of the source system. To switch the database mode back to normal operation. enter the following command: db2start 4. To create a database online backup using the DB2 backup command. 3. 2. To switch the database mode to write suspend. Create the split image.. The split image must include: All database containers (sapdata*) The DB2 instance directory: UNIX: /db2/<DBSID>/db<dbsid> Windows: <drive>:\db2###BOT_TEXT###lt;DBSID>\db<dbsid> 3. 4. 128 August 2003 . Thus. log on to the database server as user db2<dbsid> and enter the following command: db2 set write suspend for database The database only allows read access now. b. On the target system: 1. To create a database instance using DB2 instance creation tool db2icrt. the restore procedure is equivalent. enter the following command: db2 backup db <DBSID> online to /tmp Performing a Restore The backup images created with the backup command on the standby system can be used as normal backups for the source system. To start the database instance. enter the following command: db2icrt <instance_owner> 2. Log on as instance owner.

that is you create a hot-standby database. the log files are assigned to the last backup made on the source system. the following command would delete all log files before 1 January 2003: brrestore –delete 20030101000000 -force 6. This affects. The setup can be as follows: The source database works normally. Hot-standby database systems are used to: • • Avoid long restore operations after a hardware failure. the usability of the brrestore –delete option. you have to consider the following: If no normal database backup (that is a regular online or offline backup) was performed o the system. August 2003 129 . the hot-standby system is kept in a state with a defined time delay compared to the source system. If a logical error is detected on the source system. Since no normal backup is performed.4 db2inidb Option: as standby for Hot-Standby Database Use You use the db2inidb tool option as standby to synchronize two databases using log files. you can switch to the state of the hot-standby system that may not have applied this logical error. To avoid the log file deletion problem. The hot-standby database buffers are allocated and filled with the most recently changed data pages. If you use –force in conjunction with -delete <TS>. for example. Allow a fast recovery from logical failures. The hot-standby database is in rollforward pending mode. In this case.11. As an example. The brrestore –delete option requires that you specify a backup timestamp. the backup timestamp is not known to the Admin Tools. All log files are created on the source database and are copied to the hot-standby database using the ROLLFORWARD command as shown in the following graphic. you can specify a timestamp that is not a backup timestamp. brrestore option –force was introduced.6 Advanced Tasks Log File Management Considerations If you want to use indirect archiving.

6 Advanced Tasks source system hot-standby system source database log file copied on regular basis hotstandby database log_dir log_dir The following graphics show the differences for direct or indirect archiving. Overview of Standby Databases If Direct Archiving Is Used source system hot-standby system source database hotstandby database log_dir db2uext2 ARCHIVE Storage Management System log_dir db2uext2 RETRIEVE 130 August 2003 .

No further action is required. • If you are using direct archiving: The central point for the log files is the storage management system.6 Advanced Tasks Overview of Standby Databases If Indirect Archiving Is Used source system hot-standby system source database hotstandby database log_dir Admin DB Admin DB log_dir db2uext2 ARCHIVE log_archive brarchive standby_dir db2uext2 RETRIEVE without DB copy log file on regular basis log_archive backend Procedure The following procedures describe the end of log scenario. August 2003 131 . works according to the end of log scenario. The User Exit then writes a copy of the log file into the standby directory in addition to the one the User Exit writes into the archive directory. Preparing the Source Database • If you are using indirect archiving: Configure environment variable DB2DB6_STANDBY_DIR in file init<DBSID>. but you must use rollforward to <point of time> instead of rollforward to end of logs to ensure the time delay for the hot-standby system. The other scenario. that is recovering from logical failures.db6.

Initialize the hot-standby database using the following: db2inidb <DBSID> as standby The open transactions are not rolled back and the hot-standby database is now in rollforward pending mode. 2.. enter the following command: db2 set write resume for database The database now allows full access again. Create the database by mounting the split image from the source system.db6 to ON. 2. Set environment variable DB2DB6_UEXIT_RETRIEVE_WO_DB in file init<DBSID>. Archive the split image. The User Exit then retrieves the latest log files with the log file number requested by the database engine during rollforward recovery. To enable the User Exit to retrieve log files during rollforward recovery. 4. The split image must include: All database containers (sapdata*) The database instance directory: UNIX: /db2/<DBSID>/db<dbsid> Windows: <drive>:\db2###BOT_TEXT###lt;DBSID>\db<dbsid> Make sure that the image does not include the log directory. log on to the database server as user db2<dbsid> and enter the following command: db2 set write suspend for database The database only allows read access now. the archive directory and the retrieve directory. Drop the Admin DB using the following command: db2 drop db ADM<DBSID> The Admin DB of the hot-standby system is empty until the system failover. 3. The Admin DB on the hot-standby system does not have any knowledge about log files created on the source database. 132 August 2003 . . To switch the database mode back to normal operation. To switch the database mode to write suspend. Create the split image. Preparing the Hot-Standby Database If you want to use indirect archiving: 1.. you have to activate this flag. On the hot-standby system: 1.. 1..6 Advanced Tasks Creating an Initial Hot-Standby Database Version On the source system: Create a database snapshot of the source system that is used as the starting point for the hot-standby system: . 2.

you have to transport the log files from the source database system to the hot-standby system.6 Advanced Tasks If you want to use direct archiving: If you are using TSM. enter the following command: db2 rollforward db <DBSID> to end of logs 2. for example. • If you want to use direct archiving: You perform a rollforward recovery on the hot-standby system (without the stop/complete option) using the following command: db2 rollforward db <DBSID> to end of logs The User Exit then retrieves the required log files directly from the storage management system. enter the following command: db2 rollforward database <DBSID> and complete If the operation was successful. the standby directory (DB2DB6_STANDBY_DIR) of the source database is a shared file system pointing to the archive directory of the hot-standby database system (DB2DB6_ARCHIVE_PATH>/<DBSID>). To start the rollforward recovery. you perform a rollforward recovery to the end of log files on the hot-standby system. August 2003 133 . you have to configure the same NODENAME (TSM configuration parameter) on the hot-standby system as on the source database. Keeping the Hot-Standby Database in Synchronization with the Source Database To keep the hot-standby database in synchronization with the source database. Perform a rollforward recovery on the hot-standby system (without the stop/complete option) using the following command: db2 rollforward db <DBSID> to end of logs • Delete log files that have already been applied to the hot-standby database using rollforward recovery and that have already been archived on the source system using brarchive. Switching Over to the Hot-Standby Database System If you are using direct archiving. where the source database had stored them. you have to correct the error. 3. 1. enter the following command: db2 rollforward db <DBSID> query status If the rollforward recovery is not complete. To stop the rollforward recovery. the hot-standby database is now in the most current state and can be accessed again. you have to perform the following tasks on a regular basis. If this is not the case. To check if the rollforward recovery is complete. If you want to use indirect archiving: • In most cases. by providing missing log files and repeat step a.

To start the rollforward recovery. for example. 1. enter the following command: db2 rollforward db <DBSID> to end of logs b. by providing missing log files and repeat step a. The system failover is relatively complex and error-prone. The SAR file is only available in the standby directory if you have set configuration parameter DB2DB6_STANDBY_DIR_ADMDBSAR to ON in the init<DBSID>. the hot-standby database should now be in the most current state and can be accessed again.db6 file. In directory <DB2DB6_TEMP_DIR>/adminDB_<DBSID> that is located on the source system. you have to perform an emergency restore using brrestore –ex. enter the following command: sddb6ins –r <SAR file> 2. enter the following command: db2 rollforward database <DBSID> and complete If the operation was successful. To recreate the content of the Admin DB. To complete the rollforward recovery. enter the following command: db2 rollforward db <DBSID> query status If the rollforward recovery is not complete. Thus. To check if the rollforward recovery is complete. a. we recommend that you use direct archiving. you have to correct the error. the Admin DB of the hot-standby database does not contain any information on log files and database backups before the system failover.6 Advanced Tasks If you are using indirect archiving. c. Perform a rollforward recovery to end of log files.. You can find the latest Admin DB backup SAR file in one of the following locations: In the standby directory (DB2DB6_STANDBY_DIR). you perform the following tasks on the hot-standby system: . If the Admin DB backup SAR file is not in one of these locations or cannot be accessed. Log File Management Considerations If you are using indirect archiving.. 134 August 2003 . Recreate the content of the Admin DB on the hot-standby system using the latest Admin DB backup SAR file.

If you use indirect archiving.12 Dual Logging Dual logging is a new feature of DB2 Version 7. It provides the option to keep two copies of the log files. Set DB configuration parameter MIRROR_LOGPATH. To activate dual logging on DB2 UDB for UNIX and Windows Version 8.. Enter: db2 update db cfg for <DBSID> using MIRROR_LOGPATH <second log directory> 2. you use the following brarchive options: • -GAL add Log files that are not known to the Admin DB but located in the archive directory are added to the Admin DB. This means that the log files are not archived twice. Procedure To adjust the content of the Admin DB. To activate dual logging on DB2 V7: Set. Set DB2 instance registry variable DB2_NEWLOGPATH2 using db2set.. restart the instance. which are normally only in the log directory. Enter the following command: db2set DB2_NEWLOGPATH2=ON DB2 creates the name of the second log directory from the first log directory by adding 2. • -GAL remove Log files that are assumed to be in the archive directory but do not exist there are removed from the Admin DB.2. restart the instance. brarchive stores only one log file. 2. the Admin DB keeps track of only one log file. To activate this change. 1.13 Adjusting the Content of the Admin DB Use You adjust the content of the Admin DB by using the brarchive option –GAL.6 Advanced Tasks 6. Before you enter the –GAL option of brarchive you should use the preview mode with the –DMP option to make sure that your changes to the Admin DB are correct. 6. proceed as follows: 1. DB2 calls the User Exit just once for each log file regardless if dual logging is activated or not. To activate this change. August 2003 135 .

you can revert the state of log files from ARCHRET (archive retained) to OFFLRET (offline retained) if the log files are still in the archive directory. The next time brarchive is run to archive log files. these log files will be treated like log files that have not yet been archived. they will then be archived again.6 Advanced Tasks • -GAL revert With this option. 136 August 2003 .

DB2 Command Center or DB2 Control Center. If the active log file is not sufficient for a recovery. up to any point within the time period covered by the logs ROLLFORWARD recovery. During the restore phase. but it cannot detect the location of the required log. Restoring Databases from an Offline Backup Without Rolling Forward You can only restore without rolling forward at the database level. that is. The DB2 Database Manager ensures that an incorrect log is not applied during rollforward recovery. the last log that was used by rollforward is truncated. When the rollforward recovery method completes successfully. but the other tablespaces in the database are. When you perform an online rollforward operation on a tablespace. As long as all the log files are available covering the time period from the time of the backup through to the current time. You can specify that rollforward recovery is done to the end of logs. The restore command can be entered from the command line processor. perform an online rollforward of tablespaces as long as SYSCATSPACE is not included. Restoring Databases and Tablespaces and Rolling Forward You do not have to recover your database with the latest backup copy of the database.1 SAP Database Recovery If you are using a full database backup as a basis. You can start with any backup as long as you have the logs associated with and following that backup. You have to make a copy of the logs before executing the ROLLFORWARD command if not already done by the User Exit program. it is not available for use. or you could specify the WITHOUT ROLLING FORWARD parameter for the restore utility. and logging begins with the next sequential log. A database must be restored successfully before it can be rolled forward. The practical effect is that any log in the log directory with a sequence number greater than the last log used for rollforward recovery is re-used. To restore a database without rolling forward. rollforward recovery re-applies the completed units of work recorded in the database logs to the restored database. and not at the tablespace level. a database that uses circular logging. August 2003 137 . The database is not available for use until the rollforward completes either by reaching the end of the logs during a tablespace rollforward. the rollforward must be issued from the catalog node of the database. the db2uext2 interface will be called with the RETRIEVE request to get the missing log file. you could either restore a nonrecoverable database. or to a particular point in time. In a partitioned database environment. You can. The database administrator db2<dbsid> or the SAP system administrator <sapsid>adm can restore or rollforward the database.7 Emergency Tasks 7 Emergency Tasks 7. or by specifying STOP on the ROLLFORWARD command. however. you can choose to have DB2 apply all the units of work for any or all of the tablespaces in the database. A database rollforward runs offline. tablespace or tablespaces. but a tablespace does not. a copy of the SAP database and SAP database logs is needed for recovery.

from the context menu of the SAP database. If required. The timestamp used on the backup is based on the local time that the backup started. From there the User Exit is able to retrieve log files to the online log directory. you must specify the time in CUT. choose SAP Log File Management. The timestamp in the log uses the Coordinated Universal Time (CUT). you can restore log files either automatically using the User Exit program or you have to restore them from the retrieve directory. You can restore log files from storage (tape. enter user <sapsid>adm or db2<dbsid>.. 7. because of a change in time associated with daylight savings time. TSM or any other backend where you archived log files to using customer script) either with the brrestore tool or with the DB2 Control Center Extensions for the SAP system.7 Emergency Tasks One type of problem that requires point-in-time rollforward recovery is the corruption of data that is caused by errant logic or incorrect input in an application. use one of the following procedures. Restoring Log Files with the DB2 Control Center: To restore the log files. As a result. for example.2 Log File Restore of the SAP Database As outlined in Basic Concepts [Page 21]. 138 August 2003 . proceed as follows: . 2. If you choose to restore from storage into the retrieve directory. CUT helps to avoid having the same timestamp associated with different logs.. In the navigation frame of the DB2 Control Center. The Logfile Management dialog box appears. when you call the ROLLFORWARD command. A log uses a timestamp associated with the completion of a unit of work. You can use rollforward recovery to recover the database to a point-in-time that is close to when the application began working with the database. 1.

5. Choose the node where you want to restore log files. 4. the oldest log file must be at the start of the range. All available log files for the selected backup are displayed together with the number of locations on which they are stored. choose a backup date. August 2003 139 . 6.7 Emergency Tasks 3. Choose Restore. Due to a program limitation. In the Restore logiles taken at group box select a log file range to be restored. To determine which log files are to be restored.

you have to choose a tape device in the Select tape drive field. an emergency restore can be attempted. a dialog box appears displaying a success message. Calling brrestore on the command line gives the administrator access to all command line options and may therefore be more flexible than using the DB2 Control Center.Log File Retrieval Tool [Page 153]. To start restoring from the selected location. choose Start. A dialog box appears informing you that the restore process has been started. All restore actions and their results can be seen on the Journal screen. Choose the location to be used for the restore process. choose Restore. If there are still log files left to be restored. 9. The Select Location dialog box appears. 8. After the restore has finished. If so. To start the restore procedure.7 Emergency Tasks 7. 140 August 2003 . If you choose a tape location from where all matching devices are retrieved. The -a arguments (shown in the following tables) must be log file numbers and not log file names. All log files that can be restored from the chosen location are displayed. For more information on the syntax of brrestore. a check is made whether all selected log files were restored. If this fails. although we do not recommend this action. The best location is the default value. Restoring Log Files with the Command Line Tool brrestore brrestore can be used to retrieve any log file archived using brarchive. the Select Location dialog box reappears again and you have to repeat the process for all different locations where necessary. The following tables describes the most common usage of brrestore. see brrestore .

You have started the database ROLLFORWARD and determined that DB2 requests log files that cannot be retrieved directly from the active log or by the User Exit from the archive or retrieve directory. Prerequisites • • The SAP database has been restored from a backup and left in ROLLFORWARD_PENDING state. Restoring Log Files Archived Using Customer Script Command syntax Description brrestore -a 110-120 -d script –out –sid SAPSID This command tries to retrieve the log files with the numbers 110 to 120. Messages are written to the standard output file and a protocol file. Procedure You can perform the following procedures using either the DB2 Control Center or brrestore.. Use the DB2 Control Center Extensions to restore the log files from TSM or tape as described in “Restoring Log Files” in this section. Emergency Restore of Log Files Using brrestore -ex Use this procedure either when both the Admin DB and the SAP database have been destroyed or normal log file retrieval methods fail. 2. Do not use an emergency restore for normal management purposes. as the Admin DB is not updated. Restoring Log Files From TSM Command syntax Description brrestore -a 110-120 -d tsm –out –sid SAPSID This command tries to retrieve the log files with the numbers 110 to 120 from TSM. and then use the standard restore command brrestore -a as described in the tables above. 1. Locate the most recent backup of the Admin DB ADM<DBSID> on TSM or tape and recreate the database as described in Recovery of the Admin DB [Page 143]. August 2003 141 . Messages are written to the standard output and a protocol file. which where archived using your own script. DB2 Control Center . Messages are written to the standard output file and a protocol file..7 Emergency Tasks Restoring Log Files From a Tape Command syntax Description brrestore -a 110-120 -d tape -v D4XA99 –out –sid SAPSID This command tries to retrieve the log files with the numbers 110 to 120 from tape D4XA99. We recommend that you first recover the Admin DB if necessary.

7 Emergency Tasks

brrestore If you do not currently have access to the Admin Tools, you can restore the log files completely independently of the DB2 Control Center and the Admin DB. This procedure allows you to retrieve log files and Admin DB backups directly from tape or TSM.
...

1. After restoring the SAP database and starting the rollforward recovery, determine which log files are not yet available but will be required for the recovery process. That is, which log files were created after the backup was taken but are currently not in the log_dir, log_archive or log_retrieve directories. 2. To find out where these files are located, enter the following command: brrestore -q <file pattern> { -d tsm | -d tape -t <tape address> | -d script } 3. To restore the log files from the archive, enter the following command: brrestore –ex <file pattern> [<from time>[<to time>]] { -d tsm | -d tape –t <non rewind addr> | -d script } <non_rewind_addr> is the non-rewind address of the tape for restoring from tape. 4. Put the files where DB2 or the User Exit expects to find them (log_dir, log_retrieve) and continue the rollforward recovery.

To restore all files from a tape on Windows, enter the following command: brrestore -d tape –ex "*" -t /dev/nmt0.1 To retrieve all log files in the number range 100 to 199 that were archived to TSM between November 1997 and the current day, enter: brrestore -d tsm -ex "S00001*" 199711 For more information on the syntax of brrestore and non-rewind addresses, see brrestore Log File Retrieval Tool [Page 153].

142

August 2003

7 Emergency Tasks

7.3 Recovery of the Admin DB

7.3.1 General Information
The Admin DB contains information about objects such as log files and their locations. This information is required to process these log files, for example, to recover them. The Admin DB data itself may need to be recovered for the following reasons: • • The Admin DB is lost or damaged. The SAP system is being moved or a duplicate SAP system is being set up on another machine. The SAPSID and DBSID must remain unchanged. Otherwise, you must create a new empty Admin DB.

You can deal with these situations as follows: • You create a new Admin DB and take a backup of the SAP database. If you do not need the old log files, for example, on a test system, this is the fastest way of recovering or recreating the Admin DB. Otherwise, you must recover the Admin DB from a safety copy as described below.
If the Admi...

a. If the Admin DB still exists, drop it using the following command: DROP DB ADM<DBSID> b. To recreate an empty Admin DB, call sddb6ins –i.

It is not essential but useful to prune the DB2 backup history file (PRUNE…). c. Make sure that the SAP database parameters LOGRETAIN and USEREXIT are both set to ON. d. Perform a full backup of the SAP database. • You recover the Admin DB from a safety copy. To make sure that the Admin DB ADM<DBSID> can be recovered, an export of essential information from that database is archived to the same target as the log files just archived. brarchive does this export and archiving automatically after successfully archiving one or more log files. This database safety copy is not a database backup but a compressed archive file (adminDB<timestamp>.SAR) made up of individual table exports. This database backup image does not contain job information such as the one shown on journal pages in the DB2 Control Center. This data is lost when ADM<DBSID> is recreated using this image.

August 2003

143

7 Emergency Tasks

7.3.2 Recovery Process
The recovery process consists of the following steps:
Re...

1. Retrieving the Admin DB backup image from archive. 2. Recreating the Admin DB using sddb6ins or manually.

Retrieving the Admin DB Backup Image from Archive (TSM, Customer Script or Tape)
A copy of the latest Admin DB safety copy export archive file (adminDB.<timestamp>.SAR) should be located in subdirectory <DB2DB6_TEMP_DIR>/adminDB_<DBSID>. If this file is available, you do not need to recover the Admin DB backup image from storage and you can continue with “Recreating the Admin DB” described further below in this section. • TSM: If the database log files were archived to TSM, Admin DB backup images are also stored there. To find the most recent file, it may be necessary to retrieve several or all SAR files from TSM. If you specify adminDB.*.SAR as the file pattern, all safety files will be retrieved. If you specify a part of the timestamp in the file pattern, the number of files is reduced. You can restore the SAR file from TSM using the following command: brrestore –d tsm –ex <file pattern> -out • Customer script: If the database logs were archived using a customer script, Admin DB backup images are also stored using a customer script. You need to restore the SAR file manually from where the customer script has stored it. • Tape: If database safety copies (and log files) are archived to tape, restore the safety file of the Admin DB from the current tape to the current working directory using the following command: brrestore –d tape –ex <file pattern> -t <non rewind addr> -out

<non rewind addr> is the non-rewind address of the tape for restoring from tape. For more information on non-rewind addresses, see brrestore – Log File Retrieval Tool [Page 153].

You can use the pattern adminDB.20000626*.SAR to retrieve all safety files of the Admin DB archived on August 26, 2000. This pattern reduces the number of log files that are to be retrieved. To retrieve the above mentioned safety file(s) to the current working directory, enter the following command: • For TSM: brrestore –d tsm –out –ex “adminDB.20000626*.SAR“ • For tape: brrestore –d tape –out –ex “adminDB.20000626*.SAR“

Recreating the Admin DB
The Admin DB can be recreated either using program sddb6ins or manually.

144

August 2003

7 Emergency Tasks

Recreating the Admin DB Using Program sddb6ins
1. Log on to the database server: On UNIX: As user <sapsid>adm and switch to user root (su root). On Windows: As user <sapsid>adm. 2. Create the Admin DB using sddb6ins. To do so, enter the following command: sddb6ins –r <file name>

sddb6ins –r adminDB.20000626123504.SAR This command performs the following actions: • It creates the Admin DB. • It extracts SAR file. • It imports IXF files from SAR file. • It adds backups, which were made after the SAR file has been created, to the Admin DB. • It adds log files from log_archive that are not known to the Admin DB to the Admin DB. The reason is that these log files are moved to log_archive after the SAR file has been created.

Recreating the Admin DB Manually
1. To recreate the Admin DB step-by-step from the SAR file, enter the following command: On UNIX: a. Log on as user <sapsid>adm and switch to user root using the following command: su root b. As user root, enter the following command: sddb6ins –I On Windows: Log on to your database server as user <sapsid>adm and enter the following command: sddb6ins –i –db2dbnamepwd <password of user db2<dbsid>> 2. Extract the SAR file using the following command: SAPCAR –xvf adminDB.<timestamp>.SAR 3. Import IXF files using the db2move tool. 4. To import the original data, call db2move as user <sapsid>adm from the directory where the archive was unpacked. db2move is located in the DB2 directory misc. Enter the following command: db2move ADM<DBSID> IMPORT –io INSERT_UPDATE

August 2003

145

DB6LFSTATE All errors and warnings are recorded in the table-specific message files named tab?.msg. 146 August 2003 . 774 Table: SAPR3. The reason is that these log files are moved to log_archive after the SAR file has been created. The reason is that these log files are moved to log_archive after the SAR file has been created (brarchive –GAL add –out). The output of the db2move command can be as follows: IMPORT: -Rows read: 2109.DB6LOGFILE IMPORT: -Rows read: 1774. Log files that are not known to the Admin DB are added from log_archive to the Admin DB. 2109 Table: SAPR3. As a result. –Rows committed.DB6CONFIG IMPORT: -Rows read: 774. backups that are made after the SAR file has been created are added to the Admin DB using the following command: brarchive –q backups –out Tool db2move also adds log files that are not known to the Admin DB from log_archive to the Admin DB using the following command: brarchive –GAL add –out.7 Emergency Tasks This command performs the following actions: Backups that were made after the SAR file was created are added to the Admin DB (brarchive –q backups –out).DB6IDENTIFIER IMPORT: -Rows read: 19. –Rows committed. –Rows committed. –Rows committed. 19 Table: SAPR3. 1774 Table: SAPR3.

Log File Archive Tool August 2003 147 .Appendix A: Tool Command Line Parameters Appendix A: Tool Command Line Parameters brarchive .

You use this option if the tape is lost or is physically damaged. set Re-initializes the old archive tape. Tape only: Same as –ss action but removes original copies from disk. Deletes tape with label volume from the Admin DB. Similar to -i show -ss -ssd -ds -q <type> -query <type> 148 August 2003 . also specify –v and –t. <type> can be replaced by one of the following: • • backups Displays the timestamps of all known backups. Stores and deletes log file(s). Action Displays the application command line syntax. Removes original copies from disk. also specify –v. Deletes stored log file(s). Successfully archived files are deleted from disk.Appendix A: Tool Command Line Parameters Command Parameter Actions Parameter -h -help -V -Version -do -dt Displays the application information and library version information if -d is specified. <subcommand> can be replaced by one of the following: • • • show Displays the tape volume name (default). Files are not deleted on disk after they are archived. For tape. Stores each log file twice to backend.. For tape. Files are not deleted on disk after they are archived. also specify –v and –t. Deletes obsolete files. check Displays detailed information about a tape. force Initializes the new tape or re-initializes the old tape containing the active log files. also specify –v and –t. For tape.. For tape. -s -sd Stores log file(s). -i <subcommand> -initialize .

/dev/rmt/0 on Solaris. Two arguments are required for -ss and –ssd. tsm or any other backend using a customer script. Switches on trace. However. Tape only: Volume name(s) on tape(s)..node ALL cannot be used with all actions. The default value is NODE0000. <level> is a value between 1 (low detail) and 9 (high detail). Node on which to perform processing or all nodes on which to perform processing. -d tsm can be followed by a single TSM management class or by two TSM management classes separated by ‘+‘. The numerical argument does not refer to a log file number. -sid <SAPSID> -t <device> [<dev2>] -tape_device .. No automatic tape eject after successful archive operation Displays the protocol on the command line (stdout). for example. File name (including path) of the vendor library to load brarchive and brrestore only automatically display output with -h and -V. August 2003 149 . -out must be specified. To display the output for other actions. The oldest files are processed first. the trace is normally turned on in the init<DBSID>.Appendix A: Tool Command Line Parameters Command Parameter Modifiers Modifier -d <device> -device <device> Description Device to archive files to retrieve files from tape.. -v <volume> [<vol2>] -volume . -vndlib <lib> SAP system ID to which the operation applies Tape only: Tape device(s).db6 file. This parameter is only required with multi-partitioned systems. -DEB [<level>] -one -out Without this parameter no output is displayed except -h and -V. -n <number> -number <number> -node NODExxxx -node ALL Maximum number of log files to process. . Two arguments are required for -ss and –ssd..

150 August 2003 .Appendix A: Tool Command Line Parameters brdb6brt .Redirected Restore Tool brdb6brt runs in the following four modes: • • • Backup/retrieve Check Tool information The following sections provide syntax examples of each mode. Creates the relocate script for the specified database. Creates a backup of and the restore script for the specified database. Backup/Retrieve Mode To create a backup or a restore script. Creates the restore script for the specified database only. use the following syntax: Command Parameter: Parameter -bm BACKUP -bm RETRIEVE -bm BOTH -bm RETRIEVE RELOCATE Description Creates a backup of the specified database only.

Appendix A: Tool Command Line Parameters

-s <SourceDB> -pp <ProtocolPath>

Name of the database for which the backup and/or restore script should be created Directory where the protocol file for the brdb6brt run will be written to. The default value is the working directory. The protocol file is named <SourceDB>.brp or <SourceDB>_NODE<NodeNumber>.brp in a multipartitioned environment. Directory where the restore script will be written to. The default value is the working directory. The restore script is named <SourceDB>.scr or <SourceDB>_NODE<NodeNumber>scr in a multipartitioned environment. Number of buffers reserved for the execution of the backup. The default value is 2. Size of the buffer for the backup operation, in 4 KB allocation units. The default value is 1024. The restore script is created for experts, that is, only comments that are really needed are included. Backup operation is done online. Only used in retrieve mode. If specified, the timestamp in the restore script is set to this value which must be in the form YYYYMMDDhhmmss. The default value is the current date and time. With this option you replace strings in the generated scripts for redirected restore and relocate. Parameter ReplaceDefinition must have the format <orig. string 1>=<repl. string 1>,<orig. string 1>=<repl. string 2>,…. This option only makes sense for –bm RETRIEVE, -bm BOTH and –bm RETRIEVE RELOCATE. Allows you to specify the parallelism degree for backup and redirected restore operations. In a multi-partitioned environment the backup operation is done against this node. The restore script is specific for this node and is named <SourceDB>_NODE<NodeNumber>.scr. To back up the database to tape, specify a valid tape device. You can split the backup into multiple pieces by specifying multiple devices separated by blanks. To back up the database to a directory, specify a valid directory. Make sure it has sufficient space to hold the backup volume. It is possible to split the backup into multiple pieces by specifying multiple directories separated by blanks.

-i <ScriptPath>

-nb <NumberOfBuffers> -bs <BufferSize> -es -ol -ts <Timestamp>

- replace <ReplaceDefinition>

-parallelism <degree> -nn <NodeNr>

-bpt <Device>

-bpt <Directory>

August 2003

151

Appendix A: Tool Command Line Parameters

-bpt TSM [<NumberOfSessions>] -bpt XBSA [<NumberOfSessions>]

With this option you back up the database into TSM. Specify NumberOfSessions for the TSM connection. With this option you back up the database into an XBSAcompliant storage management system. Specify NumberOfSessions for the XBSA connection. This feature can only be used on DB2 V8. With this option you use a third party shared library to perform the backup operation. Specify the library as LibName and optionally the NumberOfSessions. If this option is not specified, a full database backup is performed. However, you may choose to back up only one or more tablespaces of the database. To do so, specify the tablespaces separated by blanks. The restore script is created only for the specified tablespaces. To perform the whole operation of brdb6brt as another user, you can specify the user name here. Password for the specified user

-bpt VENDOR <LibName> [<NumberOfSessions>] -tbs <Tablespace>

-user <Username> -using <Password>

Check Mode
Use this syntax to check whether a given restore script would succeed on this machine. The user who performs the check mode should be the instance owner of the database instance. The terminal output of the check run is written to a protocol file in the current directory. The name of the protocol file is <SourceDB>.chk or <SourceDB>_NODE<NodeNumber>.chk depending on the specified script name.

Command Parameters Parameter -bm CHECK -ip <ScriptName> Description Checks whether a given restore script would succeed on this machine Name of the restore script to be checked on this machine. By default, the restore script is named <SourceDB>.scr or <SourceDB>_NODE<NodeNumber>.scr in a multipartitioned environment. In a multi-partitioned environment the check operation is done against this node. To perform the database dependent checking of the check mode as another user, you can specify the user name here. Password for the specified user

-nn <NodeNr> -user <Username>

-using <Password>

Tool Information Mode
Use this syntax to retrieve version information about this tool.

152

August 2003

Appendix A: Tool Command Line Parameters

brrestore - Log File Retrieval Tool

Command Parameter Actions Parameter -h -help -V Displays application information and library version information if -d is specified. Deletes restored log file(s). Removes restored copies from disk. Action Displays the application command line syntax.

-dr [<number>|<range>]

August 2003

153

Appendix A: Tool Command Line Parameters

-a <number> -a <range>

Restores log file(s) from archive. Each parameter is a log file number and not a log file name, for example, -a 5 or -a 5-10 to restore log file 5 only or files 5 to 10. Performs emergency restore of log files when the Admin DB is not available. Tape argument -t must refer to a non-rewind device. Nonrewind address examples are described under “Non-Rewind Tape Device Addresses” later in this section.

-ex <pattern>

-delete <timestamp> [<pattern>]

Deletes all known log files in an archive (TSM only) older than the given backup timestamp ts. An additional (optional) file pattern can be specified to force all matching files older than the timestamp to be deleted, even if they are not known to the Admin DB. If you want to specify a timestamp that is not a backup timestamp, you need to specify the –force option in addition. <type> can be replaced by one of the following: • • adsmMC Displays known TSM management classes. <pattern> Requests a list of log files matching the given file pattern on the TSM server, for example, –q "*.LOG" (TSM only).

-q <type> -query <type>

-force

Currently only used in conjunction with –delete ts-.

Command Parameter Modifiers Modifier -d <device> -device <device> -DEB [<level>] Description Device to archive files to retrieve files from tape, TSM or any other backend using a customer script. -d adsm can be followed by an TSM management class Switches on trace. level is a value between 1 (low detail) and 9 (high detail). However, the trace is normally turned on in the init<DBSID>.db6 file. No automatic tape eject after successful archive operation Displays the protocol on the command line (stdout).

-one -out

Without this parameter no output is displayed except -h and -V. -n <number> -number <number> Maximum number of log files to process. The oldest files are processed first. The numerical argument does not refer to a log file number.

154

August 2003

“2” and so on as appropriate. For example. -node ALL cannot be used with all actions. -sid <SAPSID> -t <device address> -tape_device -v <volume> -volume -vndlib <lib> Volume name on tape. /dev/rmt/0 on Solaris. With the exception of AIX. brrestore can only access one tape at a time. August 2003 155 .1 /dev/rmt/0n /dev/nst0 /dev/rmt/0mn If you have more than one tape device to address. replace the “0” with “1”. The default value is NODE0000 or ALL nodes. the non-rewind address of the second tape on Solaris is /dev/rmt/1n.Appendix A: Tool Command Line Parameters -node NODExxxx -node ALL Node on which to perform processing. -out must be specified Non-Rewind Tape Device Addresses This form of the addresses is only required for emergency restore (-ex). To display output for other actions. brarchive and brrestore only automatically display output with -h and -V. This parameter is only required with multi-partitioned systems. brrestore can only access one tape a time. it is formed by adding an "n" to the standard (rewind) address: Windows: AIX: Solaris: Linux: HP-UX: /dev/nmt0 /dev/rmt0. File name (including path) of the vendor library to load SAP system ID to which the operation applies Tape device. for example.

Performs consistency check on the backup copy that is on the server. Copies DB2 objects from the TSM server to the current directory on the local machine. 156 August 2003 . Either deactivates backup objects or deletes log archives on the TSM server.DB2 TSM Management Tool Parameter QUERY EXTRACT DELETE VERIFY Description Queries the TSM server for DB2 objects. This parameter causes the entire backup image to be transferred over the network.Appendix A: Tool Command Line Parameters db2adutl .

Includes backup objects that have been deactivated. Deactivates all objects of the specified type except for the most recent n by timestamp. the value specified for the TSM password database configuration parameter is passed to TSM. Specifies that objects with a timestamp earlier than timestamp or n days will be deactivated. If a database is specified and the password is not provided. Considers only those images associated with a specific TSM node name. NODENAME <node_name> WITHOUT PROMPTING OWNER <owner> August 2003 157 . Considers only those objects created by the specified node number. Specifies a backup image by its timestamp. Specifies that the logs between log sequence number 1 and log sequence number 2 are to be used. Considers only those objects created by the specified owner. Includes only full database backup images. if required. Specifies the TSM client password for this node. Otherwise. The user is not prompted for verification before objects are deleted. Includes only load copy images.Appendix A: Tool Command Line Parameters TABLESPACE FULL LOADCOPY LOGS BETWEEN <sn1> AND <sn2> SHOW INACTIVE TAKEN AT <timestamp> KEEP n OLDER THAN <timestamp or n days> DATABASE <database_name> NODE <node_number> PASSWORD <password> Includes only tablespace backup images. no password is used. Considers only those objects associated with the specified database name. Includes only log archive images.

This option does not validate the image. Displays the results of check bits and check sums. Validation will be performed on the entire image if this option is not specified. including the name or path of the image expected by the restore utility. The name of the backup can be checked at a time. Displays media header information.DB2 Check Backup Utility Command Parameters Parameter -a -c -d -h -H Description Displays all available information. Displays information from the headers of DMS tablespace data pages.Appendix A: Tool Command Line Parameters db2ckbkp . 158 August 2003 . -l -o <file name> Displays log file header data. Displays only the media header information. Displays detailed information from the object headers.

format the dump file.DB2 Trace Using this utility is described in DB2 Trace Facility db2trc [Page 171]. See the next table for information about the options for this parameter. use this parameter to dump the trace information out to a file once you reproduce the error.Appendix A: Tool Command Line Parameters db2trc . turn the trace off by entering the following command: db2trc off August 2003 159 . produce a dump file.dmp You must specify a file name with this parameter. and turn tracing off. The following command puts the information in the current directory in a file called db2trc. off After you dump the trace to a file.dmp: db2trc dump db2trc. If you are tracing to memory. The following table represents the order in which you use the parameters: Parameter on dump Description Use this parameter to start the DB2 trace facility. Parameters You must issue the db2trc command several times to turn tracing on. The file is saved in the current directory unless you explicitly specify a path.

When using this output.*. or the fmt option (to list every event chronologically). If the workstation is being suspended preventing you from accessing this output. the trace output is stored in shared memory (the s option).dmp db2trc. The default trace option values are: Trace Option -m *. only the dump file itself should be sent to the DB2 Customer Service. The mask variable consists of four one-byte masks separated by periods. -e max_sys_errors Limits the number of DB2 internal system errors that the trace will hold to max_sys_errors. Maximum record size is 16 KB. and functions. Trace destination to shared memory (instead of to a file) Specifies trace record types to focus the search on. event types.*. enter db2trc on. respectively. Limits the size of trace records to max_record_size bytes. These masks correspond to products. If the DB2 Customer Service requires mask values different from the default values. you can trace to a file with the -f option. In most cases. Use either the flw option (to sort by process or thread). Starting a DB2 Trace To start the trace facility. you will be instructed on which values to use.* -e –1 -r 16000 -s -m mask Description Traces everything. The default value is -1 (collect all errors).dmp db2trc. components. you must specify a file where the trace output will be stored. For either option.Appendix A: Tool Command Line Parameters flw | fmt After you dump the trace to a binary file. By default.flw db2trc fmt db2trc. Longer trace records are truncated. and act as a filter to accept or reject the trace record sent by DB2 for each event based on its ID. confirm that the trace was successful by formatting it into an ASCII file. Collects all errors. For example: db2trc flw db2trc.fmt These options are provided for you to verify the trace. -r max_record_size -s | -f filename 160 August 2003 . you must specify the name of the dump file and should specify the name of an output file that will be generated.

the first records are overwritten when the buffer is full. August 2003 161 . to start db2trc with a 4 MB buffer. The default and maximum trace buffer sizes vary by platform. no more records are written to the buffer once it is full. enter the following command: db2trc on -l 4m The buffer size must be a power of 2. -t Includes timestamps. –i specifies that the initial trace records are retained. The buffer size can be specified in either bytes of megabytes (MB). where the logging of timestamps severely affects performance.Appendix A: Tool Command Line Parameters l [ buffer_size] | -i [buffer_size] This option specifies the size and behavior of the trace buffer. The minimum buffer size is 1 MB.-l specifies that the last trace records are retained. To specify the buffer size in megabytes. For example. add the character m to the buffer size. that is. Applicable to UNIX-based environments only. that is.

Appendix A: Tool Command Line Parameters db2uext2 . The user exit is normally only called by the database engine. AIX. Windows. Size of the log extent in 4 KB pages 162 August 2003 . File name of the log file TSM password. Log extent starts at this number in steps of 4 KB pages of the device. The -SP and -LS parameters are only used if a raw device is used for logging. Unlike the other programs described here. HP-UX and Windows 98 DB2 release level Request type. the User Exit parameters allow no spaces before their arguments. archive or retrieve Database name Local node number Fully qualified path to the log files. for example.DB2 User Exit Wrong usage of this function may make database backups unusable. DB2 Parameters Passed to the User Exit Program Parameter -OS<os> -RL<db2rel> -RQ<request> -DB<dbname> -NN<nodenum> -LP<logpath> -LN<log name> -AP<TSMpasswd> -SP<startpage> -LS<logsize> Description Platform on which the instance is running. Solaris. for example. The path must contain the trailing path separator. The syntax description here is only for qualified SAP support personnel and administrators who have been explicitly instructed to perform an action involving the User Exit by SAP support. It is passed to the User Exit if it is provided in the database configuration.

Archived Admin DB safety files (adminDB. Copies log files from the TSM server to the current directory on the local machine. Performs action for log files in TSM backup copy group. Either deactivates log files or deletes log files on the TSM server. Considers only those objects associated with the specified database name.Appendix A: Tool Command Line Parameters db6adutl . The user is not prompted for verification before objects are deleted.<timestamp>. Performs action for log files in TSM archive copy group.SAP TSM Management Tool Parameter QUERY EXTRACT DELETE ARCHIVE BACKUP BOTH BETWEEN <sn1> AND <sn2> DB <dbname> NODE <n> WITHOUT PROMPTING Description Queries the TSM server for log files. Performs action for log files in TSM archive and backup copy group. Considers only those objects created by the specified node number. Specifies that the logs between log sequence number 1 and log sequence number 2 are to be used.SAR) should be deleted using brrestore before changing from indirect archiving to direct User Exit archiving. August 2003 163 .

User authentication. The default value is stdout. RUNSTATS on single tables and all indexes RUNSTATS on tables provided in file first RUNSTATS on tables with VOLATILE attribute. Database name.Appendix A: Tool Command Line Parameters db6util . Displays overview over deadlocked processes in application snapshot. Modifies database manager parameter. db6util tries to retrieve the <sapsid>adm password from the DB2 password service. Gets database parameter. Result file.Tool to Assist Database Administration Parameter -h -V -n <dbname> -auth Description Prints help text. -o -w -r -rf -rv -f -dg -dm -mg -mm -sd -sl 164 August 2003 . Gets tablespace free space information. The VOLATILE attribute is removed after RUNSTATS. Displays overview over deadlocked processes and processes in lock wait status in application snapshot. Prints version information. The default value is stdout. Modifies database parameter. Tables flagged in DBSTATC with ACTIVE = N are not affected. Log file. Gets database manager parameter. If this option is not specified. The default value is the value of environment variable DB2DBDFT.

The default value is 1024.Database Backup Tool Command Parameters Parameter <dbName> -NODExxxx -ONLINE | OFFLINE -ADSM OPEN <num> SESSIONS -TO <targetArea> -LOAD <vendorLibrary> OPEN <num> SESSIONS -BUFFERS <num> -BUFFERSIZE <size> -PARALLELISM <p> Description Specifies the SAP database name <DBSID>. for example. Name of shared library containing the vendor backup I/O functions and the number of I/O sessions to be used Number of buffers to be used Size. The default value is 1. of the buffer used when building the backup image. Number of I/O sessions to be used with TSM Lists directory or tape device names. Number of buffer manipulators to be spawned during the backup process. Partition number. August 2003 165 . in pages.Appendix A: Tool Command Line Parameters dmdb6bkp . NODE0002 Specifies online or offline backup mode.

<tabname> -z <maxRuntime> -m <statisticalOption> Description Specifies the SAP database name <DBSID>. Performs the operation on all selected DBSTATC tables. for example. This is the default value.Appendix A: Tool Command Line Parameters dmdb6srp .Update Statistics Tool Command Parameters Parameter -n <dbsid> -tALL -tDBSTAT -tCALL -t<tabschema>. Performs the operation on all database tables. specify one of the following letters: • b Both tables and index statistics are gathered.MONI Maximum amount of time (in minutes) for the execution of the program. To use a statistical option. The default value is 1200 minutes. 166 August 2003 . Calculates REORGCHK information on all database tables with current statistics. Table name. The default value is 1200 minutes. SAPR3. t Table statistics only I Indexes only d Table with extended (distribution) statistics x Extended statistics for indexes only e Both table (with distribution statistics) and basic indexes y Extended statistics for indexes and basic table statistics a Extended statistics for indexes and table statistics with distribution • • • • • • • -l <longFieldTimeFrame> Maximum amount of time (in minutes) spent on the calculation of the size of long fields.

August 2003 167 . Specifies the name of the tablespace that contains the tables to be reorganized.Table Reorganization Tool Command Parameters Parameter -n <dbName> -t <tablespace> -m <tempTablespace> Description Specifies the SAP database name <DBSID>. The page size must match the page size of the tablespace specified with the –t switch.Appendix A: Tool Command Line Parameters dmdb6rts . Specifies the name of the tablespace where the DB2 Database Manager can temporarily store the table being reconstructed.

46D). the -db2dbnamepwd <pwd> is mandatory. Prints the version of sddb6ins. The default value of <target release> is the default release of sddb6ins. -u <start SAP release> [<target release>] -r [<adminDB backup image>] -checkonly [<target release>] [-db2dbnamepwd <pwd>] [-sidadmpwd <pwd>] Windows only: [-db2dbnamedomain <domain>] [-sidadmdomain <domain>] For the installation of the 6. The default value of <target release> is the release of sddb6ins. Command Parameters Parameter -h -V -i [<target release>] Description Prints the usage of sddb6ins. Upgrades the Admin Tools. Recreates the Admin DB using the Admin DB backup SAR file. Installs the Admin Tools. All of these parameters have useful default values. except -db2dbnamepwd <pwd>. <start release> indicates the release of the already installed Admin Tools (for example. sddb6ins must always be called with root authorization but with the user environment for user db2<dbsid> as described in Installation and Setup [Page 36].Appendix A: Tool Command Line Parameters sddb6ins . The value for -sidadmpwd <pwd> is read from the dscdb6up password file.Admin Tools Installation Program On UNIX. Checks if the Admin Tools are installed correctly.NN Admin Tools on Windows. The default value of <target release> is the release of sddb6ins. The following default values apply: • • The value of the USERDOMAIN environment variable is the default value for <domain>. 168 August 2003 .

The default value is 3. The value 9 means "very detailed". -DEB [<level>] -NOADMDB August 2003 169 . The Admin DB is not needed because log files are archived directly to the vendor storage product by the User Exit program. <level> can be between 1 and 9. Activates the tracing facility. The detail level can be specified using <level>. The value of the SAPSYSTEMNAME environment variable is the default value for <SAPSID>.Appendix A: Tool Command Line Parameters -s <SAPSID> Specifies the SAP system ID.

The value 9 means “very detailed”. The detail level can be specified using <level>.Admin DB Creation and Mirror Tool Utility Command Parameters Parameter -m -DEB [<level>] Description Mirrors the Admin DB ADM<DBSID> to the SAP database <DBSID>. 170 August 2003 .Appendix A: Tool Command Line Parameters sddb6mir . <level> can be between 1 and 9. Activates the tracing facility. The default value is 3.

or even stop other activities while recreating the problem situation with the trace turned on. this reduces the duration of the trace to a few minutes. Given the number of activities in an SAP environment. traces are usually only run at the request of DB2 support. run the command with no options. It is a time-consuming task. The following facts should be taken into consideration: • • • In most cases. For this reason. When turned on. It must be run by the DB2 instance owner on the database server. it is essential to find the smallest possible scenario that reproduces the problem. DB2 Trace Facility db2trc The DB2 trace. Interpreting trace data properly requires detailed low-level knowledge of DB2. system performance will decrease. August 2003 171 . To get an overview of the available options. DB2 will probably come to a standstill. • In a file This severely affects performance. trace data needs to be formatted on the system the trace was taken on. • • All DB2 traces are documented in the Troubleshooting Guide of the DB2 Online Documentation delivered with the software. In many cases. The amount of trace data can be enormously large. Problem situations that have been observed might disappear during attempts to reproduce them with the trace turned on. controlled by the command db2trc. The decision to run a trace must be carefully met. For this reason. trace data first needs to be dumped before the trace is turned off. It might be necessary to drill down.Appendix B: Troubleshooting Appendix B: Troubleshooting DB2 Traces The DB2 software provides several trace facilities to track down a variety of problem categories that might occur when running or developing DB2 applications. options for the location of trace data are: • In shared memory For this. To get the trace into readable form. Once the problem has been traced. the amount of memory available for tracing is limited by the amount of available shared memory. traces events.

log on as DB2 instance owner. Enter the following command: db2 update cli cfg for section common using <parameter> <value> 5. 1.. It is run on the machine running the DB2 application program. the SQL interface of DB2. To turn the DB2 CLI trace on or off. Turn off the trace by entering the following command: db2trc off 5. 1.fmt db2trc flw db2trc. To do so for all databases in a DB2 instance. Typical values to start with are 20000000 or 40000000 (20 or 40 million bytes). the output is written to the screen. enter the following command: db2 update cli cfg for section common using trace 0 4.flw While formatting. turn the trace on by entering the following command: db2trc on –l <memory> -s 2. If the output mentions that the trace has wrapped. 2. several parameters can be set. the sequence of activities using this kind of trace is as follows: . for example db2trc. There is no option to activate the trace for a process while it is being connected to the database.dmp db2trc.fmt and db2trc. DB2 CLI Trace The DB2 CLI trace traces all activities of the Call Level Interface (CLI). parameter TRACE in the CLI configuration needs to be set to 1. The trace needs to be repeated with a larger amount of memory. To de-activate the trace.. To configure the trace. Format the trace into two files. by entering the following command: db2trc dmp db2trc. Reproduce the problem. 3.. enter the following command: db2 update cli cfg for section common using trace 1 3.flw by entering the following command: db2trc fmt db2trc. To store trace data in a preallocated buffer of size <memory> in shared memory. enter the following command: db2 get cli cfg 172 August 2003 .Appendix B: Troubleshooting Usually. To verify the current settings.dmp db2trc.dmp. that is. To activate the trace.dmp 4.. db2trc. Procedure . the amount of memory reserved for trace data was insufficient and the trace might not be useful. Dump the trace data to a file named. It is activated for an application process when the trace is turned on or the process connects to the database.

BRARCHIVE. You can control brarchive and brrestore tracing using the command line option –DEB. but are acceptable under certain conditions. In the table above. There are often several items that appear to be errors. This environment file is located in the $INSTHOME/admintools directory (UNIX) or on the environment settings (Windows.Appendix B: Troubleshooting Examples of Available Parameters Parameter TRACEFILENAME <file> TRACEPATHNAME <path> TRACEFLUSH 0|1 Description Path of the file containing all trace data Directory to store trace files. Admin Tools Traces You can activate all tracing activities of most SAP DB2 kernel tools using variable settings in environment file init<DBSID>. BRRESTORE. <TOOL> is DB2UEXT2.db6. also Registry settings). which overrides the environment. which is overwritten by each new trace. SDDB6JDS. Environment Variables Environment Variable DB2DB6_TRC_<TOOL> Values ON or OFF Default value: OFF For example: DB2DB6_TRC_DB2UEXT2=ON DB2DB6_TRC_<TOOL>_LEVEL Default value: 2 1 Errors Error tracing 2 Footprint Function internal info 3 DEV: Development trace DB2DB6_TRC_<TOOL>_PATH Any path where db2<dbsid> has write access. This should normally be left unset to use the default behavior of creating one file per trace. one per process If this parameter is set to 1 it forces a write to disk for each entry. August 2003 173 . For example: DB2DB6_TRC_DB2UEXT2_PATH/db2/PRD/admintools/TraceFiles DB2DB6_TRC_<TOOL>_FILE A fixed name for the file to be used for all traces. or BRDB6BRT. or an optional trace level and trace directory. The trace output is intended for experienced support personnel and the application developers. The trace level can have a value between 0 and 9. Each component of the Admin Tools can be traced separately.

trc dmdb6bkp.trc db2uext2.trc brrestore.<timestamp>.trc dmdb6srp.trc dmdb6rdi.<timestamp>.sap.6D → <Your OS> → DB2 UDB. • For 64 Bit Choose SAP R/3 → SAP R/3 4.<timestamp>.<timestamp>.6D 64-BIT → <Your OS> → DB2 UDB. 174 August 2003 .<timestamp>.trc db6clp.trc brdb6brt.<timestamp>.6D Admin Tools • For 32 Bit Choose SAP R/3 → SAP R/3 4.6C → Binary Patches → SAP KERNEL 4.6C → Binary Patches → SAP KERNEL 4. Default Trace File Names Admin Tools DB2 administration server DB2 User Exit Log file management Data collector Update statistics Redirected restore Backup tool DB6CLP (command line processor) File Names sddb6jds.<timestamp>.trc The default trace file directories are: UNIX: $INSTHOME/admintools/TraceFiles Windows: %INSTHOME%\admintools\TraceFiles Downloading Admin Tool Patches from the SAP Service Marketplace You can download the latest available versions of the Admin Tools from the SAP Service Marketplace at the Internet address service. You can neither use the environment nor the ini file.<timestamp>.trc brarchive.com/patches.Appendix B: Troubleshooting Tracing of sddb6ins can only be activated using the command line option -DEB.<timestamp>. For 4.

Contains the SAP DB2 Control Center Extensions.6x Keep in mind that HW stands for UNIX if the DB2 Control Center runs on UNIX. • For 64 Bit Choose SAP Web AS → SAP Web AS <Release> → Binary Patches → SAP KERNEL <Release> 64-BIT → <Your OS> → DB2 UDB.CAR Description Contains the extraction tool SAPSAR(.exe). or I386 if it runs on Windows. UNIX only and only for SAP system Releases 4. The following table provides an overview of the files available: File SAPCAR.exe).SAR sddb6ins.CAR/SAR dscdb6up.Appendix B: Troubleshooting For 6. August 2003 175 . Contains the installation program sddb6ins(.NN Admin Tools • For 32 Bit Choose SAP Web AS → SAP Web AS <Release> → Binary Patches → SAP KERNEL <Release> → <Your OS> → DB2 UDB.CAR DB6CCEXT_HW.

As soon as enough space is available. For more information. that is. Initial Troubleshooting Steps Implement the following steps until the problem is resolved. defects that you find have already been found and addressed. You can now check the runtime environment for the Admin Tools by calling sddb6ins –checkonly. Initializing tapes with non-default values.. brarchive should then be called and the log files in temporary storage moved back to the log directory. Make sure that the DB2 protocol file db2diag. Running the tool again will cause an LFA158 error that will contain the path of the lock file. Make sure that files are no longer active before moving them. Look in the protocol file for the error. or a user inadvertently changed the environment. Also. check that the operating system user has not revoked users. 2. SAP system Release 3. ADSM must be still used in this case. If there is an SQL return code in the error message. 4. Password file problems are also common. If the database cannot be started. Look up the meaning of the error message in this appendix. 5.1I. 176 August 2003 . Older versions of the Admin Tools.log in the db2dump directory has not become too large. Ensure that neither brarchive nor brrestore are running and delete the file. . will cause problems if these values conflict with the parameters in those in the Admin DB. Customers occasionally run out of disk space. For detailed information. Use dscdb6up to resynchronize passwords. Search SAP Notes for solutions to previous occurrences of this error. For example. Downloading and installing the latest patch from the SAP Service Marketplace will often resolve the problem. For more information. General Troubleshooting Comments Many recent customer problems were caused by problems with the runtime environment.. Running brarchive will free up space by removing log files from the archive directory. look it up in the DB2 Message Reference and perform the recommended action. an environment variable was changed or unset. with a different block size.Appendix B: Troubleshooting Troubleshooting Admin Tools and Programs The following section provides information and advice on how to proceed when problems occur. see Setting and Updating Passwords [Page 108]. are not compatible with TSM. see Downloading Admin Tool Patches from the SAP Service Marketplace [Page 174] in this appendix. Perform the suggested action. when the User Exit has archived several files. it may be necessary to first temporarily move some log files out of the log directory to provide space. 1. An installation may not have completed successfully. a lock file may be left behind. If brrestore or brarchive can not terminate properly. It is important to choose only the most recent inactive files as the user exit and brarchive will move older files first. Problems with devices are a frequent issue. 3. for example. see Changing the Admin Tools Configuration [Page 64]. Often. or file or directory authorizations were changed.

db6. August 2003 177 . The passwords given when installing the SAP system or using the dscdb6up utility must match the operating system passwords for the same users. the protocol file init<DBSID>. 8. To ensure efficient troubleshooting.com/patches for new patches. Installation (sddb6ins) Troubleshooting Installation Failure In general. Run the action again. File cannot be replaced because the executable or shared library is currently in use. if the installation or upgrade has not completed successfully. DB2DB6EKEY must have the same value on all systems. run the installation tool with the -checkonly option and check the output.Appendix B: Troubleshooting 6. Upload the protocol and trace files. Download and install the latest patch version.sap. you can retry this operation without causing data loss. Make any appropriate adjustments to the runtime environment. Switch on Admin Tool tracing. and any core file to the SAP server. 7. the value is based on the machine name. which is often different on multi-node systems (DB2 UDB EEE V7 or DB2 UDB ESE V8 with multiple partitions). variable DB2DB6EKEY changed. Common Installation Problem The password file is inconsistent with the operating system. Create a message using SAPNet − R/3 Frontend. If not. By default. Check the SAP Service Marketplace at the Internet address service. The following error can occur during the installation of the Admin Tools: Error Message Reason Action Required Error opening file <file> with mode wb. go through the above steps and gather as much information as possible about the problem before contacting SAP support. Retry installation or upgrade operation.

6 8 Function module in the shared library could not be loaded. you can use the following procedure that is valid for the ARCHIVE and RETRIEVE actions of the DB2 User Exit program: .NODEXXXX 2.. TSM shared lib could not be loaded. The User Exit returns this value to the DB2 Database Manager for most failures. Hardware error Error with the User Exit program or system function used by the program. Look at the journal page for User Exit entries. Check previous error messages.NODEXXXX Error file: db2uext2. No new log files appear in the archive directory. contact SAP support. See the following table for details.NODEXXXX (located in the DIAGPATH database parameter) report a User Exit failure. These files are located in the DIAGPATH database parameter and are written for each database partition. check environment variable DB2DB6_VENDOR_UEXIT. check the error file db2uext2. The DB2 Database Manager automatically retries archive operations again after five minutes. If processing of the same log file fails repeatedly. If the problem persists. the return codes have the following description: User Exit Error Messages Return Code 0 1 4 5 Description Successful DB2 shared library not found.err. contact your system administrator and SAP support.Appendix B: Troubleshooting User Exit Troubleshooting The following errors might occur: • • • The log directory (database parameter LOGPATH) becomes full.err. activate the tracing facility.err. Retry. Retry. On UNIX: Verify if environment variable INSTHOME is set correctly.log and db2alert.log. Temporary error encountered (system memory). For detailed analysis. 12 16 178 August 2003 . 1.NODExxxx for more detailed information. If the problem persists.dll If files are being archived directly to TSM by the User Exit.log or db2uext2.. To check the reasons for these errors. for example. signal handling). Look at the db2uext2 protocol and error files. Check if the specified shared library is in the path of the DB2 instance owner: UNIX: libApiDS (for 64bit libApiDS64) Windows: ADSM32. For the User Exit error message. The file names are as follows: Protocol file: db2uext2. Entries in diagnostic file db2diag.

Check error file db2uext2. 37 38 Opening file failed.NODExxxx for more detailed information. This return code is recorded in the db2diag. Contact SAP support. Ensure that the file has never existed and then perform ROLLFORWARD STOP.log.NODExxxx for more detailed information. There could be a free space problem. If the file does not exist (and never has existed) you are finished and can perform ROLLFORWARD STOP. If not. 36 Opening file failed. the log file could not be found in either the archive or the retrieve directory.err. The log file has probably been moved out of the online log directory. • Retrieve operations (ROLLFORWARD): If the DB2 User Exit was called to retrieve log files. Check error file db2uext2. • Archive operations: If the source is the log file to be archived by the DB2 User Exit. this is just a warning.err.err. Admin DB access error.NODExxxx for more detailed information. Make sure that the log file is still available. Check error file db2uext2. Writing to file failed: The log file could not be copied to the archive directory.h. you may have problems if a database recovery becomes necessary. The User Exit program was not found. Check whether you are using a version of db2uext2 that is compatible with the database product release. Reading from file failed. Accompanying message should contain the system error number defined in file errno. This is a safety feature to ensure that the ROLLFORWARD is not accidentally stopped when log files still exist that could be recovered using brarchive. Wait to see if db2uext2 succeeds at a future attempt. Retrieve operations (ROLLFORWARD): This is not necessarily an error. If not. check at the file system level. Log file does not exist.err. 39 40 August 2003 179 . This is deliberately different to the default (simplified) User Exits provided as source code together with DB2.NODExxxx for more detailed information. Attempt to retrieve it using brrestore.Appendix B: Troubleshooting 20 Error with one or more of the parameters passed to the User Exit program. Closing of log file failed. Check if program db2uext2 is available in the following directories: UNIX: $INSTHOME/sqllib/adm/ Windows: <DRIVE>:\sqllib\bin\ 23 24 28 30 35 I/O fail File I/O error. Check the messages and access authorizations. Check error file db2uext2.

Try to retrieve this parameter on the command line. Error when accessing file.err. Check the database environment.conf. errno). Database management (DBM) parameter DFTDBPATH is not set or could not be retrieved.log. Recording information failed: An action step cannot be protocolled in the Admin DB. Check error file db2uext2.err.NODExxxx for more detailed information. Check error file db2uext2. check the ADM<DBSID> database of your managed instance and contact SAP support.NODExxxx for more detailed information (for example.err. Password could not be retrieved from password file dscdb6. Check the database environment.NODExxxx for more detailed information. Check the SQL code in DB2 Message Reference. errno). Windows only: Environment variable DSCDB6HOME not set.conf (permission 600. Environment variable DB2DBDFT not set.err. Check error file db2uext2.NODExxxx for more detailed information (for example.NODExxxx or db2uext2.NODExxxx for more detailed information. On Windows Check if share \DSCDB6HOME\sapmnt is available and if the DB2 service has been started by user db2<dbsid>. RC_AUDIT_IO_ERROR: Problem writing to db2uext2.NODExxxx for more detailed information. 43 44 45 46 48 49 90 91 92 93 101 102 104 110 180 August 2003 . It is generated in the Admin DB. Environment variable DB2DB6EKEY not set. Processing continues.NODExxxx File I/O seek error. Check your environment. Try to retrieve this parameter on the command line. Check the file system access authorizations. owner <sapsid>adm. Check error file db2uext2. group sapsys). Check error file db2uext2. If this error occurs. Check the file system access authorizations. On UNIX Check the file authorizations of /sapmnt/<SAPSID>/global (permission 700. owner <sapsid>adm. SQL warning occurred. SQL error occurred. It may be necessary to modify the environment variables DB2DB6_ARCHIVE_PATH and DB2DB6_RETRIEVE_PATH. Check the SQL code in DB2 Message Reference. Check your environment. Check error file db2uext2. Database management (DBM) parameter DIAGPATH is not set or could not be retrieved.err.err. Check error file db2uext2. Check your environment.err. Unable to read environment variable.err. Any log file to be archived by the DB2 User Exit is assigned a unique ID.Appendix B: Troubleshooting 41 Creating directory failed. Log file ID cannot be obtained.NODExxxx for more detailed information. group db<dbsid>adm) and /sapmnt/<SAPSID>/global/dscdb6.

in addition to the standard environment tracing switches.NODExxxx for more detailed information. and suggested corrective actions. The version and patch level of each program can be seen near the top of each protocol. However. VND000 to VND999 are back end library error messages. Check error file db2uext2. The vendor user exit program could not be started. contact SAP support. LFA100 to LFA999 are brarchive and brrestore error messages. Last backup timestamp could not be retrieved from the database recovery history file and could not be inserted in the Admin DB. No log file entry can be made in the Admin DB. make sure that you are using the most recent patch available in the SAP Service Marketplace at the Internet address service.err. for example. Check error file db2uext2. LFA000 to LFA099 are brarchive and brrestore warning messages. when called directly on the command line the protocol is by default only written to file and no output appears on the command line. Processing cannot continue. As mentioned above. August 2003 181 . ADM<DBSID> object creation failed. To override this.only warnings and errors.NODExxxx for more detailed information. • • • • brarchive and brrestore information messages have no numbers .com/patches. brarchive and brrestore also allow activation of tracing on the command line using parameter -DEB <level>. their texts.err. For detailed information. Check from the DB2 command line (CLP) whether a connection to ADM<DBSID> can be established. option -out must be included in the program call. Vendor user exit program error.NODExxxx for more detailed information. If not. 112 115 116 117 brarchive/brrestore Troubleshooting Checking the protocol output and corresponding corrective actions can solve most problems involving brarchive and brrestore. brarchive and brrestore Messages The following tables list brarchive and brrestore message IDs.Appendix B: Troubleshooting 111 Protocol database connect error.err. Check error file db2uext2. 1…9. If an application does not perform correctly. refer to the vendor user exit documentation.sap.

It is better to use the new syntax. Use option –help to see the syntax. LFA011 Use -d adsm to explicitly specify the device type. Use option – help to see the syntax. Use option –help to see the syntax. It is better to use the new syntax. LFA001 LFA002 LFA005 LFA006 LFA007 Although the program still supports this old command line option it may not in future releases. Although the program still supports this old command line option it may not in future releases. Option <OPTION><ARG> supported but archaic – Interpreted literally -d/-device not specified but tape implied. LFA010 Use -d tape to explicitly specify the device type. Use ssd. 182 August 2003 . LFA015 Use quotes for pattern. '*. Use the new syntax. Use option –help to see the syntax. Use <NEW OPTION>. A command line option was ignored because it is no longer valid syntax. for example. It is better to use the new syntax. <OLD> syntax supported but archaic. Use ss. Although the program still supports this old command line option it may not in future releases.SAR'. Although the program still supports this old command line option it may not in future releases. Unexpected pattern argument Comment Main action completed successfully but warnings were issued. -d/-device not specified but ADSM implied. See other messages for more information. -s with two devices and volumes supported but archaic. <OLD> syntax archaic and ignored. It is better to use the new syntax. It is better to use the new syntax. <OLD> option supported but archaic. Use new syntax. -sd with two devices and volumes supported but archaic. Use option –help to see the syntax. Use new syntax. Use option –help to see the syntax.Appendix B: Troubleshooting brarchive and brrestore Warning Messages ID LFA000 Message Action ended with warnings. LFA009 Although the program still supports this old command line option it may not in future releases.

Using adsm (default in the config table of the Admin database). LFA025 Use -d tape or -d adsm to explicitly specify the device type. Assuming 'help'. Look for the protocol file in the temporary directory set in environment variable DB2DB6_TEMP_DIR. Program finished before INSTHOME or db2<dbsid> home dir determined. File <FILE> could not be found for deletion. However. LFA023 Ensure that environment variable DB2DB6_TEMP_DIR is set for user db2<dbsid>. Device not specified or implied. The default value was changed to TSM in the Admin DB using the DB2 Control Center Extensions. This is a valid log file archiving tape but appears to be owned by a different SAP system. Protocol file will remain in temp dir. August 2003 183 . try to determine why the file was missing. Using tape. Using <DIRECTORY> for temporary files. Use -i force to force tape re-initialization for the current system. Specify an action option. Unable to change real user. Check installation and program authorizations.Appendix B: Troubleshooting LFA015 LFA021 No file pattern given No action specified on command line. Warning if no file pattern is given. LFA032 LFA034 LFA036 LFA037 Internal problem caused by an error. May result in errors. The default value is tape. Signal handling looping. Device not specified or implied. see Installing the Admin Tools Manually [Page 42]. Use option –checkonly of program sddb6ins to verify the installation. No action is necessary as the file would have been deleted anyway. ‘*’ will be used. Clean up may not be successful. See the syntax diagram that is displayed. LFA024 Use -d tape or -d adsm to explicitly specify the device type. LFA031 A file intended for deletion was not found. May cause other errors. Application may not be able to terminate properly. Tape is initialized but volume unknown to system. For more information on authorizations.

Could not delete backup timestamp entries (rc = <VALUE>). Check DB environment or permission to connect to the Admin DB. No backup timestamp entries found. Return without trying to connect to DB config parameter too long Unable to eject tape. check the DB2 Message Reference. Otherwise. If this causes concern.. Are the program ownership and permissions set correctly? XDB DB access function error (rc=<VALUE>). Check if db2start has been executed. Unable to remove old protocol entries from admin db. or dd. LFA042 Warning: No backups appear to have been performed to this target. cpio. Entries not found or internal error when accessing or deleting them. Unable to connect to admin db. Non-critical error.Appendix B: Troubleshooting LFA038 .6D only: Log files may not be displayed in transaction DB13. LFA047 LFA048 LFA051 LFA053 LFA070 Tape belongs to another system. check the database error files. Directory <DIR> cannot be written to. Only a problem if other messages reflect this. Value of the configuration parameter in table DB6CONFIG too long Tape must be ejected manually. Operation completed with warnings. LFA046 SAP Basis Release 4. contact SAP support. the tape header must be overwritten using operating system commands.. Tape has SID <SAPSID> and not <SAPSID> as expected! Action was successful but warnings occurred. tar. Check the protocol file for warning statements. LFA039 LFA040 Query may not be appropriate. Check the executable authorizations. If you are certain this tape is not needed. For the SQL return code. check the DB2 Message Reference. 184 August 2003 . LFA043 LFA044 Normally suggested in connection with another error or warning. LFA041 For the SQL return code. ls db started? (rc = <VALUE>) Query operation ended with warning. for example.

Too many actions on the command line. Check this variable in the user environment. The option <OPTION> is required for this action. Check and replace bad numeric argument value. Check and replace the bad string argument value. <OPTION> results in repeated or conflicting parameters. Use option –help to see the syntax. <OPTION> argument missing. Required argument is missing. Only one action option is permitted. If the problem is not clear. If the problem is not clear. brarchive and brrestore Error Messages ID LFA101 LFA102 LFA103 LFA104 Message Parameter <OPTION> unknown. LFA105 LFA106 LFA107 LFA108 LFA109 LFA110 LFA112 LFA113 August 2003 185 . It is no longer reliable. refer to the option documentation. Add the required option to the call. <VAL> “<VAL>”: Same device given twice. Use option –help to see the syntax. The option <OPTION> requires two arguments for this action. Do not repeat arguments on the command line. refer to the option documentation. Be careful that you have not used wild card characters interpreted by the shell. <OPTION> argument "<VALUE>" not OK. Check for repeating or conflicting options. Bad environment value ? <VARIABLE> = <VALUE This tape must be replaced as soon as possible. Comment Use option –help to see the syntax. <OPTION> argument "<VALUE>" not OK. Use option –help to see the syntax. –d ADSM or –d TAPE. Action not allowed for <PROGRAM>. for example. Use a shorter argument value. Action only allowed for <PROGRAM>. Use option –help to see the syntax. The action requires that the additional option be used. . Use option – help to see the syntax. Provide the correct number of arguments. LFA073 The environment variable value may be invalid.Appendix B: Troubleshooting LFA071 Tape # has been reused # times (>#) and should be replaced. <OPTION> argument "<VALUE>" too long.

see Configuration [Page 64]. Refer to other messages. Use option –help to see the syntax. Refer to other messages. Backend library function failed. Refer to other messages. Emergency restore failed. Transfer operation failed. LFA115 LFA120 Check the db2<dbsid> user environment. Please refer to new syntax. Error creating the file list for processing. If the cause is not clear. Query operation failed. Error initializing tape. Archive or restore operation failed. Library initialization failed.Appendix B: Troubleshooting LFA114 The option <OPTION><ARG> is 31Ispecific. <CONFIGURATION PARAMETER> parameter error. New tape label not set correctly. The option <OPTION><ARG> is not supported by <PROGRAM> Problem determining value of <ENVIRONMENT VARIABLE>. tape device and tape device class values using the DB2 Control Center Extensions. Application error. For more information. Use the new syntax. Error while getting tape label. Internal database call failed. Use option -help to see the syntax. Refer to other messages. Refer to other error messages. LFA132 LFA133 LFA134 Log-file delete failed. Admin-tool database error (rc = VALUE). Refer to other error messages. (ADG rc = <VALUE>) Unable to open backend session. Refer to other error messages. Refer to the DB2 Message Reference for an explanation of the SQL code. Most likely an error occurred opening the session with the backend library. The old syntax may no longer be supported in a later release. Refer to other error messages. Refer to other messages. Check the default. Emergency restore operation failed. Backend function error (rc = <VALUE>). Unable to initialize the tape. Query operation failed. Error while preparing list of files to process. VARIABLE> too long. Check value in control center. contact SAP support. Refer to other messages. LFA136 LFA137 LFA138 LFA141 LFA142 LFA143 LFA144 LFA145 186 August 2003 . LFA130 LFA131 Application error. LFA121 Check the db2<dbsid> user environment. Tape initialization failed. Unable to delete the file. Retry the operation. Refer to other error messages. Value of environment variable <ENV.

• LFA154 LFA155 Error preparing for operation. Delete on backend failed. <VALUE> is not a valid device. <sapsid>adm) of the program caller. For more information. Use option –check_only of the installation tool and check the installation documentation specifically for file authorizations. Refer to other messages. Refer to other error messages.Appendix B: Troubleshooting LFA146 LFA147 Unable to create file list. Use the –check_only option of the installation tool and check installation documentation specifically for file authorizations. Refer to other messages. see: • SAP Web Application Server Installation on UNIX: IBM DB2 Universal Database for UNIX and Windows SAP Web Application Server Installation on Windows: IBM DB2 Universal Database for UNIX and Windows. No files were successfully processed to completion. Check the Admin Tools installation. Check the user environment (db2<dbsid>. Refer to other error messages. Cannot access sap<sapsid>/db2<dbsid > data file. Action failed. Error prohibited file processing. LFA148 LFA149 Delete operation for an archived log file failed. August 2003 187 . Operation failed. Check the Admin Tools installation. Unable to determine value for <ENVIRONMENT VARIABLE>. Unable to load backend library. Unable to access an essential tool file. Retry operation. see : • SAP Web Application Server Installation on UNIX: IBM DB2 Universal Database for UNIX and Windows SAP Web Application Server Installation on Windows: IBM DB2 Universal Database for UNIX and Windows • LFA150 LFA151 LFA152 LFA153 Unable to initialize session info. Refer to other error messages. Check the command line parameters and arguments. Error creating the file list for processing. Unable to find or load brarchive or brrestore library. Library initialization failed. For more information.

Check the default. For more information on non-rewind address examples. Use -i force to force re-initialization of a current tape. Error getting/releasing lock: <FILE>. LFA157 LFA158 Internal error. Target directory unknown but should have been made available by the User Exit. Check that the correct tape being used. Only db2<dbsid> or <sapsid>adm users should start programs brarchive and brrestore. The tape is not known. 188 August 2003 . Use -i force. Unable to create file sub list. The tape is not initialized. Tape is initialized but volume is unreadable. Has User Exit been run? '-i set' not ok if tape already labeled. Tape <NUMBER> volume <LABEL> does not match command line value <LABEL>. If not. invalid or current tape. Tape <DEVICE> must be initialized first. Initialize with -i force. Use -i force to force initialization of a new. LFA159 LFA160 LFA161 LFA162 LFA163 LFA164 LFA165 The tape may be damaged or may have come from an incompatible system (Windows/UNIX). Default tape rewind and non-rewind addresses identical (<DEVICE>) Tape is not known to system.Appendix B: Troubleshooting LFA156 Not all files were successfully processed to completion. invalid or current tape. Use -i force to force initialization. No log_archive entry in Admin DB. tape device and tape device class values using the DB2 Control Center extensions. see brrestore Log File Retrieval Tool [Page 153]. brarchive or brrestore may already be running. Use -i force. Error prohibited some file processing. The label found on the referenced tape does not match the value specified with -v on the command line. delete the file and restart the program. Retry operation. Use –I set or -i force. LFA166 User is <USER> but should be <USER> or <USER>. Refer to other messages. The action -i set can only be used to initialize tapes that are out-of-date. The tape label is not a valid format. This error can also be caused by incorrectly performed upgrade. Check the User Exit protocols. Use -i force to force initialization of a new.

LFA168 Volume name <VOLUME> used on other tape. For more information. Tape not used and can therefore have no files. LFA170 Attempting to restore from the wrong tape? LFA171 See “Tape Management” in Indirect Archiving to Tape [Page 75]. LFA184 LFA188 August 2003 189 . Contact your system administrator. Either brarchive or brrestore is running elsewhere at the same time (wait for program to end) or a previous program call terminated unexpectedly (in this case delete <LOCK FILE>).Appendix B: Troubleshooting LFA167 Program is already running. Name already exists. Unable to load library <LIBRARY NAME>. If environment variable INSTHOME is not set. Check system resources. Use new name or reinitialize old tape. LFA169 Tape has not been initialized by brarchive. Check the file authorizations of <FILENAME>. A lock file is already present. System error that may result in incorrect program execution. Unable to determine home directory of <USER>. Must be registered in Control Center. LFA181 • LFA182 Delete failed for file <FILENAME>. Use option –check_only of the installation tool and check the installation documentation specifically for files and file authorizations. Set variable INSTHOME. Refer to other error messages. Initialize with –i set/force. errno = <VALUE>. Unable to find or load the brarchive or brrestore library. Check system memory resources and retry operation. Unable to set signal handler. If not. Name can only be reused if tape with this name is re-initialized. see: • SAP Web Application Server Installation on UNIX: IBM DB2 Universal Database for UNIX and Windows SAP Web Application Server Installation on Windows: IBM DB2 Universal Database for UNIX and Windows. Tape device <DEVICE> not known. Delete operation for the log file failed. the application attempts to determine the home directory of user db2<dbsid>. delete <LOCK FILE>. Check the Admin Tools installation. LFA180 System memory error. Unable to allocate memory. Tape not initialized or already used.

Error creating Admin DB backup file. Unexpected log file status. Internal error. LFA283 Internal error. If the problem is not resolved. Internal error. Contact SAP support.19920211152635. Internal error. Directory <dir> cannot be written to. Contact SAP support. See the output of the query for the correct format. Contact SAP support. Unexpected device. Internal error. Contact SAP support. Error deleting <TYPE> DB entry (rc = <VALUE>) Error retrieving <TYPE> DB entry (rc = <VALUE>) Error updating <TYPE> DB entry (rc = <VALUE>) Error creating <TYPE> DB entry (rc = <VALUE>) New entry already in DB (rc = <VALUE>) LFA200 LFA201 LFA202 LFA203 LFA240 LFA241 LFA242 LFA243 LFA244 LFA245 LFA280 LFA281 Internal error. Check the reason. Contact SAP support. 190 August 2003 .Appendix B: Troubleshooting LFA189 Unable to find file or directory <VALUE>. for example. Check installation using the check option of program sddb6ins. Internal error. No backup is known to the Admin DB. Get backup timestamp entries failed (rc = <VALUE>) Check backup timestamp is valid. Has the file been automatically deleted by TSM or moved manually? Check log file name is valid. S0000000. contact SAP. Contact SAP support. Contact SAP support. Internal error. Unexpected value. LFA282 Internal error. Wrong timestamp format or length. LFA190 LFA191 Log file <FILE> has wrong format. Refer to other message and check the existence of the item. Contact SAP support. Cannot allocate memory to extend the file list. Use: -q backups –out Unable to extend file list Add missing backups failed Unexpected action. Contact SAP support.NODE0000. Unexpected return code. Make sure that you performed a database backup when you activated database recovery. Check the command line device option. Internal error. LFA284 Internal error. Check the command line action option.

VND009 Check the file and directory authorizations. needed: <VALUE> MB. See also accompanying system error message VND180. the file may be damaged. Not enough disk space in <DIRECTORY>.Appendix B: Troubleshooting LFA285 Action <action> failed with <error_text> SQL Error: <SQL error text> Try to interpret the error text. Try to interpret the error text. the media may be damaged. If the problem persists. The original file size does not match the size of the file restored. If the problem persists. contact SAP support. If the meaning is not clear to you. Restore operation failed. You may be able to restore the file using the emergency restore option -ex. Available: <VALUE> MB. the media may be damaged. August 2003 191 . contact SAP support. LFA286 brarchive and brrestore Library Error Messages ID VND000 Message Environment variable <ENVIRONMENT VARIABLE> is not set. Compressed file systems may calculate the amount of space available wrongly. Note return code for SAP support. Error reading data from file <FILE> (rc = <VALUE>). Delete operation failed. File size mismatch for <FILE>. If the problem persists. Comment Check the db2<dbsid> user environment. VND001 Delete files or increase the size of the file system. VND004 Store operation failed. VND002 VND003 See previous error messages. If the meaning is not clear to you. Failed to save <FILE> (rc = <VALUE>)! Cannot continue… Failed to retrieve <FILE> (rc = <VALUE>)! Cannot continue… Failed to delete <FILE> (rc = <VALUE>)! Cannot continue… Error writing data to file <FILE> (rc = <VALUE>). Note the return code for SAP support. VND005 VND006 VND008 Check the file and directory authorizations. If the problem persists. <VALUE> on disk and <VALUE> kB on tape Unable to access list of files to be processed. the media may be damaged.

See other messages. See other messages. remove the write protection. System error. Label on volume in device <DEVICE> has the wrong format. Volume size limit reached no more log files will be processed. Error opening file <FILE> to be sent to/retrieved. If the problem persists. Check the backend version. Wrong volume <LABEL> in device <DEVICE>. the tape must now be full. contact SAP support. VND023 VND024 Check the tape or tape drive. Query <Value> is not supported by back-end library. Check that this entry matches the real tape size. Tape has to be initialized prior to usage. If the log file management tool was terminated. In both cases. VND012 Backend does not support the query. VND011 Check the file and directory authorizations. Volume in device <DEVICE> has no label. Command <Value> is not supported by back-end library.Appendix B: Troubleshooting VND010 Error closing file <VALUE> just sent to/retrieved. see other messages. VND026 If the tape should be written to. Check the backend version. delete file <FILE>. Tape needs initializing or may be damaged. Check the tape and device. VND021 VND022 Tape needs initializing. VND020 According to the tape device class tape entry -size in the DB2 Control Center. should be: <LABEL> Volume in device <DEVICE> is write protected! Volume label could not be written to <DEVICE>. Complete the (restart) operation with a new tape. Verify that brarchive is not already running for the same node or using the same device(s). 192 August 2003 . VND025 Put the correct tape in the drive or specify the correct label on the command line. VND027 VND028 Initialize the tape. Check the volume or device. VND013 Backend does not support the command. A temporary lock file is still present.

use the brarchive option -i force. Either brarchive or brrestore is running elsewhere at the same time (wait for program end) or a previous program call terminated unexpectedly (in this case delete the lock file). VND043 VND044 Check the TSM installation and configuration. Check the TSM installation and configuration. Check the TSM installation and configuration. Check the command line parameters and the version of the backend. ADSM mgmt class bind (<STRING>) failed! (FSname: <STRING> HL-name: <STRING> . should be <SAPSID>! Wrong tape number <#> in device <Device name>. Check the TSM installation and configuration.'G' or 'T' should directly follow volume size. Check the TSM installation and configuration.Appendix B: Troubleshooting VND029 Character 'K'. Look at the accompanying messages for return codes and TSM error messages. VND045 VND046 Error sending data to ADSM. Contact Tivoli support if necessary. Look at the accompanying messages for return codes and TSM error messages.LLname: <FILE>) Error starting ADSM transaction. To overwrite data on tape. VND030 A tape lock file is already present. Look at the accompanying messages for return codes and TSM error messages. Error sending object to ADSM. VND031 Tape is used by another SAP system. should be <#> Error registering ADSM file space '<FILE>' of Type '<String>’.'M'. Check the accompanying messages for return codes and TSM error messages. If not. Tape <Device name> is already in use. VND032 VND042 Check the TSM installation and configuration. Look at the accompanying messages for return codes and TSM error messages. Contact Tivoli support if necessary. The tape device class tape entry -size in the DB2 Control Center is incorrect. SAP-SID on tape is <SAPSID>. Contact Tivoli support if necessary. Contact Tivoli support if necessary. delete the lock file or look for error (<file name or error message>). Contact Tivoli support if necessary. Look at the accompanying messages for return codes and TSM error messages. August 2003 193 . Contact Tivoli support if necessary. VND047 Error ending process for sending object to ADSM.

Error getting object from ADSM <STRING> repository. Look at the accompanying messages for return codes and TSM error messages. Error starting data transfer from ADSM 'STRING' repository. Check the TSM installation and configuration. Look at the accompanying messages for return codes and TSM error messages. ADSM objects query found no match. Look at the accompanying messages for return codes and TSM error messages. Look at the accompanying messages for return codes and TSM error messages. Contact Tivoli support if necessary. Look at the accompanying messages for return codes and TSM error messages. Error starting ADSM <STRING> query. ADSM reason <No>: <String> ADSM error <No>: <String> Unable to load ADSM API DLL. Look at the accompanying messages for return codes and TSM error messages. Check the TSM installation and configuration. Contact Tivoli support if necessary. Check the TSM installation and configuration. No entries match the queries. TSM reason for an error TSM error number and description Check that TSM has been correctly installed. Contact Tivoli support if necessary. Check the TSM installation and configuration. Look at the accompanying messages for return codes and TSM error messages. VND053 VND054 VND055 VND056 VND059 VND060 VND061 VND062 194 August 2003 . Contact Tivoli support if necessary. Contact Tivoli support if necessary. Check the Admin Tools installation. Error during data transfer from ADSM. Look at the accompanying messages for return codes and TSM error messages. Client's API version is higher than the ADSM version Check the TSM installation and configuration. Error ending ADSM <STRING> query. Contact Tivoli support if necessary. VND049 VND050 VND051 VND052 Check the TSM installation and configuration. Error concluding object transfer from ADSM <STRING> repository.Appendix B: Troubleshooting VND048 Error ending ADSM transaction. Error concluding data transfer from ADSM <STRING> repository. Contact Tivoli support if necessary. See other messages. brarchive executables and library do not match. Contact Tivoli support if necessary. Check the TSM installation and configuration. Check the TSM installation and configuration.

Rewind of volume in device <DEVICE> failed. Check the file. Check if <FILE> is a directory. Delete files or increase the size of the file system. VND170 VND181 VND182 File already exists and will be overwritten. VND064 VND101 VND102 VND111 No matching files in TSM. VND149 VND150 See other error messages.Appendix B: Troubleshooting VND063 Client's ADSM API structures are incompatible/hav e changed File <FILE> not found in ADSM. Available: <VALUE> MB. Tape <DEVICE> should be a nonrewind address. brarchive executables and library do not match. see brrestore . Internal error. Refer to other error messages. See other error messages. Check the Admin Tools installation. File <FILE> does not exist. Refer to other error messages. Needed: <VALUE> MB <FILE> is not a directory. Check the tape and device. For more information on non-rewind address examples. Copying <FILE> to/from <LOCATION> failed due to previous errors. check if there is enough free space in the directory.Log File Retrieval Tool [Page 153]. Check the command line device name and DB2 Control Center configuration values. Use TSM tools to verify if files exist. Operation failed. File <FILE> already exists. … failed Internal library error. VND186 VND190 August 2003 195 . Space information on device <DEVICE>. Compressed file systems may calculate the amount of space available wrongly. Restore of <FILE> failed.

Check whether directory.. Error executing car. Switch to the specified directory and restart the installation. DB2HOME not found Cause Solution DB2 client application enabler (CAE) is not installed or an error occurred during Registry access. Menu does not appear Cause Solution The DB2 administration tools were probably not installed correctly. Directory does not exist Cause Solution Directory <directory> does not exist.. Contact SAP support.Appendix B: Troubleshooting DB2 Control Center Extensions Troubleshooting The following tables provide information on error messages from the DB2 Control Center installation program on Windows: Please change directory to <CDROM-drive>:\NT\I386\ADMIN and start again! Cause Solution The installation program was not started in the specified directory. Check whether directory <directory> exists.\sqllib\bin contains file sapdef.exe Cause Solution Program car could not be executed.dll and sddb6wfm. Install DB2 client application enabler (CAE).dll. Logon dialog is not displayed Cause Solution The DB2 administration tools were probably not installed correctly. one of the software components might not have been installed. If the directory is missing...dll.\sqllib\bin contains files sapact. Check whether directory. 196 August 2003 . Check that you can access the Registry and that there is a key software\IBM\DB2\DB2 Folder Name under HKEY_LOCAL_MACHINE.

log is created in your TEMP directory. db6algfl. Since DB2 Control Center Extensions are an extension of the DB2 Control Center.exe. you should mention the file name and location.exe.. August 2003 197 . When you create a problem message. Check whether directory.\sqllib\bin contains files sddb6wfm. db6algfl. a tool is provided that is described in SAP Note 83819.bat.exe. Collecting Diagnostic Information for SAP Support While processing issues reported to SAP support. db6aopt and db6ar3db. a special start script switches on tracing for the DB2 Control Center. To run the DB2 Control Center with the DB2 Control Center Extensions trace switched on. At present. the tool currently runs on UNIX systems only.dll. db6atape. To ease data collection.exe. A trace file called db6cc. Many of the data requested by SAP support for DB2 UDB for UNIX and Windows can be grouped together to form typical data sets. To speed up processing of reported issues in DB2 UDB for UNIX and Windows.. start it with script db2ccdebug. the data collecting tool can be run when the issue is sent to SAP. The data collected needs to be provided to SAP.Appendix B: Troubleshooting Dialog is not displayed Cause Solution The DB2 administration tools were probably not installed correctly. SAP support often needs data required for further investigation.exe. db6achpw.

This has the advantage that the Admin DB should continue to function even when the main SAP database is blocked by a file system containing log files that are becoming full. The most important tables in the Admin DB refer to log files and their locations. On occasion. it is essential that you understand the file states described in Log File States [Page 32]. Transaction logging is circular for the Admin DB. support personnel will ask database administrators to extract information from this database to assist in problem determination. The following graphic shows the Admin DB tables and their relationships. that is. LOGRETAIN and USEREXIT are set to OFF. However. but must not use this knowledge to change the system without an explicit request from SAP support. and administration action protocols. 198 August 2003 . To understand the log file information in the Admin DB. this is not strictly necessary as brarchive in archive mode also stores the essential parts of the database from which it can be rebuilt. or for customers directed by SAP support to perform specific operations. configuration parameters. It contains administration management data. Admin DB Structure Wrong use of this information may make the log file management tools fail or make it impossible to recover log files required to fully restore a database backup The Admin DB (or ADM<DBSID> database) is the core component of SAP DB2 administration. The Admin DB should require very little administrative attention.Appendix C: Implementation Details Appendix C: Implementation Details This appendix is only intended as a reference for SAP support personnel to assist with problem determination. The database administrator can decide whether to back up the database. Customers may wish to read this information for a better understanding of the tools and to inspect the system. This information is used in recovering archived files. Other tables record information such as tape volume management and Admin Tools protocol data.

August 2003 199 . the TSM server name. Relates each object to a database node if appropriate. DB6CONFIG OBJID (from DB6IDENTIFIER) DB6LOCATION LOCID (OBJID in DB6IDENTIFIER) DB6BACKUP OBJID (from DB6IDENTIFIER) DB6LOGFILE OBJID (from DB6IDENTIFIER) The OBJID key is not the log file number. use the DB2 DESCRIBE command. plus tape information. Contains Admin Tools configuration parameters. Contains imported backup information from the database recovery history file. These can normally only be set using the DB2 Control Center. Admin DB Tables Table Name DB6IDENTIFIER Key OBJID Description Unique identifier. Contains the locations of log files and backups.Appendix C: Implementation Details The following table describes the Admin DB tables shown in the graphic above. DB6LFSTATE OBJID (from DB6IDENTIFIER) + LOCID (from DB6LOCATION) Contains the location and state of each log file. together with their keys. for example. Contains information about log files. To see the complete structure of each table.

this is usually due to the DB6ACTION and especially the DB6ACTIONDETAIL tables. This can be determined by studying the contents of these tables. /dev/rmt0. for example. For example. enter the following SQL statement: SELECT * from sapr3. DLT Contains physical tape devices and related information. DB6DEVCLASS Name Contains tape device classes and related information.Appendix C: Implementation Details DB6TAPE OBJID (from DB6IDENTIFIER) Contains tape volume information. S0000456. 8mm. if a tool is looping or being called repeatedly due to an error situation. For example. these tables will fill very quickly. to list all location information.LOG is log file number 456.db6logfile_place 200 August 2003 . This view joins several tables and displays the information in a slightly more userfriendly way. Only recent versions of brarchive prune these tables automatically. These tables can become very large. • Admin DB size If the Admin DB is running out of space. This number is the number contained in the log file name.db6location. Contain the tool protocols used by DB2 Control Center Extensions. A convenient method of studying log file information is using the LOGFILE_PLACE view. so all table references in SQL statements must be qualified with this value. Contain temporary data used for internal communication. enter the following SQL statement: SELECT * from sapr3. for example. Alternatively. • Log file information view DB6LOGFILE_PLACE Log file numbers are stored in the integer column NAME in the DB6LOGFILE table. DB6TAPETOC OBJID (from DB6TAPE) + LFID (OBJID in DB6LOGFILE) Contains the position of log files on each tape (accelerates recovery). Make sure that the Admin Tools are up-todate. for example. DB6DEVICE Name DB6ACTION DB6ACTIONDETAIL DB6CACHE DB6MESSAGE Additional Notes and Troubleshooting Information • Schema The Admin DB tables are created with schema SAPR3 (even with MCOD systems).

For best User Exit performance. This view contains no node information. DB6BACKUP. If the User Exit has not yet been run before brarchive is called for the first time. the backup information will be missing and brarchive also generates an error. this table can be reset to the default values.Appendix C: Implementation Details The output can be limited by specifying a value or range for the NAME column (which contains the log file number). DB6LOGFILE. It may be necessary to prune the file occasionally. • Configuration table DB6CONFIG This table contains information to configure the Admin Tools. DB6LFSTATE. where the OBJID columns have the same value and NODE=’NODExxxx’ (replace xxxx with the node number). • Mirroring in Admin Tools Release 4. DB6CONFIG. This is used to mirror (duplicate) informative Admin DB information to the SAP database. all related rows will also automatically be deleted from the tables DB6LOGFILE. if you want to create the mirrored tables manually. August 2003 201 . do not attempt to create these tables using exactly the same structure as in the Admin DB. DB6TAPE. Each tape has two object IDs – one related to the DB6LOCATION table and one related to the DB6TAPE table. if you require node-specific information.6D There is an extra executable in Admin Tools releases up to 4.6D called sddb6mir. and DB6TAPETOC are set up with cascading deletes. and DB6TAPETOC. They all have no mirror flag column. You can also use SQL to update the entries directly. the User Exit will not be able to add this association. Normally it can only be updated using the DB2 Control Center Extensions. This information is used to associate log files with a backup. You can do this by using SQL to delete all related entries from the DB6IDENTIFIER table. Although this should not be necessary. In other words. DB6LFSTATE. If an entry is corrupt or lost. Be very careful only to delete the OBJIDs found in the configuration table DB6CONFIG and running sddb6ins -i. • Backup data in table DB6BACKUP The information in the DB6BACKUP table is extracted from the backup history file by the User Exit. If no backup is performed after the Admin Tools are installed. if an object in DB6IDENTIFIER that relates to a log file is deleted. There is no direct relationship joining these two objects. you must join this view with the DB6IDENTIFIER table. DB6LOCATION. In a multi-partitioned environment. it is also important that the backup history file is not too long. • Recursive deletion The relationships between tables DB6IDENTIFIER. The mirror contains most of the tables that the Admin DB contains but these tables have one column less.

which can be made available to vendors intending to provide a library interfacing to their archiving product. whose interface is not open. The interface is described in the SAP system header file vnddb6lfm.Appendix C: Implementation Details brarchive and brrestore backend Library Architecture brarchive and brrestore were designed with an open interface to separate log file management logic from the lower-level code responsible for archiving and restoring data. for example. The separation of logic permits the log file management applications to retain full control over the Admin DB. At the same time it permits storage product manufacturers to provide backend libraries that implement low-level file storage to their products. brarchive Admin DB brrestore LfmVndInterface tape library TSM library script library vendor library Tape TSM customer script backend backend 202 August 2003 .h. Tivoli Data Protection.

If this file exists. In the context menu of any SAP DB2 instance or database. supplementary menu options will be offered. stored procedure sddb6jds is called via JDBC. the corresponding SAP extension window appears. If any of these options is chosen. it will be loaded. It comprises the SAP extensions for the DB2 Control Center.zip.Appendix C: Implementation Details DB2 Control Center Extensions Architecture The DB2 Control Center Extensions make use of an open DB2 interface to add functions to the DB2 Control Center via additional menu options. Since all these operations are done on the server. Sddb6jds calls the Admin Tools and manages the Admin DB ADM<DBSID>. the user can perform several SAP DB2-specific administrative operations. From this window. These functions are implemented using the following architecture: The DB2 Control Center looks in directory sqllib/cc for a file called db2plug. August 2003 203 .

parameter definition can be continued on the next # # line.Appendix D: Example of File init<DBSID>. # # After any symbol. # # There can be any number of white spaces (blanks. # # # ######################################################################## # Log file archive directory # # default: /db2/<DBSID>/log_archive DB2DB6_ARCHIVE_PATH = /db2/Y1D/log_archive # Log file retrieve directory # # default: /db2/<DBSID>/log_retrieve DB2DB6_RETRIEVE_PATH = /db2/Y1D/log_retrieve # Temporary work directory # # default: /tmp DB2DB6_TEMP_DIR = /tmp # Standby directory # # default: no default # DB2DB6_STANDBY_DIR = # ignore errors on standby dir # # default: OFF # DB2DB6_STANDBY_DIR_NOERR = ON # if ON. brarchive copies Admin DB backup SAR file to STANDBY_DIR # # default: OFF # DB2DB6_STANDBY_DIR_ADMDBSAR = ON # Direct userexit archiving # # default: no default # DB2DB6_UEXIT_DIRECT = TSM:DEFAULT # Vendor userexit archiving # # default: no default # DB2DB6_VENDOR_UEXIT = # user exit archive without ADMDB # # default: OFF (new DB12 detected) DB2DB6_UEXIT_ARCHIVE_WO_DB = ON # user exit retrieve without ADMDB # # default: OFF # DB2DB6_UEXIT_RETRIEVE_WO_DB = ON # deactivate signal handling for SIGSEGV and SIGBUS # # default: OFF # DB2DB6_CORE = ON # done eject tape (same as -one) # # default: OFF 204 August 2003 .db6 Appendix D: Example of File init<DBSID>.db6 File init<DBSID>. the list # # items should be delimited by commas. # # A parameter value list should be enclosed in parentheses.db6 on UNIX The following is an example of an environment file under UNIX: ######################################################################## # # # SAP DB2 Universal DB for Unix/Windows Environment File # # # # Enclose parameter values which consist of more than one symbol in # # double quotes. tabs and new lines) # # between symbols for parameter definition.

if TSM LANFREE option should be used # # default: OFF # DB2DB6_TSM_MULTITHREADED = ON # TSM shared library # # default: libApiDS64.o) # DB2DB6_TSM_SLIB = libApiDS64.a(dsmapish_64.a(dsmapish_64.db6 # DB2DB6_NO_EJECT = ON # Script name for -d script # # default: no default # DB2DB6_LIBDB6SC_SCRIPT = # TSM multithread support is required.Appendix D: Example of File init<DBSID>.o) # Admin DB reorg frequency in days # # default: 7 # DB2DB6_ADMDB_REORG_FREQUENCY = 7 # Userexit Trace # DB2DB6_TRC_DB2UEXT2 = ON DB2DB6_TRC_DB2UEXT2_LEVEL = 3 DB2DB6_TRC_DB2UEXT2_PATH = /db2/Y1D/admintools/TraceFiles # Brarchive Trace # DB2DB6_TRC_BRARCHIVE = ON DB2DB6_TRC_BRARCHIVE_LEVEL = 3 DB2DB6_TRC_BRARCHIVE_PATH = /db2/Y1D/admintools/TraceFiles # Brrestore Trace # DB2DB6_TRC_BRRESTORE = ON DB2DB6_TRC_BRRESTORE_LEVEL = 3 DB2DB6_TRC_BRRESTORE_PATH = /db2/Y1D/admintools/TraceFiles # Stored Procedure Trace # DB2DB6_TRC_SDDB6JDS = ON DB2DB6_TRC_SDDB6JDS_LEVEL = 3 DB2DB6_TRC_SDDB6JDS_PATH = /db2/Y1D/admintools/TraceFiles # TSM Util Trace # DB2DB6_TRC_DB6ADUTL = ON DB2DB6_TRC_DB6ADUTL_LEVEL = 3 DB2DB6_TRC_DB6ADUTL_PATH = /db2/Y1D/admintools/TraceFiles ######################################################################## # End of Environment File # ######################################################################## August 2003 205 .

Appendix D: Example of File init<DBSID>. # # # ######################################################################## # Log file archive directory # # default: \<DSCDB6HOME>\log_archive<DBNAME> DB2DB6_ARCHIVE_PATH = \PFERD\log_archiveN2D # Log file retrieve directory # # default: \<DSCDB6HOME>\log_retrieve<DBNAME> DB2DB6_RETRIEVE_PATH = \PFERD\log_retrieveN2D # Temporary work directory # # default: c:\WINNT\TEMP DB2DB6_TEMP_DIR = C:\WINNT\TEMP # Standby directory # # default: no default # DB2DB6_STANDBY_DIR = # ignore errors on standby dir # # default: OFF # DB2DB6_STANDBY_DIR_NOERR = ON # if ON. # # There can be any number of white spaces (blanks. parameter definition can be continued on the next # # line. the list # # items should be delimited by commas. tabs and new lines) # # between symbols for parameter definition. if TSM LANFREE option should be used 206 August 2003 . brarchive copies Admin DB backup SAR file to STANDBY_DIR # # default: OFF # DB2DB6_STANDBY_DIR_ADMDBSAR = ON # Direct userexit archiving # # default: no default # DB2DB6_UEXIT_DIRECT = TSM:DEFAULT # Vendor userexit archiving # # default: no default # DB2DB6_VENDOR_UEXIT = # user exit archive without ADMDB # # default: OFF (new DB12 detected) DB2DB6_UEXIT_ARCHIVE_WO_DB = ON # user exit retrieve without ADMDB # # default: OFF # DB2DB6_UEXIT_RETRIEVE_WO_DB = ON # deactivate signal handling for SIGSEGV and SIGBUS # # default: OFF # DB2DB6_CORE = ON # done eject tape (same as -one) # # default: OFF # DB2DB6_NO_EJECT = ON # Script name for -d script # # default: no default # DB2DB6_LIBDB6SC_SCRIPT = # TSM multithread support is required.db6 on Windows The following is an example of an environment file on Windows: ######################################################################## # # # SAP DB2 Universal DB for Unix/Windows Environment File # # # # Enclose parameter values which consist of more than one symbol in # # double quotes. # # After any symbol.db6 File init<DBSID>. # # A parameter value list should be enclosed in parentheses.

Appendix D: Example of File init<DBSID>.dll # DB2DB6_TSM_SLIB = adsm32.dll.dll.adsmv3.adsmv3.dll # Admin DB reorg frequency in days # # default: 7 # DB2DB6_ADMDB_REORG_FREQUENCY = 7 # Userexit Trace # DB2DB6_TRC_DB2UEXT2 = ON DB2DB6_TRC_DB2UEXT2_LEVEL = 3 DB2DB6_TRC_DB2UEXT2_PATH = \PFERD\db2n2d\admintools\TraceFiles # Brarchive Trace # DB2DB6_TRC_BRARCHIVE = ON DB2DB6_TRC_BRARCHIVE_LEVEL = 3 DB2DB6_TRC_BRARCHIVE_PATH = \PFERD\db2n2d\admintools\TraceFiles # Brrestore Trace # DB2DB6_TRC_BRRESTORE = ON DB2DB6_TRC_BRRESTORE_LEVEL = 3 DB2DB6_TRC_BRRESTORE_PATH = \PFERD\db2n2d\admintools\TraceFiles # Stored Procedure Trace # DB2DB6_TRC_SDDB6JDS = ON DB2DB6_TRC_SDDB6JDS_LEVEL = 3 DB2DB6_TRC_SDDB6JDS_PATH = \PFERD\db2n2d\admintools\TraceFiles # TSM Util Trace # DB2DB6_TRC_DB6ADUTL = ON DB2DB6_TRC_DB6ADUTL_LEVEL = 3 DB2DB6_TRC_DB6ADUTL_PATH = \PFERD\db2n2d\admintools\TraceFiles ######################################################################## # End of Environment File # ########################################################## August 2003 207 .db6 # # default: OFF # DB2DB6_TSM_MULTITHREADED = ON # TSM shared library # # default: adsm32.

Also you can * # use os commands like cp.smp * # * # * # Sample script to be used with brarchive/brrestore -d script.out LANG=C export LANG #********************************************************************* # Arguments # action=$1 directory=$2 file=$3 #********************************************************************* # Messages # echo "action =$action" echo "directory=$directory" echo "file =$file" #********************************************************************* # Configuration section # mgmtclass=DEFAULT INIFILE=$INSTHOME/admintools/init$DB2DBDFT.db6 if [ ! -f $INIFILE ] then INIFILE=/usr/sap/$SAPSYSTEMNAME/SYS/global/init$DB2DBDFT. * # * # Attention: It is important to return LFMVND_RC_ERROR if the * # archive.Appendix E: Example of Customer Script db6sctsm. tar.smp Appendix E: Example of Customer Script db6sctsm..smp #!/bin/sh #********************************************************************* # * # SAP AG Walldorf / Germany * # Systeme. * # * # This sample script uses TSM (dsmc) to handle the log files. Anwendungen und Produkte in der Datenverarbeitung * # * # (C) Copyright SAP AG * # * # * # db6sctsm. retrieve or delete command failes! * # * # Arguments: * # action * # directory * # filename * # * # Returncodes * # LFMVND_STATUS_OK * # LFMVND_RC_ERROR * # LFMVND_COMMAND_NOT_SUPPORTED * # * #********************************************************************* #********************************************************************* # ReturnCodes # LFMVND_STATUS_OK=0 LFMVND_RC_ERROR=64 LFMVND_COMMAND_NOT_SUPPORTED=71 #********************************************************************* # Variables # res=$LFMVND_RC_ERROR outfile=/tmp/dsmc$$. .. . * # Instead of dsmc you can use your own commands.db6 fi #********************************************************************* 208 August 2003 .

*\[Sent\]' $outfile` if [ "$G" = "" ] then res=$LFMVND_RC_ERROR fi ..*\[Done\]' $outfile` if [ "$G" = "" ] then res=$LFMVND_RC_ERROR fi . #********************************************************************* # This section retrieves the logfile from the archive # "RETRIEVE") $DSM_DIR/dsmc retrieve -replace=yes $arch_path/$file $directory/$file | tee $outfile G=`grep 'Retrieving..Appendix E: Example of Customer Script db6sctsm.*finished without failure' $outfile` if [ "$G" = "" ] then res=$LFMVND_RC_ERROR fi . #********************************************************************* # This section delete the logfile in the archive # "DELETE") $DSM_DIR/dsmc delete archive -noprompt $arch_path/$file | tee $outfile G=`grep 'Archive Delete. esac echo "rc =$res" rm -f $outfile exit $res August 2003 209 .smp # Path to put the retrieved logfile # arch_path=`grep DB2DB6_ARCHIVE_PATH $INIFILE | cut -f 2 -d =`/$DB2DBDFT/ case "$action" in #********************************************************************* # This section puts the logfile to the archive # "ARCHIVE") $DSM_DIR/dsmc archive -archmc=$mgmtclass -description='Log file' -compressa=yes $directory/$file | tee $outfile G=`grep 'Archive processing of... #********************************************************************* # *) echo "ERROR: action $action not supported" res=$LFMVND_COMMAND_NOT_SUPPORTED .

for example. Application Building Guide Application Development Guide CLI Guide and Reference 210 August 2003 . auditing. Provides environment setup information and step-by-step instructions about how to compile. Administration Guide: Implementation provides information on implementation issues such as implementing your design. accessing databases. Administration Guide: Performance provides information on database environment and application performance evaluation and tuning. a callable SQL interface that is compatible with the Microsoft ODBC specification. there are separate Quick Beginnings books for DB2 on platforms based on Windows and UNIX. DB2 installation and configuration information These books are for DB2 on a specific platform. and UNIX platforms.com/db2. writing user-defined functions. link.ibm. and run DB2 applications on Windows.Appendix F: References Appendix F: References DB2 UDB for UNIX and Windows V7 . using triggers. backup and recovery. Administrative API Reference Describes the DB2 application programming interfaces (APIs) and data structures that you can use to manage your databases. OS/2. Discussion topics include writing stored procedures. creating user-defined types. and developing applications in partitioned environments or with federated systems. Explains how to develop applications that access DB2 databases using embedded SQL or Java (JDBC and SQLJ). information about design issues (such as logical and physical database design). All manuals listed in the following table are available at the Internet address www. and information on high availability. Name Administration Guide Description Administration Guide: Planning provides an overview of database concepts.Additional Documentation The following table divides the DB2 books into two categories: • • DB2 guide and reference information These books contain the common DB2 information for all platforms.software. Explains how to develop applications that access DB2 databases using the DB2 Call Level Interface. This book also explains how to call APIs from your applications.

Provides planning. This book explains how to use the information to understand database activity. and configuration information for DB2 Universal Database on Windows 32-bit operating systems. installation. This book also contains installation and setup information for many supported clients. migration. installation. Describes SQL syntax. and use diagnostic tools in consultation with DB2 Customer Service. and enhancements in DB2 UDB for UNIX and Windows Version 7. Describes how to collect different kinds of information about databases and the database manager. Data Movement Utilities Guide and Reference Message Reference SQL Getting Started SQL Reference. and configuration information for DB2 Enterprise . that facilitate the movement of data. Describes the new features. installation. recover from problems. Provides planning. This book also contains installation and setup information for many supported clients. installation. functions. Helps you determine the source of errors. export. and configuration information for DB2 Enterprise .Extended Edition on UNIX platforms. and catalog views. Provides planning. This book also includes information about releaseto-release incompatibilities.Extended Edition for Windows 32-bit operating systems. Lists messages and codes issued by DB2. product limits. semantics.Appendix F: References Command Reference Explains how to use the command line processor and describes the DB2 commands that you can use to manage your database. This book also contains installation and setup information for many supported clients. Volume 1 and Volume 2 System Monitor Guide and Reference Troubleshooting Guide What’s New DB2 Enterprise – Extended Edition for UNIX Quick Beginnings DB2 Enterprise – Extended Edition for Windows Quick Beginnings DB2 for UNIX Quick Beginnings DB2 for Windows Quick Beginnings August 2003 211 . and DPROP. Explains how to use DB2 utilities. improve performance. load. This book also contains installation and setup information for many supported clients. and configuration information for DB2 Universal Database on UNIX platforms. such as import. Introduces SQL concepts and provides examples for many constructs and tasks. and the Data Warehouse Center. and describes the actions you should take. migration. Provides planning. AutoLoader. and the rules of the language. and determine the cause of problems. the Information Catalog Manager.

information about design issues (such as logical and physical database design). Programming Client Applications and Programming Server Applications CLI Guide and Reference Volume 1 and Volume 2 Command Reference Data Movement Utilities Guide and Reference Message Reference 212 August 2003 . This book also explains how to call APIs from your applications. a callable SQL interface that is compatible with the Microsoft ODBC specification. and DPROP. load. Administration Guide: Performance provides information on database environment and application performance evaluation and tuning. Discussion topics include writing stored procedure.ibm. Name Administration Guide Description Administration Guide: Planning provides an overview of database concepts. backup and recovery. using triggers. Explains how to use DB2 utilities. Explains how to develop applications that access DB2 databases using embedded SQL or Java (JDBC and SQLJ). auditing. such as import.Additional Documentation All manuals listed in the following table are available at the Internet address software. AutoLoader. and information on high availability. and the Data Warehouse Center. Application Development Guide: Building and Running Applications Application Development Guide. link.Appendix F: References DB2 UDB for UNIX and Windows V8 . that facilitate the movement of data. Explains how to develop applications that access DB2 databases using the DB2 Call Level Interface. Explains how to use the command line processor and describes the DB2 commands that you can use to manage your database. Administration Guide: Implementation provides information on implementation issues such as implementing your design. Administrative API Reference Describes the DB2 application programming interfaces (APIs) and data structures that you can use to manage your databases. creating user-defined types. Provides environment setup information and step-by-step instructions about how to compile. and run DB2 applications on Windows.com/db2. and developing applications in partitioned environments or with federated systems. and UNIX platforms. OS/2. accessing databases. and describes the actions you should take. writing user-defined functions. Lists messages and codes issued by DB2. the Information Catalog Manager. export.

and determine the cause of problems. migration. and catalog views. installation. and the rules of the language. and configuration information for DB2 Universal Database servers. and configuration information for DB2 Universal Database client. Provides planning. Describes how to collect different kinds of information about databases and the database manager. Provides planning. Describes the new features. product limits. and enhancements in DB2 UDB for UNIX and Windows Version 8. installation. improve performance. migration. What’s New Quick Beginnings for DB2 Servers Quick Beginnings for DB2 Clients August 2003 213 . functions. Describes SQL syntax. This book also includes information about releaseto-release incompatibilities.Appendix F: References SQL Getting Started SQL Reference. semantics. Volume 1 and Volume 2 System Monitor Guide and Reference Introduces SQL concepts and provides examples for many constructs and tasks. This book explains how to use the information to understand database activity.

Make sure that you observe lower and upper case! Additionally. sap<sapsid>) and directory names are affected. If you are unable to find an appropriate link for a topic in this documentation.6D and higher. sapr3. Admin Tools Refers to the SAP DB2 administration tools described in this documentation. The new terms are valid for SAP systems with Release 4. ADSM 214 August 2003 . If appropriate. Admin Database Admin DB Refers to the database associated with the log file management tools. They are explained in more detail in Admin Tools: Enhancements and Changes [Page 11]. The former SAP database name <SID> or <sid> changes to <DBSID> or <dbsid>. <sapsid>adm. The changes are as follows: • • The former SAP system ID <SID> or <sid> changes to <SAPSID> or <sapsid>.Glossary and Index Glossary and Index This glossary defines terms used in this documentation or terms often used by support personnel in connection with the Admin Tools. it is necessary to differentiate between SAP system IDs and SAP database names. The Admin DB has the name ADM<DBSID>. Term <DBSID> and <dbsid> (SAP database name) <SAPSID> and <sapsid> (SAP system ID) Description Refer to “<SAPSID> and <sapsid>” in this table. see Naming Conventions [Page 10]. The IDs and the SAP database names are case-sensitive. refer to the table of contents or the DB2 documentation. With the introduction of MCOD systems. This is separate from the SAP system database <DBSID> but part of the same database manager instance db2<dbsid>. user IDs (db2<dbsid>. The IBM storage product ADSM has been renamed to TSM (Tivoli Storage Manager). which describe the term in more detail. it also includes links to other parts of this documentation. For more information.

Glossary and Index archiving archival Refers to the movement or copying of a file to other longerterm storage. See the term User Exit for an example. TSM or a vendor product Refers to the action of storing the database in a form. Not to be confused with backup. Refer to SAP DB2 Control Center Extensions.db6 log directory log file August 2003 215 . see Actions Performed by the sddb6ins Program [Page 48] and Appendix D: Example of File init<dbsid>db6 [Page 204]. DB2 product offering a graphical interface used to administer databases. Refers to the DB2 software controlling a database instance and its databases. Product name and refers to IBM DB2 UDB Enterprise Server Edition. For more information. File init<DBSID>. usually /db2/<DBSID>/log_dir/NODExxxx. It is defined in the ini file as DB2DB6_ARCHIVE_PATH. backend backup DB2 Control Center DB2 Control Center Extensions DB2 Database Manager ESE ini file init<DBSID>. Refers to the target used to archive files to. archive directory Refers to the directory where brarchive stores log files. Refers to a file generated by DB2 to keep track of changes made to the database. usually /db2/<DBSID>/log_archive. This is a DB parameter (db cfg) defined as “Path to log files”. which will allow it to be recovered (restored) later. For more information. Offers extra functions when used with the SAP DB2 Control Center Extensions. such as tape. see Naming Conventions [Page 10]. The opposite of retrieving. with the assumption that the file is less likely to be lost there in case of system failure.db6 contains environment variables used by the Admin Tools for tasks such as turning on tracing. for recovery purposes. Refers to the directory where DB2 stores log files.

This means that you can install an additional SAP system into an existing database. which indicates what the tool has done and contains any results or errors. such as one of the Admin Tools. Refers to the action of restoring the database from a backup. This will often require a database rollforward afterwards. Contents are set using the dscdb6up utility. see the SAP Service Marketplace at the Internet address www. The Admin Tools have been modified to support this SAP system feature. This may be done after a system failure or in order to generate a database copy.com/platforms and choose Multiple Components in One Database (MCOD). For more information on released platforms and availability.conf containing encrypted passwords.Glossary and Index log file management tools The term log file management tools refers to components of the Admin Tools that perform log file management tasks: • • • • • • • • brarchive brrestore db2uext2 (User Exit) db6adutl libdb6ds (brarchive/brrestore library) libdb6tp (brarchive/brrestore library) libdb6sc (brarchive/brrestore library) sddb6mir (4.sap. Refers to a file generated by an application.6D Admin Tools only) mirror Has two meanings depending on the context: • • A copy of the Admin DB tables mirrored in the SAP database A copy of the entire SAP database. For more information. For more information. password file Refers to file dscdb6.service. protocol file restore 216 August 2003 . often on a neighboring machine Multiple Components in One Database (MCOD) Multiple Components in One Database is referred to as MCOD. see Setting and Updating Passwords [Page 108]. see Admin Tools: Enhancements and Changes [Page 11].

Executable db2uext2. Not to be confused with restore.Glossary and Index retrieving retrieval Refers to the movement or copying of a file back to disk from longer-term storage. or directly to TSM. Refers to the directory where brrestore stores log files. retrieve directory rollforward SAP DB2 Control Center Extensions TSM User Exit August 2003 217 . This is normally only necessary after a system failure. It is defined in the ini file as DB2DB6_RETRIEVE_PATH. For more information. usually /db2/<DBSID>/log_retrieve. For more information. For more information. which is the opposite of archiving. See the term User Exit for an example. see Installation and Setup of the DB2 Control Center Extensions [Page 55]. see SAP Log File Management [Page 23]. This information is added to a database after a restore operation in order to bring it up to date. see Naming Conventions [Page 10]. Refers to the extraction of database transaction data from log files. Refer to the DB2 documentation in Appendix F: References [Page 210]. The IBM storage product ADSM has been renamed to TSM (Tivoli Storage Manager). Used directly by DB2 to archive log files out of the log directory to either the archive directory. Product installed together with the Admin Tools. Also used by DB2 to retrieve log files in order to perform rollforward operations after a database restore operation. which extends the functionality of the DB2 Control Center to perform SAP-specific database administration tasks.