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 > Cannot open log file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-14-08, 16:42
rev1976 rev1976 is offline
Registered User
 
Join Date: Dec 2007
Posts: 78
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
Reply With Quote
  #2 (permalink)  
Old 03-14-08, 16:49
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
What OS are you using? Do you have permissions to write the file you specify with the l parameter?

Andy
Reply With Quote
  #3 (permalink)  
Old 03-14-08, 16:51
rev1976 rev1976 is offline
Registered User
 
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?
Reply With Quote
  #4 (permalink)  
Old 03-14-08, 16:53
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Your system admin should do it. You need root privileges to grant the permission.

Andy
Reply With Quote
  #5 (permalink)  
Old 03-14-08, 16:58
rev1976 rev1976 is offline
Registered User
 
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.
Reply With Quote
  #6 (permalink)  
Old 03-14-08, 17:07
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
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
Reply With Quote
  #7 (permalink)  
Old 03-14-08, 17:11
rev1976 rev1976 is offline
Registered User
 
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
Reply With Quote
  #8 (permalink)  
Old 03-16-08, 05:40
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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.)
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development

Last edited by stolze; 03-17-08 at 03:36.
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