For SDP 10.5 and above series, STEP 1 can be done using the createPostgresUser.bat in ServiceDesk\bin directory.
a. Stop the ServiceDesk Plus application.
b. Open windows command prompt
c. Change directory to ServiceDesk\bin and invoke the createPostgresUser.bat scriptC:\Program Files\ManageEngine\ServiceDesk\bin>createPostgresUser.bat -sU postgres -sp <super-user-password> -U <new-username> -p <new-password> -r readonly
i. For the options -sU and -sp, the Postgres super user username and password are to be provided. Default super user name is 'postgres'.ii. The option -r readonly will make the newly created user a read only user.d. Open windows command prompte. Change directory to ServiceDesk\bin and execute startDB.bat. Wait for the success message.C:\Program Files\ManageEngine\ServiceDesk\bin>startDB.bat"C:\Program Files\ManageEngine\ServiceDesk\bin\\.."Database server successfully started...f. Change directory to ServiceDesk\pgsql\binC:\Program Files\ManageEngine\ServiceDesk\bin>cd ..\pgsql\bing. Execute the below command to connect to Postgres query console using PG super user (postgres). Enter the password when promptedC:\Program Files\ManageEngine\ServiceDesk\pgsql\bin>psql.exe -U postgres -p 65432 -h 127.0.0.1 -d servicedeskPassword for user postgres:psql (10.5)WARNING: Console code page (437) differs from Windows code page (1252)8-bit characters might not work correctly. See psql referencepage "Notes for Windows users" for details.Type "help" for help.servicedesk=#h. Grant the necessary permissions with following commandsservicedesk=# GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public to sdpreadonly;GRANTservicedesk=# GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA pg_catalog to sdpreadonly;GRANTservicedesk=# GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA information_schema to sdpreadonly;GRANTi. Exit from Postgres query console by entering '\q'servicedesk=# \q
For SDP 9.4 and 10.0 series build, please follow the instructions mentioned below for STEP 1
a. Stop the ServiceDesk Plus application.
b. Open windows command prompt
c. Change directory to ServiceDesk\bin and execute startDB.bat. Wait for the success message.
C:\Program Files\ManageEngine\ServiceDesk\bin>startDB.bat
"C:\Program Files\ManageEngine\ServiceDesk\bin\\.."
Database server successfully started...
d. Change directory to ServiceDesk\pgsql\bin
C:\Program Files\ManageEngine\ServiceDesk\bin>cd ..\pgsql\bin
e. Execute the below command to connect to Postgres query console using PG super user (postgres). Enter the password when prompted
C:\Program Files\ManageEngine\ServiceDesk\pgsql\bin>psql.exe -U postgres -p 65432 -h 127.0.0.1 -d servicedesk
Password for user postgres:
psql (10.5)
WARNING: Console code page (437) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page "Notes for Windows users" for details.
Type "help" for help.
servicedesk=#
f. Create a user with password and grant read only access to servicedesk database with following commands
servicedesk=# create user sdpreadonly;
CREATE ROLE
servicedesk=# ALTER USER sdpreadonly with password '<your-password-here>';
ALTER ROLE
servicedesk=# GRANT CONNECT ON DATABASE servicedesk TO sdpreadonly;
GRANT
servicedesk=# GRANT USAGE ON SCHEMA public TO sdpreadonly;
GRANT
servicedesk=# GRANT SELECT ON ALL TABLES IN SCHEMA public TO sdpreadonly;
GRANT
servicedesk=# ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO sdpreadonly;
ALTER DEFAULT PRIVILEGESservicedesk=# GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public to sdpreadonly;GRANTservicedesk=# GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA pg_catalog to sdpreadonly;GRANTservicedesk=# GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA information_schema to sdpreadonly;GRANT
g. Exit from Postgres query console by entering '\q'
servicedesk=# \q