Errors while running create_schema.sh script

I am trying to install the product with DB2® database. When I run create_schema.sh, I get SQL0552N and/or SQL0403W errors. Why am I getting these errors and how can I prevent them?

Symptoms

As the error text suggests, SQL0552N means the database user does not have the necessary permissions to be able to create/edit data structures like tables.

Causes

Before using the application, you must create a database schema. This is done by running $TOP/bin/db/create_schema.sh. Since this script creates data structures like tables and indexes, the database user of the application must have the necessary permissions to be able to run this script successfully.

If the database user does not have these permissions, then we get SQL0552N and/or SQL0403W errors usually in the following form:

===== ERROR SQL0552N  "Database_User" does not have the privilege to perform operation
or
===== ERROR SQL0403W  The newly defined alias "Database_User.XYZ" resolved to the object
===== ERROR SQLSTATE=01522
===== ERROR SQLSTATE=42601
where XYZ is the table name.

Resolving the problem

To correct this error, give the database user the following permissions:
  1. CREATETAB
  2. BINDADD
  3. CONNECT
  4. CREATE_NOT_FENCED
  5. IMPLICIT_SCHEMA
  6. LOAD ON DATABASE

Meanwhile, SQL0403W is got when the table or view being referenced does not exist. The reason for this can be that the user does not have the necessary table space usage permissions. As of version 10.1.0, the database user needs usage permission for following table spaces: USERS, INDX, BLOB_TBL_DATA, XML_DATA, XML_LARGE_DATA.

If you are using custom table space mapping file with the following table spaces ICM_DATA, ICM_IX, ITM_DATA, ITM_IX, ITD_DATA, ITD_IX, ITA_DATA, ITA_IX, LCK_DATA, and LCK_IX, then you should provide necessary usage permissions for the same.

For more information, refer to the related URL section.