Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2012
    Posts
    4

    Unanswered: logfilepath error while trying to execute sample dblognoconn.sqc

    I am trying to run the program dblognoconn.sqc. I enabled archive logging on the sample database using the following statements.

    update db cfg for sample using LOGARCHMETH1 DISK:/home/db2inst1/db2inst1
    update db cfg for sample using LOGRETAIN ON
    db2stop force
    db2start
    db2 backup db sample to "/home/db2inst1/backup" with 2 BUFFERS BUFFER 1024 PARALLELISM 4 WITHOUT PROMPTING;


    After executing these and connecting to sample database,
    get database configuration returns the following:

    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/SQL00002/SQLOGDIR/
    Overflow log path (OVERFLOWLOGPATH) =
    Mirror log path (MIRRORLOGPATH) =
    First active log file = S0000006.LOG
    Block log on disk full (BLK_LOG_DSK_FUL) = NO
    Block non logged operations (BLOCKNONLOGGED) = NO
    Percent max primary 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) = OFF


    Now when i try to run the program dblognoconn.sqc, i get the following error:


    ---- error report -----------------------------

    application message = database logs no db conn -- initialization
    line = 271
    file = dblognoconn.sqc
    SQLCODE = -2650

    SQL2650N An invalid parameter "piLogFilePath" was passed to the
    "db2ReadLogNoConnInit" read log API. Reason Code = "11".

    ---- end error report ------------------------
    Non-zero rc from function DbReadLogRecordsNoConn.


    Could anyone point out whether i am missing something here. Why is the piLogFilePath invalid.

    Thanks
    mpk

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    would it not be better to publish the program - how you did bind - compile
    os/level ? executed on client /server ?
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Aug 2012
    Posts
    4
    I compiled and binded the program using the bldapp that comes along with the db2 V9.7 express C software.

    The compile and bind were successful.

    Here is how:


    [db2inst1@VerticaMc c]$ ./bldapp dblognoconn sample db2inst1 vertica

    Database Connection Information

    Database server = DB2/LINUXX8664 9.7.0
    SQL authorization ID = DB2INST1
    Local database alias = SAMPLE


    LINE MESSAGES FOR dblognoconn.sqc
    ------ --------------------------------------------------------------------
    SQL0060W The "C" precompiler is in progress.
    SQL0091W Precompilation or binding was ended with "0"
    errors and "0" warnings.

    LINE MESSAGES FOR utilemb.sqc
    ------ --------------------------------------------------------------------
    SQL0060W The "C" precompiler is in progress.
    SQL0091W Precompilation or binding was ended with "0"
    errors and "0" warnings.

    LINE MESSAGES FOR dblognoconn.bnd
    ------ --------------------------------------------------------------------
    SQL0061W The binder is in progress.
    SQL0091N Binding was ended with "0" errors and "0" warnings.
    DB20000I The SQL command completed successfully.
    DB20000I The TERMINATE command completed successfully.


    But when i try running it, following are the messages:

    [db2inst1@VerticaMc c]$ ./dblognoconn sample db2inst1 db2inst1 vertica

    THIS SAMPLE SHOWS HOW TO READ DATABASE LOGS ASYNCHRONOUSLY
    WITH NO DATABASE CONNECTION.


    ############## ATTACH TO THE INSTANCE: db2inst1 #######


    USE THE DB2 API:
    db2CfgGet -- Get Configuration
    TO GET THE DATABASE CONFIGURATION AND DETERMINE
    THE SERVER WORKING PATH.

    ***************************************
    *** PRUNE THE RECOVERY HISTORY FILE ***
    ***************************************

    USE THE DB2 API:
    db2Prune -- Prune Recovery History File
    AND THE SQL STATEMENTS:
    CONNECT
    CONNECT RESET
    TO PRUNE THE RECOVERY HISTORY FILE.

    Connecting to 'sample' database...
    Connected to 'sample' database.

    Prune the recovery history file for 'sample' database.

    Disconnecting from 'sample' database...
    Disconnected from 'sample' database.

    *********************************
    *** NO DB CONNECTION READ LOG ***
    *********************************

    USE THE DB2 APIs:
    db2ArchiveLog -- Archive the active log files
    db2ReadLogNoConnInit -- Initialize reading the database logs without a db connection
    db2ReadLogNoConn -- Read the database logs without a db connection
    db2ReadLogNoConnTerm -- Terminate reading the database logs without a db connection
    TO READ LOG RECORDS FROM THE ARCHIVED LOG DIRECTORY.

    Connecting to 'sample' database...
    Connected to 'sample' database.

    Invoke the following SQL statements:
    ALTER TABLE emp_resume DATA CAPTURE CHANGES;
    COMMIT;
    INSERT INTO emp_resume
    VALUES('000120', 'ascii', 'This is a new resume.');
    ('000030', 'ascii', 'This is another new resume');
    COMMIT;
    DELETE FROM emp_resume WHERE empno = '000120';
    DELETE FROM emp_resume WHERE empno = '000030';
    COMMIT;
    DELETE FROM emp_resume WHERE empno = '000140';
    ROLLBACK;
    ALTER TABLE emp_resume DATA CAPTURE NONE;
    COMMIT;

    Disconnecting from 'sample' database...
    Disconnected from 'sample' database.


    ############## DETACH FROM THE INSTANCE: db2inst1 #####


    ---- error report -----------------------------

    application message = database logs no db conn -- initialization
    line = 271
    file = dblognoconn.sqc
    SQLCODE = -2650

    SQL2650N An invalid parameter "piLogFilePath" was passed to the
    "db2ReadLogNoConnInit" read log API. Reason Code = "11".

    ---- end error report ------------------------
    Non-zero rc from function DbReadLogRecordsNoConn.


    Thanks
    mpk

  4. #4
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    pd/psi is good for you..
    how about changing the program and displaying the logpath retrieved from dbcfg
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  5. #5
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    @mpk2012: the dblognoconn sample supplied in v10.1 may not work as supplied currently.

    Looks like IBM did not update it correctly for v10.1.

    Note: you specify a valid log path directory for LOGARCHMETH1. That directory must exist , instance-owner must own it , and must initially be empty.

    I made some changes to get it to comple and run without crashing:

    (1) You must globally replace the string db2Version970 by db2Version1010 in file dblognoconn.sqc, the run bldapp again. Otherwise some APIs fail complaining about the version number .

    (2)The IBM sample code assumes a non-partitioned environment (i.e. a few minor code changes are necessary to make the sample work with DPF), but if your installation is DB2 Express-C then you don't need to worry about that.

    (3) The supplied sample code assumes (in recovutil.c function ServerWorkingPathGet) that the alias-name is part of the server log path. This can be false, so the code will then cause a crash. Just test the result of the strstr() for NULL and only when it is not-null perform the memcpy(), otherwise initialise the result string correctly for your environment.

    (4) The code in DbReadLogRecordsNoConn has a hard-coded directory string to append to the logPath variable. I had to give the correct directory string for my environment.

    The code will then compile and run, but still shows some unknown log records. I will chase IBM about that.

  6. #6
    Join Date
    Aug 2012
    Posts
    4
    Thanks much for those pointers. I did a display of the logPath and found the problem. Also i had to change the hard coded directory string path that it was appending to LOGARCHMETH1 in DbReadLogRecordsNoConn. The program is now completing successfully.

Posting Permissions

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