pg_ctl管理PostgreSQL数据库
2011-12-15 18:13
387 查看
pg_ctl
名称:一个初始化,启动,停止,或控制PostgreSQL服务器的设备(命令).
用法:
pg_ctl init[db] [-D DATADIR] [-s] [-o "OPTIONS"]
pg_ctl start [-w] [-t SECS] [-D DATADIR] [-s] [-l FILENAME] [-o "OPTIONS"]
pg_ctl stop [-W] [-t SECS] [-D DATADIR] [-s] [-m Shutdown-mode]
pg_ctl restart [-w] [-t SECS] [-D DATADIR] [-s] [-m Shutdown-mode] [-o "OPTIONS"]
pg_ctl reload [-D DATADIR] [-s]
pg_ctl status [-D DATADIR]
pg_ctl promote [-D DATADIR] [-s]
pg_ctl kill SIGNALNAME PID
常规选项:
-D,--pgdata DATADIR:指定数据库存储目录
-s,--silent:仅打印错误,不输出信息
-t SECS:指定等待秒数
-w:等待直到操作完成
-W:不等待操作完成
若没有指定-D选项则使用环境变量PGDATA
start或restart的选项:
-c,--core-files:允许postgres产生core文件
-l,--log FILENAME:指定日志文件
-o OPTIONS:指定传递给postgres命令的选项
-p PATH-TO-POSTGRES:指定postgres的路径
stop或restart的选项:
-m Shutdown-mode:可能的值为"smart","fast","immediate"
Shutdown模式:
smart:在所有客户端都断开时退出
fast:直接退出
immediate:不完成shutdown退出,然后重启恢复
SIGNALNAME可能值为:
HUP INT QUIT ABRT TERM USR1 USR2
实例:
#1.查看postgres的状态信息(是否运行,PID等)
./pg_ctl status -D /usr/local/postgres/data
#2.关闭postgres服务器
./pg_ctl stop -D /usr/local/postgres/data
#3.启动postgres服务器
./pg_ctl start -D /usr/local/postgres/data
#4.重启postgres服务器
./pg_ctl restart -D /usr/local/postgres/data
#5.初始化postgres数据
./pg_ctl initdb -D /usr/local/postgres/data
本文出自 “黄彦东” 博客,请务必保留此出处http://huangyandong.blog.51cto.com/1396940/742928
名称:一个初始化,启动,停止,或控制PostgreSQL服务器的设备(命令).
用法:
pg_ctl init[db] [-D DATADIR] [-s] [-o "OPTIONS"]
pg_ctl start [-w] [-t SECS] [-D DATADIR] [-s] [-l FILENAME] [-o "OPTIONS"]
pg_ctl stop [-W] [-t SECS] [-D DATADIR] [-s] [-m Shutdown-mode]
pg_ctl restart [-w] [-t SECS] [-D DATADIR] [-s] [-m Shutdown-mode] [-o "OPTIONS"]
pg_ctl reload [-D DATADIR] [-s]
pg_ctl status [-D DATADIR]
pg_ctl promote [-D DATADIR] [-s]
pg_ctl kill SIGNALNAME PID
常规选项:
-D,--pgdata DATADIR:指定数据库存储目录
-s,--silent:仅打印错误,不输出信息
-t SECS:指定等待秒数
-w:等待直到操作完成
-W:不等待操作完成
若没有指定-D选项则使用环境变量PGDATA
start或restart的选项:
-c,--core-files:允许postgres产生core文件
-l,--log FILENAME:指定日志文件
-o OPTIONS:指定传递给postgres命令的选项
-p PATH-TO-POSTGRES:指定postgres的路径
stop或restart的选项:
-m Shutdown-mode:可能的值为"smart","fast","immediate"
Shutdown模式:
smart:在所有客户端都断开时退出
fast:直接退出
immediate:不完成shutdown退出,然后重启恢复
SIGNALNAME可能值为:
HUP INT QUIT ABRT TERM USR1 USR2
实例:
#1.查看postgres的状态信息(是否运行,PID等)
./pg_ctl status -D /usr/local/postgres/data
#2.关闭postgres服务器
./pg_ctl stop -D /usr/local/postgres/data
#3.启动postgres服务器
./pg_ctl start -D /usr/local/postgres/data
#4.重启postgres服务器
./pg_ctl restart -D /usr/local/postgres/data
#5.初始化postgres数据
./pg_ctl initdb -D /usr/local/postgres/data
本文出自 “黄彦东” 博客,请务必保留此出处http://huangyandong.blog.51cto.com/1396940/742928
相关文章推荐
- PG_ctl管理Postgresql数据库
- pg_rman 实现对postgresql数据库的备份,恢复与管理
- 使用postgreSQL DataSync 进行pg数据库升级 数据同步 升级脚本生成, postgreSQL DataSync简单教程
- postgresql 启动报错 pg_ctl:PID file "/database/data/postmaster.pid" does not exist
- 15实用的PostgreSQL数据库管理命令
- 使用postgreSQL DataSync 进行pg数据库升级 数据同步 升级脚本生成, postgreSQL DataSync简单教程
- 循序渐进PostgreSQL(三): 网络访问配置、用户及角色管理、表空间及数据库创建
- Ubuntu16.04安装PostgreSQL并使用pgadmin3管理数据库_图文详解
- POSTGRESQL 数据库 数据库管理
- PostgreSQL数据库pg_dump命令行不输入密码的方法
- PostgreSQL远程连接,发生致命错误:没有用于主机“…”,用户“…”,数据库“…”,SSL关闭的pg_hba.conf记录
- PostgreSQL学习手册(十一) 数据库管理
- 用Java开发的MySQL,Oracle,PostgreSQL数据库web维护管理软件
- 使用postgreSQL DataSync 进行pg数据库升级 数据同步 升级脚本生成, postgreSQL DataSync简单教程
- PostgreSQL-数据目录与pg_ctl
- ubuntu 桌面版 postgresql数据库的界面管理工具pgadmin3 安装使用
- 使用pg_ctl启动数据库时报错
- postgresql数据库--psql、pg_dump命令带密码执行sql语句
- 使用postgreSQL DataSync 进行pg数据库升级 数据同步 升级脚本生成, postgreSQL DataSync简单教程
- PostgreSQL教程(十三):数据库管理详解