473,395 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

how to enable user exit

I know there are some sample user exit programs in sqllib/samples/c
directory. How do I tell DB2, which user exit program to use? I know I
have to edit and compile the c based user exit programs, but how do I
tell DB2 instance and database to use that particular user exit
program.
Thanks,
Yasaswi
Nov 12 '05 #1
11 11113
"Yasaswi Pulavarti" <ya*****@encfor.com> wrote in message
news:aa**************************@posting.google.c om...
I know there are some sample user exit programs in sqllib/samples/c
directory. How do I tell DB2, which user exit program to use? I know I
have to edit and compile the c based user exit programs, but how do I
tell DB2 instance and database to use that particular user exit
program.
Thanks,
Yasaswi


db2 get db cfg for database-name

You will see the parameter-name that specifies the exit program.

db2 update db cfg using parameter-name parameter-value
Nov 12 '05 #2
you compile one of the available db2uext2.c* files and place them at
sqllib/adm location. i don't know whether you can use multiple
db2uext2.c* files for the same instance. eg. either you can use
db2uext2.ctsm if you are using TSM or you can use db2uext2.cdisk if
you using a filesystem, but not both. maybe someone else can shed more
light on this.

hth,
dotyet

ya*****@encfor.com (Yasaswi Pulavarti) wrote in message news:<aa**************************@posting.google. com>...
I know there are some sample user exit programs in sqllib/samples/c
directory. How do I tell DB2, which user exit program to use? I know I
have to edit and compile the c based user exit programs, but how do I
tell DB2 instance and database to use that particular user exit
program.
Thanks,
Yasaswi

Nov 12 '05 #3

"Yasaswi Pulavarti" <ya*****@encfor.com> ????
news:aa**************************@posting.google.c om...
I know there are some sample user exit programs in sqllib/samples/c
directory. How do I tell DB2, which user exit program to use? I know I
have to edit and compile the c based user exit programs, but how do I
tell DB2 instance and database to use that particular user exit
program.
Thanks,
Yasaswi


After compiling a user exit program, you should put them into specific
directory(/sqllib/adm on UNIX and \SQLLIB\BIN on Windows) and DB2 will seek
them automatically.
Nov 12 '05 #4
> > I know there are some sample user exit programs in sqllib/samples/c
directory. How do I tell DB2, which user exit program to use? I know I
have to edit and compile the c based user exit programs, but how do I
tell DB2 instance and database to use that particular user exit
program.
Thanks,
Yasaswi
After compiling a user exit program, you should put them into specific
directory(/sqllib/adm on UNIX and \SQLLIB\BIN on Windows) and DB2 will

seek them automatically.

You have to update the db config to indicate the program name before DB2
will use it.
Nov 12 '05 #5
You can find a detailed explanation about setting userexit program
here.

http://www-106.ibm.com/developerwork...0307kline.html

GOODLUCK

-Visu

do****@yahoo.com (dotyet) wrote in message news:<6c**************************@posting.google. com>...
you compile one of the available db2uext2.c* files and place them at
sqllib/adm location. i don't know whether you can use multiple
db2uext2.c* files for the same instance. eg. either you can use
db2uext2.ctsm if you are using TSM or you can use db2uext2.cdisk if
you using a filesystem, but not both. maybe someone else can shed more
light on this.

hth,
dotyet

ya*****@encfor.com (Yasaswi Pulavarti) wrote in message news:<aa**************************@posting.google. com>...
I know there are some sample user exit programs in sqllib/samples/c
directory. How do I tell DB2, which user exit program to use? I know I
have to edit and compile the c based user exit programs, but how do I
tell DB2 instance and database to use that particular user exit
program.
Thanks,
Yasaswi

Nov 12 '05 #6
Yes this is what am interested, can I use the sample disk backup
db2uext2.cdisk in addition to a Veritas NetBackup. Also in an earlier
post Mark A. said I can update the parameter in the database
configuration file, however all of the DB2 documentation talks about
setting LOGRETAIN to ON and USEREXIT to on, but does not tell which
parameter I should look out for. Anyway does the act of putting the
compiled db2uext2.c* binary in sqllib/adm location instruct DB2 to
invoke the user exit program?
Thanks,
Yasaswi

do****@yahoo.com (dotyet) wrote in message news:<6c**************************@posting.google. com>...
you compile one of the available db2uext2.c* files and place them at
sqllib/adm location. i don't know whether you can use multiple
db2uext2.c* files for the same instance. eg. either you can use
db2uext2.ctsm if you are using TSM or you can use db2uext2.cdisk if
you using a filesystem, but not both. maybe someone else can shed more
light on this.

hth,
dotyet

ya*****@encfor.com (Yasaswi Pulavarti) wrote in message news:<aa**************************@posting.google. com>...
I know there are some sample user exit programs in sqllib/samples/c
directory. How do I tell DB2, which user exit program to use? I know I
have to edit and compile the c based user exit programs, but how do I
tell DB2 instance and database to use that particular user exit
program.
Thanks,
Yasaswi

Nov 12 '05 #7
"Yasaswi Pulavarti" <ya*****@encfor.com> wrote in message
news:aa*************************@posting.google.co m...
Yes this is what am interested, can I use the sample disk backup
db2uext2.cdisk in addition to a Veritas NetBackup. Also in an earlier
post Mark A. said I can update the parameter in the database
configuration file, however all of the DB2 documentation talks about
setting LOGRETAIN to ON and USEREXIT to on, but does not tell which
parameter I should look out for. Anyway does the act of putting the
compiled db2uext2.c* binary in sqllib/adm location instruct DB2 to
invoke the user exit program?
Thanks,
Yasaswi

I already answered that question. NO, the act of putting the compiled
db2uext2.c* binary in sqllib/adm location DOES NOT instruct DB2 to invoke
the user exit program. You must name the exit program in the database config
with the USEREXIT parm.

Setting LOGRETAIN ON does not invoke an exit program. It does instruct DB2
to retain log files (instead of the default circular logging). See the
manuals for an explanation of the difference between circular logging (the
default) and logretain (with or without an exit program).

When you want to retain the log files, AND ALSO move the log files no
longer needed to another directory, then you set the USEREXIT to the name of
your exit program to do the archiving (moving them to a different
directory). You do not set USEREXIT to ON (you set it to the name of the
exit program if you want one to be invoked).

If the USEREXIT is set to anything but OFF, DB2 will use logretain (instead
of circular logging) regardless of the setting for LOGRETAIN.

If you ask this question one more time, I am going to have to slap you hard.
Nov 12 '05 #8
Ian
Mark A wrote:
"Yasaswi Pulavarti" <ya*****@encfor.com> wrote in message
news:aa*************************@posting.google.co m...
Yes this is what am interested, can I use the sample disk backup
db2uext2.cdisk in addition to a Veritas NetBackup. Also in an earlier
post Mark A. said I can update the parameter in the database
configuration file, however all of the DB2 documentation talks about
setting LOGRETAIN to ON and USEREXIT to on, but does not tell which
parameter I should look out for. Anyway does the act of putting the
compiled db2uext2.c* binary in sqllib/adm location instruct DB2 to
invoke the user exit program?
Thanks,
Yasaswi


I already answered that question. NO, the act of putting the compiled
db2uext2.c* binary in sqllib/adm location DOES NOT instruct DB2 to invoke
the user exit program. You must name the exit program in the database config
with the USEREXIT parm.

Setting LOGRETAIN ON does not invoke an exit program. It does instruct DB2
to retain log files (instead of the default circular logging). See the
manuals for an explanation of the difference between circular logging (the
default) and logretain (with or without an exit program).

When you want to retain the log files, AND ALSO move the log files no
longer needed to another directory, then you set the USEREXIT to the name of
your exit program to do the archiving (moving them to a different
directory). You do not set USEREXIT to ON (you set it to the name of the
exit program if you want one to be invoked).


The problem is that you're wrong. USEREXIT is either Yes or No:

"userexit - User exit enable configuration parameter

Configuration Type
Database
Parameter Type
Configurable
Default [Range]
No [ Yes; No ]

If this parameter is enabled, log retention logging is performed
regardless of how the logretain parameter is set. This parameter also
indicates that a user exit program should be used to archive and
retrieve the log files. Log files are archived when the database manager
closes the log file. They are retrieved when the ROLLFORWARD utility
needs to use them to restore a database."
This looks for the 'db2uext2' executable in sqllib/adm (preferred)
or sqllib/bin. (sqllib/adm is preferred because, on unix, this is
a unique directory per instance, whereas sqllib/bin is a soft link
to the installation directory (/usr/opt/db2_08_01/bin on AIX).
V8.2 allows much more flexible archive log handling. The USEREXIT
parameter is superseded by LOGARCHMETH1 (and LOGARCHMETH2), which allow
you to specify 1 (or 2) locations for archving log files, for example:

LOGARCHMETH1 = DISK:/archivelogs
LOGARCHMETH2 = TSM:

Which would send a copy of the file to both /archivelogs and to TSM
(using the default TSM management class).

You can even specify LOGARCHMETH1 = USEREXIT, which will let you
continue to use your own custom written user exit (db2uext2).
Nov 12 '05 #9
referring to db2 v8 documentation:

When a user exit program is invoked, the database manager passes
control to the executable file, ****db2uext2****. The database manager
passes parameters to db2uext2 and, on completion, the program passes a
return code back to the database manager. Because the database manager
handles a limited set of return conditions, the user exit program
should be able to handle error conditions (see Error handling). And
because

**only one user exit program can be invoked within a database manager
instance**

, it must have a section for each of the operations it may be asked to
perform.

so according to the documentation, on LUW environment, the filename
has to be db2uext2 and the number of db2uext2 programs allowed to use
at a given time is just ONE.

Mark, can you tell me what would be the exact command to specify any
program name for userexit facility? I am asking this just for my
information sake and not otherwise.

hth,
dotyet
"Mark A" <no****@nowhere.com> wrote in message news:<fk***************@news.uswest.net>...

You have to update the db config to indicate the program name before DB2
will use it.

Nov 12 '05 #10
only possible values for userexit are: ON, OFF or YES, NO

C:\Documents and Settings\Administrator>db2 "create database test"
DB20000I The CREATE DATABASE command completed successfully.

C:\Documents and Settings\Administrator>db2 "update db cfg for test
using userexit dabba"
SQL0104N An unexpected token "dabba" was found following "USEREXIT".
Expected tokens may include: "ON". SQLSTATE=42601

C:\Documents and Settings\Administrator>db2 "update db cfg for test
using userexit yes"
DB20000I The UPDATE DATABASE CONFIGURATION command completed
successfully.

C:\Documents and Settings\Administrator>db2 "update db cfg for test
using userexit no"
DB20000I The UPDATE DATABASE CONFIGURATION command completed
successfully.

C:\Documents and Settings\Administrator>db2 "update db cfg for test
using userexit on"
DB20000I The UPDATE DATABASE CONFIGURATION command completed
successfully.

C:\Documents and Settings\Administrator>db2 "update db cfg for test
using userexit off"
DB20000I The UPDATE DATABASE CONFIGURATION command completed
successfully.

C:\Documents and Settings\Administrator>db2 "update db cfg for test
using userexit true"
SQL0104N An unexpected token "true" was found following "USEREXIT".
Expected
tokens may include: "ON". SQLSTATE=42601

C:\Documents and Settings\Administrator>db2 "update db cfg for test
using userexit false"
SQL0104N An unexpected token "false" was found following "USEREXIT".
Expected tokens may include: "ON". SQLSTATE=42601

C:\Documents and Settings\Administrator>db2 "update db cfg for test
using userexit myboy"
SQL0104N An unexpected token "myboy" was found following "USEREXIT".
Expected tokens may include: "ON". SQLSTATE=42601
C:\Documents and Settings\Administrator>

Nov 12 '05 #11
> When you want to retain the log files, AND ALSO move the log files no
longer needed to another directory, then you set the USEREXIT to the name of your exit program to do the archiving (moving them to a different
directory). You do not set USEREXIT to ON (you set it to the name of the
exit program if you want one to be invoked).

If the USEREXIT is set to anything but OFF, DB2 will use logretain (instead of circular logging) regardless of the setting for LOGRETAIN.

Correction,

You set USEREXIT ON or YES and DB2 will use the userexit program placed in
the path. But it will not use the program by merely placing the program in
the path unless USEREXIT is ON or YES.

If either USEREXIT or LOGRETAIN are set on, DB2 will retain the log files
and enable log forward recovery. Otherwise, the default circular logging is
used.

I have slapped myself.
Nov 12 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Vincent Bouret | last post by:
Hi, I have read that Unicode (UTF-8) was not enabled by default in the mysql-4.1.0-alpha binaries. How can I enable it? What should I change in the code to do so? Thanks Vincent
4
by: Mulder | last post by:
Has anyone enabled log mirroring under DB2 v8 on AIX 4.3.3 or 5.? and if so are you archiving these mirrored logs to TSM? Is this possible? If so is there any sample code for the user exit and...
3
by: DBQueen | last post by:
I have a form with lines of controls. On some of the lines there are 3 controls (call them A,B,C); other lines have only control A. The controls have been numbered sequentially (Q20, Q21....Q76)...
1
by: @ndy | last post by:
Hi developers, i've a problem with my tabcontrol. Before i open my form with a tabcontrol with 3 tabs (Frm_Files|Frm_Lines|Frm_Guarantee) all the controls on al the tabs must be enabled. With...
2
by: jburkle | last post by:
The following is the onclick method called when the "Renew" button is clicked by the user in my Windows application: ..... Private Sub cmdRenew_Click(ByVal eventSender As System.Object, ByVal...
3
by: hary08 | last post by:
im doing a database for Hospital Admission, I have a log in form which prompt user for a password. The source of log in is to look for the values in my Table tblEmployees and match user name and...
3
by: CanuckChuck | last post by:
I have a code for enabling a command button to password protect the enabling/disabling of the Shift bypass. For some reason though I keep recieving a syntax error when I try to use it. I copied the...
2
by: Bronquites | last post by:
Hi! I'm having a problem with a User Control that I want to implement in my project. All the variables and classes are declared as Public. My User Control has a procedure that calls the...
3
by: Pietro | last post by:
Hi all, First of all I'd like to thank you very very much ,as finally after many years of searching,I could find a code to disable/enable the shift key,but actually i cannot use the code as I'm...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.