官术网_书友最值得收藏!

Restarting the database server quickly

Sometimes there are situations where you need a database bounce. This is most likely for the database parameters that require a server restart to come into effect. This is different from the reload option of the server configuration, which only reloads the configuration files without requiring a server bounce.

How to do it...

We can use the following command to restart the database server:

pg_ctl -D /var/lib/pgsql/9.6/data restart

Here, /var/lig/pgsql/9.6/data is the location of the data directory of the PostgreSQL server.

How it works...

Using the restart mode of the pg_ctl command first stops the running databases on the PostgreSQL server and then starts the server. It is in effect a two-way process, where the running server is first stopped and then started again. A database restart is needed in many situations. It could be likely that some of the server parameters require a server restart to enable the changes made to these parameters to come into effects or it can also be that some of the server processes have hung and a restart is needed.

In this mode, by default, the PostgreSQL process will terminate using SIGINT, which is a fast shutdown mode. However, we can also specify the restart mode using the -m argument.

主站蜘蛛池模板: 延寿县| 株洲市| 黄浦区| 奇台县| 日照市| 牡丹江市| 江孜县| 山东省| 凤庆县| 衡阳县| 临桂县| 枣阳市| 东光县| 二连浩特市| 乌审旗| 上思县| 永兴县| 秦安县| 尼玛县| 宁河县| 汽车| 苏州市| 云和县| 宿州市| 探索| 桂阳县| 会理县| 南宁市| 铁岭县| 合江县| 自贡市| 乌兰察布市| 岳阳市| 酉阳| 兴国县| 呼图壁县| 牙克石市| 金川县| 周口市| 绥江县| 阿克苏市|