 |
|
EnterpriseDB: Restarting the Database
Oracle Tips by Burleson Consulting
|
If you
need to restart the database, you can run the Restart Database icon
under the Expert Setting menu option. You would normally only need to
run this if something is stuck or you have edited your option files.
pg_ctl restart -w -D /opt/EnterpriseDB/8.1/data -m smart
/opt/EnterpriseDB/8.1/bin$ pg_ctl restart -w -D /opt/EnterpriseDB/8.1/data -m
smart
waiting for edb-postmaster to shut down..... done
edb-postmaster stopped
2006-11-05 15:58:25 LOG: logger shutting down
waiting for edb-postmaster to start...2006-11-05 15:58:28 LOG:
** EnterpriseDB Dynamic Tuning Agent
********************************************
* System Utilization: 33
%
*
* Database Version:
8.1.5.21
*
* Operating System Version:
Linux
*
* Number of Processors:
2
*
* Processor Type: x86 Family 15 Model 4 Stepping 1,
GenuineIntel
*
* Processor Architecture:
x86
*
* RAM: 1.5
GB
*
* Max DB Connections: 100
*
* Autovacuum:
off
*
* Autovacuum Naptime: 60
Seconds
*
********************************************************************************
done
edb-postmaster started
Reloading the
Database
Reloading the
database means to reload the configuration files. If you need to reload the
database, you will need to call pg_ctl.exe directly.
pg_ctl reload -D
c:\enterprisedb\8.1\data
C:\EnterpriseDB\8.1\dbserver\bin>pg_ctl reload -D c:\EnterpriseDB\8.1\data|edb-postmaster
signaled
C:\EnterpriseDB\8.1\dbserver\bin>
Killing the
Database
It is preferable
to Stop the database rather than kill the database. If you try to stop the
database with a Shutdown and that doesn’t work, you can try Shutdown Fast and
Shutdown Immediate. If these do not work, you may resort to kill.
If the database is
killed, it will have to be recovered.
pg_ctl kill INT 3036
C:\EnterpriseDB\8.1\dbserver\bin>type ..\..\data\postmaster.pid
3036
C:/EnterpriseDB/8.1/data
5444001 1872
C:\EnterpriseDB\8.1\dbserver\bin>pg_ctl kill INT 3036
C:\EnterpriseDB\8.1\dbserver\bin>2006-11-05 16:13:14 LOG: logger shutting down
Getting Database
Status
Status will show
you if a database is running in the specified directory and what the command
line to start it was. This can be useful but the Remote DBA Management Server is much
more useful to get status.
Here is a sample
of the command line and response for two scenarios: a database is running and a
database not running.
Database is
running:
C:\EnterpriseDB\8.1\dbserver>bin\pg_ctl status -D
c:\EnterpriseDB\8.1\data
pg_ctl: edb-postmaster is running (PID: 1296)
C:/EnterpriseDB/8.1/dbserver/bin/edb-postmaster.exe "-D" "C:/EnterpriseDB/8.1/data"
"-p" "5444"
Database is not
running:
C:\EnterpriseDB\8.1\dbserver>bin\pg_ctl status -D
c:\EnterpriseDB\8.1\data
pg_ctl: neither edb-postmaster nor edb-postgres running
This is an excerpt
from the book "EnterpriseDB: The Definitive Reference" by Rampant TechPress.