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.
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.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"
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.
Connect to the repository database specified in
the repo.name parameter on behalf of the database owner
(usually it is the ppem user):
sudo -udatabase_ownerpsql -ddatabase_name
Back 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 SCHEMAold_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 public
schema
CREATE 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.yml configuration file
and locate the repo section.
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.
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_name schema.
The housekeeping
rules for the repository database. Ensure that no rules use
the old_schema_name schema.
PPEM
agent statuses. All agents must have the online
status.