Db2 Unix Windows
Db2 Unix Windows
®
SAP on IBM DB2
Universal Database
for UNIX and
Windows
No part of this publication may be reproduced or transmitted in any SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and
form or for any purpose without the express permission of SAP AG. other SAP products and services mentioned herein as well as their
The information contained herein may be changed without prior respective logos are trademarks or registered trademarks of SAP AG
notice. in Germany and in several other countries all over the world. All other
product and service names mentioned are the trademarks of their
Some software products marketed by SAP AG and its distributors respective companies. Data contained in this document serves
contain proprietary software components of other software vendors. informational purposes only. National product specifications may
vary.
Microsoft, Windows, Outlook, and PowerPoint are registered
trademarks of Microsoft Corporation. These materials are subject to change without notice. These materials
are provided by SAP AG and its affiliated companies ("SAP Group")
IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, for informational purposes only, without representation or warranty of
MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, any kind, and SAP Group shall not be liable for errors or
xSeries, zSeries, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, omissions with respect to the materials. The only warranties for SAP
Tivoli, and Informix are trademarks or registered trademarks of IBM Group products and services are those that are set forth in the express
Corporation in the United States and/or other countries. warranty statements accompanying such products and services, if any.
Nothing herein should be construed as constituting an additional
Oracle is a registered trademark of Oracle Corporation. warranty.
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the SAP Library document classification: PUBLIC
Open Group.
Disclaimer
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, Some components of this product are based on Java™. Any code
VideoFrame, and MultiWin are trademarks or registered trademarks of change in these components may cause unpredictable and severe
Citrix Systems, Inc. malfunctions and is therefore expressively prohibited, as is any
decompilation of these components.
HTML, XML, XHTML and W3C are trademarks or registered
trademarks of W3C®, World Wide Web Consortium, Massachusetts Any Java™ Source Code delivered with this product is only to be used
Institute of Technology. by SAP’s Support Services and may not be modified or altered in any
way.
Java is a registered trademark of Sun Microsystems, Inc.
JavaScript is a registered trademark of Sun Microsystems, Inc., used Documentation in the SAP Service Marketplace
under license for technology invented and implemented by Netscape. You can find this documentation at the following Internet address:
service.sap.com/instguides
and copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in
royalty-free license to use the STLport.org C++ library software and its documentation for any purpose is
(STLport) and its documentation without fee. hereby granted without fee, provided that the above
b. By downloading, using, or copying STLport or any portion copyright notice appear in all copies and that both that
thereof Customer agrees to abide by the intellectual property copyright notice and this permission notice appear in
laws, and to all of the terms and conditions of this supporting documentation. Silicon Graphics makes no
c. The Customer may distribute binaries compiled with any purpose. It is provided "as is" without express or
royalties or restrictions.
d. Customer shall maintain the following copyright and Permission to use, copy, modify, distribute and sell this
permission notices on STLport sources and its software and its documentation for any purpose is
documentation unchanged: hereby granted without fee, provided that the above
Copyright 2001 SAP AG copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in
supporting documentation. Moscow Center for SPARC
Technology makes no representations about the 3. Exclusion of warranty
suitability of this software for any purpose. It is As the STLport is transferred to the Customer on a loan basis and
provided "as is" without express or implied warranty. free of charge, SAP cannot guarantee that the STLport is error-
free, without material defects or suitable for a specific application
Boris Fomitchev makes no representations about the under third-party rights. Technical data, sales brochures,
suitability of this software for any purpose. This advertising text and quality descriptions produced by SAP do not
material is provided "as is", with absolutely no indicate any assurance of particular attributes.
warranty expressed or implied. Any use is at your own 4. Limited Liability
risk. Permission to use or copy this software for any a. Irrespective of the legal reasons, SAP shall only be liable for
purpose is hereby granted without fee, provided the damage, including unauthorized operation, if this (i) can be
above notices are retained on all copies. Permission to compensated under the Product Liability Act or (ii) if caused
modify the code and to distribute modified code is due to gross negligence or intent by SAP or (iii) if based on
granted, provided the above notices are retained, and a the failure of a guaranteed attribute.
notice that the code was modified is included with the b. If SAP is liable for gross negligence or intent caused by
above copyright notice. employees who are neither agents or managerial employees
of SAP, the total liability for such damage and a maximum
Permission to use, copy, modify, distribute and sell this limit on the scope of any such damage shall depend on the
software and its documentation for any purpose is extent to which its occurrence ought to have anticipated by
hereby granted without fee, provided that the above SAP when concluding the contract, due to the circumstances
copyright notice appear in all copies and that both that known to it at that point in time representing a typical
copyright notice and this permission notice appear in transfer of the software.
supporting documentation. SAP makes no c. In the case of Art. 4.2 above, SAP shall not be liable for
representations about the suitability of this software for indirect damage, consequential damage caused by a defect or
any purpose. It is provided with a limited warranty and lost profit.
liability as set forth in the License Agreement d. SAP and the Customer agree that the typical foreseeable
distributed with this copy. SAP offers this liability and extent of damage shall under no circumstances exceed EUR
warranty obligations only towards its customers and 5,000.
only referring to its modifications. e. The Customer shall take adequate measures for the
protection of data and programs, in particular by making
2. Support and Maintenance backup copies at the minimum intervals recommended by
SAP does not provide software maintenance for the STLport. SAP. SAP shall not be liable for the loss of data and its
Software maintenance of the STLport therefore shall be not recovery, notwithstanding the other limitations of the present
included. Art. 4 if this loss could have been avoided by observing this
All other services shall be charged according to the rates for obligation.
services quoted in the SAP List of Prices and Conditions and f. The exclusion or the limitation of claims in accordance with
shall be subject to a separate contract. the present Art. 4 includes claims against employees or
agents of SAP.
Typographic Conventions Icons
Type Style Description
Icon Meaning
Example Text Words or characters quoted
Caution
from the screen. These include
field names, screen titles,
pushbuttons labels, menu Example
names, menu paths, and menu
options. Note
Cross-references to other
documentation Recommendation
6 July 2006
3.3.7 Special Configurations ................................................................................................57
3.3.8 Enabling the Database for Rollforward Recovery.......................................................57
3.3.8.1 Enabling Rollforward Recovery for a Single-Partitioned Database ......................58
3.3.8.2 Enabling Rollforward Recovery for a Multi-Partitioned Database.........................59
3.3.9 Deinstalling the Admin Tools ......................................................................................60
3.4 Installation and Setup of the DB2 Control Center Extensions ......... 60
3.4.1 Installation of the DB2 Control Center ........................................................................61
3.4.2 Installing the DB2 Control Center Extensions ............................................................61
3.4.3 Setting Up the DB2 Control Center.............................................................................62
3.4.4 Using the DB2 Control Center Extensions .................................................................69
4 Configuration.....................................................................................70
4.1 Changing the Admin Tools Configuration ......................................... 70
4.1.1 Parameters Affecting Log File Management Storage.................................................70
4.1.2 Configuring the Admin Tools Using Environment Files ..............................................73
4.2 Configuring the System for Archiving Log Files ............................... 78
4.2.1 Archiving Directly to TSM ...........................................................................................80
4.2.2 Archiving Directly to Disk ............................................................................................81
4.2.3 Archiving to an Alternative Storage Management Product.........................................82
4.2.4 Indirect Archiving to Tape ...........................................................................................82
4.2.5 Indirect Archiving to TSM............................................................................................88
4.2.6 Indirect Archiving Using a Customer Script ................................................................89
4.3 Configuring TSM (Tivoli Storage Management)................................. 90
4.3.1 Configuring TSM Files dsm.opt and dsm.sys .............................................................91
4.3.2 Configuring TSM Environment Variables....................................................................92
4.3.3 Configuration Considerations .....................................................................................94
4.4 DB2 Configuration Parameters ........................................................... 95
4.5 Disk Space Considerations for Running the Admin Tools ............... 96
5 Regular Administration ....................................................................98
5.1 DB2 Log File Management .................................................................. 98
5.1.1 Archiving Log Files from Disk to Backend ..................................................................98
5.1.2 Deleting Log Files .....................................................................................................101
5.2 Storage Management ......................................................................... 103
5.2.1 Checking the Space Available in a File System .......................................................104
5.2.2 Checking the Space Available in a Tablespace .......................................................104
5.2.3 Checking the Size of Tables and Indexes ................................................................106
5.3 Performance Monitoring.................................................................... 107
5.3.1 Monitoring Database Performance ...........................................................................107
5.3.2 Monitoring Dynamic SQL Statements.......................................................................109
5.3.3 Updating Statistics for Database Tables and Checking for Reorganization.............109
5.3.4 Job Monitoring ..........................................................................................................110
5.4 Database Backup ............................................................................... 110
5.4.1 Backup Considerations.............................................................................................111
5.4.2 Performing the Backup .............................................................................................111
5.4.3 Integrity of Backups ..................................................................................................113
5.4.4 Frequency of Backups and Time Required ..............................................................113
5.4.5 Advanced Backup Techniques .................................................................................114
6 Advanced Tasks..............................................................................115
6.1 The db6util Tool.................................................................................. 115
6.2 Setting and Updating Passwords ..................................................... 116
6.3 Using the Journal in the DB2 Control Center Extensions .............. 116
July 2006 7
6.4 Advanced Log File Management Tasks ........................................... 117
6.4.1 Deleting Special Log Files ........................................................................................118
6.4.2 Deleting Tapes from the Admin DB ..........................................................................120
6.5 Reorganization of Tables and Tablespaces ..................................... 120
6.6 Redirected Restore ............................................................................ 122
6.6.1 Usage of Tool brdb6brt .............................................................................................123
6.7 Command Line Tasks Using db6clp................................................. 128
6.8 Monitoring Database Alerts............................................................... 130
6.9 Monitoring Lock Waits and Deadlocks............................................. 130
6.10 Managing Backups and Logs Archived on TSM............................ 131
6.11 The db2inidb Tool ............................................................................ 132
6.11.1 db2inidb Option: as mirror ......................................................................................133
6.11.2 db2inidb Option: as snapshot .................................................................................136
6.11.3 db2inidb Option: as standby for Backups ...............................................................138
6.11.4 db2inidb Option: as standby for Hot-Standby Database ........................................139
6.12 Dual Logging .................................................................................... 145
6.13 Adjusting the Content of the Admin DB ......................................... 145
7 Emergency Tasks............................................................................147
7.1 SAP Database Recovery.................................................................... 147
7.2 Log File Restore of the SAP Database ............................................. 148
7.3 Recovery of the Admin DB ................................................................ 153
7.3.1 General Information ..................................................................................................153
7.3.2 Recovery Process.....................................................................................................154
Appendix A: Tool Command Line Parameters................................157
brarchive - Log File Archive Tool............................................................ 157
brdb6brt - Redirected Restore Tool ........................................................ 160
brrestore - Log File Retrieval Tool .......................................................... 164
db2uext2 - DB2 User Exit......................................................................... 167
db6adutl - SAP TSM Management Tool.................................................. 168
db6util - Tool to Assist Database Administration.................................. 169
dmdb6bkp - Database Backup Tool........................................................ 170
dmdb6srp - Update Statistics Tool ......................................................... 172
dmdb6rts - Table Reorganization Tool ................................................... 173
sddb6ins - Admin Tools Installation Program ....................................... 174
sddb6mir - Admin DB Creation and Mirror Tool Utility ......................... 176
Appendix B: Troubleshooting...........................................................177
DB2 Traces ............................................................................................... 177
DB2 Trace Facility db2trc...................................................................................................177
DB2 CLI Trace ...................................................................................................................178
Admin Tools Traces ................................................................................. 179
Downloading Admin Tool Patches from SAP Service Marketplace ..................................180
Troubleshooting Admin Tools and Programs ....................................... 182
General Troubleshooting Comments.................................................................................182
Initial Troubleshooting Steps..............................................................................................183
Installation (sddb6ins) Troubleshooting .............................................................................183
User Exit Troubleshooting..................................................................................................184
8 July 2006
brarchive/brrestore Troubleshooting..................................................................................189
DB2 Control Center Extensions Troubleshooting..............................................................204
Collecting Diagnostic Information for SAP Support ...........................................................205
Appendix C: Implementation Details................................................206
Admin DB Structure ................................................................................. 206
brarchive and brrestore backend Library Architecture.......................................................210
DB2 Control Center Extensions Architecture........................................ 211
Appendix D: Example of File init<DBSID>.db6 ...............................212
File init<DBSID>.db6 on UNIX ................................................................. 212
File init<DBSID>.db6 on Windows .......................................................... 215
Appendix E: Example of Customer Script db6sctsm.smp.............221
Appendix F: References ....................................................................223
DB2 UDB for UNIX and Windows V7 - Additional Documentation ....... 223
DB2 UDB for UNIX and Windows V8 - Additional Documentation ....... 225
Glossary and Index ............................................................................227
July 2006 9
1 Introduction
10 July 2006
1.1.2 How this Documentation is Structured
This documentation is divided into the following sections:
Chapters
...
1. Introduction
Provides general information about the guide, its targeted audience, interfaces, naming
conventions and new features.
2. Basic Concepts
Describes administration and Admin Tools and the related concepts, including DB2
UDB-specific information about installing and configuring servers and clients for the
SAP system.
3. Installation and Setup
Explains how to install Admin Tool patches and deal with upgrades. It also covers
manual (re)installation of the tools if required.
4. Configuration
Describes the available options and steps required to configure the Admin Tools.
5. Regular Administration
Lists and describes tasks that system administrators need to perform on a regular
basis such as storage administration, backup and log file management.
6. Advanced Tasks
Covers one-time or rarely needed tasks not related to configuration. Some tasks may
be prerequisites for other day-to-day tasks, which must be performed before log files
can be stored to tape.
Also includes monitoring and performance considerations.
7. Emergency Tasks
Tasks that administrators may need to perform after a database failure.
Appendices
A. Tool Command Line Parameters
Contains detailed command line syntax for each command.
B. Troubleshooting
Describes what to do when tools do not work as expected.
C. Implementation Details
Contains internal tool information, especially for support personnel.
D. Example of the File init<DBSID>.db6
E. Example of Customer Script db6sctsm.smp
F. References
G Glossary and Index
July 2006 11
1.2 Naming Conventions
Terminology
For information about terminology used in this documentation, see Glossary and
Index [Page 227].
Product Names
In this documentation the following naming conventions apply:
SAP Web Application Server / SAP system
SAP Web Application Server is referred to as SAP Web AS or SAP system. Additionally the
term SAP system also refers to other applications of mySAP.com.
IBM DB2 Universal Database for UNIX and Windows
IBM DB2 Universal Database for UNIX and Windows is referred to as DB2 UDB for UNIX and
Windows or DB2.
IBM DB2 Universal Database Enterprise Server Edition for UNIX and Windows
IBM DB2 Universal Database Enterprise Server Edition for UNIX and Windows is referred to
as DB2 UDB ESE for UNIX and Windows
single-partitioned system / EE system
The term single-partitioned system replaces the term EE system.
multi-partitioned system / EEE system
The term multi-partitioned system replaces the term EEE system.
6.NN Admin Tools / 6.10 Admin Tools
The term 6.NN Admin Tools replaces the term 6.10 Admin Tools, as these Admin Tools can
be used for any SAP system release starting from 6.10 and higher.
Tivoli Storage Management (TSM) / ADSM
The IBM storage product ADSM has been renamed to TSM (Tivoli Storage Manager) in the
most recent versions. The names are often used interchangeably, but in this documentation
the product is referred to as TSM. The term ADSM is normally only used in this guide to
indicate program parameters or configuration parameter names.
Tivoli (IBM) no longer supports the product ADSM. Customers still using ADSM
are strongly advised to upgrade to TSM Client Version 4.1 or higher.
Serious problems have occurred when using the Admin Tools with TSM Version
3.7. This version is also out of service now, so an upgrade is also strongly
advised.
Windows
The term Windows refers to Windows 95, Windows 98, Windows NT, or Windows 2000.
Servers can only be installed on Windows NT or Windows 2000. Clients can be installed on
any Windows platform.
12 July 2006
1.3 End of Support of SAP DB2 Admin Tools
With version 8.2, DB2 UDB for UNIX and Windows has introduced its own log file
management that replaces the SAP log file management tools (referred to as Admin Tools
throughout this document). Therefore, the SAP log file management tools are no longer
supported by:
• Version 9 and higher of IBM DB2 for Linux, UNIX, and Windows
• SAP Java only systems
• SAP systems based on SAP kernel releases 7.00 or higher
• New operating system platforms, for example, Linux AMD64/EM64T, Linux on Power,
Windows AMD64/EM64T or Solaris on AMD64.
• TheDB2 HADR feature.
If you are using DB2 UDB for UNIX and Windows version 8.2 or higher, we
recommend that you use DB2’s integrated log file management. The DB2 log
file management is supported for all SAP releases. For more information, see
the following documentation:
• IBM DB2 Universal Database for UNIX and Windows: New Log File
Management that is available on SAP Service Marketplace at
service.sap.com/instuidesNW2004s → Operations → Database-
Specific Guides
• DB2 documentation IBM DB2 Universal Database - Data Recovery and
High Availability Guide and Reference
• SAP Note 913481
Within these sections, we refer to the Admin Tools release and not the SAP
system release, which do not need to be the same.
For example, the 4.6D Admin Tools should be used on all SAP 3.1I to 4.6D
systems where DB2 UDB for UNIX and Windows Version 7 or higher is
installed. The 6.10 Admin Tools or higher should be used with all SAP system
releases above and including 6.10.
July 2006 13
The following changes are informational or not patch-specific:
• Installation Program sddb6ins
The command line syntax of sddb6ins has been simplified by extracting information
from the environment. The sddb6ins program now also contains the remaining Admin
Tools, which it installs. sddb6ins therefore no longer requires a separate
DBATOOLS.SAR file, and the shared library path environment variable must no longer
be set before starting it.
The Admin Tools installation program sddb6ins now checks many aspects of the
environment to locate the majority of problems experienced by customers. In the past a
difficulty with the Admin Tools has been the runtime environment. Admin Tools files
and directories may have been unintentionally removed or were given the wrong
ownership or authorizations; environment variables may have been set to non-existent
directories, and so on.
For more information, see Installing the Admin Tools Manually [Page 47].
• Admin Tools in an MCOD Environment
The Admin Tools have been modified to support this SAP feature. They are only
installed with the first SAP system, that is, only once per database. As log files are
shared by all the SAP systems using the same single database, user db2<dbsid> and
all <sapsid>adm users can perform log file management tasks.
It is necessary to differentiate between the SAP system ID <SAPSID> and the SAP
system database name <DBSID>, as these are no longer necessarily the same.
Additionally, user IDs and directory names may be affected. If <SAPSID> and
<DBSID> have the same value, as is often the case for the first SAP system installed
on a database, the old terminology still applies as described in the table below.
However, there is a limitation in SAP 4.6x releases, that the initial SAP system must
have the same ID as the SAP database. Further SAP systems have different IDs. The
database connect user for the first SAP system in a 4.6D system environment is still
sapr3.
If an MCOD system is removed, you must make sure that the db2<dbsid> user
environment still points to another valid MCOD system using the same database.
The following terminology conversions must be used:
SAP System and Database Name Descriptions
ID Old ID New ID
SAP system ID <SID>, <SAPSID>, <sapsid>
<sid>
SAP database <SID>, <DBSID>, <dbsid>
name <sid>
User ID Descriptions
User Old ID New ID
Database db2<sid> db2<dbsid>
instance owner
SAP database <sid>adm <sapsid>adm
administrator
14 July 2006
Database sapr3 sap<sapsid>
connect user
The following are examples of how the descriptions of directory names have
changed on UNIX systems compared to earlier versions of this documentation
on. If <SAPSID> and <DBSID> are the same, the real directory name after
substitution remains unchanged:
Old New
/usr/sap/<SID>/sys/exe/run /usr/sap/<SAPSID>/sys/exe/run
/db/<SID>/log_dir /db/<DBSID>/log_dir
If the original SAP system is removed, certain Admin Tools are no longer fully
functional. This restriction only applies to 4.6D SAP systems.
From SAP system Release 6.10 and higher, it is only necessary to verify that
the db2<dbsid> user is set up correctly. Use sddb6ins –checkonly to
verify this. This user may require changes to his environment.
For more information about released platforms and availability, see SAP Service
Marketplace at service.sap.com/mcod.
• 64-bit Support
The Admin Tools have been modified to work with 64-bit platforms.
Some changes were specifically implemented for the 4.6D and 6.NN Admin Tools and
delivered as patches. For more detailed information, see New Features [Page 16].
For information about the main differences between the 4.6D and 6.NN Admin Tools, see
Differences Between 4.6D and 6.NN Admin Tools [Page 19].
July 2006 15
1.4.1 New Features
This section provides information about new features that have been specifically implemented
for the 4.6D and 6.NN Admin Tools.
6.NN stands as a placeholder for all Admin Tools releases starting from 6.10
and higher.
For more detailed information about 4.6D patch 22 and 6.NN patch 11, see SAP
Note 533979.
16 July 2006
• Support of TSM LANFREE
The Admin Tools have been modified to support the TSM LANFREE feature. You
activate this feature by setting configuration variable DB2DB6_TSM_MULTITHREADED
in file init<DBSID>.db6. For more information, see Configuring TSM (Tivoli Storage
Management) [Page 90].
For more detailed information about 4.6D patch 22 and 6.NN patch 11, see SAP
Note 597356.
For more detailed information about 4.6D patch 23 and 6.NN patch 12, see SAP
Note 597416.
HP-UX IA64 is not yet supported since the TSM API and client is not yet
available.
• To deinstall the Admin Tools, you can use sddb6ins –d.
July 2006 17
New Features of Other Administrative Tools
• Backup restore tool brdb6brt patch 12
If an incremental or delta backup was detected, option INCREMENTAL AUTOMATIC
was added.
• Backup restore tool brdb6brt patch 11
AutoStorage support was added.
• Backup restore tool brdb6brt patch 9
Option –nn ALL was added. With this option, you can create backups or the redirected
restore script for all database partitions with one call.
• Backup restore tool brdb6brt patch 5
{ New comments starting with SET IGNORE ROLLFORWARD
The script created by brdb6brt patch 2 or higher contains new comments
starting with SET IGNORE ROLLFORWARD. You might have to use this feature if
the log files contain information about container change operations and
the operations cannot be applied during the roll-forward recovery. This may
occur in a redirected restore scenario because the container layout is then
different to the one when the backup was made.
You activate this feature by removing the two dashes (−−) at the beginning of
the corresponding comment line.
{ Support of striped containers
Striped containers are created if you are using DB2 Version 7 and instance
registry variable DB2_STRIPED_CONTAINERS is set to ON. For DB2 Version 8,
this variable is set to ON by default.
{ Backup information in brdb6brt
brdb6brt automatically contains the information from the latest full backup. It
retrieves the information from the backup history file.
{ Option –bm RETRIEVE RELOCATE
You use this option to create scripts that can be used for database relocation.
These scripts can be used as a template in db2relocatedb with command
relocate DB or in db2inidb with command RELOCATE USING.
For more detailed information about the current patch of brdb6brt, see SAP
Note 867914
18 July 2006
• DB2 Control Center Extensions patch 4:
{ You can now use the DB2 Control Center Extensions for the 4.6D and 6.NN
Admin Tools.
{ The DB2 Control Center Extensions have been modified to support the customer
script option of brarchive.
{ The DB2 Control Center Extensions are supported for DB2 UDB for UNIX and
Windows Version 8.
For more detailed information about patch 3 of the DB2 Control Center
Extensions, see SAP Note 703988.
July 2006 19
The following table shows the location of the Admin Tools files and variables for 4.6D
and 6.NN:
4.6D 6.NN
Executables UNIX: UNIX:
and libraries: /usr/sap/<SAPSID>SYS/ <INSTHOME>/admintools/
exe/run bin
brarchive/
brrestore, Windows: Windows:
db6adutl, <drive>:\usr\sp\<SAPSID>\SYS\ <INSTHOME>\admintools\
libdb6* exe\run bin
Protocol files UNIX: UNIX:
/db2/<DBSID>/saparch <INSTHOME>/admintools/
/db2/<DBSID>/saprest protocols
Windows: Windows:
<drive>:\db2\db2<dbsid>\ <INSTHOME>\admintools\
saparch protocols
<drive>:\db2\db2<dbsid>\
saprest
Trace files UNIX: UNIX:
/tmp/TraceFiles <INSTHOME>/admintools/
TraceFiles
Windows:
<DB2DB6_TEMP_DIR>\ Windows:
TraceFiles <INSTHOME>\admintools\
TraceFiles
TSM UNIX: UNIX:
environment in.dbenv_<host>.csh/sh <INSTHOME>/admintools/
variables bin/dbaenv_<host>.csh/
Windows: sh
user environment
Windows:
user environment
Version 7.1
• Closing the Active Log File after Backup
After an online backup is complete, DB2 forces the currently active log file to be closed
and as a result it will be archived. This ensures that an online backup has a complete
set of archived log files available for recovery.
For more information, see the IBM documentation DB2 Administration Guide:
Implementation
20 July 2006
• On Demand Log Archive Support
You can now force the currently active log file closed, which is then automatically
archived by DB2 if the User Exit is enabled. Database administrators are thus provided
with more granular control over their backup and restore strategy. For more
information, see the IBM documentation DB2 Administration Guide: Implementation.
• Log Limit Increased to 32 GB
The maximum size of (the sum of) all log files has been increased from 4 GB to 32 GB.
This enables applications to perform extremely large amounts of work within a single
transaction. For more information, see the IBM documentation DB2 Administration
Guide: Implementation.
• Renaming a Tablespace
When creating a tablespace, you specify its name. In previous versions, you were not
allowed to change that name again during the lifetime of the tablespace object. Now,
an administrator can rename a tablespace with the RENAME TABLESPACE statement.
For more information, see the IBM documentation DB2 Administration Guide:
Implementation.
Version 7.2
• Block Transactions When Log Directory is Full
DB2 Version 7.2 provides a new registry variable DB2_BLOCK_ON_LOG_DISK_FULL,
which is used to prevent disk full errors from being generated when DB2 cannot create
a new log file in the active log directory. DB2 attempts to create the log file every five
minutes and writes a message to file db2diag.log after each attempt. This file
indicates if your application is hanging.
For more information about the DB2 instance variable
DB2_BLOCK_ON_LOG_DISK_FULL, see the DB2 Release Notes.
• Suspended I/O
Supports continuous system availability, while allowing online split mirror handling of
the database. By momentarily suspending I/O to disk, DB2 will ensure that the split
mirror copy maintains its integrity. A new tool db2inidb has been created that
operates on split mirror copies.
If you want to use the db2inidb tool, we strongly recommend that you read
The db2inidb Tool [Page 132] before you start using it.
• Dual Logging
DB2 now has the capability to mirror the active log files to protect databases from
accidental deletion of an active log and data corruption caused by a hardware failure. A
new registry variable DB2_NEWLOGPATH2 instructs the database to write an identical
copy of the log files to a different path on a physically separate disk.
July 2006 21
• Parallel Recovery
DB2 now uses multiple agents to perform both crash recovery and database roll-
forward recovery. This may improve performance on SMP machines.
• Incremental and Delta Backups
There are two backup types supported:
{ Incremental backup:
Only contains pages that have been modified since the last full database or
tablespace backup.
{ Delta backup:
Only contains data that has changed since the last tablespace backup (full,
incremental, or delta backup).
Logging Enhancements
• Dual Logging
Restrictions of this feature, which was introduced in DB2 Version 7.2, have been
removed. This feature is now supported on Windows as well. You can choose the
mirror log directory by setting database configuration parameter mirrorlogpath.
• Infinite Logging
It allows an active unit of work to span the primary logs and archive logs, effectively
allowing a transaction to use an infinite number of log files. Without infinite active log
enabled, the log records for a unit of work must fit in the primary log space. Infinite
active log is enabled by setting logsecond to -1. Infinite active logging can be used to
support environments with large jobs that require more log space than you would
normally allocate to the primary logs.
Be aware that if you activate this feature, rollbacks may take a long time if the
log files containing the rollback information need to be retrieved by the User
Exit. We strongly recommend that you use this feature only if you are using
direct archiving.
If you use indirect archiving, it is possible that the User Exit cannot retrieve
required log files for a rollback, because they have already been archived and
deleted from log_archive by brarchive. In addition, you should set the new
database configuration parameters MAX_LOG and NUM_LOG_SPAN to avoid that
transactions run indefinitely.
22 July 2006
• Block Transactions when Log Directory is Full
The block on log disk full function, which was introduced in DB2 Version 7, is now set
using database configuration parameter blk_log_dsk_ful.
• Increased Log Space
The maximum amount of log space, which can be defined, has increased from 32 GB
to 256 GB.
Availability Enhancements
• Online Table Reorganization
Online table reorganization allows applications to access the table during the
reorganization. In addition, online table reorganization can be paused and resumed
later by anyone with the appropriate authorization by using the schema and table
name. Online table reorganization is allowed only on tables with type-2 indexes and
without extended indexes.
• Online Index Reorganization
A table and its existing indexes can be read and updated during an index
reorganization using the new REORG INDEXES command.
• Online Configuration Parameters
Over 50 configuration parameters can now be set online. Changes to these online
configuration parameters take immediate effect without the need to stop and start the
instance, or deactivate and activate the database. You no longer have to disconnect
users when you fine tune your system, which gives you more flexibility to decide when
to change the configuration.
• DMS Container Operations
If you use database-managed tablespaces, DB2 Version 8 will allow you to drop a
container from a tablespace, reduce the size of existing containers, and add new
containers to a tablespace in a way that a rebalance does not occur.
Usability Enhancements
DB2 Control Center and 64-bit Instances
The DB2 Control Center can now be used to administer 32-bit and 64-bit instances.
July 2006 23
1.7 DB2 UDB for UNIX and Windows Version
8.2: Enhancements
• Integrated log file management
With Version 8.2, DB2 has introduced its own integrated log file management. For
more information, see the document IBM DB2 Universal Database for UNIX and
Windows: New Log File Management that is available on SAP Service Marketplace at
service.sap.com/instuidesNW2004s → Operations → Database-Specific
Guides
• Automatic RUNSTATS:
With automatic statictics collection, you let DB2 determine, which statistics are required
by your workload and which statistics need to be updated. With AutoRunstats
enabled, DB2 will automatically run the RUNSTATS tool in the background to make sure
that the correct statistics are collected and maintained.
AutoRunstats replaces the former internal mechanism of SAP CCMS and is now
available for all SAP system releases. For more information, see SAP Note 860724
Configuration of CCMS Planning Calendar for AutoRunstats.
• Inclusion of transaction logs in backup images
When creating an online backup image, you can include the log files that are required
to restore and recover a database in the backup image. The advantages are as follows:
{ You only need the backup image to ensure the consistency of an online backup.
{ You do not have to decide any more which log files are required.
This feature is supported by dmdb6bkp. For more information, see dmdb6bkp –
Database Backup Tool [page 170].
• Self tuning backup and restore operations
DB2 automatically chooses the number of buffers, the buffer size, and the parallelism
settings for both backup and restore operations.
• New command for simplified database recovery
The new command for database recovery combines the functions of the RESTORE
DATABASE and ROLLFORWARD DATABASE commands. Using this command, you
specify the point in time to which you want the database to be recovered. You do not
need to indicate which database backup image must be restored or which log files are
required to reach the specified point in time. You can also use this new command for
multi-partitioned databases.
• Throttling database tools
Running DB2 database tools can have a significant impact on the database
performance. Using this feature, you can decrease the priority of a specific database
tool to a desired value.
This feature is supported by tool dmdb6bkp. For more information, see dmdb6bkp –
Database Backup Tool [page 170].
24 July 2006
1.8 DB2 UDB for UNIX and Windows Version
8.2.2: Enhancements
You can only enable DB2’s automatic storage management during database
creation. You cannot disable automatic storage management afterwards.
July 2006 25
2 Basic Concepts
2.1 Introduction
This chapter describes the concepts relating to the Admin Tools, and the terminology used
throughout this documentation. Much of this terminology is described in Glossary and Index
[Page 227].
This documentation includes new and updated information that was not
available in previous versions.
26 July 2006
SAP System
<SAPSID>
SAP database
<DBSID> SAP processes
M
+ o
Ex nit
ec or
cute
ut
+ Exe r
o
e
Monit
Proto
c
Admin Tools + Qu o l
ery
cute
Exe
DB2 Control Center
+ SAP Extensions Admin database
Configure ADM<DBSID>
+ Query
The following graphic shows the relationship between the Admin Tools and the DB2 Control
Center Extensions plus the SAP system and database.
July 2006 27
• Operating System Command Line
This can be used to perform the majority of tasks described in this documentation.
Generally this is the fastest and most flexible method, but may require user knowledge
of complex command syntax. The system administrator can also use this interface to
automate tasks, for example, by writing scripts or batch files.
• SAP Transactions
These provide an additional graphical interface for starting specific tasks. The number
of available tasks is limited, but they are often neither platform nor database-specific
and can therefore be used in a mixed environment.
28 July 2006
• Database recovery
The DB2 Database Manager may be forced to restart without applications being able to
close all open transactions. The log files containing the information about changes
made by these transactions are required to perform database recovery when the
database manager is started again. This involves rolling back (undoing) all open
transactions for all applications.
• Database restore
A database can be recreated by restoring a previous backup. A backup represents the
state of a database at the time the backup was performed, but does not contain
information about transactions completed after this time. Therefore, after a backup
image is used to restore a database, log file data generated after the backup was taken
must be added to the database again, to bring the database completely up-to-date.
This process is known as rollforward recovery. The command to add the log file
information is as follows:
DB2 ROLLFORWARD.
{ Restoring from an offline backup image
Such a database is immediately usable after the ROLLFORWARD STOP
subcommand. Alternatively, log files can be first applied to bring the database
up to date (to end of logs).
{ Restoring from an online backup image
In the case of an online backup, the log files generated while the backup
operation was running are also required, as transactions may have modified the
database contents during the time of the backup. Without this additional data
the restored database cannot be activated. The database must be rolled forward
to at least the point in time when the backup operation completed to ensure
that the data is consistent throughout the database.
Rollback and database recovery do not normally require user intervention. The DB2
Database Manager retains all log files as long as they contain information from open
transactions. User intervention is only required if the directory where the database manager
stores log files is damaged or lost. This directory is known both as the LOGPATH and log
directory. In case of loss or damage, you can recover at least those files that have been
successfully archived with the tools described below.
If the log directory is changed and then the subdirectory or any required log files
in that subdirectory are removed, DB2 will look for log files in the default log
directory (SQLOGDIR) when the database is activated. If the log files are not
found, the database will enter a backup pending state.
In connection with rollforward operations, DB2 version 7 supports a log overflow directory.
The rollforward operation first checks for logs in the location specified by the LOGPATH
database configuration parameter. If you have moved any logs from the location specified by
the log path parameter, use the ROLLFORWARD overflow directory parameter to specify the
path to the logs that you moved. This is especially important in connection with recovery
when logging to raw devices.
July 2006 29
2.2.2 Recovering Log Files
The tools db2uext2 (the User Exit), brarchive and brrestore were developed as the log
file management component of the Admin Tools. Their main purposes are:
• To archive log files.
• To assist database administrators performing database rollforward operations after a
database restore.
The Admin Tools are automatically installed as part of an SAP system installation with
R3SETUP. If you install your SAP system with SAPinst, the Admin Tools are no longer
automatically installed. You can manually (re)install, upgrade or patch the Admin Tools using
the sddb6ins program. For more information, see Installing the Admin Tools Manually [Page
47].
Rollforward recovery is not enabled by default. Unless otherwise configured, the DB2
Database Manager reuses a fixed number of log files in a circular fashion, for example,
0,1,2,3,0,1,2,3,0 and so on. This behavior can be modified so that the database manager
uses log files in an ascending order, for example, 0,1,2,3,4,…,9999999. By default, the
database manager also does not start any application (User Exit) to independently archive
full log files for later recovery.
Database administrators are strongly recommended to set the following database parameters
in the SAP environment to ON:
• LOGRETAIN
Rollforward recovery is enabled by turning on this parameter. That is, circular logging
is turned off and each new log file has a higher number.
Each time the LOGRETAIN parameter is turned off and on again, the database
manager resets log file numbers and starts from zero again. This can result in
several log files having the same log file number on a given node. The log files
management tools only directly support recovery of the most recent version of
log files. Recovery of older versions must be done manually.
• USEREXIT
The User Exit mechanism is enabled by turning on this parameter. The User Exit is
automatically started by the DB2 engine each time a log file becomes full.
A backup is required after setting the LOGRETAIN parameter (or both), after which the
database can be started again.
30 July 2006
The database can be recovered later using the DB2 commands RESTORE and
ROLLFORWARD. Dependent on the configuration, the User Exit either retrieves log files directly
from the chosen repository, or from the archive directory and/or retrieve directories. The latter
is the directory (defined by the DB2DB6_RETRIEVE_PATH environment variable) to which log
files are restored using brrestore. To complete a rollforward operation (other than stop),
brrestore and ROLLFORWARD operations may need to be performed repeatedly until all
required log files have been retrieved and rolled into the database.
If the database is not rolled forward to the end of all logs when restarted, the
Database Manager will create new log files starting with the number
immediately following the last log file that was rolled into the database. This can
result in several log files having the same log file number on a given node. The
log file management tools only directly support recovery of the most recent
version of log files. Recovery of older versions must be done manually.
July 2006 31
Indirect …/log_archive/<DBSID>
S0000003.LOG
(A)
LOGPATH DB Parameter S0000004.LOG (B)
…/log_dir . User Exit offline retained
brarchive
S0000005.LOG (D) TSM, TAPE or SCRIPT
S0000006.LOG S0000002.LOG
S0000007.LOG archived retained
brrestore
online active User Exit restored retained
online retained S0000000.LOG (C)
(D)
S0000001.LOG
DB2DB6_RETRIEVE_PATH
…/log_retrieve/<DBSID>
Direct
LOGPATH DB Parameter . TSM, DISK or VENDOR
…/log_dir . S0000000.LOG
(A)
S0000005.LOG S0000001.LOG
S0000006.LOG User Exit S0000002.LOG
S0000007.LOG (D) S0000003.LOG
online active S0000004.LOG
online retained archived retained
Archive
Restore
When the USEREXIT database configuration parameter is set, the database engine
automatically starts the User Exit program to archive each log file as soon as it is full or it is
closed. The location the file is moved to depends on the configuration of the User Exit. By
default, log files are archived indirectly by first copying the file to the archive directory. The
User Exit can be reconfigured to archive directly using TSM, archive to disk or via an
alternative User Exit.
The Admin Tools can only administer the latest version of a log file with a given
number per node, that is, you cannot administer two log files with the number 25
on node 0.
32 July 2006
Only indirect archiving supports archiving to tape without a vendor storage
management product. However, before you decide to use this solution you
should take the following disadvantages into consideration:
• Log files are not immediately archived to long-term storage. Therefore, log
files copied by the User Exit but not yet archived with brarchive can be lost
if the disk containing the archive directory fails.
• The complexity of the solution, including additional storage directories and an
extra Admin DB slightly increases the risk of failure.
July 2006 33
For example, during archiving, the copy of the file S0000001.LOG put in the archive
directory might be renamed to S0000001.LOG.20001130140536.NODE0000.
A file restored by brrestore (in the LOG RETRIEVE directory) still has the extended
file name.
The name is first truncated back to its original form in the copy returned to the log
directory by the User Exit when it is called to retrieve files for a ROLLFORWARD
operation.
DB2 log file names are of the format Snnnnnnn.LOG, where nnnnnnn is a seven digit
number ranging from 0000000 to 9999999. When a database is first created, log files
starting from S0000000.LOG are created. DB2 restarts the log file numbering sequence at
S0000000.LOG under the following conditions:
• When the database configuration file is changed to enable archive logging
• When the database configuration file is changed to disable archive logging
• When the log file sequence wraps, that is after log S9999999.LOG is used
The states a log file passes through, which appear in the above graphic, for example, online
active, are described in Log File States [Page 37].
Normally, only the Admin Tools should be used to manage log files. The files
should not be moved or deleted manually as this will lead to data
inconsistencies. The only exception to this is when log files that are no longer
supported by the tools (see Invalid in the section Log File States [Page 37]), are
restored. Those files must have the timestamp and node extension removed
from their names when they are moved back to the log directory.
34 July 2006
• If you chose indirect archiving, log files copied to the archive directory by the User Exit
and later successfully archived using brarchive will only be deleted from the archive
directory if this is explicitly requested. The same applies to log files restored to the
retrieve directory by brrestore.
In the latter cases deletion is requested by:
• Indicating deletion as part of a brarchive/brrestore operation (options -sd and –
ssd).
• Explicitly deleting log files in a later call to an Admin Tool (options -ds and –dr). Log
files no longer required on the backend should also be deleted using these tools.
Be aware that the available disk space will eventually be exhausted if the User
Exit is unable to successfully archive log files over a long period of time. The
same will happen if log files archived using brarchive and restored using
brrestore are not deleted using the same tools.
Tapes can be reused, but other backend storage should be cleaned up regularly
using the Admin Tools. Storage management products often supply their own
tools for doing this or can be configured to automatically remove old files.
However, it is essential that you use the Admin Tools to delete files when using
indirect archiving, as the Admin DB is then also updated.
July 2006 35
2.2.5 Protocols
The User Exit (db2uext2), brarchive and brrestore generate protocol information to
record the actions that have been performed. Protocol information is also written into the
Admin DB by the log file management tools. This information can be used by the DB2 Control
Center Extensions. The Admin DB protocols and the protocol files of brarchive and
brrestore are eventually deleted by brarchive. The frequency can be configured by
setting configuration parameter delete_protocols using the DB2 Control Center
Extensions.
36 July 2006
2.2.7 Log File States
This section is mainly written for system administrators and support personnel
only for use if problems involving the Admin DB occur.
Within an SAP environment, in order for the tools to know what operations have been
performed on a log file, the log file is defined to pass though the following states during its life
cycle. This state information is stored in the Admin DB, so it is only relevant to systems using
the (default) indirect archiving method. This information is consequently not stored on
systems performing direct archiving.
• Online active
The log file is currently being used to log transactions. The location of the log file is
defined in the LOGPATH database configuration parameter. This can be either a file
system path or a raw device.
• Online retained
The log file is no longer being written to by the database, but may contain information
about transactions that the database engine has not yet written from the buffer pool to
disk. The log file is located in the log directory, and will also be in the archive directory
after the User Exit has run.
• Offline retained
The log file is no longer being used and does not contain transactions with unwritten
data pages. The log file is in the archive directory.
The original log file will also remain in LOGPATH until the database is stopped or
the DB2 Database Manager reuses the file. However, the tools have no
influence on this and so assume that the file is no longer there.
• Archived retained
The log file has been archived using brarchive. The location of the archived log file
is a storage management product, for example, TSM (Tivoli Storage Manager) or tape.
If not explicitly deleted, the original log file is also still in the archive directory and no
restore is possible (or necessary) as long as this original log file has not been deleted
using brrestore.
• Restored retained
The log file has been restored using brrestore. The location of the restored log file is
the retrieve directory. If not explicitly deleted by using the -delete option in a
subsequent operation, the archived log file is also still available on the backend.
• INVALID
The Admin Tools can only administer the latest version of a log file with a given number
per node. If the database generates a second log file with a number already used, the
User Exit marks previous versions as INVALID. This can occur after a database
restore if the ROLLFORWARD operation does not use all log files, or by turning the
LOGRETAIN database configuration parameter off and on again. Older log files that
have been archived can still be manually retrieved from the backend using system or
storage product tools, but the Admin Tools only support the retrieval of the newest
version.
July 2006 37
• Gone
This state is only used internally to indicate that a log file could not be found in the
location where it was expected, for example, if a customer uses MOVE, RENAME or
DELETE. This state can also occur when storage products, such as TSM, automatically
delete files after a certain period of time. A delete operation will delete such entries.
For this feature, we strongly recommend customers to only use direct archiving.
This requires either TSM or a vendor product that provides its own User Exit.
For more information, see The db2inidb Tool [Page 132].
Do not attempt to copy Admin DB information from the source system to the
new target system.
Although DB2 does not force a backup in this situation, as LOGRETAIN is normally already
active, it is essential that you take a new backup before you use the Admin Tools on the new
SAP system.
Sometimes a system copy is used to overwrite another system or a previous system copy
where the Admin Tools were already installed. In this case, the old Admin DB should be
dropped before the Admin Tools are reinstalled. Additionally, the backup history file must be
pruned to remove all previous backup information before a new backup is taken and before
the Admin Tools are used.
38 July 2006
2.3 SAP Security Concept
General Information
In an SAP environment, DB2 runs with authentication set to the value
server_encrypt. This means that the user ID and password provided to connect to
databases or attach to database instances are verified by DB2 using operating system
services from within the database server.
The user IDs and passwords for SAP system users are maintained and stored in the file:
• UNIX: /usr/sap/<SAPSID>/SYS/global/dscdb6.conf
• Windows: \\%DSCDB6HOME%\sapmnt\<SAPSID>\SYS\global\dscdb6.conf
July 2006 39
Managing Passwords for Database Standard Users
DB2 uses operating system users to maintain system security. The Admin Tools need access
to the user passwords to access the database. These are stored in encrypted form in a
special file and must be updated using the dscdb6up tool.
Do not change user passwords only using operating system methods. Tools that
read password file dscdb6.conf will no longer be able to connect to the
database until tool dscdb6up has been used.
For information about how to set and update passwords for SAP system users, see Setting
and Updating Passwords [Page 116].
40 July 2006
3 Installation and Setup
3.1 Introduction
This chapter is intended for administrators who want to check their environment, or need to
(re)install or upgrade the Admin Tools manually.
The installation of the Admin Tools depends on the SAP installation tool. You can install the
SAP system using:
• R3SETUP
The Admin Tools are automatically installed as part of the SAP system installation.
R3SETUP creates the directories, user, groups and user environment that are required
to successfully install the Admin Tools using the sddb6ins program.
• SAPinst
The Admin Tools are not automatically installed during the SAP system installation
with SAPinst. However, you can install the Admin Tools after installing the SAP system.
SAPinst creates the users and groups that are required to successfully install the
Admin Tools using the sddb6ins program. Version 6.10 of sddb6ins and higher
creates the directories and adds variables to the user environment that are required to
run the Admin Tools.
The 6.NN Admin Tools must be used on SAP systems with release 6.10 or
higher. They do not perform correctly on SAP systems with release 4.6D or
lower, and the 4.6D Admin Tools do not perform correctly on SAP systems with
release 6.10 or higher.
Installation Overview
The following list provides an overview of the steps that you have to perform to install the
Admin Tools and enable the SAP system database for recovery:
...
1. Check the SAP system environment [Page 43] to make sure that the SAP system was
installed correctly.
2. Check the prerequisites for the installation of the Admin Tools [Page 48].
3. Install or upgrade to the latest Admin Tools. For more information, see one of the
following sections:
{ Upgrading the Admin Tools [Page 50] if you want to upgrade the Admin Tools to
the latest version.
{ Installing the Latest Admin Tools [Page 51]if you want to install the latest
version of the Admin Tools or apply the latest patch.
4. Check the Admin Tools environment [Page 52] after installation.
5. Install the DB2 Control Center on the SAP database server or one or more
workstations. For more information, see Installation of the DB2 Control Center [Page
61].
July 2006 41
You may have already performed this step as part of the database installation.
Otherwise, this can be delayed until step 7 if roll-forward recovery enabling (step 6) will
be performed on the command line.
6. Enable the database for roll-forward recovery [Page 57].
7. Catalog the databases to be administered. For more information, see Setting Up the
DB2 Control Center [Page 62].
8. Check that the DB2 Control Center Extensions are working correctly. For more
information, see Using the DB2 Control Center Extensions [Page 69].
See also:
• For information about installing IBM DB2 Universal Database for UNIX and Windows
with the SAP system, see the following documentation:
{ For SAP Web AS Release 6.10, 6.20 and 6.30:
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
To find this documentation, see SAP Service Marketplace at
service.sap.com/instguides → SAP Components →SAP Web
Application Server.
{ For SAP Web AS 6.40 SR1:
SAP Web Application Server ABAP 6.40 SR1on UNIX: IBM DB2 Universal
Database for UNIX and Windows
SAP Web Application Server ABAP 6.40 SR1on Windows 2000: IBM DB2
Universal Database for UNIX and Windows
To find this documentation, see SAP Service Marketplace at
service.sap.com/instguidesNW04 → Installation.
{ For SAP Basis Release 4.6D:
SAP Basis Installation on UNIX: IBM DB2 Universal Database for UNIX and
Windows
SAP Basis Installation on Windows: IBM DB2 Universal Database for UNIX and
Windows
To find this documentation, see SAP Service Marketplace at
service.sap.com/instguides → SAP Components →SAP Basis.
{ For SAP R/3 Release 4.6x and lower:
To find the corresponding documentation, see SAP Service Marketplace at
service.sap.com/instguides → SAP Components → SAP R/3.
• For additional information about installing the Admin Tools, see the following SAP
Notes:
{ SAP Note 410252
DB6: Installing the latest 4.6D DB2 Admin Tools
{ SAP Note 455506
DB6: Installing the latest 6.NN DB2 Admin Tools
To find the SAP Notes, see SAP Service Marketplace at service.sap.com/notes.
42 July 2006
3.2 SAP System Environment
The following sections explain the SAP system environment that is a prerequisite for the
successful installation of the Admin Tools.
User Description
db2<dbsid> Database administrator
This operating system user is the DB2 instance
owner and the SAP database administrator.
<sapsid>adm SAP system administrator
This operating system user is authorized to start and
stop the SAP system and the DB2 Database
Manager (instance). <sapsid>adm has the DB2
authorizations DBADM and SYSCTRL. DB2-specific
monitoring functions invoked by SAP application
server functions require SYSCTRL authorization. This
user belongs to the operating system group
db<dbsid>ctl.
sapr3 Database user
These operating system users own all SAP database
First installed SAP system with
objects (tables, indexes and views). All database
Release 4.6D or lower
connection and instance access operations for an
SAP application server are performed using these
users.
July 2006 43
SAP System Groups
Groups Description
db<dbsid>adm Database system administration group
Each member of this group has SYSADM authorization
for the DB2 Database Manager instance. This is the
highest level of authorization within the database
manager and controls all database objects.
db<dbsid>ctl Database system control group
Each member of this group has SYSCTRL
authorization for the DB2 Database Manager
instance. SYSCTRL has authorizations allowing
operations affecting system resources, but not
allowing direct access to data.
db<dbsid>mnt Database maintenance group
A user of this group can perform maintenance
operations on all databases associated with an
instance. It does not allow direct access to data. This
authority includes privileges to update database
configuration files, to back up a database or a
tablespace, to restore an existing database and to
monitor a database.
Windows only: Domain-level SAP system administration group
This group is used for grouping the SAP system
SAP_<SAPSID>_GlobalAdmin
administrators. The sole function of a global group is
to gather users together at domain level so that they
can be placed in the appropriate local groups. The
members of this group are the domain users
<sapsid>adm and sapse<sapsid>.
The group SAP_<SAPSID>_GlobalAdmin is only
used when the SAP System belongs to a Windows
domain. The group SAP_<SAPSID>_GlobalAdmin
is not required for a local installation.
Windows only: Local group on an application server
SAP_<SAPSID>_LocalAdmin Only local groups are created and maintained on an
application server. A local group can only be given
authorizations to the system where it is located. If the
system is part of the domain, the local group can
contain users and global groups from the domain.
44 July 2006
3.2.2 User Environment
In the following table, the Set In column shows the location where the variables
are set and where they need to be changed.
July 2006 45
dbs_db6_schema Database schema: Same as relevant location
for variable
Valid for all SAP sap<sapsid> or sapr3
SAPSYSTEMNAME as
systems with SAP depending on the SAP system
Web AS 6.10 or described in this table
release you have installed.
higher and MCOD
4.6D SAP systems
46 July 2006
Access Authorizations for Directories and Files under Windows
The 4.6D Admin Tools must be used on all SAP systems with release 3.1I −
4.6D where DB2 UDB for UNIX and Windows Version 7 or higher is installed.
The Admin Tools are installed on the database server using program sddb6ins. During
normal installation of an SAP system with R3SETUP, sddb6ins is called automatically.
The administrator only needs to execute sddb6ins manually in the following cases:
• If an SAP system was installed with SAPinst
• If you want to use the 4.6D Admin Tools and your SAP system is between Release 3.1I
and 4.6C
• After completion of an SAP system upgrade and if you have not yet installed the latest
Admin Tools
• When applying a downward compatible kernel and if you have not yet installed the
latest Admin Tools
• When manually installing the Admin Tools or applying an Admin Tools patch
• When checking the installation of the Admin Tools
July 2006 47
3.3.1 Prerequisites for the Admin Tools Installation
Before you can install the Admin Tools, you must make sure that certain prerequisites are
met. Some are general, some apply to a certain patch level of the sddb6ins program or
depend on your operating system.
General Prerequisites
• Sufficient space
Make sure that you have sufficient space (approx. 4 MB) in the directory containing the
Admin Tools executables. sddb6ins installs the executables in the following directory:
{ For 6.NN Admin Tools:
UNIX: $INSTHOME/admintools/bin
Windows: %INSTHOME%\admintools\bin
{ For 4.6D Admin Tools
UNIX: /usr/sap/<SAPSID>/SYS/exe/run
Windows: <drive>:\usr\sap\<SAPSID>\SYS\exe\run
If you are using indirect archiving (that is parameter -NODADMDB is not used during
installation), the Admin DB requires additional space. The directory to which the
database manager configuration parameter DFTDBPATH is pointing must be large
enough to hold the Admin DB and its log files (approx. 4 MB).
• Availability of the database instance
The SAP database instance DB2<DBSID> must be running when installation program
sddb6ins is executed.
• Correct user environment
Program sddb6ins must be executed in the correct user environment.
Windows:
To start sddb6ins.exe, log on to the database server as user <sapsid>adm.
48 July 2006
UNIX only: For SAP Systems lower than 4.6x
If you want to install the 4.6D Admin Tools for the first time on SAP systems lower than 4.6x,
you have to perform the following additional steps as the group concept changed with
Release 4.6A:
...
1. Create two new groups called db<dbsid>ctl and db<dbsid>adm if they do not
already exist.
2. Change the primary group of user db<dbsid> to db<dbsid>adm and keep group
sysadm as the secondary group.
3. Add group db<dbsid>ctl as the secondary group to user <sapsid>adm.
4. Update the database manager configuration.
To do so, 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. Perform an instance update to correct the file authorizations of executables, for
example, db2start:
a. Log on to the database server as user db2<dbsid> and stop the DB2 instance.
Enter the following command:
db2stop force
b. As user root, switch to the instance directory and update the DB2 instance.
Enter the following commands:
cd <DB2 installation directory>/instance
./db2iupdt db2<dbsid>
c. Log on again as user db2<dbsid> and restart the DB2 instance. Enter the
following command:
db2start
6. Download the dscdb6up program from SAP Service Marketplace at
service.sap.com/patches.
7. To extract dscdb6up using CAR, enter the following command:
CAR -xvf dscdb6up.CAR
8. Copy the dscdb6up program to directory /usr/sap/<SAPSID>/SYS/exe/run.
9. Use chmod and chown to set the authorizations as follows:
File Permission Owner Group
<SAPMNT>/SYS/exe/run/dscdb6up 4750 root db<dbsid>ctl
<SAPMNT>/SYS/global 750 <sapsid> db<dbsid>adm
adm
<SAPMNT>/SYS/global/dscd6.conf 640 <sapsid> db<dbsid>adm
adm
<SAPMNT> acts as a place holder for /usr/sap/<SAPSID>.
July 2006 49
3.3.2 General Information
Return Codes of sddb6ins
The sddb6ins program writes information about the steps it performs to standard output.
The return code of the sddb6ins program depends on the success of the installation. The
following table describes the possible return codes:
Return Code Description
0 No error detected
1 Severe errors detected, the installation is not complete.
For more information, see Appendix B: Troubleshooting
[Page 177].
2 Warning. Errors have occurred during the installation
but the installation is complete. Check the output
messages.
The values listed in the table above differ from other Admin Tools.
50 July 2006
• If you upgrade to an SAP system Release 6.10 or higher, an upgrade to the 6.NN
Admin Tools is required.
If you are using an SAP system with Release 4.6D or lower and you want to use
the 6.NN Admin Tools, Admin Tools upgrades are not supported.
Procedure
To upgrade the Admin Tools, enter the following command:
sddb6ins -u <start release> [<target release>] {common options}
<start release> is a placeholder for the release of the previously installed Admin Tools.
For example, to upgrade the Admin Tools from 4.6D to 6.10 using the 6.10
sddb6ins executable:
UNIX: sddb6ins –u 46D
Windows: sddb6ins –u 46D –db2dbnamepwd <password of user
db2<dbsid>>
If the -NOADMDB option is used, the Admin DB will not be installed. In this case log file
archiving is only performed directly by the User Exit program db2uext2 (for more
information, see Archiving Directly to TSM [Page 80]). Otherwise, the Admin DB will be
installed (if not already present) and brarchive and brrestore are then also available.
See also:
Actions Performed by the sddb6ins Program [Page 53]
Procedure
To manually install the latest Admin Tools or to apply an Admin Tools patch, enter the
following command:
sddb6ins -i [<target release>] {common options}
July 2006 51
For example, to install the current version of the Admin Tools, enter the
following command:
UNIX: sddb6ins –i
Windows: sddb6ins –i –db2dbnamepwd <password of user
db2<dbsid>>
If the -NOADMDB option is used, the Admin DB will not be installed. In this case log file
archiving is only performed directly by the User Exit program db2uext2 (for more
information, see Archiving Directly to TSM [Page 80]). Otherwise, the Admin DB will be
installed (if not already present) and brarchive and brrestore are then also available.
The -a option of sddb6ins, which was used to install the latest Admin Tools
after the installation of a downward-compatible kernel (DCK), no longer exists.
Use the -i option instead.
See also:
Actions Performed by the sddb6ins Program [Page 51]
52 July 2006
Procedure
To check the environment of the Admin Tools, enter the following command:
sddb6ins –checkonly [<target release>] {common options}
For example, to check the Admin Tools, enter the following command:
UNIX: sddb6ins –checkonly
Windows: sddb6ins –checkonly –db2dbnamepwd <password of
user db2<dbsid>>
With the sddb6ins version 6.10 or higher, this verification is also performed automatically at
the end of an installation (–i) or upgrade (-u) operation. The output contains useful
information about the environment in which the Admin Tools operate. The verification tool
writes the following message types:
Message Description
Type
[I] Provides information about the current configuration.
[E] Severe configuration errors have occurred during the
installation.
[W] Warnings if possible inconsistencies have been detected
July 2006 53
• UNIX: Contains the trace files
$INSTHOME/admintools/TraceFiles created by all Admin Tools.
• Windows:
%INSTHOME%\admintools\TraceFiles
• UNIX: Contains brarchive and
$INSTHOME/admintools/protocols brrestore protocol files.
• Windows: User Exit protocol files are in
%INSTHOME%\admintools\protocols the DIAGPATH directory.
• 6.NN Admin Tools on Windows only:
In a multi-partitioned system, sddb6ins creates the following shares on the node
where hostname matches the contents of the variable DSCDB6HOME:
{ log_archive<DBSID>
{ log_retrieve<DBSID>
• Extracts the executables stored in sddb6ins to the following directory:
{ For 6.NN Admin Tools:
<INSTHOME>/admintools/bin
{ For 4.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, which is required for the DB2 Control Center
Extensions, to the DB2 directory.
{ UNIX: $INSTHOME/sqllib/function
{ Windows: <DB2_install_dir>\sqllib\function
• 6.NN Admin Tools only:
Removes executables installed with previous versions, which are no longer required.
The Admin Tools up to 4.6D were stored in the same directory as the standard SAP
system executables and were therefore deleted during an SAP system upgrade.
• Creates or updates the environment file init<DBSID>.db6 in the following directory:
{ For 6.NN Admin Tools: <INSTHOME>/admintools directory (see table above)
{ For 4.6D Admin Tools: /usr/sap/<SAPSID>/SYS/global
For an example of the environment file, see Appendix D: Example of File
init<DBSID>.db6 [Page 212].
54 July 2006
• By default, sddb6ins creates the Admin DB ADM<DBSID> if it does not already exist
and performs the following actions:
{ Customizes a multi-partitioned system.
{ Grants the access authorizations to the Admin DB ADM<DBSID>.
{ If required, it creates the tables in the Admin DB and fills the configuration table
with default values if this table is empty.
{ 4.6D Admin Tools only:
Creates mirror tables in the <DBSID> database.
If you use the –NOADMDB option, the Admin Tool creation will be suppressed.
The Admin DB will not be created then and the above steps will not be
performed. If you want to use indirect archiving, do not use the –NOADMDB
option.
• 4.6D Admin Tools only:
Creates a user defined function (UDF) entry in the <DBSID> database.
• 6.NN Admin Tools only:
Adds Admin Tools-specific environment variables, for example for TSM, to the
environment of db2<dbsid> and <sapsid>adm.
• Sets the DB2 instance variable DB2ENVLIST, so that the stored procedure works
properly.
• UNIX only:
Sets the access authorizations on the Admin Tools directories and files as follows:
July 2006 55
$INSTHOME/admintools/bin/libdb6sct 0755 db2<dbsid> db<dbsid>adm
sm.smp
$INSTHOME/admintools/bin/db6adutl 6755 root db<dbsid>adm
$INSTHOME/sqllib/adm/db2uext2 0755 db2<dbsid> db<dbsid>adm
$INSTHOME/sqllib/function/sddb6jds 0755 db2<dbsid> db<dbsid>adm
56 July 2006
Actions Performed During Upgrade (-u)
The actions performed during upgrade are similar to the actions performed during installation.
However, some actions depend on the <start release> parameter.
The sddb6ins program performs the following additional actions:
• If starting with 3.1I Admin Tools:
The 3.1I init<DBSID>.sap configuration file content is moved to the Admin DB.
• 4.0B − 4.6A Admin Tools
The log archive location must be changed. Any log files in the old location are moved
and the Admin Database is updated.
• 3.1I − 4.6C Admin Tools
The executables and libraries are exchanged.
July 2006 57
recorded, 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).
Roll-forward recovery is not enabled by default. You enable roll-forward recovery and the
User Exit mechanism by setting the database configuration parameters LOGRETAIN and
USEREXIT to ON. An offline backup of the database must be performed after setting these
parameters. The procedures differ depending whether you are using a single-partitioned or
multi-partitioned system.
Unlike with an offline backup, if you want to perform online backups, the
database must be in roll-forward recovery mode, that is LOGRETAIN must be set
to ON.
There are ways of forcing the database out of BACKUP PENDING mode after
setting these parameters without performing a backup first. Do not do this, as
the Admin Tools will not operate correctly until a backup has been performed.
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.
A new backup must be performed before the User Exit is called.
See also:
Enabling Rollforward Recovery for a Single-Partitioned Database [Page 58]
Enabling Rollforward Recovery for a Multi-Partitioned Database [Page 59]
58 July 2006
DB2 Control Center
Make sure that you have installed and set up the DB2 Control Center before
performing these steps. For more information, see Installation of the DB2
Control Center [Page 61] and Setting Up the DB2 Control Center [Page 62].
1. Start the DB2 Control Center.
2. From the context menu of the <DBSID> database icon, choose Configure.
3. Choose Logs of the notebook.
4. Choose Retain log files for roll-forward recovery from the list.
5. In the value area, select the Yes radio button.
6. To confirm, choose OK to confirm.
7. Restart the database instance.
...
Make sure that you have installed and set up the DB2 Control Center before
performing these steps. For more information, see Installation of the DB2
Control Center [Page 61] and Setting Up the DB2 Control Center [Page 62].
1. Start the DB2 Control Center.
2. From the context menu of the <DBSID> database icon, choose Open → Database
Partitions….
3. In the table Database Partitions, Select all nodes.
4. From the menu that appears, select Configure….
July 2006 59
5. Choose Logs of the notebook.
6. Select Retain log files for roll-forward recovery from the list.
7. In the value area, choose the Yes radio button.
8. To confirm, choose OK.
9. Restart the database instance.
...
Procedure
To deinstall the Admin Tools, enter the following command:
sddb6ins –d
60 July 2006
3.4.1 Installation of the DB2 Control Center
The DB2 Control Center is part of the DB2 Client Software called the DB2 Administration
Client, and also part of the DB2 server installation.
To install it, follow the standard DB2 installation process and make sure that you select the
option Control Center for installation. On a UNIX based operating system, you can start the
DB2 Control Center by executing command db2cc. On Windows, there is also a menu entry
in the DB2 group in the Start menu.
The DB2 Control Center of DB2 Version 7 or lower does not support 64-bit
instances in general. In order to work with 64-bit systems, the DRDA protocol
must be used. This is available with all single- and multi-partitioned systems. On
all other systems, install DB2 Connect in addition.
If you use the direct archiving mode to archive the log files, the DB2 Control
Center Extensions are not required,.
On Windows:
...
1. Log on to the machine where you want to install the Admin Tools as a user with local
administration authorizations.
2. Insert the SAP kernel CD.
3. On the CD, change to the directory NT\I386\DBTOOLS.
4. Extract file DB6CCEXT.SAR to a temporary directory by using tool SAPCAR.
5. Change to the temporary directory.
6. Invoke setup.exe and follow the instructions.
For the DB2 Control Center Extensions to perform correctly, 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.
July 2006 61
On UNIX:
...
1. Log on to the machine where you want to install the DB2 Control Center Extension as
user root.
2. Insert the SAP kernel CD.
3. Mount the CD.
4. On the CD, change to the directory UNIX/<Unix platform>/DBTOOLS.
5. Extract file DB6CCEXT.SAR to a temporary directory by using SAPCAR.
6. Change to the temporary directory.
7. Invoke the shell script install and follow the instructions
1. In the navigation frame of the DB2 Control Center, choose Systems from the context
menu.
2. Choose Add from the menu.
The Add System dialog box appears.
62 July 2006
3. To retrieve a list of DB2 systems located in the network, choose Refresh.
4. If available, choose the system on which the SAP database server is located. If the
system is not listed, enter the name of the server in the System Name field. Fill out or
modify the remaining fields.
5. To add this and further systems, choose Apply. Otherwise, confirm with OK.
July 2006 63
Cataloging a Database Manager Instance:
1. In the navigation frame of the DB2 Control Center, expand the node with the name of
the system where the DB2 server is located.
2. From the context menu of the Instances subnode, choose Add.
The Add Instance dialog box appears.
64 July 2006
Cataloging the Databases <DBSID> and ADM<DBSID>:
...
1. In the navigation frame of the DB2 Control Center, expand the <system name> node,
then the instances node, and the <instance name> node.
2. From the context menu of the Databases node, choose Add.
The Add Database dialog box appears.
If you want to access a DB2 Version 7 64-bit instance using DB2 Control Center
Version 8, you must configure the DRDA communication protocol to enable
communication. Be aware, however, that in this case only limited functionality is
available.
With DB2 Version 7, the DB2 Control Center does not provide all functions on 64-bit DB2
instances. To use the DB2 Control Center for DB2 Version 7 for the administration of 64-bit
DB2 instances, you must use the communication protocol DRDA.
July 2006 65
Using the DB2 Version 7 Client Configuration Assistant
...
If this option does not appear, you have not installed DRDA support on the client.
8. Select Connect directly to the server.
9. To continue, choose Next.
The Add Database Wizard - 3. TCP/IP screen appears.
10. In the Host Name field, enter the host name where the SAP database is running.
11. In the Port Number field, enter the port number of the database instance.
You can find the port number in the following file on the database host. The
location depends on the host operating system:
• Windows: <WindowsSystemDirectory>\system32\drivers\etc\services
• UNIX: /etc/services
Look for the entry sapdb2<DBSID>.
12. To continue, choose Next.
The Add Database Wizard - 4. Database screen appears.
13. Enter the name of the SAP database and choose Next twice.
The Add Database Wizard - 6. Node Option screen appears.
14. In the System Name field, enter the name of the database host.
15. In the Instance Name field, enter the DB2 instance name.
16. Choose the corresponding operating system.
66 July 2006
17. Choose Finish.
The Confirmation dialog box appears. To test the connection, choose Test Connection,
enter the user ID and password, and choose OK.
18. To repeat the procedure for the Admin DB ADM<DBSID>, choose Add and repeat steps
13 to 17.
If this option does not appear, you have not installed DRDA support on the client.
8. Select Connect directly to the server.
9. To continue, choose Next.
The Add Database Wizard – 3. TCP/IP screen appears.
10. In the Host name field, enter the host name where the SAP database is running.
11. In the Port number field, enter the port number of the database instance.
You can find the port number on the database host in the following file:
• UNIX:
/etc/services
• Windows:
<Windows_system_directory>\system32\drivers\etc\services
July 2006 67
15. Choose the corresponding operating system.
16. In the Remote instance name field, enter the DB2 instance name and choose Next.
The Add Database Wizard – 7. System Options screen appears.
17. To continue, choose Next.
The Add Database Wizard – 8. Security Options screen appears.
18. Select User authentication value in server’s DBM configuration.
19. To continue, choose Next.
The Add Database Wizard – 8 DCS Options screen appears.
20. Select Configure DCS options.
21. Select Disconnect if client generates an interrupt (INTERRUPT_ENABLED).
22. Choose Finish.
The Test Connection dialog box appears.
23. Select CLI and enter the user ID and password.
24. Choose Test Connection.
25. To check for a successful test connection, choose the Results tab. In case of a
success, the following message is displayed:
CLI connection tested successfully
26. To add the Admin DB ADM<DBSID>, repeat steps 1 to 22.
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>.
db2 catalog db <DBSID> at node <nodeName> authentication dcs
db2 catalog dcs db <DBSID> parms ',,INTERRUPT_ENABLED,,,,,'
db2 catalog db ADM<DBSID> at node <nodeName> authentication dcs
db2 catalog dcs db ADM<DBSID> parms ',,INTERRUPT_ENABLED,,,,,'
68 July 2006
3.4.4 Using the DB2 Control Center Extensions
After cataloging the databases, the DB2 Control Center Extensions can now be used. You
can access the DB2 Control Center Extensions using new context menu entries, 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,
SAP Log File Management and SAP Tape Management.
For more information about how to use the option SAP Option Management, see Parameters
Affecting Log File Management Storage [Page 70].
For more information about how to use the option SAP Log File Management, see Advanced
Log File Maintenance Tasks [Page 117].
July 2006 69
4 Configuration
1. In the navigation frame of the DB2 Control Center, choose the database <DBSID>
using the context menu.
If you are using the DB2 Control Center Extensions with a patch level lower than
3, you choose the database instance db2<dbsid> (containing the <DBSID>
database) using context menu.
70 July 2006
2. Choose SAP Option Management.
The Options dialog box appears. The following is an example from an AIX system.
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 Description
backup_dev_type 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 82] section Modifying the Tape
Block Size.
cpio_in_flags 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 82] section Modifying the Tape
Block Size.
July 2006 71
rewind Command used to rewind a tape. The $ is replaced by the
tape device name. This value should not normally be
changed.
rewind_offline 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.
tape_pos_cmd 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.
tape_size 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.
tape_address 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 about non-rewind
addresses, see brrestore - Log File Retrieval Tool [Page
163].
tape_address_rew Standard address of the default tape device. Using this
address results in the tape being rewound at the end of each
tape operation.
expir_period 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.
tape_use_count 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.
dd_flags Flags used to modify the dd command when archiving files
to tape. These may need modifying if a non-standard block
size is used.
dd_in_flags Flags used to modify the dd command when restoring files
from tape. These may need modifying if a non-standard
block size is used.
delete_protocols Number of days to retain tool protocol entries in the Admin
DB, before they are deleted. The default value is 30.
adsm_mc Name of the default TSM management class.
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.
72 July 2006
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.
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\<SAPSID>\SYS\global
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.
July 2006 73
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 Value
INSTHOME UNIX:
(4.6D Admin Tools only) 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\<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 132].
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.
74 July 2006
DB2DB6_UEXIT_DIRECT • For indirect archiving:
This variable is not set or set to OFF.
• For TSM:
To activate archiving to TSM, set variable as follows:
DB2DB6_UEXIT_DIRECT=TSM:<mgmt
class1>[+<mgmt class 2>]
• For direct archiving to an alternative storage product, set
the variable as follows:
DB2DB6_UEXIT_DIRECT=VENDOR.
In addition, to activate direct archiving to an alternative
storage product, you must configure variable
DB2DB6_VENDOR_UEXIT.
• For archiving directly to disk, set the variable as follows:
DB2DB6_UEXIT_DIRECT=DISK.
For more information, see Configuring the System for Archiving
Log Files [Page 78].
DB2DB6_VENDOR_UEXIT By default, this variable is not set.
If you have configured DB2DB6_UEXIT_DIRECT=VENDOR,
you need to set the variable as follows:
DB2DB6_VENDOR_UEXIT=<path to vendor User
Exit>.
For more information, see Archiving to an Alternative Storage
Management Product [Page 82].
DB2DB6_UEXIT_ARCHIVE_WO_DB By default, this variable is not set or set to ON.
If this variable is set to ON, the User Exit does not update the
Admin DB during indirect archiving operations. brarchive
updates the Admin DB only during the next archiving
operation. For SAP system releases lower and including 4.6D
where program sddb6mir is used, sddb6mir updates the
Admin DB as well.
DB2DB6_UEXIT_RETRIEVE_WO_DB By default, this variable is not set or set to OFF.
If this variable is set to ON, 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.
DB2DB6_CORE By default, this variable is not set or set to OFF.
If this variable is set to ON, the Admin Tools executables write
a core file in UNIX instead of trying to handle exceptions
internally. We strongly recommend that you do not set this
variable to ON unless you are asked to do so by SAP support.
DB2DB6_NO_EJECT By default, this variable is not set or set to OFF which
generally avoids ejection of the tape To eject the tape, which
is the default behaviour, set this variable to ON.
DB2DB6_TSM_TIMEOUT Disconnects DB2 from TSM after a specified time in seconds
of no response . By default, this variable is not set. To switch
off this function, set this parameter to zero.
July 2006 75
DB2DB6_LIBDB6SC_SCRIPT By default, this variable is not set.
If you want to archive log files using a customer script with
brarchive, the value of the variable must be set to the fully
qualified path of the customer script.
For more information, see Indirect Archiving Using a Customer
Script [Page 89].
DB2DB6_TSM_MULTITHREADED By default, this variable is not set or set to OFF.
If you want to use the TSM LANFREE feature, you must set
this variable to ON.
For more information, see Configuring TSM (Tivoli Storage
Management) [Page 90].
DB2DB6_TSM_SLIB By default, this variable is not set or set to OFF.
You only have to set this variable if the currently shown
shared library version changes in newer versions of TSM. We
strongly recommend that you do not set this variable to ON
unless you are asked to do so by SAP Support.
DB2DB6_ADMDB_REORG_FREQUENCY By default, this variable is not set. The default value of seven
days applies.
By setting this variable, you can specify how often the Admin
DB is reorganized :
• –1 = never
• 7 = default value
DB2DB6_TRC_<TOOL> By default, this variable is not set or set to OFF.
If you set this variable to ON, the tracing for <TOOL> is
activated.
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 Specifies the path where the trace files of format
<TOOL>.<timestamp>.trc are created.
DB2DB6_TRC_<TOOL>_FILE Overrides DB2DB6_TRC_<TOOL>_PATH.
If this variable is used, the same trace is used for all runs of
<TOOL>, which is set to the fully qualified path of the trace file.
76 July 2006
Configuration Variables of Other Tools
The following table lists the configuration variables of the redirected restore tool brdb6brt
and the CCMS tools, which are contained in file init<SAPSID>.db6, and their values.
Variable Default Description
Value
DB2DB6_DMDB6BKP_RETRIES 10 Backup retries in
case of offline
backups.
DB2DB6_DMDB6BkP_TAPE_PATTERN \\ Pattern which
distinguishes tapes
(Windows only)
from normal
directories
DB2DB6_DMDB6BKP_BLOCK_SIZE 1024 Sets backup block
size for tapes
(used by tool
dmdb6bkp)
DB2DB6_DBDM6SRP_UPDATE_THRESHOLD 15 Updates threshold
in percent to flag
tables for
RUNSTATS.
DB2DB6_DMDB6SRP_TABLESIZE_THRESHOLD 1000 Specifies minimum
table size in rows
to flag tables for
RUNSTATS.
DB2DB6_DMDB6BKP_UTIL_IMPACT_PRIORITY 0 Specifies impact
priority for backup.
0 means no
throttling.
DB2DB6_DMDB6BKP_COMPRESS OFF Sets compression
flag for backup
DB2DB6_DMDB6BKP_INCLUDE_LOGS OFF Includes required
transaction log files
in an online backup
to recover the
database to any
consistent point in
time.
July 2006 77
DB2DB6_DB2DB6_BLOCK_SIZE 1024 Specifies backup
block size for tapes
(used by tool
db2db6)
DB2DB6_DB6SRPRTS_PCT_LONG_LOB 10 Percentage of rows
that are read for
table size
calculation for long
and lob columns.
DB2DB6_DMDB6RDI_REFRESH_LOG_INFO 14 Number of days to
refresh CCMS
archiving log
information
See also:
Appendix D: Example of File init<DBSID>.db6 [Page 212].
Direct Archiving
The User Exit archives log files either directly to disk (DB2DB6_ARCHIVE_PATH), to TSM or
to another vendor storage management product, that is log files are immediately copied from
the system to a safe backend and do no longer reside on the local system. The User Exit
program can be configured to support one of these options.
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. In case of TSM the User
Exit utilizes the TSM APIs to archive and retrieve log files. All other storage products (for
example, Legato Networker from Legato System, Inc.) deliver their own implementation of the
User Exit program.
78 July 2006
Direct archiving offers the following advantages:
• System configuration is less complex as no Admin DB or DB2 Control Center
Extensions are required.
• Backups can also be archived with the storage management product.
• Tape access and management using storage management systems are easy to handle
and no tape space is wasted.
• No extra space for an archive directory is needed when archiving to TSM or any other
storage management product. You only need extra space if you archive directly to
disk.
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. In
addition, setting DB2 registry variable DB2_BLOCK_ON_LOG_DISK_FULL=ON
(DB2 Version 7.2) or the corresponding database configuration variable
parameter BLK_LOG_DSK_FULL=YES (DB2 Version 8) also reduces the risk of
database failure. You also may consider to use infinite logging.
Indirect Archiving
This is the default configuration. The User Exit automatically copies log files to the directory
specified in the DB2DB6_ARCHIVE_PATH variable. Then brarchive is used to archive the
copied files. In this case, you can archive log files to TSM, tape or using a customer script.
Indirect archiving offers the following advantages:
• Log files are stored on the local system until deleted by brarchive.
In case your storage management system is unavailable, 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.
• Simple tape support is provided by the Admin Tools.
• Option brrestore –delete allows deletion of log files that were created before a
specific timestamp. With direct archiving this function is not available.
• The time of the archiving operation can freely be chosen. Thus, network traffic can be
avoided during the day by archiving during the night.
July 2006 79
However, when using indirect archiving, you have to take into consideration that there are a
few disadvantages. For example, log files located in the archive directory are unsafe until
stored to a safe backend by brarchive. The complexity of the solution, including additional
storage directories and an extra Admin DB, slightly increases the risk of failure. Especially the
existence of the Admin DB can cause problems in split-mirror scenarios and when performing
a homogeneous system copy.
See also:
For detailed information about direct and indirect archiving, see the following sections:
• Archiving Directly to TSM [Page 80]
• Archiving Directly to Disk [Page 81]
• Archiving to an Alternative Storage Management Product [Page 82]
• Indirect Archiving to Tape [Page 82]
• Indirect Archiving to TSM [Page 88]
• Indirect Archiving Using a Customer Script [Page 89]
80 July 2006
The following naming conventions on the TSM server apply:
TSM Variable Meaning
/<DBSID> TSM file space name
DB2 TSM file space type
/NODEyyyy High level file identifier, where yyyy is the node number
/Szzzzzzz.LOG Low level file name, where zzzzzzz is the log file number
For the database BIN on node NODE0000, archiving log file S0000599.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.LOG
For storing the log files, the archive copy group is used by default. If no archive copy group is
defined, a backup copy group is used. We recommend that you define an archive copy group.
DB2DB6_UEXIT_DIRECT = TSM:MC1+MC2
July 2006 81
the log file is transferred back to the log directory and the partition number is removed
automatically.
The log files in the archive directory need to be manually archived to disk using tools of your
choice.
Make sure that the vendor User Exit program is renamed and does not
overwrite the User Exit program delivered by SAP.
Set the DB2DB6_UEXIT_DIRECT and DB2DB6_VENDOR_UEXIT variables in the environment
file init<DBSID>.db6 using the following syntax:
DB2DB6_UEXIT_DIRECT = VENDOR
DB2DB6_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>,
specify the program with the fully qualified path.
For setup and error handling relating to the vendor User Exit program, refer to the vendor’s
documentation.
82 July 2006
Initially, a default device class is defined. This device class initially contains one defined
device:
Windows: /dev/mt0
AIX: /dev/rmt0
Solaris: /dev/rmt/0
Linux: /dev/st0
HP-UX: /dev/rmt/0m
1. In the navigation frame of the DB2 Control Center, expand the <system name> node
until the database names are visible.
2. From the context menu of the SAP database <DBSID> icon, choose SAP Tape
Management.
3. If required, log on as user db2<dbsid>.
The Tape Management dialog box appears.
4. Choose Tapes.
5. To display a list of all known device classes, expand the <System name> node in the
tree.
July 2006 83
6. You can choose from the following actions:
{ To add a new device class, choose Add Device Class from the context menu of
the <system name> node.
{ To change an existing device class definition, choose Edit from the context
menu of the <device class> node.
{ To remove a device class definition, choose Delete from the context menu of the
<device class> node.
All devices and tapes of that class will also be removed by the delete action.
For the first two actions, the Add/Change Device Class dialog box appears.
7. Enter or change the fields as required. The fields are described in detail in the table
following this procedure.
8. Choose Add or Change depending whether you want to add a new device class or
change existing data.
The fields in the Add/Change Device Class dialog box describe a tape device class. Most
fields have a corresponding configuration parameter as described in the table under
Parameters Affecting Log File Management Storage [Page 70].
84 July 2006
Field Description
Name Name of the device class. Required but can be freely chosen.
Capacity Overrides the tape_size configuration parameter.
Type Describes the device type you can choose from the menu.
Description Optional field that describes the device class.
Rewind Overrides the rewind configuration parameter.
Rewind Offline Overrides the rewind_offline configuration parameter.
Eject Identical to Rewind offline. Set this field to the same value.
Positioning Overrides the tape_pos_cmd configuration parameter.
1. In the navigation frame of the DB2 Control Center, choose SAP Tape Management
from the context menu of the SAP database <DBSID>.
2. If required, log on as user db2<dbsid>.
3. Expand the <system name> node, and the <device class> node to which the device
definition will be added.
4. Expand the Devices node.
A list of known device classes is displayed.
5. You can choose from the following actions:
{ To add a new tape, choose Add Device… from the context menu of the <device
class> node.
{ To change an existing Device definition, choose Edit from the context menu of
the <device> node.
{ To retrieve the label of a tape currently located in a tape drive, choose Retrieve
Tape Label from the context menu of the <device> node.
{ To remove a device definition, choose Delete from the context menu of the
<device> node.
For the first two actions the Add/Change Device dialog box appears.
July 2006 85
6. Enter or change the fields as required. Description is optional.
7. Choose Add or Change depending on whether you want to add a new tape or change
existing data.
Due to a limitation in the Admin DB design, such changes apply to all tape
classes and tape devices.
Initializing Tapes
Tapes must be initialized before files can be archived to them. This involves writing a header
file to each tape, containing information such as volume name, SAP system ID and tape
usage count. Only a single archive operation involving one or more log files is permitted on
an initialized tape. Tapes must normally then be re-initialized before new log files can be
archived to them. As described in Changing the Admin Tools Configuration [Page 70], tapes
can be re-used if the log files go out of date as defined by the expir_period configuration
parameter.
1. In the navigation frame of the DB2 Control Center, choose SAP Tape Management
from the context menu of the SAP database <DBSID>.
2. If required, log on as user db2<dbsid>.
3. Expand the <system name> node, and the <device class> node to which the tape to be
initialized belongs.
The Tape Management dialog box appears.
86 July 2006
4. From the context menu of the Tapes node, choose Initialize Tape….
The Initialize Tape dialog box appears
5. Enter the name of the new tape.
6. Choose the device where the tape is located.
If the tape has never been initialized before or was used to archive files less
than expir_period weeks ago, the initialization is not permitted unless the
Force initialization box is selected. You can change the value of the
expir_period parameter in the SAP Option Management dialog box.
To initialize a tape the first time, the Force initialization option must be selected.
7. To initialize the tape, choose Init.
All tape actions and their results can be seen by choosing Journal tab.
The following command initializes a tape with the name D4XA01 without
checking whether the tape has already been used or initialized. Messages are
only written to a protocol file. To initialize the tape, 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 157].
July 2006 87
4.2.5 Indirect Archiving to TSM
For indirect archiving to TSM, no special tasks must be performed other than configuring TSM
itself. You can find more general information about TSM configuration in Configuring TSM
(Tivoli Storage Management) [Page 90].
The following naming conventions apply on the TSM server:
TSM Variable Description
/<DBSID> TSM file space name
DB2 TSM file space type
/NODEyyyy High level file identifier, where yyyy
is the node number
/Szzzzzzz.LOG.YYYYMMDDHHMMSS.NODEyyyy Low level file name, 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, archiving the log file S0000599.LOG
would result in the following values:
• File space name: /BIN
• File space type: DB2
• High-level name: /NODE0000
• Low-level name:
/S0000599.LOG.20010606103645.NODE0000
For storing the log files the archive copy group is used by default if no archive copy group is
defined. Then a backup copy group is used.
88 July 2006
4.2.6 Indirect Archiving Using a Customer Script
brarchive und brrestore currently only support archiving to two backends: TSM and
tape. By using your own script, you enable the Admin Tools to archive log files to any
backend, which means any other storage product or storage device, according to your
requirements.
The script needs to be able to archive, retrieve or delete log files.
The sequence of the parameters in the script must be the same as in the table.
...
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 Description
LFMVND_STATUS_OK=0 Indicates success of the action performed.
LFMVND_RC_ERROR=64 Indicates failure of the action performed.
LFMVND_COMMAND_NOT_SUPPORTED=71 Indicates that the action specified in the
script is not supported.
You must make sure that you specify the correct return codes for every action
performed − as described in the table.
For example, 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. Thus, the content of the Admin DB becomes
inconsistent and you risk to lose log files.
July 2006 89
Writing Your Own Script
You use the sample script db6sctsm.smp, which is part of the Admin Tools delivery, to write
your own script. The shell script is designed for UNIX. If your system is running on Windows,
you have to write a batch file or an executable. In the sample script the TSM client dsmc is
used to archive, retrieve or delete log files.
We strongly recommend that you copy the sample script to avoid overwriting
during the next Admin Tool installation. After having copied the script, you can
enter your archive, retrieve or delete commands.
Procedure
Before the DB2 Database Manager db2<dbsid> can use TSM, you have to perform the
following steps:
...
90 July 2006
4.3.1 Configuring TSM Files dsm.opt and dsm.sys
On UNIX systems, the TSM files dsm.opt and dsm.sys must be configured. On Windows
systems, the TSM file dsm.opt must be configured. The files must contain the following
parameters:
UNIX
File dsm.opt
Parameter Value
SERVERNAME <TSM server name>
File dsm.sys
Parameter Value
SERVERNAME <TSM server name>
COMMETHOD TCP/IP
TCPPORT 1500
TCPSERVERADDRESS <TSM server IP address or host name and
domain name>
PASSWORDACCESS Generate
PASSWORDDIR /etc/adsm
The entry of SERVERNAME in the dsm.opt file must fit the value SERVERNAME
in the dsm.sys file.
Windows
File dsm.opt
Parameter Value
COMMMETHOD TCP/IP
TCPPORT 1500
NODENAME <TSM client>
TCPSERVERADDRESS <TSM server IP address or host name and
domain name>
PASSWORDACCESS Generate
July 2006 91
4.3.2 Configuring TSM Environment Variables
TSM environment variables DSM_DIR, DSMI_DIR, DSM_CONFIG, DSMI_CONFIG, 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.
The following list provides additional information about these variables that you have to take
into consideration depending on the Admin Tools version you are using:
• 4.6D Admin Tools
{ UNIX
During the installation of the SAP system with R3SETUP the files
.dbenv_<hostname>.csh and .dbenv_<hostname>.sh are created in the
home directory of db2<dbsid> and <sapsid>adm. These files contain some
default values for the TSM variables, which are not valid in most cases and
which must be corrected.
{ 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.
• 6.NN Admin Tools or higher
{ UNIX
The sddb6ins program, which installs the Admin Tools, adds an entry to the
profile, .cshrc and .login scripts in the home directories of db2<dbsid>
and <sapsid>adm, which call the dbaenv_<hostname>.csh and
dbaenv_<hostname>.sh script.
The shell script dbaenv_<hostname>.csh and dbaenv_<hostname>. sh
add the TSM API-specific environment variables DSMI_DIR, DSMI_CONFIG and
DSMI_LOG, as well as the TSM client-specific environment variables DSM_DIR,
DSM_CONFIG and DSM_LOG. The values, which are set there, work on all
standard TSM installations and generally do need not to be corrected.
{ Windows
If the TSM software is installed on the database server before the sddb6ins
program is called, sddb6ins detects this and sets the TSM API-specific
environment variables DSMI_DIR, DSMI_CONFIG and DSMI_LOG to appropriate
values in the user environment of users db2<dbsid> and <sapsid>adm.
If you install the TSM software afterwards, you can rerun sddb6ins with the –i
option and sddb6ins will add these variables.
92 July 2006
Environment Variables for TSM:
The following table provides an overview of all environment variables you should check:
Variable Value Set In
DSMI_DIR Location of TSM API library with the Windows:
following default:
User environment of
Windows: db2<dbsid> and <sapsid>adm
<drive>:\progra~1\Tivoli\ UNIX:
tsm\api
For 6.NN Admin Tools:
UNIX:
• $INSTHOME/admintools/bin/dbaen
For 6.NN Admin Tools: v_<hostname>.csh
• dbaenv_<hostname>.csh • dbaenv_<hostname>.sh
• dbaenv_<hostname>.sh For 4.6D Admin Tools:
For 4.6D Admin Tools: • ~/.dbenv_<hostname>.csh
• ~/.dbenv_<hostname>.csh • ~/.dbenv_<hostname>.sh
• ~/.dbenv_<hostname>.sh
DSMI_LOG Log directory for TSM API with Same as for variable DSMI_DIR
the following default: as described in this table.
Windows:
<drive>:\progra~1\Tivoli
\tsm\api
UNIX:
$INSTHOME/errors
DSMI_CONFIG Location of dsm.opt file with Same as relevant location
the following default: for variable DSMI_DIR as
described in this table
Windows:
<drive>:\progra~1\Tivoli
\tsm\baclient\dsm.opt
UNIX:
$INSTHOME/sqllib/adsm
/dsm.opt
UNIX only: Location of TSM client with the UNIX only:
following default:
DSM_DIR For 6.NN Admin Tools:
For 6.NN Admin Tools:
• $INSTHOME/admintools/bin/dbaen
• dbaenv_<hostname>.csh v_<hostname>.csh
• dbaenv_<hostname>.sh • $INSTHOME/admintools/bin
For 4.6D Admin Tools: For 4.6D Admin Tools:
• ~/.dbenv_<hostname>.csh • ~/.dbenv_<hostname>.csh
• ~/.dbenv_<hostname>.sh • ~/.dbenv_<hostname>.sh
July 2006 93
UNIX only: Log directory for TSM client. UNIX only:
DSM_LOG The default is $INSTHOME/errors Same as for variable DSM_DIR
as described in this table
UNIX only: Location of dsm.opt file for TSM UNIX only:
DSM_CONFIG client. The default is:
Same as for variable DSM_DIR
$INSTHOME/sqllib/adsm/ as described in this table
dsm.opt
We recommend that for archiving log files you use a disk storage pool. With
this pool, you can achieve a better system and rollforward performance if
caching on the disk storage pool is switched on.
For backups, however, we recommend that you do not use such a disk storage
pool. If the DB2 backup image does not fit into this disk storage pool, TSM will
fail. An extremely large disk storage pool would be necessary to avoid this
problem.
94 July 2006
4.4 DB2 Configuration Parameters
DB2 variables are configured by the SAP installation to ensure that DB2 and the Admin Tools
work. This section lists parameters, which influence the Admin Tools directly, with a brief
description. If it is necessary to change them, refer to the DB2 documentation.
July 2006 95
4.5 Disk Space Considerations for Running the
Admin Tools
The following section provides additional information about the directories that are needed if
you want to install the Admin Tools. 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.
• Indirect archiving
The free space in the directory where DB2DB6_ARCHIVE_PATH is pointing to, needs to
be dimensioned, 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.
The free space in the directory where DB2DB6_TEMP_DIR is pointing to needs to be
dimensioned, so that two exports of the Admin DB fit into it. Otherwise, brarchive
fails to store the Admin DB.
Protocols
• User Exit protocols
The User Exit writes its protocol files db2uext2.NODExxxx.log and
dbuext2.NODExxxx.err to the directory where the database manager configuration
parameter DIAGPATH points to.
• brarchive/brrestore protocols
These log files are initially generated in the directory where DB2DB6_TEMP_DIR points
to. They are moved to the protocols directory at the end of the
brarchive/brrestore run.
The directories differ for the Admin Tools version as follows:
{ For 6.NN Admin Tools:
<INSTHOME>/admintools/protocols
{ For 4.6D Admin Tools:
brarchive: <INSTHOME>/saparch
brrestore: <INSTHOME>/saprest
These directories need to be dimensioned to hold the small protocol files.
96 July 2006
Trace Files
Trace files are only generated if the user has explicitly enabled trace file generation in the
init<DBSID>.db6 file. The trace files are only required to determine defects or by the SAP
support to fix problems.
The trace file directory can be configured in the init<DBSID>.db6 file for each executable
separately. The default directories are:
• For 6.NN Admin Tools:
<INSTHOME>/admintools/TraceFiles
• For 4.6D Admin Tools:
<DB2DB6_TEMP_DIR>/TraceFiles
July 2006 97
5 Regular Administration
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.
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.
98 July 2006
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 70].
{ 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 82].
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 70].
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.
Tapes must be initialized before brarchive can use them. For more
information, see Indirect Archiving to Tape [Page 82].
July 2006 99
Archiving Log Files to Single Tape
For more information about the barchive syntax, see brarchive - Log File Archive Tool
[Page 157].
• 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
221].
Normally there is no need to delete files from this directory. Do not delete files
that are still needed by the database.
Log files will be deleted from the log directory if you:
• Drop a database.
This action deletes all log files in the current log path directory. You may need to back
up these log files beforehand, for future recovery purposes.
• Recover the database to a point in time.
When recovering the database to a point in time, log files chronologically past the point
in time are re-used and therefore lost. For example, if a roll-forward operation only
needs log data up to the middle of log file 35 and you restart the database, the
remainder of log file 35 and the whole of log files 36 and onwards will be re-used.
If you need to restore again past the point in time used earlier, you cannot do so since
the log files were re-used. Retrieve the original set of log files manually to a different
location and copy them back for the restore action. You can identify the original log files
easily by their timestamp if they have the following format:
Snnnnnnn.LOG.<timestamp>.NODExxxx.
To actively delete log files, use the PRUNE LOG FILE command. This DB2 command
deletes all log files in the log directory created prior to a nominated log file. It will only do so
from the active log path. If any log files have been moved to another path, they will not be
considered by this command.
The information provided for the DBA Cockpit is valid for SAP Web AS 6.10 or
higher.
For SAP system Release 4.6x, you must make sure that you have installed the
DBA Cockpit as described in SAP Note 300828.
If you are using the new features of DB2 Version 8.2.2, that is, DMS AutoResize
or AutoStorage, you do not have to manually add space to containers.
Be aware that running a REORGCHK on the listed tables may take a long time
and affect the database performance.
To adjust the tables, choose REORGCHK. Otherwise, choose Continue.
For more information, see the SAP Online Documentation in the SAP Library.
The information provided for the DBA Cockpit is valid for SAP Web AS 6.10 or
higher.
For SAP system releases lower than and including 4.6x, you must make sure
that you have installed the DBA Cockpit as described in SAP Note 300828.
We recommend that you keep the monitor switches turned on. SAP provides a
graphical performance monitor for DB2 to analyze the database activity basis of
the DB2 monitor switches.
The information provided in this paragraph is only valid for SAP system
Release 4.6C and higher.
You can access information about 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. The values of Overall Buffer Quality, Data Hit
Ratio and Index Hit Ratio should be more the 95 percent. Otherwise, contact SAP remote
services Early Watch to improve the values.
The information provided in this paragraph is only valid for SAP system
Release 4.6C and higher.
You can access information about lock escalation, deadlocks and lock timeouts by calling
transaction ST04 and choosing Performance → Database → Buffer Pools in the navigation
frame of the DBA Cockpit.
The value of Lock Escalations, Deadlocks Detected and Lock Timeouts should be almost
zero. Otherwise, contact SAP remote services Early Watch to improve the values.
For more information, see the SAP Online Documentation in the SAP Library.
The information provided in this paragraph is only valid for SAP system
Release 4.6C and higher.
You can access information about sort overflows by calling transaction ST04 and choosing
Performance → Database → Sorts in the navigation frame of the DBA Cockpit.
The value of Sort Overflows divided by Total Sorts should result in less than 0,01. Otherwise,
contact SAP remote services Early Watch to improve the values.
For more information, see the SAP Online Documentation in the SAP Library.
Procedure
You can access information about the dynamic SQL cache by calling transaction ST04 and
choosing Performance → SQL Cache in the navigation frame of the DBA Cockpit. You can
retrieve the latest cached SQL statement by choosing Refresh.
If you retrieve data for the first time, a Selection Criteria dialog box appears where you can
limit the result set displayed. Depending on your system, the snapshot can give you a wide
range of information, which might lead to a very large result set.
If a snapshot already exists, that is, if you had already chosen Refresh at least once, you can
display the last snapshot taken by choosing Set Selection Criteria.
For more information, see the SAP Online Documentation in the SAP Library.
Explain Function
If a statement is displayed, choose Explain to list the access plan for the statement execution.
The Explain function provides a detailed analysis of expensive SQL statements, for example,
on how DB2 accesses the data to resolve the SQL statements.
To display the access plan of a statement from the SAP performance monitor:
...
To reorganize tables we recommend that you use the jobs provided in the DBA
Planning Calendar. These jobs automatically update the table and index
statistics afterwards.
The information provided in this section is valid for SAP Web AS 6.10 and
higher.
For SAP system Release 4.6x, you must make sure that you have installed the
DBA Cockpit as described in SAP Note 300828.
You can schedule background jobs to display information about 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. If you want to display
details on a single protocol record, double-click it.
For more information, see the SAP Online Documentation in the SAP Library.
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.
The following is necessary to perform a backup:
• You must have SYSADM, SYSCTRL, or SYSMAINT authorization to use the BACKUP
DATABASE command.
• You must start the database manager (db2start) before taking a database backup. If
you want to use the DB2 Control Center, you do not need to explicitly start the DB2
Database Manager.
• In a partitioned database system, keep a copy of the db2nodes.cfg file with any
backup copies you take. This copy is as a protection against possible damage to this
file.
The database may be local or remote. The backup remains on the database server unless a
storage management product, such as Tivoli Storage Manager (TSM), is used.
You can back up a database to a specified disk, a tape, or a location managed by TSM or
another vendor storage management product.
After an online backup, DB2 forces the currently active log file to be closed and as a result it
will be archived. This ensures that an online backup has a complete set of archived log files
available for recovery.
For the complete syntax of this command check the DB2 documentation.
Make sure that you have installed and set up the DB2 Control Center before
performing these steps. Fore more information, see Installation of the DB2
Control Center [Page 61] and Setting Up the DB2 Control Center [Page 62].
1. Start the DB2 Control Center
2. From the context menu of <DBSID> choose Backup → Database… .
3. In the dialog box that appears, enter the required values, including the correct backup
target.
4. Choose Backup now.
A job will be generated that can be monitored using the DB2 Control Center Journal.
For the complete syntax check the DB2 documentation and replace n wit the
catalog node number (the default value is 0).
3. To back up all other nodes in parallel, enter the following command:
db2_all "<<-n< db2 backup db <DBSID> ... "
Make sure that you have installed and set up the DB2 Control Center before
performing these steps. Fore more information, see Installation of the DB2
Control Center [Page 61] and Setting Up the DB2 Control Center [Page 62].
...
db2ckbkp SAMPLE.0.krodger.NODE0000.CTN0000.19990817150714.*
If the backup resides on TSM, refer to the information about db2adutl and db6adutl
provided in Managing Backups and Logs Archived on TSM [Page 131].
For more information about the db2ckbkp utility, see db2ckbkp - DB2 Check Backup Utility
[Page 166].
You can only use an online backup for recovery if the database log files that are
created during the online backup are available.
The operating system passwords are not changed when you use the -create
option.
1. In the Log File Management, Tape Management or Log File Maintenance dialog box,
choose Journal.
2. Choose the radio button with the category of actions you want to browse.
A list of actions is displayed with start and end time, return code (RC), category and
return message.
3. If you want to see an action that took place more than seven days ago, you can use the
Back button to go back in steps of seven days.
To update the list of actions with the most current data, choose Refresh.
Procedure
You can delete (or maintain) these special log files using either the DB2 Control Center
Extensions or the DB2 command line.
Procedure
Using the DB2 Control Center Extensions
...
To delete tape PRD01 from the Admin DB, enter the following command:
brrestore –dt –v PRD01 –out
2 Create Restore
brdb6brt
Script
Customized
Source DB DB Copy Restore User
Script 5 Create
Redirected
Restore 8
brdb6brt Check 7
to change
container Create 6
layout
Customized
Restore
Script
The graphic above illustrates the tasks relevant to a redirected restore process. First of all,
back up the database and retrieve data on the container layout (1) using tool brdb6brt. The
tool creates a backup of the database (3) and a CLP script for restoring this backup (2). This
script corresponds to the container layout of the database at the time of the backup. The
script can then be adapted to the needs of the database to be restored (4). This can involve
changes to the number, size or location of the containers for a restore to the same database
(6 + 8). 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). Additionally,
brdb6brt can serve to check the script (7). It reports any failure the restore process might
encounter. In this way, failures can be avoided before they occur.
The following procedure only applies if you are using DMS tablespaces. You
must not use it for tablespaces that are managed by DB2’s automatic storage
management.
You want to change the layout of the containers of your current database. This can comprise
changing the number of containers of a tablespace, changing their sizes or their location in
the file system. The following procedure is an example of of changing the container layout
and storing the backup into three separate directories:
...
1. To create the backup and the restore script, enter the following command:
brdb6brt –s <DBSID> –bm BOTH –bpt Y:\BACKUPS1 Y:\BACKUPS2
Y:\BACKUPS3
Since the database is rather large, the backup splitted and stored in three separate
directories..
2. Edit the script SDB.scr and change the container’s location, size and number.
3. To change the container layout, restore the database using the following command:
db2 –tvf <DBSID>.scr
If automatic storage is enabled for a database, the database can have AutoStorage
tablespaces as well as DMS tablespaces without AutoStorage. The database has one or
more storage paths (that are database parameters) and automatically handles the space
allocation for the automatic storage table spaces. The DMS tablespaces without AutoStorage
are handled as described under Changing the Container Layout.
1. To create the backup and the restore script, enter the following command:
brdb6brt –s <DBSID> –bm BOTH –bpt Y:\BACKUPS1 Y:\BACKUPS2
Y:\BACKUPS3
Since the database is rather large, the backup is splitted and stored in three separate
directories..
2. Make the backup images and the script available on the target machine. This can be
accomplished by copying them to the machine via ftp.
3. Log on to the target machine and edit the script SDB.scr. Change the container’s
locations. You also need to adapt the location of the backup image to the directory
where the containers are available on the target machine.
4. Restore the database by entering:
db2 –tvf <DBSID>.scr
If you have a multi-partitioned database, you need to run brdb6brt for all
partitions of your database. To do so, use the –nn <node number>
parameter. The scripts created include the partition number, which prevents
existing scripts from other database partitions from being overwritten.
If you use the –nn all option, scripts for all database partitions are
automatically created.
If you are using AutoStorage tablespaces and a database that also has
automatic storage enabled, you must not use the following procedure.
With brdb6brt patch 5 or higher, you can create relocate scripts to move existing containers
to other directories using the db2relocatedb tool. Furthermore, you can use these scripts
to initialize mirrored databases with a modified container layout using the db2inidb tool and
its parameter RELOCATE USING.
1. To create the relocate script, enter the following command:
brdb6brt –s SAMPLE –bm RETRIEVE_RELOCATE
Script SAMPLE is generated. You need to modify it according to your requirements.
2. To move containers using the db2relocatedb tool, enter the following command:
db2relocatedb –f SAMPLE.scr
3. To initialize the mirrored database, for example, to create a database snapshot using
the db2inidb tool, enter the following command:
db2inidb SAMPLE as snapshot relocate using SAMPLE.scr
The following procedure only applies if you are using AutoStorage tablespaces
and a database that also has automatic storage enabled.
When automatic storage is enabled for a database, it can have automatic storage table
spaces as well as “normal” DMS table spaces. The database has one or more storage paths
(that are database parameters) and automatically handles the space allocation for the
automatic storage table spaces. The “normal” DMS table spaces are handled as described
under Changing the Container Layout.
To change the storage paths for the AutoStorage tablespaces, proceed as follows:
1. Create the relocate script by entering the following command:
brdb6brt –s SAMPLE –bm RETRIEVE_RELOCATE
2. Edit the script SDB.scr and change the autostorage paths for the autostorage table
spaces
3. Move containers using the db2relocatedb tool by entering the following command:
db2relocatedb –f SAMPLE.scr
For example, 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,/db2/sample=/db2/sam
To query, extract and delete backups and log files, you should use the following tools:
DB Backups Log Files saved Log Files saved
with brarchive using the User
Exit in Direct
Mode
TSM Backup Mode db2adutl brarchive db6adutl
The procedures provided in the following sections are only intended for
experienced DB2 database administrators. Be aware that when using these
options, problems with the log file management tools might occur.
For more detailed information about the db2inidb tool, see the IBM DB2
documentation Data Recovery and High Availability Guide and Reference.
With DB2, 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. If you do not
use these tools, you may cause irrevocable data loss or unexpected system
behavior.
1. To switch the database mode to write suspend, 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.
2. Create the split image. The split image must include:
{ All database containers (sapdata*)
{ The database directory:
UNIX: /db2/<DBSID>/db<dbsid>
Windows: <drive>:\db2\<DBSID>\db<dbsid>
Make sure that the image does not include log directory, archive directory and
retrieve directory. This is important because, if the split image is mounted for a
database restore, the current log files, which are contained in these directories,
will be overwritten with the old log files contained in the split image.
3. 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.
4. Archive the split image.
Performing a Restore
1. Log on to the database server as user db2<dbsid>.
2. To restore the split image using the storage management system tools, enter the
following command:
db2inidb <DBSID> as mirror
The database is now in rollforward pending mode.
3. 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.
{ For indirect archiving:
You have to recreate the Admin DB and restore required log files. To do so,
proceed as follows:
i. Delete the Admin DB using the following command:
db2 drop db ADM<DBSID>
ii. 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.
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>. Then the Admin DB is not contained in the split image and
contains up-to-date information after the split image has been mounted.
By default, the Admin DB is created in the path specified by the database
manager configuration parameter DFTDBPATH. You can use the redirected
restore tool to move an existing Admin DB. Alternatively, if the Admin DB has
not existed so far, you can set the database manager configuration parameter
DFTDBPATH to a different directory, for example, to /db2/ADM<DBSID> before
calling sddb6ins –i. You should reset parameter DFTDBPATH after
sddb6ins –i was called.
4. Perform a rollforward recovery to the end of logs as follows:
a. Start the rollforward recovery using the following command:
db2 rollforward database <DBSID> to end of logs
b. Check if the rollforward recovery is complete using the following command:
db2 rollforward database <DBSID> query status
If the rollforward recovery is not complete, you have to correct the problem, for
example, by providing missing log files and repeating step a.
c. Complete the rollforward recovery using the following command:
db2 rollforward database <DBSID> to end of logs and
complete
If the operation was successful, the database should now be in the most current
state and can be accessed again.
As an example, 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, we strongly recommend that you use
direct archiving.
Procedure
On the source system:
...
1. To switch the database mode to write suspend, 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.
2. Create the split image. The split image must include:
{ All database containers (sapdata*)
{ The database directory:
UNIX: /db2/<DBSID>/db<dbsid>
Windows: <drive>:\db2\<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.
Be aware that all databases using circular logging are subject to some
restrictions, for example, online backups and rollforward recovery are not
supported. If you require these features on the target system, you must reinstall
and reconfigure the log file management tools on the target system.
Procedure
Performing a Backup
On the source system:
...
1. To switch the database mode to write suspend, 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.
2. 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\<DBSID>\db<dbsid>
3. 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.
4. Archive the split image.
On the target system:
1. To create a database instance using DB2 instance creation tool db2icrt, enter the
following command:
db2icrt <instance_owner>
2. Log on as instance owner.
3. To start the database instance, enter the following command:
db2start
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. Thus, the restore procedure is equivalent.
The backup performed on the standby system is not listed in the backup history
of the source system.
As an example, the following command would delete all log files before 1
January 2003:
brrestore –delete 20030101000000 –force
hot-
source
standby
database
database
The following graphics show the differences for direct or indirect archiving.
hot-
source
standby
database
database
log_dir log_dir
Storage
db2uext2 Management db2uext2
ARCHIVE System RETRIEVE
hot-
source
standby
database
database
db2uext2
RETRIEVE
without DB
db2uext2
ARCHIVE copy log file on
regular basis
log_archive standby_dir log_archive
brarchive
backend
Procedure
The following procedures describe the end of log scenario. The other
scenario, that is recovering from logical failures, works according to the end of
log scenario, 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.
1. To switch the database mode to write suspend, 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.
2. Create the split image. The split image must include:
{ All database containers (sapdata*)
{ The database instance directory:
UNIX: /db2/<DBSID>/db<dbsid>
Windows: <drive>:\db2\<DBSID>\db<dbsid>
Make sure that the image does not include the log directory, the archive
directory and the retrieve directory.
3. 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.
4. Archive the split image.
...
1. Recreate the content of the Admin DB on the hot-standby system using the latest
Admin DB backup SAR file. You can find the latest Admin DB backup SAR file in one of
the following locations:
{ In the standby directory (DB2DB6_STANDBY_DIR).
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>.db6 file.
{ In directory <DB2DB6_TEMP_DIR>/adminDB_<DBSID> that is located on the
source system.
If the Admin DB backup SAR file is not in one of these locations or cannot be
accessed, you have to perform an emergency restore using
brrestore –ex.
To recreate the content of the Admin DB, enter the following command:
sddb6ins –r <SAR file>
2. Perform a rollforward recovery to end of log files.
a. To start the rollforward recovery, enter the following command:
db2 rollforward db <DBSID> to end of logs
b. To check if the rollforward recovery is complete, enter the following command:
db2 rollforward db <DBSID> query status
If the rollforward recovery is not complete, you have to correct the error, for
example, by providing missing log files and repeat step a.
c. To complete the rollforward recovery, enter the following command:
db2 rollforward database <DBSID> and complete
If the operation was successful, the hot-standby database should now be in the
most current state and can be accessed again.
1. Set DB2 instance registry variable DB2_NEWLOGPATH2 using db2set. 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.
2. To activate this change, restart the instance.
To activate dual logging on DB2 UDB for UNIX and Windows Version 8, proceed as follows:
1. Set DB configuration parameter MIRROR_LOGPATH. Enter:
db2 update db cfg for <DBSID> using MIRROR_LOGPATH <second log
directory>
2. To activate this change, restart the instance.
DB2 calls the User Exit just once for each log file regardless if dual logging is
activated or not. This means that the log files are not archived twice. If you use
indirect archiving, the Admin DB keeps track of only one log file. brarchive
stores only one log file.
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.
Procedure
To adjust the content of the Admin DB, 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.
1. In the navigation frame of the DB2 Control Center, from the context menu of the SAP
database, choose SAP Log File Management.
2. If required, enter user <sapsid>adm or db2<dbsid>.
The Logfile Management dialog box appears.
Due to a program limitation, the oldest log file must be at the start of the range.
The -a arguments (shown in the following tables) must be log file numbers and
not log file names. For more information about the syntax of brrestore, see
brrestore - Log File Retrieval Tool [Page 163].
We recommend that you first recover the Admin DB if necessary, and then use
the standard restore command brrestore -a as described in the tables
above.
Prerequisites
• The SAP database has been restored from a backup and left in
ROLLFORWARD_PENDING state.
• 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.
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 153].
2. Use the DB2 Control Center Extensions to restore the log files from TSM or tape as
described in “Restoring Log Files” in this section.
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 about the syntax of brrestore and non-rewind addresses, see
brrestore - Log File Retrieval Tool [Page 163].
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.
<non rewind addr> is the non-rewind address of the tape for restoring from
tape. For more information about non-rewind addresses, see brrestore – Log
File Retrieval Tool [Page 163].
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“
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.
Parameter Action
-h Displays the application command line syntax.
-help
-V Displays the application information and library version
-Version information if -d is specified.
Modifier Description
-d <device> Device to archive files to retrieve files from tape,
tsm or any other backend using a customer
-device <device>
script. -d tsm can be followed by a single TSM
management class or by two TSM management
classes separated by ‘+‘.
-DEB [<level>] 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.
-one No automatic tape eject after successful archive
operation
-out Displays the protocol on the command line
(stdout).
brarchive and brrestore only automatically display output with -h and -V.
To display the output for other actions, -out must be specified.
Backup/Retrieve Mode
To create a backup or a restore script, use the following syntax:
Command Parameter:
Parameter Description
-V Displays the version information (patch level) brdb6brt.
-h Displays an overview of the command line options of
brdb6brt.
-bm BACKUP Creates a backup of the specified database only.
-bm RETRIEVE Creates the restore script for the specified database only.
Command Parameters
Parameter Description
-bm CHECK Checks whether a given restore script would succeed on
this machine
-ip <ScriptName> 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 multi-
partitioned environment.
-nn <NodeNr> In a multi-partitioned environment the check operation is
done against this node.
-user <Username> To perform the database dependent checking of the check
mode as another user, you can specify the user name
here.
-using <Password> Password for the specified user
Parameter Action
-h Displays the application command line syntax.
-help
-V Displays application information and library version
information if -d is specified.
Modifier Description
-d <device> Device to archive files to retrieve files from tape, TSM or
-device <device> any other backend using a customer script. -d tsm can
be followed by an TSM management class
-DEB [<level>] 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.
-one No automatic tape eject after successful archive
operation
-out Displays the protocol on the command line (stdout).
brarchive and brrestore only automatically display output with -h and -V.
To display output for other actions, -out must be specified
If you have more than one tape device to address, replace the “0” with “1”, “2”
and so on as appropriate. For example, the non-rewind address of the second
tape on Solaris is /dev/rmt/1n.
Unlike the other programs described here, the User Exit parameters allow no
spaces before their arguments.
The -SP and -LS parameters are only used if a raw device is used for logging.
Parameter Description
-OS<os> Platform on which the instance is running, for example, AIX,
Windows, Solaris, HP-UX and Windows 98
-RL<db2rel> DB2 release level
-RQ<request> Request type, for example, archive or retrieve
-DB<dbname> Database name
-NN<nodenum> Local node number
-LP<logpath> Fully qualified path to the log files. The path must contain the
trailing path separator.
-LN<log name> File name of the log file
-AP<TSMpasswd> TSM password. It is passed to the User Exit if it is provided
in the database configuration.
-SP<startpage> Log extent starts at this number in steps of 4 KB pages of
the device.
-LS<logsize> Size of the log extent in 4 KB pages
-V Displays the version information of the db2uext2 tool
Parameter Description
QUERY Queries the TSM server for log files.
EXTRACT Copies log files from the TSM server to the current
directory on the local machine.
DELETE Either deactivates log files or deletes log files on the
TSM server.
ARCHIVE Performs action for log files in TSM archive copy group.
BACKUP Performs action for log files in TSM backup copy group.
BOTH Performs action for log files in TSM archive and backup
copy group.
BETWEEN <sn1> AND Specifies that the logs between log sequence number 1
<sn2> and log sequence number 2 are to be used.
DB <dbname> Considers only those objects associated with the
specified database name.
NODE <n> Considers only those objects created by the specified
node number.
WITHOUT PROMPTING The user is not prompted for verification before objects
are deleted.
Parameter Description
-h Prints help text.
-V Prints version information.
-n <dbname> Database name. The default value is the value of environment
variable DB2DBDFT.
-auth User authentication. If this option is not specified, db6util tries
to retrieve the <sapsid>adm password from the DB2 password
service.
-o Log file. The default value is stdout.
-w Result file. The default value is stdout.
-r RUNSTATS on single tables and all indexes
-rf RUNSTATS on tables provided in file first
-rv RUNSTATS on tables with VOLATILE attribute. Tables flagged in
DBSTATC with ACTIVE = N are not affected. The VOLATILE
attribute is removed after RUNSTATS.
-f Gets tablespace free space information.
-dg Gets database parameter.
-dm Modifies database parameter.
-mg Gets database manager parameter.
-mm Modifies database manager parameter.
-sd Displays overview over deadlocked processes in application
snapshot.
-sl Displays overview over deadlocked processes and processes in
lock wait status in application snapshot.
Command Parameters
Parameter Description
<dbName> Specifies the SAP database name <DBSID>.
NODExxxx Partition number, for example, NODE0002
ONLINE | OFFLINE Specifies online or offline backup mode.
ADSM OPEN <num> SESSIONS Number of I/O sessions to be used with TSM
TSM OPEN <num> SESSIONS Identical to the –ADSM option
TO <targetArea> Lists directory or tape device names.
XBSA <vendorLibrary> Name of shared library that is compliant with the
XBSA standard, whichcontains the vendor backup
I/O functions
LOAD <vendorLibrary> Name of shared library containing the vendor backup
OPEN <num> SESSIONS I/O functions and the number of I/O sessions to be
used
BUFFERS <num> Number of buffers to be used
BUFFERSIZE <size> Size, in pages, of the buffer used when building the
backup image. The default value is 1024.
PARALLELISM <p> Number of buffer manipulators to be spawned during
the backup process. The default value is 1.
Command Parameters
Parameter Description
-V Prints out the version information (patch level) of
dmdb6srp
-h Prints out an overview of the command line
options of dmdb6srp
-n <dbsid> Specifies the SAP database name <DBSID>.
-t ALL Performs the operation on all database tables.
-t DBSTAT Performs the operation on all selected DBSTATC
tables.
-t CALL Calculates REORGCHK information about all
database tables with current statistics.
-t <tabschema>.<tabname> Table name, for example, SAPR3.MONI
-m <statisticalOption> To use a statistical option, specify one of the
following letters:
• Y Basic table and extended index statistics
This is the default value.
• B Basic table and basic index statistics.
• T Basic table and no index statistics
Command Parameters
Parameter Description
-V Prints out the version information (patch level)
dmdb6rts
-h Prints out an overview of the command line options for
the tool dmdb6rts
-n <dbName> Specifies the SAP database name <DBSID>.
-t <tablespace> Specifies the name of the tablespace that contains the
tables to be reorganized.
-m Specifies the name of the tablespace where the DB2
<tempTablespace> Database Manager can temporarily store the table
being reconstructed.
The page size must match the page size of the
tablespace specified with the –t switch.
On UNIX, sddb6ins must always be called with root authorization but with the
user environment for user db2<dbsid> as described in Installation and Setup
[Page 41].
Command Parameters
Parameter Description
Command Parameters
Parameter Description
-V Prints out the version information (patch level) of sddb6mir
-h Prints out an overview of the command line options of sddb6mir
-m Mirrors the Admin DB ADM<DBSID> to the SAP database
<DBSID>.
-DEB Activates the tracing facility. The detail level can be specified using
[<level>] <level>. <level> can be between 1 and 9. The default value is
3. The value 9 means “very detailed”.
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.
The decision to run a trace must be carefully met. The following facts should be taken into
consideration:
• In most cases, system performance will decrease.
• It is a time-consuming task.
• The amount of trace data can be enormously large. For this reason, it is essential to
find the smallest possible scenario that reproduces the problem. It might be necessary
to drill down, or even stop other activities while recreating the problem situation with the
trace turned on.
• Interpreting trace data properly requires detailed low-level knowledge of DB2. For this
reason, traces are usually only run at the request of DB2 support.
• Problem situations that have been observed might disappear during attempts to
reproduce them with the trace turned on.
All DB2 traces are documented in the Troubleshooting Guide of the DB2 Online
Documentation delivered with the software.
1. To store trace data in a preallocated buffer of size <memory> in shared memory, turn
the trace on by entering the following command:
db2trc on –l <memory> -s
2. Reproduce the problem.
3. Dump the trace data to a file named, for example db2trc.dmp, by entering the
following command:
db2trc dmp db2trc.dmp
4. Turn off the trace by entering the following command:
db2trc off
5. Format the trace into two files, db2trc.fmt and db2trc.flw by entering the
following command:
db2trc fmt db2trc.dmp db2trc.fmt
db2trc flw db2trc.dmp db2trc.flw
While formatting, the output is written to the screen. If the output mentions that the trace has
wrapped, the amount of memory reserved for trace data was insufficient and the trace might
not be useful. The trace needs to be repeated with a larger amount of memory. Typical
values to start with are 20000000 or 40000000 (20 or 40 million bytes).
Procedure
...
1. To turn the DB2 CLI trace on or off, log on as DB2 instance owner.
2. To activate the trace, parameter TRACE in the CLI configuration needs to be set to 1.
To do so for all databases in a DB2 instance, enter the following command:
db2 update cli cfg for section common using trace 1
3. To de-activate the trace, enter the following command:
db2 update cli cfg for section common using trace 0
4. To configure the trace, several parameters can be set. Enter the following command:
db2 update cli cfg for section common using <parameter> <value>
5. To verify the current settings, enter the following command:
db2 get cli cfg
Parameter Description
TRACEFILENAME <file> Path of the file containing all trace data
TRACEPATHNAME <path> Directory to store trace files, one per
process
TRACEFLUSH 0|1 If this parameter is set to 1 it forces a write
to disk for each entry.
The trace output is intended for experienced support personnel and the
application developers. There are often several items that appear to be errors,
but are acceptable under certain conditions.
Environment Variables
Tracing of sddb6ins can only be activated using the command line option
-DEB. You can neither use the environment nor the ini file.
Ggf. Verweis auf Hinweis, in dem die DL parameter stehen … (BRITTA) Was is hier nochmal
mit DL gemeint?
You can download the latest available versions of the Admin Tools from SAP Service
Marketplace at service.sap.com/patches.
There is no Unicode version of sddb6ins. Therefore, you must use the non-
Unicode version.
For brdb6brt, there is both a Unicode and a non-Unicode version.
The following table provides an overview of the files available:
File Description
SAPCAR.CAR Contains the extraction tool SAPSAR(.exe).
DB6CCEXT_HW.SAR Contains the SAP DB2 Control Center Extensions.
sddb6ins.CAR/SAR Contains the installation program sddb6ins(.exe).
dscdb6up.CAR UNIX only and only for SAP system Releases 4.6x
Keep in mind that HW stands for UNIX if the DB2 Control Center runs on UNIX,
or I386 if it runs on Windows.
Return Description
Code
0 Successful
1 DB2 shared library not found. For detailed analysis, activate the tracing facility.
On UNIX: Verify if environment variable INSTHOME is set correctly.
4 Temporary error encountered (system memory). Retry. If the problem persists,
contact your system administrator and SAP support.
5 TSM shared lib could not be loaded.
Check if the specified shared library is in the path of the DB2 instance owner:
UNIX: libApiDS (for 64bit libApiDS64)
Windows: ADSM32.dll
If files are being archived directly to TSM by the User Exit, check environment
variable DB2DB6_VENDOR_UEXIT.
6 Function module in the shared library could not be loaded. Check previous
error messages.
8 The User Exit returns this value to the DB2 Database Manager for most
failures. The DB2 Database Manager automatically retries archive operations
again after five minutes. If processing of the same log file fails repeatedly,
check the error file db2uext2.err.NODExxxx for more detailed information.
30 File I/O error. Accompanying message should contain the system error number
defined in file errno.h.
32 Operator or user terminated process
33 Operator or user terminated process
34 Copy of log file (archive or retrieve operation) failed
35 • Archive operations:
If the source is the log file to be archived by the DB2 User Exit, this is just
a warning. The log file has probably been moved out of the online log
directory. Make sure that the log file is still available. If not, you may have
problems if a database recovery becomes necessary.
• Retrieve operations (ROLLFORWARD):
If the DB2 User Exit was called to retrieve log files, the log file could not be
found in either the archive or the retrieve directory. Attempt to retrieve it
using brrestore. If the file does not exist (and never has existed) you
are finished and can perform ROLLFORWARD STOP. 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. This is
deliberately different to the default (simplified) User Exits provided as
source code together with DB2.
36 Opening file failed. Log file does not exist. Check error file
db2uext2.err.NODExxxx for more detailed information.
Retrieve operations (ROLLFORWARD):
This is not necessarily an error. Ensure that the file has never existed and then
perform ROLLFORWARD STOP.
For more detailed information about the most current documentation of the db2uext2 tool
return codes, see SAP Note 104019.
However, when called directly on the command line the protocol is by default
only written to file and no output appears on the command line. To override this,
option -out must be included in the program call.
If an application does not perform correctly, make sure that you are using the most recent
patch available on SAP Service Marketplace at service.sap.com/patches. The version
and patch level of each program can be seen near the top of each protocol.
As mentioned above, in addition to the standard environment tracing switches, brarchive
and brrestore also allow activation of tracing on the command line using parameter
-DEB <level>, for example, 1…9.
ID Message Comment
LFA000 Action ended Main action completed successfully but warnings
with warnings. were issued. See other messages for more
information.
LFA001 <OLD> syntax Although the program still supports this old command
supported but line option it may not in future releases. It is better to
archaic. Use use the new syntax. Use option –help to see the
new syntax. syntax.
LFA002 <OLD> syntax A command line option was ignored because it is no
archaic and longer valid syntax. Use the new syntax. Use option –
ignored. Use help to see the syntax.
new syntax.
LFA005 <OLD> option Although the program still supports this old command
supported but line option it may not in future releases. It is better to
archaic. Use use the new syntax. Use option –help to see the
<NEW OPTION>. syntax.
LFA006 -s with two Although the program still supports this old command
devices and line option it may not in future releases. It is better to
volumes use the new syntax. Use option –help to see the
supported but syntax.
archaic. Use -
ss.
LFA007 -sd with two Although the program still supports this old command
devices and line option it may not in future releases. It is better to
volumes use the new syntax. Use option –help to see the
supported but syntax.
archaic. Use -
ssd.
LFA009 Option Although the program still supports this old command
<OPTION><ARG> line option it may not in future releases. It is better to
supported but use the new syntax. Use option –help to see the
archaic – syntax.
Interpreted
literally
LFA010 -d/-device not Use -d tape to explicitly specify the device type.
specified but
tape implied.
LFA011 -d/-device not Use -d adsm to explicitly specify the device type.
specified but
ADSM implied.
LFA015 Unexpected Use quotes for pattern, for example, '*.SAR'.
pattern
argument
LFA015 No file pattern Warning if no file pattern is given. ‘*’ will be used.
given
ID Message Comment
LFA101 Parameter <OPTION> Use option –help to see the syntax.
unknown.
LFA102 Action not allowed Use option –help to see the syntax.
for <PROGRAM>.
LFA103 Action only allowed Use option –help to see the syntax.
for <PROGRAM>.
LFA104 <OPTION> argument Use a shorter argument value. Be careful that
"<VALUE>" too long. you have not used wild card characters
interpreted by the shell.
LFA105 <OPTION> argument Required argument is missing. Use option –
missing. help to see the syntax.
LFA106 <OPTION> argument Check and replace the bad string argument
"<VALUE>" not OK. value. If the problem is not clear, refer to the
option documentation.
LFA107 <OPTION> argument Check and replace bad numeric argument
"<VALUE>" not OK. value. If the problem is not clear, refer to the
option documentation.
LFA108 Too many actions on Only one action option is permitted. Use
the command line. option
–help to see the syntax.
LFA109 <OPTION> results in Check for repeating or conflicting options, for
repeated or example, . –d ADSM or –d TAPE.
conflicting Use option –help to see the syntax.
parameters.
LFA110 The option <OPTION> The action requires that the additional option
is required for this be used. Add the required option to the call.
action.
ID Message Comment
VND000 Environment Check the db2<dbsid> user environment. See
variable also accompanying system error message VND180.
<ENVIRONMENT
VARIABLE> is not
set.
VND001 Not enough disk Delete files or increase the size of the file system.
space in
<DIRECTORY>.
Available:
<VALUE> MB; Compressed file systems may calculate
needed: <VALUE> the amount of space available wrongly.
MB.
VND002 File size The original file size does not match the size of the
mismatch for file restored. If the problem persists, the file may be
<FILE>. <VALUE> damaged. You may be able to restore the file using
on disk and the emergency restore option -ex.
<VALUE> kB on
tape
Since DB2 Control Center Extensions are an extension of the DB2 Control Center, 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, start it with script
db2ccdebug.bat. A trace file called db6cc.log is created in your TEMP directory.
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. It contains administration management data, configuration parameters, and
administration action protocols.
The most important tables in the Admin DB refer to log files and their locations. This
information is used in recovering archived files. On occasion, support personnel will ask
database administrators to extract information from this database to assist in problem
determination. Other tables record information such as tape volume management and Admin
Tools protocol data.
To understand the log file information in the Admin DB, it is essential that you understand the
file states described in Log File States [Page 37].
The Admin DB should require very little administrative attention. The database administrator
can decide whether to back up the database. However, this is not strictly necessary as
brarchive in archive mode also stores the essential parts of the database from which it can
be rebuilt.
Transaction logging is circular for the Admin DB, that is, LOGRETAIN and USEREXIT are set
to OFF. 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 following graphic shows the Admin DB tables and their relationships.
Admin DB Tables
Each tape has two object IDs – one related to the DB6LOCATION table and one
related to the DB6TAPE table. There is no direct relationship joining these two
objects.
• Backup data in table DB6BACKUP
The information in the DB6BACKUP table is extracted from the backup history file by
the User Exit. This information is used to associate log files with a backup. If no backup
is performed after the Admin Tools are installed, the User Exit will not be able to add
this association. 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.
For best User Exit performance, it is also important that the backup history file is not
too long. It may be necessary to prune the file occasionally.
• Configuration table DB6CONFIG
This table contains information to configure the Admin Tools. Normally it can only be
updated using the DB2 Control Center Extensions. You can also use SQL to update
the entries directly.
If an entry is corrupt or lost, this table can be reset to the default values. You can do
this by using SQL to delete all related entries from the DB6IDENTIFIER table.
Be very careful only to delete the OBJIDs found in the configuration table
DB6CONFIG and running sddb6ins -i.
• Mirroring in Admin Tools Release 4.6D
There is an extra executable in Admin Tools releases up to 4.6D called sddb6mir.
This is used to mirror (duplicate) informative Admin DB information to the SAP
database.
The mirror contains most of the tables that the Admin DB contains but these
tables have one column less. They all have no mirror flag column. Although this
should not be necessary, if you want to create the mirrored tables manually, do
not attempt to create these tables using exactly the same structure as in the
Admin DB.
brarchive Admin
brrestore
DB
LfmVndInterface
customer
backend
Tape script
TSM
backend
The DB2 Control Center looks in directory sqllib/cc for a file called db2plug.zip. If this
file exists, it will be loaded. It comprises the SAP extensions for the DB2 Control Center. In
the context menu of any SAP DB2 instance or database, supplementary menu options will be
offered. If any of these options is chosen, the corresponding SAP extension window appears.
From this window, the user can perform several SAP DB2-specific administrative operations.
Since all these operations are done on the server, stored procedure sddb6jds is called
viJDBC. Sddb6jds calls the Admin Tools and manages the Admin DB ADM<DBSID>.
# Standby directory
#
# default: no default
# DB2DB6_STANDBY_DIR =
# Disconnect from TSM after this time in seconds of no response. A value of zero turns
off this timeout mechanism.
#
# default: 0
# DB2DB6_TSM_TIMEOUT = 0
# Userexit Trace
# DB2DB6_TRC_DB2UEXT2 = ON
DB2DB6_TRC_DB2UEXT2_LEVEL = 3
DB2DB6_TRC_DB2UEXT2_PATH = /db2/Y6D/db2dump
# Brarchive Trace
# DB2DB6_TRC_BRARCHIVE = ON
DB2DB6_TRC_BRARCHIVE_LEVEL = 3
DB2DB6_TRC_BRARCHIVE_PATH = /db2/Y6D/db2dump
# Brrestore Trace
# DB2DB6_TRC_BRRESTORE = ON
DB2DB6_TRC_BRRESTORE_LEVEL = 3
DB2DB6_TRC_BRRESTORE_PATH = /db2/Y6D/db2dump
# DB6CLP Trace
# DB2DB6_TRC_DB6CLP = ON
DB2DB6_TRC_DB6CLP_LEVEL = 3
DB2DB6_TRC_DB6CLP_PATH = /db2/Y6D/db2dump
# History Utility
# DB2DB6_TRC_SDDB6HIS = ON
DB2DB6_TRC_SDDB6HIS_LEVEL = 3
DB2DB6_TRC_SDDB6HIS_PATH = /db2/Y6D/db2dump
# Mirror Utility
# DB2DB6_TRC_SDDB6MIR = ON
DB2DB6_TRC_SDDB6MIR_LEVEL = 3
DB2DB6_TRC_SDDB6MIR_PATH = /db2/Y6D/db2dump
# backup retries
#
# default: 10
# DB2DB6_DMDB6BKP_RETRIES = 10
# Percentage of rows read for table size calculation for long and lob columns
#
# default: 10
# DB2DB6_DB6SRPRTS_PCT_LONG_LOB = 10
########################################################################
# End of Environment File #
########################################################################File
# Standby directory
#
# default: no default
# DB2DB6_STANDBY_DIR =
# Userexit Trace
# DB2DB6_TRC_DB2UEXT2 = ON
DB2DB6_TRC_DB2UEXT2_LEVEL = 3
DB2DB6_TRC_DB2UEXT2_PATH = c:\db2\N4D\db2dump
# Brarchive Trace
# DB2DB6_TRC_BRARCHIVE = ON
DB2DB6_TRC_BRARCHIVE_LEVEL = 3
DB2DB6_TRC_BRARCHIVE_PATH = c:\db2\N4D\db2dump
# Brrestore Trace
# DB2DB6_TRC_BRRESTORE = ON
DB2DB6_TRC_BRRESTORE_LEVEL = 3
DB2DB6_TRC_BRRESTORE_PATH = c:\db2\N4D\db2dump
# DB6CLP Trace
# DB2DB6_TRC_DB6CLP = ON
DB2DB6_TRC_DB6CLP_LEVEL = 3
DB2DB6_TRC_DB6CLP_PATH = c:\db2\N4D\db2dump
# History Utility
# DB2DB6_TRC_SDDB6HIS = ON
DB2DB6_TRC_SDDB6HIS_LEVEL = 3
DB2DB6_TRC_SDDB6HIS_PATH = c:\db2\N4D\db2dump
# Mirror Utility
# DB2DB6_TRC_SDDB6MIR = ON
DB2DB6_TRC_SDDB6MIR_LEVEL = 3
DB2DB6_TRC_SDDB6MIR_PATH = c:\db2\N4D\db2dump
# backup retries
#
# default: 10
# DB2DB6_DMDB6BKP_RETRIES = 10
# tape pattern
#
# default: \\
# DB2DB6_DMDB6BKP_TAPE_PATTERN = \\
########################################################################
# End of Environment File #
########################################################################
Name Description
Administration Guide Administration Guide: Planning provides an overview of
database concepts, information about design issues (such as
logical and physical database design), and information about
high availability.
Administration Guide: Implementation provides information
about implementation issues such as implementing your
design, accessing databases, auditing, backup and recovery.
Administration Guide: Performance provides information
about database environment and application performance
evaluation and tuning.
Administrative API Describes the DB2 application programming interfaces
Reference (APIs) and data structures that you can use to manage your
databases. This book also explains how to call APIs from
your applications.
Application Building Guide Provides environment setup information and step-by-step
instructions about how to compile, link, and run DB2
applications on Windows, OS/2, and UNIX platforms.
Application Development Explains how to develop applications that access DB2
Guide databases using embedded SQL or Java (JDBC and SQLJ).
Discussion topics include writing stored procedures, writing
user-defined functions, creating user-defined types, using
triggers, and developing applications in partitioned
environments or with federated systems.
CLI Guide and Reference Explains how to develop applications that access DB2
databases using the DB2 Call Level Interface, a callable SQL
interface that is compatible with the Microsoft ODBC
specification.
Name Description
Administration Guide Administration Guide: Planning provides an overview of
database concepts, information about design issues (such as
logical and physical database design), and information about
high availability.
Administration Guide: Implementation provides information
about implementation issues such as implementing your
design, accessing databases, auditing, backup and recovery.
Administration Guide: Performance provides information about
database environment and application performance evaluation
and tuning.
Administrative API Describes the DB2 application programming interfaces (APIs)
Reference and data structures that you can use to manage your
databases. This book also explains how to call APIs from your
applications.
Application Development Provides environment setup information and step-by-step
Guide: Building and instructions about how to compile, link, and run DB2
Running Applications applications on Windows, OS/2, and UNIX platforms.
Application Development Explains how to develop applications that access DB2
Guide, Programming databases using embedded SQL or Java (JDBC and SQLJ).
Client Applications and Discussion topics include writing stored procedure, writing
Programming Server user-defined functions, creating user-defined types, using
Applications triggers, and developing applications in partitioned
environments or with federated systems.
CLI Guide and Explains how to develop applications that access DB2
Reference Volume 1 and databases using the DB2 Call Level Interface, a callable SQL
Volume 2 interface that is compatible with the Microsoft ODBC
specification.
Command Reference Explains how to use the command line processor and
describes the DB2 commands that you can use to manage
your database.
Data Movement Utilities Explains how to use DB2 utilities, such as import, export,
Guide and Reference load, AutoLoader, and DPROP, that facilitate the movement
of data.
Message Reference Lists messages and codes issued by DB2, the Information
Catalog Manager, and the Data Warehouse Center, and
describes the actions you should take.
If you are unable to find an appropriate link for a topic in this documentation,
refer to the table of contents or the DB2 documentation.
Term Description
<DBSID> and <dbsid> Refer to “<SAPSID> and <sapsid>” in this table.
(SAP database name)
<SAPSID> and <sapsid> With the introduction of MCOD systems, it is necessary to
(SAP system ID) differentiate between SAP system IDs and SAP database
names. The changes are as follows:
• The former SAP system ID <SID> or <sid> changes
to <SAPSID> or <sapsid>.
• The former SAP database name <SID> or <sid>
changes to <DBSID> or <dbsid>.
ADSM The IBM storage product ADSM has been renamed to TSM
(Tivoli Storage Manager). For more information, see
Naming Conventions [Page 12].
archiving Refers to the movement or copying of a file to other longer-
term storage, with the assumption that the file is less likely
archival
to be lost there in case of system failure.
See the term User Exit for an example. Not to be confused