PG_ctl管理Postgresql数据库
来源:互联网 发布:69敏天宫中上游数据 编辑:程序博客网 时间:2024/05/17 07:26
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
名称:一个初始化,启动,停止,或控制PostgreSQL服务器的设备(命令).
用法:
常规选项:
start或restart的选项:
stop或restart的选项:
Shutdown模式:
SIGNALNAME可能值为:
实例:
阅读全文
0 0
- PG_ctl管理Postgresql数据库
- postgresql的pg_ctl
- PostgreSQL工具pg_ctl实现代码
- POSTGRESQL 数据库 数据库管理
- pg_ctl -- 启动、停止、重启 PostgreSQL
- PostgreSQL 数据库管理
- PostgreSQL服务器管理:管理数据库
- 使用pg_ctl启动数据库时报错
- PostgreSQL数据库管理:定期vacuum
- PostgreSQL学习手册(数据库管理)
- PostgreSQL学习手册(数据库管理)
- PostgreSQL学习手册(数据库管理)
- 利用postgreSQL管理地图数据库
- 15实用的PostgreSQL数据库管理命令
- postgresql 启动报错 pg_ctl:PID file "/database/data/postmaster.pid" does not exist
- postgresql: pg_ctl -D data start 出现 postgres aaaaaaaaaaaaaaaaaaaaaaaaa "C:/Users/huang zhen yang/dat
- pg_ctl 命令
- PostgreSQL简介、安装、用户管理、启动关闭、创建删除数据库
- win10家庭版安装sqlserver2000
- 利用shell脚本验证rman备份集和做定期恢复实验
- [WARNING] The requested profile "pom.xml" could not be activated because it does not exist.
- C#将集合key键以ASCII码从小到大排序
- 关于 矩阵 矩阵乘法 行列式的一点思考
- PG_ctl管理Postgresql数据库
- git常见用法
- win10+python3下Anaconda的安装及环境变量配置
- 11.3USACO水题。
- Xml文档解析工具比较 dom sax
- sprintf、strcpy和memcpy的区别
- 19 个 JavaScript 常用的简写技术
- Map 遍历
- 第九章 连网