Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2003
    Posts
    77

    Unanswered: problem in user exit 's functioning

    I have set up a user exit program recently.
    I'm working in Windows NT/2000 platform, DB2 v 7.2

    I changed the parameter values for ARCHIVE_PATH, RETRIEVE_PATH and AUDIT_ERROR_PATH to "d:\\mylogs\\" , compiled , placed the db2uest2.exe in C:\Program Files\SQLLIB\bin and configured database userexit parameter as On.

    I see one file ARCHIVE.LOG being created at d:\mylogs . With every activity in the database, this file is appended with a new entry like

    ************************************************** **********
    Time Started: Mon Aug 18 14:12:46 2003

    Parameter Count: 8
    Parameters Passed:
    Database name: TESTDB
    Logfile name: S0003507.LOG
    Logfile path: D:\DB2Log2\
    Node number: NODE0000
    Operating system: NT
    Release: SQL07020
    Request: ARCHIVE

    System Action: ARCHIVE D:\DB2Log2\S0003507.LOG to d:\mylogs\TESTDB

    Media Type: disk
    User Exit RC: 0
    Time Completed: Mon Aug 18 14:12:46 2003

    ***************

    My problem is that Archive.LOG is the only file in this folder.
    There is no path like d:\mylogs\TESTDB which I suppose should've been created by this program.
    All the archive logs are still at their old location.
    According to my understanding of user exit so far, the archive logs should exist now in this new location so that I can copy them to some other location.

    Please help if you know what is happening in this case.

    Thanks,
    -Preeti

  2. #2
    Join Date
    Mar 2003
    Posts
    343
    I would think that you'd also have to set the database configuration parameter logretain to RECOVERY.

  3. #3
    Join Date
    Mar 2003
    Posts
    280
    Does your userexit program create the directory structure if it does not exist? Try creating the TESTDB subdirectory manually and see what happens (do this as the db user (db2admin?), and you should be able to tell whether there is a permission problem).

    Do you have LOGRETAIN turned on?


    HTH
    /Lennart

  4. #4
    Join Date
    Mar 2003
    Posts
    343
    Actually, it should archive to
    d:\mylogs\TESTDB\NODE0000\

    But I'm not sure that the userexit will create the underlying directories. Did you get any errors when compiling?

  5. #5
    Join Date
    Mar 2003
    Posts
    280
    I wrote mine userexit in perl, but I assume you is using the sample c prog shipped with db2? I dont have time to check whether it creates the dir or not, so my advise is still to create the directory manually and see what happens.


    /Lennart

  6. #6
    Join Date
    Aug 2003
    Location
    London
    Posts
    25
    "For Windows users, upon first archival with the user exit program, the archive directory structure \SAMPLE\NODE0000 will be created under the mylogs directory. The archive logs path on AIX, which is created manually, is similar with the following: /sample/NODE0000 .."

    Pls Check out on the drive whether there is a directory existing or not.

    Message in your ARCHIVE.LOG clearly says

    "System Action: ARCHIVE D:\DB2Log2\S0003507.LOG to d:\mylogs\TESTDB

    Media Type: disk
    User Exit RC: 0
    Time Completed: Mon Aug 18 14:12:46 2003 "

    as copied successful with User Exit RC :- 0....

    Regards,

  7. #7
    Join Date
    Mar 2003
    Posts
    343
    Also for the same timestamp in the archive.log, look for messages in the db2diag.log - there should be messages if it couldn't archive a log.

  8. #8
    Join Date
    Jun 2003
    Posts
    77

    Thumbs up creating the path manually worked for user exit.

    Thanks a lot to all of you . I'm really grateful for your help.

    Earlier I assumed that Windows should create the path \mylogs\TESTDB\NODE0000 on its own when running user exit program.

    But it looks like it was not doing that in my case.
    Once I created \mylogs\TESTDB , then also it didnt work. It needed the whole path \mylogs\TESTDB\NODE0000.
    When I created this path manually, I started getting log files at this location. So, it worked this way.

    Regards,
    -Preeti

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •