ansible-devops icon indicating copy to clipboard operation
ansible-devops copied to clipboard

Error while setting up DB2 for Manage

Open QDespeisse opened this issue 2 years ago • 8 comments

On the role suite_db2_setup_for_manage, a db2 script is generated, copied to the db2u pod and executed. When looking at the logs, it looks like the script is interrupted and some of the queries are not executed. This cause the maxinst to fail because the tablespaces and the maximo schema doesn't exist.

The line 48 of ansible-devops/ibm/mas_devops/roles/suite_db2_setup_for_manage/templates/setupdb.sh.j2 is throwing a warning that stops the script. I guess the line should be encaptulated between set +e and set _e so the script continues.

setupdb.log

 Database Connection Information

 Database server        = DB2/LINUXX8664 11.5.7.0
 SQL authorization ID   = DB2INST1
 Local database alias   = BLUDB

DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
SQL1363W  One or more of the parameters submitted for immediate modification 
were not changed dynamically. For these configuration parameters, the database 
must be shutdown and reactivated before the configuration parameter changes 
become effective.

QDespeisse avatar Jan 17 '23 07:01 QDespeisse

Hi @csschen I see you self-assigned this one, any progress or updates on this?

andrercm avatar Mar 22 '23 21:03 andrercm

We need involve DBA to help fix the script issue, it seem he is busy not respond yet, currently is pending on that.

csschen avatar Mar 23 '23 02:03 csschen

@csschen any update on this issue?

whitfiea avatar May 22 '23 09:05 whitfiea

@whitfiea The DBA Glenn is on vacationing, will be back on May 29th. I will ask him after the vacation.

csschen avatar May 23 '23 06:05 csschen

@QDespeisse @csschen any updates on this issue? If not we'll close it for now as there's no much movement on this.

andrercm avatar Jun 30 '23 18:06 andrercm

@andrercm I'm working with DBA [email protected] to fix this issue. Will update once there is progress.

csschen avatar Jul 03 '23 05:07 csschen

From [email protected]'s request, script setupdb should not do any db2 cfg settings, as those should belong into the db2u cluster CR.

DBA [email protected] help reviewed the DB2 setup script, the suggestion is that all the db2 config, db2 dbm config, db2 set command should not execute on DB2 instance directly, instead of changing the DB2uCluster CR. Those contents should removed from the script. He also help refined and fixed the marker file missing issue, will query the results from DB2 instance per time before create the DB2 objects.

The new script tested successfully by Ansible role suite_db2_setup_for_manage, below are the db2 setup script test logs:

"stderr": "Defaulted container \"db2u\" out of: db2u, init-labels (init), init-kernel (init)",
    "stderr_lines": [
        "Defaulted container \"db2u\" out of: db2u, init-labels (init), init-kernel (init)"
    ],
    "stdout": "\n   Database Connection Information\n\n Database server        = DB2/LINUXX8664 11.5.8.0\n SQL authorization ID   = DB2INST1\n Local database alias   = BLUDB\n\nCREATE BUFFERPOOL MAXBUFPOOL SIZE 8192 AUTOMATIC PAGESIZE 32 K\nDB20000I  The SQL command completed successfully.\n\nCREATE BUFFERPOOL MAXBUFPOOLINDX SIZE 8192 AUTOMATIC PAGESIZE 32 K\nDB20000I  The SQL command completed successfully.\n\nCREATE BUFFERPOOL MAXTEMPBP SIZE 8192 AUTOMATIC PAGESIZE 32 K\nDB20000I  The SQL command completed successfully.\n\nCREATE TABLESPACE MAXDATA PAGESIZE 32 K MANAGED BY AUTOMATIC STORAGE BUFFERPOOL MAXBUFPOOL\nDB20000I  The SQL command completed successfully.\n\nCREATE TABLESPACE MAXINDEX PAGESIZE 32 K MANAGED BY AUTOMATIC STORAGE BUFFERPOOL MAXBUFPOOLINDX\nDB20000I  The SQL command completed successfully.\n\nCREATE TEMPORARY TABLESPACE MAXTEMP PAGESIZE 32 K MANAGED BY AUTOMATIC STORAGE BUFFERPOOL MAXTEMPBP\nDB20000I  The SQL command completed successfully.",
    "stdout_lines": [
        "",
        "   Database Connection Information",
        "",
        " Database server        = DB2/LINUXX8664 11.5.8.0",
        " SQL authorization ID   = DB2INST1",
        " Local database alias   = BLUDB",
        "",
        "CREATE BUFFERPOOL MAXBUFPOOL SIZE 8192 AUTOMATIC PAGESIZE 32 K",
        "DB20000I  The SQL command completed successfully.",
        "",
        "CREATE BUFFERPOOL MAXBUFPOOLINDX SIZE 8192 AUTOMATIC PAGESIZE 32 K",
        "DB20000I  The SQL command completed successfully.",
        "",
        "CREATE BUFFERPOOL MAXTEMPBP SIZE 8192 AUTOMATIC PAGESIZE 32 K",
        "DB20000I  The SQL command completed successfully.",
        "",
        "CREATE TABLESPACE MAXDATA PAGESIZE 32 K MANAGED BY AUTOMATIC STORAGE BUFFERPOOL MAXBUFPOOL",
        "DB20000I  The SQL command completed successfully.",
        "",
        "CREATE TABLESPACE MAXINDEX PAGESIZE 32 K MANAGED BY AUTOMATIC STORAGE BUFFERPOOL MAXBUFPOOLINDX",
        "DB20000I  The SQL command completed successfully.",
        "",
        "CREATE TEMPORARY TABLESPACE MAXTEMP PAGESIZE 32 K MANAGED BY AUTOMATIC STORAGE BUFFERPOOL MAXTEMPBP",
        "DB20000I  The SQL command completed successfully."
    ]

The DBA [email protected] help confirmed above log is working as expected. The script tested on both ROKS and ROSA. Below are the Ansible role test logs.

roks_test.log rosa_test.log

csschen avatar Jul 17 '23 07:07 csschen

The fix has been merged into master branch. Can we close this issue? @QDespeisse

csschen avatar Oct 11 '23 03:10 csschen

Closing issue, looks like this was fixed back in August 2023, but the issue was not closed.

durera avatar Jan 19 '25 00:01 durera