IBM Books

Administration Guide


Calling Format

The database manager will call the user exit program as required and will pass a set of parameters to it. These parameters have a data type of character string or character.

The calling format is dependent on your operating environment as is described in the following topics:

Calling Format for OS/2

The following is the database manager format for calling an OS/2 user exit program:

   action drive db_alias log_path log_file indicator

action
Contains the value BACKUP, RESTORE, ARCHIVE, or RETRIEVE.

drive
For BACKUP, this parameter contains the drive where the database to be backed up resides.

For RESTORE, this parameter contains the drive where the database is to be restored.

For ARCHIVE and RETRIEVE, this parameter contains the drive where the database is located.

The format of this parameter is the drive letter followed by a colon (for example, C:).

db_alias
Contains the database alias, or, if no alias exists for the database, the database name.

log_path
For BACKUP, this parameter contains a fully qualified name of a response file, which contains a list of files to be backed up. Each file name in the list is a fully qualified name and may contain wild cards.

For RESTORE, this parameter contains the fully qualified name of a response file, which is the list of files to be restored. Each file name in the list is a fully qualified name and may contain wild cards. The drive letter and path are the source drive and path at the time the database file was backed up. For example, if C:\SQLUTIL\dbname.MH1 is contained in the response file, it means that the dbname.MH1 file was backed up from C:\SQLUTIL.

For ARCHIVE and RETRIEVE, this parameter contains the log path directory (for example, C:\SQL00001\SQLOGDIR\).

log_file
For BACKUP, this parameter contains a media label generated by the BACKUP DATABASE utility. This label is composed of the database alias name and timestamp.

For RESTORE, this parameter contains the path name of the database subdirectory where the files are to be restored. The drive letter is not included, because it is indicated in the drive parameter. The format is \SQLnnnnn\.

For ARCHIVE and RETRIEVE, this parameter contains the log file name (for example, S0000001.LOG).

indicator
An indicator used to support multiple calls during a backup or restore operation. The first call has a value of the character '1', and subsequent calls have a value of the character '2'.

The user exit program is called multiple times during a backup or restore operation. The first call backs up or restores media header files (the .MHn files), and the second call backs up or restores the entire set of database files.

For ARCHIVE and RETRIEVE, this parameter is not used.

Calling Format for UNIX-Based or Windows NT Operating Systems

The following is the database manager format for calling a UNIX-based or Windows NT operating system user exit program to archive or retrieve data:

db2uext2 -OS<os> -RL<db2rel> -RQ<request>
-DB<dbname> -NN<nodenum> -LP<logpath>
-LN<logname> -AP<adsmpasswd> -SP<startpage>
-LS<logsize>

os
Platform on which the instance is running: AIX, NT, SUN, HP, SNI, SCO, 95, 98, and SGI.

db2rel
DB2 release level. For example, DB2_V5.1.0 or DB2_V5.1.1.

request
Request type. This can be ARCHIVE or RETRIEVE.

dbname
Database name.

nodenum
Local node number, such as 5.

logpath
Fully qualified path to the log files. The path must contain the trailing path separator. For example, /u/database/log/path/ or d:\logpath\.

logname
Name of log file to be archived or retrieved, such as S0000123.LOG.

adsmpasswd
ADSM password. It will be passed to the user exit if it is provided in the database configuration.

startpage
Log extent starts at this number of offset 4 KB pages of the device.

logsize
The size of this log extent in 4 KB pages.

Notes:

  1. Windows NT only supports user exits for archiving logs.

  2. The -LS and -SP parameters are only used if a raw device is used for logging. If you are using an existing user exit program that uses files for logging, you do not have to change it.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]