Running the steps that require DBA privileges

Applies to: On premises

You can run a script to do the database object creation steps that require DBA privileges. Do this procedure if you do not want to enter DBA credentials when you install OpenPages® or if your organization's security policies require the separation of DBA and non-DBA tasks.

Before you begin

  • The Db2® database server is running
  • A database instance for the OpenPages database is created
  • The sql-wrapper.sql is configured for your environment

About this task

Run the following script: op-database-dba-install.sh|.bat. The script uses the parameters in the sql-wrapper.sql file.

The op-database-dba-install.sh|.bat calls the following scripts:
  • op-database-dba-install.sql: Runs the DBA steps. This script calls the other scripts in this list.
  • create-opx-tablespaces.sql: Creates the OpenPages table spaces.
  • dba-grant.sql: Grants privileges to the DBA user.
  • create-opx-schema-owner.sql: Creates the OpenPages schema owner and grants the user access to the OpenPages table spaces.
  • no-op.sql: This script is empty. Edit this script if you want to run any custom scripts at the end of the DBA setup process. See Custom table space names.
You can do the following configurations:
  • You can specify custom names for table spaces
  • You can specify a custom SQL script to run

Procedure

  1. Log on to the Db2 database server as the Db2 database administrator (DBA).
  2. Locate the scripts that are required.

    If you are a database administrator, get the scripts from your OpenPages team.

    Or, you can get the scripts from the /OP_<version>_Main/OP_<version>_Configuration/Database/DB2/INSTALL_SCRIPTS directory.

  3. Verify that you have execute permission on the scripts.
  4. Open the sql-wrapper.sql file. Verify that the values are suitable for your environment.
    The user that you specify for the opx_db2_instance_owner parameter must have the following authorities:
    • Releases prior to Db2 11.5.6: Both DBADM and SECADM authorities
    • Releases after Db2 11.5.7: DBADM, SECADM, and SYSADM authorities

      If you want to avoid the SYSADM requirement that was introduced in Db2 11.5.7, an alternative approach is to modify the DB2_ALTERNATE_AUTHZ_BEHAVIOUR registry variable to include the NOT_FENCED_ROUTINE_DBAUTH value. For more information, see the Db2 documentation.

    If you want to customize the table space names, see Custom table space names.

    Note: Do not modify the parameters in the section that is used only for upgrades.
  5. If you are using Microsoft Windows, start the Db2 command line processor.

    From the command prompt, type db2cmd. Or, click Start > IBM Db2 > IBM Db2 Db2COPY1 > Command Line Tools > Db2 Command Window - Administrator.

  6. Run the op-database-dba-install.sh|.bat script from the command line.
    • On Linux®:
      ./op-database-dba-install.sh '<dba_password>'
    • On Windows:
      op-database-dba-install.bat "<dba_password>"
    Note: Quotation marks are required around a password only if the password contains special characters. See Special characters in passwords.
  7. Verify that the return code is 0, indicating success.

    You can also check the log file, op-dba-install-<timestamp>.log.

What to do next

You can use the OpenPages installation program to complete the database setup. Or you can complete the database setup manually by using scripts.