If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > userexit setup problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-10-05, 21:14
wangzhonnew wangzhonnew is offline
Registered User
 
Join Date: Nov 2005
Location: Toronto
Posts: 65
userexit setup problem

problem with user exit.
db2 shows error in db2diag.log. the return code of userexit shows 0x18, which represents "userexit is not found" in source file. however i searched <instancepath>/sqllib/adm and db2uext2 is sitting there, and it's privilege=755.I have tried to run db2uext2 manually like db2uext -OSSOLARIS -OPARCHIVE.... and the data can be archived. If I do not run it when database activated, no USEREXIT.ERR will be created in the archive path; the USEREXIT.ERR can be successfully created after manually run the command. I'm not sure what's going on.

this is the first time compile and run the userexit in this box (solaris 9, cc -o db2uext db2uext.c to compile). i have made userexit in other platform (AIX) before and they are working good. i'm not sure why it happens here.

i'm thinking if it caused by other version of userexit exists in the directories which recorded in PATH variable (like symbolic link in other directories). I will go to check it up next monday or tuesday. If anyone have idea other than this, i'll appreciate if you can post your suggestion here

thanks very much

FYI:
db2diag.log:

2005-12-07-17.02.21.077768 Instance:db2inst1 Node:000

PID:10949(db2stop2) TID:1 Appid:none

base sys utilities DB2StopMain Probe:911

ADM7514W Database manager has stopped.

2005-12-07-17.02.24.511629 Instance:db2inst1 Node:000

PID:10953(db2star2) TID:1 Appid:none

base sys utilities LicCheckProcessors Probe:20

SQL8017W The number of processors on this machine exceeds the defined

entitlement of "1" for the product "DB2 Enterprise Server Edition". The

number of processors on this machine is "2". You should purchase additional

processor based entitlements from your IBM representative or authorized dealer

and update your license using the License Center or the db2licm command line

utility. For more information on updating processor based licenses, refer to

the Quick Beginnings manual for your platform. For more information on the

db2licm utility, refer to the DB2 Command Reference.



2005-12-07-17.02.25.740713 Instance:db2inst1 Node:000

PID:10953(db2star2) TID:1 Appid:none

base sys utilities DB2StartMain Probe:911

ADM7513W Database manager has started.

2005-12-07-17.03.39.550603 Instance:db2inst1 Node:000

PID:10989(db2loggr (TEST) 0) TID:1 Appid:none

data protection sqlpgInitRecoverable Probe:6560

DB2 will start archiving logs from extent 0

2005-12-07-17.03.39.579731 Instance:db2inst1 Node:000

PID:10988(db2cart 0) TID:1 Appid:none

data protection sqlpgart Probe:1818

An error was received from the user exit program.

0xFFBFE334 : 0x00000018 ....

2005-12-07-17.09.25.259374 Instance:db2inst1 Node:000

PID:11115(db2agent (TEST) 0) TID:1 Appid:*LOCAL.db2inst1.02B618010714

data protection sqlpgResSpace Probe:2860 Database:TEST

ADM1823E The active log is full and is held by application handle "8".

Terminate this application by COMMIT, ROLLBACK or FORCE APPLICATION.

2005-12-07-17.09.25.271709 Instance:db2inst1 Node:000

PID:11115(db2agent (TEST) 0) TID:1 Appid:*LOCAL.db2inst1.02B618010714

data protection sqlpWriteLR Probe:980 Database:TEST

DIA8309C Log file was full.

ZRC=0x85100009ÿ



db cfg:

Log file size (4KB) (LOGFILSIZ) = 1000

Number of primary log files (LOGPRIMARY) = 3

Number of secondary log files (LOGSECOND) = 2

Changed path to log files (NEWLOGPATH) =

Path to log files = /home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR/

Overflow log path (OVERFLOWLOGPATH) =

Mirror log path (MIRRORLOGPATH) =

First active log file = S0000113.LOG

Block log on disk full (BLK_LOG_DSK_FUL) = NO

Percent of max active log space by transaction(MAX_LOG) = 0

Num. of active log files for 1 active UOW(NUM_LOG_SPAN) = 0

Group commit count (MINCOMMIT) = 1

Percent log file reclaimed before soft chckpt (SOFTMAX) = 100

Log retain for recovery enabled (LOGRETAIN) = RECOVERY

User exit for logging enabled (USEREXIT) = ON



adm dir:

total 101914

drwxr-xr-x 2 db2inst1 db2iadm1 1024 Dec 8 10:47 .

drwxrwxr-t 14 db2inst1 db2iadm1 1024 Nov 23 14:37 ..

-r--r--r-- 1 db2fenc1 db2fadm1 0 Nov 23 14:20 .fenced

-rw------- 1 db2inst1 db2iadm1 80364 Dec 8 10:47 core

-r-xr-xr-x 1 db2inst1 db2iadm1 24120 Nov 23 14:20 db2_recon_aid

-r-s--x--x 1 db2inst1 db2iadm1 65192 Nov 23 14:20 db2audit

-r-s--x--x 1 root db2iadm1 16808 Nov 23 14:20 db2cacpy

-r-xr-x--x 1 db2inst1 db2iadm1 109192 Nov 23 14:20 db2cap

-r-sr-s--x 1 db2inst1 db2iadm1 984824 Nov 23 14:20 db2dart

-r-sr-xr-x 1 root db2iadm1 45148 Nov 23 14:20 db2dasstml

-r-sr-s--x 1 root db2iadm1 25884 Nov 23 14:20 db2fmp

-r-sr-s--x 1 root db2iadm1 22812 Nov 23 14:20 db2fmpterm

-r-s--x--x 1 root db2iadm1 78056 Nov 23 14:20 db2genp

-r-xr-xr-x 1 db2inst1 db2iadm1 7087 Nov 23 14:20 db2gov

-r-sr-s--x 1 db2inst1 db2iadm1 71324 Nov 23 14:20 db2govd

-r-xr-x--x 1 db2inst1 db2iadm1 5438 Nov 23 14:20 db2govlg

-r-sr-s--- 1 db2inst1 db2iadm1 34424 Nov 23 14:20 db2inidb

-r-sr-x--x 1 root db2iadm1 112188 Nov 23 14:20 db2licd

-r-sr-x--- 1 root db2iadm1 46468 Nov 23 14:20 db2licm

-r-sr-s--x 1 db2inst1 db2iadm1 15272 Nov 23 14:20 db2path

-r-xr-x--- 1 db2inst1 db2iadm1 876 Nov 23 14:20 db2rapp

-r-xr-x--- 1 db2inst1 db2iadm1 33248 Nov 23 14:20 db2rappl

-r-xr-x--- 1 db2inst1 db2iadm1 874 Nov 23 14:20 db2rem

-r-sr-s--- 1 root db2iadm1 53848 Nov 23 14:20 db2remot

-r-sr-s--- 1 db2inst1 db2iadm1 30728 Nov 23 14:20 db2rfpen

-r-xr-x--- 1 db2inst1 db2iadm1 1317 Nov 23 14:20 db2rstar

-r-xr-x--- 1 db2inst1 db2iadm1 1314 Nov 23 14:20 db2rstop

-r-xr-xr-x 1 db2inst1 db2iadm1 33692 Nov 23 14:20 db2set

-r-sr-s--x 1 db2inst1 db2iadm1 74420 Nov 23 14:20 db2star2

-r-sr-s--x 1 root db2iadm1 32600 Nov 23 14:20 db2start

-r-sr-s--x 1 root db2iadm1 34368 Nov 23 14:20 db2stop

-r-sr-s--x 1 db2inst1 db2iadm1 55012 Nov 23 14:20 db2stop2

-r-sr-s--x 1 db2inst1 db2iadm1 24684 Nov 23 14:20 db2stst

-r-sr-s--- 1 db2inst1 db2iadm1 13516 Nov 23 14:20 db2svc

-r-sr-s--- 1 root db2iadm1 48880724 Nov 23 14:20 db2sysc

-r-sr-s--x 1 db2inst1 db2iadm1 1042188 Nov 23 14:20 db2trc

-rwxr-xr-x 1 db2inst1 db2iadm1 18272 Dec 7 16:14 db2uext2



db2level:

DB21085I Instance "db2inst1" uses "32" bits and DB2 code release "SQL08015"

with level identifier "02060106".

Informational tokens are "DB2 v8.1.0.50", "SAP_9973", "U496794_9973", and

FixPak "5".

Product is installed at "/opt/IBM/db2/V8.1".
__________________
IBM Certified DBA for DB2 UDB
IBM Certified Database Developer for DB2 UDB
DB2 Tech Support, IBM Toronto Software Lab
Reply With Quote
  #2 (permalink)  
Old 12-10-05, 23:51
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
If you upgrade to 8.2 you can use use LOGARCHMETH1 and specify the path where you want the archive logs to go without the pain of a user exit program. For example,

db2 update db cfg using LOGARCHMETH1 using DISK:\archive_logs

but you already knew that, didn't you.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 12-11-05, 13:01
wangzhonnew wangzhonnew is offline
Registered User
 
Join Date: Nov 2005
Location: Toronto
Posts: 65
yeah, but i want stay on fixpak 5 since the application doesn't support 8.2.
any more suggestions please?
__________________
IBM Certified DBA for DB2 UDB
IBM Certified Database Developer for DB2 UDB
DB2 Tech Support, IBM Toronto Software Lab
Reply With Quote
  #4 (permalink)  
Old 12-11-05, 20:11
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Which source file do you mean ?

I normally tend to use a simple userexit for initial testing of the exit before I go to the 'real' one ...

http://www.dbforums.com/t516540.html

Cheers
Sathyaram
Quote:
db2 shows error in db2diag.log. the return code of userexit shows 0x18, which represents "userexit is not found" in source file.
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #5 (permalink)  
Old 12-12-05, 11:35
wangzhonnew wangzhonnew is offline
Registered User
 
Join Date: Nov 2005
Location: Toronto
Posts: 65
i used db2uext2.cdisk
__________________
IBM Certified DBA for DB2 UDB
IBM Certified Database Developer for DB2 UDB
DB2 Tech Support, IBM Toronto Software Lab
Reply With Quote
  #6 (permalink)  
Old 12-12-05, 12:18
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Sorry .... I might be asking a stupid question ..

If DB2 is unable to invoke the user exit, how does it get the error code defined in db2uext2 ?

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.

Last edited by sathyaram_s; 12-12-05 at 12:22.
Reply With Quote
  #7 (permalink)  
Old 12-12-05, 14:24
wangzhonnew wangzhonnew is offline
Registered User
 
Join Date: Nov 2005
Location: Toronto
Posts: 65
in db2diag.log, the return code is defined in db2uext2.c*
/* ----------------------------------------------------------------- */
/* User Exit Supported Return Codes */
/* NOTE: DB2 will reinvoke the user exit for the same request */
/* after 5 minutes if return code is 4 or 8. */
/* */
/* For other non-zero return codes, DB2 will not invoke */
/* user exit for the database for at least 5 minutes. */
/* If this request is to archive a log file, DB2 will not */
/* make another archive request for this file, or other */
/* log files produced during the 5 minute time period. */
/* These log files will only be archived when all */
/* applications disconnect from and the database, and the */
/* database is reopenned. */
/* ----------------------------------------------------------------- */
#define RC_OK 0 /* ok */
#define RC_RES 4 /* resource allocation error */
#define RC_OPATTN 8 /* operator/user attention required*/
#define RC_HARDWARE 12 /* hardware error */
#define RC_DEFECT 16 /* software error */
#define RC_PARM 20 /* invalid parameters */
#define RC_NOTFOUND 24 /* db2uext2() / file not found */
#define RC_UNKNOWN 28 /* unknown error */
#define RC_OPCAN 32 /* operator/user terminated */

this is just the definition in db2uext2. it will be match the code defined in db2. so if db2 can't find db2uext2, it will output error code 24...
__________________
IBM Certified DBA for DB2 UDB
IBM Certified Database Developer for DB2 UDB
DB2 Tech Support, IBM Toronto Software Lab
Reply With Quote
  #8 (permalink)  
Old 12-12-05, 14:49
dbamota dbamota is offline
Registered User
 
Join Date: Sep 2003
Posts: 237
I had a problem with not setting AUDIT_ERROR_PATH properly; do you get anything in AUDIT_ERROR_PATH? Other laborious recourse is to find all instances of
#define RC_NOTFOUND 24 /* db2uext2() / file not found */ and make sure each of those files is available.
__________________
mota
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On