I setup a userexit program and cannot get it to work correctly:
get the following errors from DB2
Time of Error: Mon Jan 12 14:15:45 2004
Parameter Count: 1
Parameters Passed:
Audit Log File:
System Call Parms:
Media Type: disk
User Exit RC: 20
> Error isolation: Action is not valid
Steps I have taken to get this far: DB2 UDB 7.2 FP6 on AIX 5.2L
# db2 get db cfg for acctview |egrep -i "log retain|user exit"
Log retain for recovery status = RECOVERY
User exit for logging status = NO
Log retain for recovery enabled (LOGRETAIN) = RECOVERY
User exit for logging enabled (USEREXIT) = OFF
# db2 "update db cfg for acctview using USEREXIT ON"
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
- Copy over sample user exit program:
cd /home/db2inst1/sqllib/samples/c
mkdir /home/db2inst1/work/userexit/scripts
cp HOME/sqllib/sample/c/db2uext2.cdisk /home/db2inst1/work/userexit/scripts/db2uext2.c
- make required changes to sample user exit c program:
#define ARCHIVE_PATH "/home/db2inst1/u/dbarch"
#define RETRIEVE_PATH "/home/db2inst1/u/dblog/"
#define AUDIT_ACTIVE 1 /* enable audit trail logging */
#define ERROR_ACTIVE 1 /* enable error trail logging */
#define AUDIT_ERROR_PATH "/home/db2inst1/u/dblog/"
#define AUDIT_ERROR_ATTR "a" /* append to text file */
#define BUFFER_SIZE 32 /* # of 4K pages for output buffer */
- create additional directories for user exit
/home/db2inst1/work/userexit/scripts >
# ls
db2uext2.c
/home/db2inst1/work/userexit/scripts >
# cd $HOME
/home/db2inst1 >
# mkdir u
/home/db2inst1 >
# cd u
home/db2inst1/u >
# mkdir dbarch
/home/db2inst1/u >
# cd dbarch
/home/db2inst1/u/dbarch >
# pwd
/home/db2inst1/u/dbarch
/home/db2inst1/u/dbarch >
# cd ..
/home/db2inst1/u >
# mkdir dblog
/home/db2inst1/u >
# pwd
/home/db2inst1/u
/home/db2inst1/u >
# cd dblog
/home/db2inst1/u/dblog >
/home/db2inst1/u/dblog >
# mkdir -p /MYDB/NODE0000
/home/db2inst1/u/dbarch >
- compile db2uext2.c program
cd /home/db2inst1/work >
# cc -o db2uext2 db2uext2.c
# chmod +s db2uext2
/home/db2inst1/work >
# ls
db2uext2 db2uext2.c userexit
- check to see if it works
# cd /home/db2inst1/u
/home/db2inst1/u >
# ls
dbarch dblog
review and fix errors in error file:
stop/start DB2 instance:
# db2stop
SQL1064N DB2STOP processing was successful.
db2inst1@av3: /home/db2inst1/work >
# db2start
SQL1063N DB2START processing was successful.
db2inst1@av3: /home/db2inst1/work >
try running db2uext2 again
/home/db2inst1/u/dblog >
# ls
USEREXIT.ERR
************************************************** ***************************
Time of Error: Mon Jan 12 14:15:45 2004
************************************************** ***************************
Time of Error: Mon Jan 12 14:15:45 2004
Parameter Count: 1
Parameters Passed:
Audit Log File:
System Call Parms:
Media Type: disk
User Exit RC: 20
> Error isolation: Action is not valid
************************************************** ***************************
Time of Error: Mon Jan 12 14:22:31 2004
Parameter Count: 1
Parameters Passed:
Audit Log File:
System Call Parms:
Media Type: disk
User Exit RC: 20
> Error isolation: Action is not valid
# cat USEREXIT.ERR
************************************************** ***************************
Time of Error: Mon Jan 12 14:15:45 2004
Parameter Count: 1
Parameters Passed:
Audit Log File:
System Call Parms:
Media Type: disk
User Exit RC: 20
> Error isolation: Action is not valid
************************************************** ***************************
Time of Error: Mon Jan 12 14:22:31 2004
Parameter Count: 1
Parameters Passed:
Audit Log File:
System Call Parms:
Media Type: disk
User Exit RC: 20
> Error isolation: Action is not valid
/home/db2inst1/u/dblog >
#
did this fail because I am not compiling the db2uext2.c program under the sqllib/adm directory? Do I need to do this as the AIX root superuser? Thanks!
Scott