Db2 On Premise and Cloud

Expand all | Collapse all

Trying to run a user-provided script

  • 1.  Trying to run a user-provided script

    Posted Tue October 15, 2019 10:03 AM
    Hi, I'm trying to use the documented feature in docker hub which is the ability to provide any custom script in '/var/custom/' directory.

    I'm adding a few .sql and a .sh script. From the script I'm trying to do:

    su db2inst1 -c '/database/config/db2inst1/sqllib/bin/db2 -stvf /tmp/myscript.sql'

    (In my dockerfile I'm changing the file permissions to 777 to both files, script and sql).

    Everytime it tries to run the script I get the error:

    SQL10007N Message "-1390" could not be retrieved.  Reason code: "3".

    Hopefully you can help me out.

    Thanks!



    ------------------------------
    JOSUE CORNEJO GALICIA
    ------------------------------


  • 2.  RE: Trying to run a user-provided script

    Posted 30 days ago
    Hi Josue ,
    You want to run db2 with the environment of root.
    why don't you run su - db2inst1?

    There seems that some environment variables are not available.
    Different hits with google point also to an environment issue due to su without dash.
    https://www.ibm.com/support/pages/db2start-fails-sql10007n-message-1390-could-not-be-retrieved-reason-code-3

    You can source db2profile.
    Maybe only DB2INSTANCE isn't set.

    ------------------------------
    Joachim Gerolf Stumpf
    ------------------------------



  • 3.  RE: Trying to run a user-provided script

    Posted 30 days ago
    Use su - db2inst1

    ------------------------------
    Joachim Gerolf Stumpf
    ------------------------------



  • 4.  RE: Trying to run a user-provided script

    Posted 30 days ago
    Thank you, it worked =)

    ------------------------------
    JOSUE CORNEJO GALICIA
    ------------------------------



  • 5.  RE: Trying to run a user-provided script

    Posted 30 days ago
    Hi,
    Why don't you use su -

    ------------------------------
    Joachim Gerolf Stumpf
    ------------------------------