国产三级农村妇女在线,国产精品毛片a∨一区二区三区,国产乱子伦视频大全,国产精品色拉拉,国产欧美日韩一区二区三区,

首頁(yè) > 技術(shù) > 數(shù)據(jù)庫(kù)

PostgreSQL深入淺出 | 數(shù)據(jù)庫(kù)的啟動(dòng)與停止

數(shù)據(jù)庫(kù) 2022-12-07 20:14:39

1、概述

上一章節(jié)我們已經(jīng)講述了基于CentOS7.9的操作系統(tǒng)環(huán)境安裝PostgreSQL的過(guò)程,本章將介紹Postgres數(shù)據(jù)庫(kù)的常用命令和基本操作。


2、Postgre數(shù)據(jù)庫(kù)的啟停

2.1、切換到postgres用戶

[root@localhost ~]# su - postgres


2.2、查看PG數(shù)據(jù)庫(kù)進(jìn)程

[postgres@localhost ~]$ ps -aux|grep postgres




2.3、啟動(dòng)數(shù)據(jù)庫(kù)

[postgres@localhost ~]$ pg_ctl -D /usr/local/pgsql/pgdata -l /tmp/logfile start

/usr/local/pgsql/pgdata:數(shù)據(jù)庫(kù)的數(shù)據(jù)目錄

/tmp/logfile:指定日志




啟動(dòng)成功后檢查進(jìn)程

[postgres@localhost ~]$ ps -aux|grep postgres




2.4、停止數(shù)據(jù)庫(kù)

[postgres@localhost ~]$ pg_ctl stop -D /usr/local/pgsql/pgdata -m fast




補(bǔ)充:


這里停止數(shù)據(jù)庫(kù)使用的-m參數(shù)有三個(gè)常用選項(xiàng):

smart: 需要等到所有連接斷開(kāi)后才關(guān)閉數(shù)據(jù)庫(kù)。

fast: 可以理解為Oracle數(shù)據(jù)庫(kù)的immdiate模式。

immediate:可以理解為Oracle數(shù)據(jù)庫(kù)的abort模式。


3、查看PostgreSQL數(shù)據(jù)庫(kù)

[postgres@localhost ~]$ pg_ctl status


TAg

加載中~

本網(wǎng)站LOGO受版權(quán)及商標(biāo)保護(hù),版權(quán)登記號(hào):國(guó)作登字-2022-F-10126915,未經(jīng)湖南木星科技官方許可,嚴(yán)禁使用。
Copyright ? 2012-2022 湖南木星科技有限公司(木星網(wǎng))版權(quán)所有
轉(zhuǎn)載內(nèi)容版權(quán)歸作者及來(lái)源網(wǎng)站所有,本站原創(chuàng)內(nèi)容轉(zhuǎn)載請(qǐng)注明來(lái)源,商業(yè)媒體及紙媒請(qǐng)先聯(lián)系:aishangyiwan@126.com

工信部備案號(hào):湘ICP備19012813號(hào)-5