I have lost the password for the postgres account (database administrator / DBA) so I can't login to the database using that account. How can I reset the password? |
NOTE – MAKE SURE ALL CONTROL-M SERVER AND EM SERVER PROCESSES ARE STOPPED BEFORE YOU ATTEMPT THE PASSWORD RESET. FOR A RECOVERY POINT, BACKUP THE CONTROL-M SERVER AND EM SERVER INSTALLATION DIRECTORIES AND REGISTRY (IF WINDOWS). This method applies to both Windows and UNIX systems: 1. Edit the pg_hba.conf file located in: 2. Replace the value “password” in the METHOD column with “trust” and save the file. 3. Run the command: pg_ctl reload 4. Connect to the PostgreSQL database using the following command: 5. Change the password for the postgres account using the following command: 6. Edit the pg_hba.conf file again and change the METHOD value back to “password” 7. Run the command: pg_ctl reload 8. Run the following command to make sure the database is running: NOTE: It is VERY important that "trust" be changed back to "password" or the provided scripts and utilities will not function properly. If you are using Control-M/Server High Availability with Postgres, please perform the next procedure to update the password for the High Availability replication: 2. Run the ctminterface utility on both Control-M/Servers as following: ctminterface -SET_PASSWORD HAKEY <new postgres user password> 4. Start the Control-M/Server Configuration Agent first on the primary and after that on secondary.
The following video demonstrates this solution:
|