Using the pg_ctl command for PostgreSQL database operations such as starting and stopping.

Document ID : KB000011050
Last Modified Date : 19/04/2018
Show Technical Document Details
Question:

  I have installed the APM Database on PostgreSQL successfully, but it did not start.

What commands should I try using to restart the database?

Environment:
All supported APM releases.
Answer:

  Verify that the PostgreSQL service is running, or restart it if not running.

  Linux/Solaris Steps.

  1. Locate and navigate to the directory that contains the PostgreSQL startup script for your operating system: <APM_Db_Home>/bin/pg_ctl 
     
  2. To check status of the database, run the following command: 
    pg_ctl -D <APM_Db_Home>/data status 
     
  3. To start the database, run the following command: 
    pg_ctl -D <APM_Db_Home>/data -l <APM_Db_Home>/data/pg_log/postmaster.log start 
     
  4. To stop the database, run the following command: 
    pg_ctl -D <APM_Db_Home>/data stop 
     
  5. To restart the database run the following command: 
    pg_ctl -D <APM_Db_Home>/data -l <APM_Db_Home>/data/pg_log/postmaster.log restart

   Windows Steps

To start/stop the PostgreSQL service,

select Control Panel > Administrative Tools > Services > pgsql-<version> - PostgreSQL Server <version>