0

I asked before but it looks like its not me, its the system.. My db2 installation completed with "minor errors" so maybe that is it. I can't make out the error code explanations.

The content of the folder:

prog1.sqc sh.sh

I gave DBADM authority to instance user. It should create bnd file on its own, correct?

Here is the report:

 $ db2 precompile prog1.sqc bindfile

 LINE    MESSAGES FOR prog1.sqc
 ------  --------------------------------------------------------------------
    SQL0060W  The "C" precompiler is in progress.
    SQL0031C  File "/home/nikica/UCENJE/precompile/prog1.bnd" 
              could not be opened.
    SQL0095N  No bind file was created because of previous 
              errors.
    SQL0091W  Precompilation or binding was ended with "2" 
              errors and "0" warnings.

IBM support pages:

https://www.ibm.com/support/pages/running-db2look-db2-instance-user-fails-sql0031c-file-db2lkfunbnd-could-not-be-opened

EDIT: my sqc

  #include <stdio.h>
  #include <string.h>
  #include <sqlca.h>

   /* SQL includes */
   EXEC SQL INCLUDE SQLCA;

   EXEC SQL BEGIN DECLARE SECTION;


   EXEC SQL END DECLARE SECTION;

    int main()
    {
    // EXEC SQL CONNECT TO sample;

   return (0);
  }
Nikica
  • 21
  • 5
  • 1
    for ubuntu there should be zero errors from a Db2-install. Did you get a successful result before installation when running db2prereqcheck? Never ignore installation errors because they can come back to cause different symptoms earlier. Possibly you have an access-control issue, but unless the installation of Db2 complete with 0 errors you are starting on 'the wrong foot'. Maybe ask a different question that includes the exact contents of the installation log file that shows the error messages, and also include any errors or warnings from db2prereqcheck. – mao Mar 22 '20 at 09:32
  • UPDATE: I made a clean Ubuntu and db2 install with no errors and its the same. Tried to create an empty .bnd file with the touch command and still the same. My .sql is included in first post edit – Nikica Mar 26 '20 at 09:08
  • Your owner/group for the directory, or the permissions of the directory are incorrect. EDIT your question to show the output of these commmands when run as your personal userid, and when run as db2inst1. `id` and `umask`. You can also (for comparison only) run the precompiler when logged in as db2inst1 (or whatever your Db2-instance-owner is called) taking care to use a directory owned by the Db2-instance owner. – mao Mar 26 '20 at 09:48

1 Answers1

0

RESOLVED with

 Precompilation or binding was ended with "0" 
              errors and "0" warnings.

Thanks to mao

Did all the steps like 100 times before plus "su - root" in the beginning

Nikica
  • 21
  • 5
  • You should not need to be root to work with Db2 on Unix/Linux. You should be working with your own userid . Sounds like you allowed root to create some directories under your home folder. Bad idea. Do not use root for everyday dev/test work with Db2-LUW. – mao Mar 26 '20 at 10:47