Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2007
    Posts
    78

    Unanswered: Cannot open log file

    Hi everyone,

    I'm trying to migrate DB2 from V8 to V9. When i'm executing the db2ckmig command i'm getting the following error message:

    Cannot open log file

    here is the command i'm trying to run
    i'm in the directory with V9: db2ckmig <dbname> -l db2ckmig.log

    Thanks in advance

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    What OS are you using? Do you have permissions to write the file you specify with the l parameter?

    Andy

  3. #3
    Join Date
    Dec 2007
    Posts
    78
    Linux on Z and i don't think i have permission to write to the file. How would i grant permission to the file?

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Your system admin should do it. You need root privileges to grant the permission.

    Andy

  5. #5
    Join Date
    Dec 2007
    Posts
    78
    Sorry i'm still new to this. I have root privileges so how do i grant access to the file tho? Doesn't the log file get created when i run the command? All i need the file for is to write any error messages to.

  6. #6
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    As root, you need to give the user write privileges to the directory that the file will be created in. Go one directory above this directory and use either chmod or chown to grant the rights.

    for example for the directory /db/log/:
    cd /db
    chown db2inst1:db2grp1 log

    Andy

  7. #7
    Join Date
    Dec 2007
    Posts
    78
    Ok i did that and it worked but when i run the db2ckmig command again it's still giving the error message:

    Cannot open log file

  8. #8
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Try to specify an absolute pathname and also try writing the log file to the /tmp/ directory. On a properly configured system, every user can create new files under /tmp/ and write to those files.

    As an explanation: relative path names are always relative to the directory which the program considers as the current directory. Since each program can switch the current directory, you have no clue whatsoever what the current directory is and where a relative path name actually points to (unless your program documents what it does). I have seen that some DB2 programs switch the current directory to the root directory. And since your DB2 instance owner should not be allowed to write to "/db2ckmig.log", the error may occur. (I'm not sure if this is the problem in your case, though.)
    Last edited by stolze; 03-17-08 at 04:36.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

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