Running the database creation scripts from the OpenPages application server computer

Applies to: On premises

If your IBM OpenPages® application server is not on the same computer as your database server, you can also run the database scripts remotely.

Before you begin

Ensure that your environment meets these prerequisites:
  • The Db2® client software is installed on the application server, see Db2 database client installations
  • The Db2 database server is running
  • A database instance for the OpenPages database has been created
  • Oracle compatibility mode is enabled
  • You have updated the database manager configuration for the OpenPages database instance
  • You have copied the Java™ routine class files and encryption files to the Db2 server from the OpenPages installation files.
  • Db2 Text Search is enabled and configured

Procedure

  1. Log on to the OpenPages application server computer as the Db2 administrator.
  2. On Windows, start the Db2 command line processor (CLP). Click Start > IBM Db2 > IBM Db2 Db2COPY1 > Command Line Tools > Db2 Command Window - Administrator.
  3. Go to the /OP_<version>_Main/OP_<version>_Configuration/Database/DB2/INSTALL_SCRIPTS directory.
  4. To catalog the node, run the following script:
    • Linux®:
      ./db2-catalog-node.sh <node_name>
                           <hostname>
                           <port-number_or_service-name> N
    • Windows:
      db2-catalog-node.bat <node_name>
                           <hostname>
                           <port-number_or_service-name> N
    Table 1. Command-line variables for the db2-catalog-node.sh|.bat script
    Variable name Description
    <node_name>

    The node name of the database partition server.

    The node name represents a local nickname that you can set for the computer that contains the database you want to catalog.

    <hostname>

    The hostname or the IP address of the node where the target database is installed.

    <port-number_or_service-name>

    The port that the database server uses. The default port is 50000.

    Or, the service name. The maximum length is 14 characters. This parameter is case-sensitive.

    N

    Use N. This parameter is reserved for future use.

    Example:
    • Linux:
      ./db2-catalog-node.sh OPNode op.server.com 50000 N
    • Windows:
      db2-catalog-node.bat OPNode op.server.com 50000 N
  5. To create the database for OpenPages, run the create-opx-db-clt script.

    Replace the variables with your system values:

    • <database_name> is the name of the OpenPages database.
    • <path> is the location on which to create the database on the server.
    • <catalog_path> is the location of the database alias on the local computer.
    • <node_name> is the cataloged node name.
    • <instance_owner_username> is the user name of the Db2 account that owns the instance on the remote computer.
    • <instance_owner_password> is the password for the account that owns the database instance.
    Use the following syntax:
    • Linux:
      ./create-opx-db-clt.sh <database_name>
                                 <path>
                                 <catalog_path>
                              
    • Windows:
      create-opx-db-clt.bat <database_name>
                                 <path>
                                 <catalog_path>
                                 <node_name>
                                 <instance_owner_username> "<instance_owner_password>"
      Example: Create a remote database on a Linux system from a Windows-based computer. The Db2 database instance owner on the remote computer is db2admin.
      create-opx-db-clt.bat OPX C: C: OPNode db2admin "password"
    Note: Quotation marks are required around a password only if the password contains special characters. See Special characters in passwords.
  6. If the database server is on a Windows operating system and the OpenPages installation user is not the Db2 database instance owner, run the following script:
    clpplus -nw <username>/\'<password>\'@<hostname>:<port>/<database_name>@sql-wrapper dba-grant.sql dba-grant.log  <instance_owner_username>
                   
    • <username> is the user name of the OpenPages installation user (the user that is logged in to the system).
    • <password> is the password of the OpenPages installation user.
    • <instance_owner_username> is the Db2 database instance owner (the user who creates the database instance).

    If the OpenPages installation user is the same as the Db2 database instance owner, no action is required.

    The script explicitly grants control on the SYSTOOLS schema objects to the Db2 database instance owner.
  7. If the database server is on a Windows computer, the OpenPages installation user is not the Db2 database instance owner, and the Db2 database instance owner is not the Db2 administration server (DAS) user, then run the following script:
    clpplus -nw <username>/\'<password>\'@<hostname>:<port>/<database-name>@sql-wrapper dba-grant.sql dba-grant.log <das_user_name>
                   
    • <username> is the user name of the OpenPages installation user (the user that is logged in to the system).
    • <password> is the password of the OpenPages installation user.
    • <das_user_name> is the Db2 Administration server (DAS) user account.

    The script explicitly grants control on the SYSTOOLS schema objects to the DAS user.