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:
On every server where the PPEM manager is installed, stop the manager services:
systemctl stop ppem ppem-gui
On any server with PPEM manager installed, open the
/etc/ppem-manager.ymlconfiguration file and locate thereposection.The section may look as follows:
repo: name:
"repository_database_name"schema:"old_schema_name"user:"DBMS_user_name"password:"DBMS_user_password"Note the value of the
repo.schemaparameter: it is the name of the schema to be changed.If there is no
repo.schemaparameter, then thepublicschema is in use.Connect to the repository database specified in the
repo.nameparameter on behalf of the database owner (usually it is theppemuser):sudo -u
database_ownerpsql -ddatabase_nameBack up the repository database and confirm the integrity of the backup before proceeding to the next steps.
Switch the repository database schema:
Change the currently used schema name to a name of your choice:
ALTER SCHEMA
old_schema_nameRENAME TOnew_schema_name;(Optional) Recreate the schema with the old name, if necessary:
Create the new empty schema:
CREATE SCHEMA
old_schema_name;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
publicschemaCREATE SCHEMA public; GRANT USAGE, CREATE ON SCHEMA public TO pg_database_owner; GRANT USAGE ON SCHEMA public TO PUBLIC;
On every server where the PPEM manager is installed, do the following:
Open the
/etc/ppem-manager.ymlconfiguration file and locate thereposection.Modify the
repo.schemaparameter 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.Save the updated configuration file.
Start the manager services:
systemctl start ppem ppem-gui
Ensure that the manager services started successfully and are available:
systemctl status ppem ppem-gui
Log in to the PPEM web application interface and check the following:
PPEM summary information. Ensure that information about the repository is correct.
The schemas used in the PPEM repository database. Ensure that the database objects are not in the
old_schema_nameschema.The housekeeping rules for the repository database. Ensure that no rules use the
old_schema_nameschema.PPEM agent statuses. All agents must have the
onlinestatus.