Db2

Db2

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  IBM DB2 12 .1.2 in Docker cannot be restarted

    Posted 6 days ago

    Hello everyone,

    I am trying to set up my database and run all scripts, but problem I am facing now is related to unability to stop and start the db2 container.

    It works only for the very first time, when db2 is initialized and it's treated as new setup. 

    Here are some details of my machine:

    Mac OS Sonoma, chip Apple M1

    Docker 4.48

    /.env_list:

    LICENSE=accept

    DB2INSTANCE=db2inst1

    DB2INST1_PASSWORD=db2instance1

    DBNAME=BOADB

    BLU=false

    ENABLE_ORACLE_COMPATIBILITY=false

    UPDATEAVAIL=NO

    TO_CREATE_SAMPLEDB=false

    REPODB=false

    IS_OSXFS=true

    PERSISTENT_HOME=true

    HADR_ENABLED=false

    ETCD_ENDPOINT=

    ETCD_USERNAME=

    ETCD_PASSWORD=

    Command used to create db2 container:

    docker run -h db2server --name db2 --restart=always --detach --privileged=true -p 50000:50000 --env-file .env_list -v db2_data:/database -v /Users/itml/Developer/cs/liquibase/database/:/liquibase-db icr.io/db2_community/db2

    After stop the container and start I see in logs:

    (*) Ending DB2 with db2stop force and db2ts "stop for text"
    (*) Restoring global registry file ...
    (*) Preparing the environment before updating the instance ...
    (*) Fixing /etc/services file for DB2 ...
    (*) Fixing db2nodes file configuration ...
    (*) Creating instance ...
    DB2 installation is being initialized
    Total number of tasks to be performed: 4
    Total estimated time for all tasks to be performed: 309 second(s)
    Task #1 start
    Description: Setting default global profile registry variables
    Estimated time 1 second(s)
    Task #1 end
    Task #2 start
    Description: Initializing instance list
    Estimated time 5 second(s)
    Task #2 end
    Task #3 start
    Description: Configuring Db2 instances
    Estimated time 300 second(s)
    Task #4 start
    Description: Updating global profile registry
    Estimated time 3 second(s)
    Task #4 end
    A minor error occurred during the execution.
    DBI1264E This program failed. Errors encountered during execution were
    written to the installation log file. Program name:
    db2icrt. Log file name: /tmp/db2icrt.log.862.

    And in the log file I can see:

    Setting default global profile registry variables :.......Success 
    Initializing instance list :.......Success 
    ERROR: DBI20187E  The fencedid file "/database/config/db2inst1/sqllib/adm/fencedid" is invalid because it is not owned by the "root":"db2iadm1". Change the ownership of the fencedid file to be owned by the "root":"db2iadm1" and then rerun the command. 
    ERROR: An error occurred while configuring the instance "db2inst1".
     
    Configuring Db2 instances :.......Failure 
    Updating global profile registry :.......Success 

    Thanks for help!



    ------------------------------
    Mariusz Lewandowski
    ------------------------------


  • 2.  RE: IBM DB2 12 .1.2 in Docker cannot be restarted

    Posted 5 days ago

    Hello Mariusz,

    Look at the following thread.

    https://community.ibm.com/community/user/discussion/db2-1212-with-docker-on-windows-wsl

    It's quite an old known problem, and it seems that the image owners still can't resolve it...



    ------------------------------
    Mark Barinstein
    ------------------------------



  • 3.  RE: IBM DB2 12 .1.2 in Docker cannot be restarted

    Posted 3 days ago

    Thank you Mark! That helped!



    ------------------------------
    Mariusz Lewandowski
    ------------------------------



  • 4.  RE: IBM DB2 12 .1.2 in Docker cannot be restarted

    Posted 3 days ago
    Edited by Mariusz Lewandowski 3 days ago

    Also, I have another problem with calling user defined function. I am not sure if it deserves another thread or is it permission problem in db2 docker image.

    When running functions it says about fenced user.

    UPDATE EMPLOYER SET PESEL = ENCRYPT_STRING(PESEL);

    Response:

    SQL Error [     ]: A routine failed because the fenced user ID cannot access required files in the sqllib directory or other instance or database directories.. SQLCODE=-1646, SQLSTATE=     , DRIVER=4.35.11



    ------------------------------
    Mariusz Lewandowski
    ------------------------------



  • 5.  RE: IBM DB2 12 .1.2 in Docker cannot be restarted

    Posted 2 days ago

    When running functions it says about fenced user.

    UPDATE EMPLOYER SET PESEL = ENCRYPT_STRING(PESEL);

    Response:

    SQL Error [     ]: A routine failed because the fenced user ID cannot access required files in the sqllib directory or other instance or database directories.. SQLCODE=-1646, SQLSTATE=     , DRIVER=4.35.11

    It's a non-related problem.
    Wrong OS permissions on supporting library for this UDF.
    You may create a new thread to discuss it.



    ------------------------------
    Mark Barinstein
    ------------------------------