IY50733: DDCSPKGN FAILS WITH SQL0031C File "<name>" could not be opened. on DB2 V81 ON LINUX

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • Using ddcspkgn db2 v81 on a bnd file will fail on Linux with
    error.
    
     SQL0031C File "<name>" could not be opened.
    
    Explanation:  The file "<name>" is required but could not be
    opened.
    
    Precompilation is terminated.
    
    User Response:  Ensure that the file name specified is correct
    and exists in the file system, and that the file permissions are
    correct.
    
    If installing the sample database, drop it and install the
    sample
    database again.  If the error continues, reinstall the database
    manager and then install the sample database.
    
    
    This worked ok in db2 v72.
    
    This works on other platforms such as Sun/AIX etc ...
    

Local fix

  • I have looked into this and think I know the problem.
    
    In engn/sqjr/sqljrpkgn.C:process_bnd_file() .... we do this ....
    
                  rc = sqloopen( filename, SQLO_READONLY,
    &bindFileHandle);
    
    This works ok on all platforms which have the O_NSHARE flag
    because in engn/sqo/sqlofmga.C:sqloopenp()
    
    #ifndef O_NSHARE
    /*@db28228kna*/
       //
       // On platforms that don't support implicit file locking
       // on the open() call, we have to use fcntl() to get an
       // explicit lock.  However, fcntl() requires the file to
       // be open in the proper mode.  The following lines set
       // up the proper mode.
       //
       if ((uiOptions & SQLO_SHAREREAD) &&
           ((uiOptions & SQLO_READWRITE) == SQLO_WRITEONLY))
       {
          iOpenOptions |= O_RDWR;
       }
       else if (((uiOptions & SQLO_SHAREWRITE) == SQLO_EXCLUSIVE) &&
    /*@bd28228mah*/
                ((uiOptions & SQLO_READWRITE) == SQLO_READONLY))
    /*@ed28228mah*/
       {
          iOpenOptions |= O_RDWR;
       }
       else
    #endif
    /*@de28228kna*/
    
    On Linux, which does not support the O_NSHARE flag, we will end
    up trying to open the file O_RDWR
    which will fail because bind files are by default perms 444.
    
    I simple fix would be to change the sqloopen() call to .....
    
         rc = sqloopen( filename, SQLO_READONLY | SQLO_NOEXPLOCK ,
    &bindFileHandle);
    
    Note: You made need to change the open on a "list" file to also
    use this.
    
    This in my opinion is an issue to be taken up with the OSS group
    as if I open a file SQLO_READONLY
    I expected just that. It seems that default behaviour for an
    sqloopen() is to perform locking.
    
    
    (previously in v72 we did an fopen (..., "r") which is why it
    worked)
    

Problem summary

  • DDCSPKGN FAILS WITH SQL0031C File "<name>" could not be opened
    on DB2 V81 ON LINUX
    

Problem conclusion

  • APAR first fixed in DB2 UDB version 8 Fix Pack 7
    
    fixed in 8.1 FP7  (also known as 8.2 FP0)
    

Temporary fix

Comments

APAR Information

  • APAR number

    IY50733

  • Reported component name

    DB2 UDB ESE HP-

  • Reported component ID

    5765F4103

  • Reported release

    810

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2003-11-11

  • Closed date

    2005-01-07

  • Last modified date

    2008-06-18

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Modules/Macros

  • DEFSRXXX
    

Fix information

Applicable component levels

  • R810 PSY

       UP



Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

DB2 for Linux, UNIX and Windows

Software version:

810

Reference #:

IY50733

Modified date:

2008-06-18

Translate my page

Machine Translation

Content navigation