33.2. Configuring PPEM Repository Database #

By default, PPEM uses the public schema for objects stored in the repository database.

If this schema cannot be used, for example, due to security policies of your organization, you can configure PPEM to use a different schema either during the post-installation manager configuration process (recommended) or later, as shown below.

The procedure described below can be used to change any schema currently in use by the repository database and is not limited to the public schema only.

Important

When changing the schema of the repository database, PPEM becomes unavailable for a short period of time. It is recommended to schedule a maintenance window to do the procedure.

To configure a different schema for the repository database of the running PPEM installation:

  1. On every server where the PPEM manager is installed, stop the manager services:

    systemctl stop ppem ppem-gui
    
  2. On any server with PPEM manager installed, open the /etc/ppem-manager.yml configuration file and locate the repo section.

    The section may look as follows:

    repo:
      name: "repository_database_name"
      schema: "old_schema_name"
      user: "DBMS_user_name"
      password: "DBMS_user_password"
    
  3. Note the value of the repo.schema parameter: it is the name of the schema to be changed.

    If there is no repo.schema parameter, then the public schema is in use.

  4. Connect to the repository database specified in the repo.name parameter on behalf of the database owner (usually it is the ppem user):

    sudo -u database_owner psql -d database_name
    
  5. Back up the repository database and confirm the integrity of the backup before proceeding to the next steps.

  6. Switch the repository database schema:

    1. Change the currently used schema name to a name of your choice:

      ALTER SCHEMA old_schema_name RENAME TO new_schema_name;
      
    2. (Optional) Recreate the schema with the old name, if necessary:

      1. Create the new empty schema:

        CREATE SCHEMA old_schema_name;
        
      2. Grant the necessary permissions for the newly created schema.

        Usually you can grant the same permissions as for the renamed schema. To view the schema permissions, execute:

        \dn+ new_schema_name
        

      Example 33.1. Recreating the commonly used public schema

      CREATE SCHEMA public;
      
      GRANT USAGE, CREATE ON SCHEMA public TO pg_database_owner;
      GRANT USAGE ON SCHEMA public TO PUBLIC;
      

  7. On every server where the PPEM manager is installed, do the following:

    1. Open the /etc/ppem-manager.yml configuration file and locate the repo section.

    2. Modify the repo.schema parameter or add it if missing:

      repo:
        name: "repository_database_name"
        schema: "new_schema_name"
        user: "DBMS_user_name"
        password: "DBMS_user_password"
      

      Use the new schema name that was specified in the ALTER SCHEMA ... RENAME TO ... command above.

    3. Save the updated configuration file.

    4. Start the manager services:

      systemctl start ppem ppem-gui
      
    5. Ensure that the manager services started successfully and are available:

      systemctl status ppem ppem-gui
      
  8. Log in to the PPEM web application interface and check the following: