Starting and Stopping the Database Server
Oracle Tips by Burleson Consulting
with a control program for starting and stopping the database. This program is
named pg_ctl. pg_ctl is an executable in Windows and a shell script in Linux.
The syntax of
pg_ctl start [-w] [-s] [-D datadir] [-l filename] [-o options] [-p path]
pg_ctl stop [-W] [-s] [-D datadir] [-m s[mart] | f[ast] | i[mmediate] ]
pg_ctl restart [-w] [-s] [-D datadir] [-m s[mart] | f[ast] | i[mmediate] ] [-o
pg_ctl reload [-s] [-D datadir]
pg_ctl status [-D datadir]
pg_ctl kill [signal_name] [process_id]
pg_ctl resides in
the bin directory under the EnterpriseDB Home. On a default installation in
Microsoft Windows, that would be c:\EnterpriseDB\8.1\dbserver\bin. On Linux,
the file would reside in /opt/ EnterpriseDB/8.1/dbserver/bin.
In most cases, you
will not need to run pg_ctl directly. You will normally run the included shell
scripts from an icon that EnterpriseDB includes in the installation package.
If for some reason
you do need to run pg_ctl directly, you can contact support or view the exact
syntax in the provided EnterpriseDB documentation. When you do run pg_ctl
directly, the two most common options that you will need to include are the –D
option and the –l option.
-D is the data
directory that you specified above (see Figure 2.8). –l is the filename of your
Database in Windows
database in MS-Windows is as easy as running a batch file. After a successful
installation, you should have a menu option to start and stop the database. The
Start Database command is under Start --> Programs --> EnterpriseDB Advanced
Server --> Start Database.
The Remote DBA Management
Server will also be started by running this menu option.
In Windows, by
default, EnterpriseDB is configured as a Service and is configured to
automatically start when Windows starts, Figure 2.17. This means it runs
without a console and can be auto-started when the machine boots. You can get
to the Services program by running Start --> Settings --> Administrative Tools
There are two
services installed: The EDB Database Server (high-lighted above) and the EDB
Management Server. You can tell if the service is running by looking at the
Status column and you can see if it is configured to auto-start by looking at
the Startup Type column.
You can view the
properties of the service by right-clicking and choosing properties, Figure
EnterpriseDB Database Server Service
You can turn off
auto-start by changing the Startup type from Automatic to Manual.
Notice that the
executable being called is the program, pg_ctl.exe. pg_ctl.exe must be run as
the unprivileged user created earlier (enterprisedb by default). You can see
that in the logon credentials for this service, Figure 2.19.
EnterpriseDB Database Service Logon Credentials
The Remote DBA Management
Server service, Figure 2.20, runs the program, wrapper.exe in the Management
Server home directory. You can run the database without running the Management
Server if you want to save resources (although, in my experience, the Management
Server really doesn’t consume much in the way of resources).
Figure 2.20: Remote DBA
Management Server Service
This is an excerpt
from the book "EnterpriseDB: The Definitive Reference" by Rampant TechPress.