暂无图片
postgreSQL 有没有办法可以终止掉?
我来答
分享
暂无图片 匿名用户
postgreSQL 有没有办法可以终止掉?

QQ图片20221230094601.jpg

我来答
添加附件
收藏
分享
问题补充
8条回答
默认
最新
zhangyfr

kill -9 pid pid pid pid 

暂无图片 评论
暂无图片 有用 2
yBmZlQzJ
2022-12-30
kill -9 pid pid pid pid
ora_221

kill -9 干掉进程,哈哈~。。。。。。。。。。。。。

暂无图片 评论
暂无图片 有用 0
watson

kill -9 好粗暴的感觉。哈。

暂无图片 评论
暂无图片 有用 0
shunwahⓂ️

一、启动数据库

pg_ctl start -D $PGDATA或pg_ctl start -D /kingdee/pgsql

$PGDATA执行postgresql的数据库的数据目录

二、停止数据库

pg_ctl stop -D $PGDATA [-m shutdown-mode]

-m shutdown-mode指数据库停止的方法,有以下三种:

smart: 等所有的连接终止后关闭数据库。如果客户端连接不终止,则无法关闭数据库。

fast: 相当于oracle数据库的immdiate模式

immediate:相当于oracle数据库的abort模式

[pgsql@easha1 ~]$ pg_ctl start -D PGDATAwaitingforservertostart....2022010511:01:16.931CST[7425]LOG:startingPostgreSQL14.1onx8664pclinuxgnu,compiledbygcc(GCC)4.8.520150623(RedHat4.8.536),64bit2022010511:01:16.932CST[7425]LOG:listeningonIPv6address"::1",port54322022010511:01:16.932CST[7425]LOG:listeningonIPv4address"127.0.0.1",port54322022010511:01:16.933CST[7425]LOG:listeningonUnixsocket"/tmp/.s.PGSQL.5432"2022010511:01:16.935CST[7426]LOG:databasesystemwasshutdownat2022010510:28:59CST2022010511:01:16.936CST[7425]LOG:databasesystemisreadytoacceptconnectionsdoneserverstarted[pgsql@easha1 ]PGDATA waiting for server to start....2022-01-05 11:01:16.931 CST [7425] LOG: starting PostgreSQL 14.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), 64-bit 2022-01-05 11:01:16.932 CST [7425] LOG: listening on IPv6 address "::1", port 5432 2022-01-05 11:01:16.932 CST [7425] LOG: listening on IPv4 address "127.0.0.1", port 5432 2022-01-05 11:01:16.933 CST [7425] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432" 2022-01-05 11:01:16.935 CST [7426] LOG: database system was shut down at 2022-01-05 10:28:59 CST 2022-01-05 11:01:16.936 CST [7425] LOG: database system is ready to accept connections done server started [pgsql@easha1 ~]

[pgsql@easha1 ~]$ pg_ctl stop -D PGDATAmfastwaitingforservertoshutdown....2022010511:02:50.390CST[7425]LOG:receivedfastshutdownrequest2022010511:02:50.391CST[7425]LOG:abortinganyactivetransactions2022010511:02:50.392CST[7425]LOG:backgroundworker"logicalreplicationlauncher"(PID7433)exitedwithexitcode12022010511:02:50.392CST[7427]LOG:shuttingdown2022010511:02:50.423CST[7425]LOG:databasesystemisshutdowndoneserverstopped[pgsql@easha1 ]PGDATA -m fast waiting for server to shut down....2022-01-05 11:02:50.390 CST [7425] LOG: received fast shutdown request 2022-01-05 11:02:50.391 CST [7425] LOG: aborting any active transactions 2022-01-05 11:02:50.392 CST [7425] LOG: background worker "logical replication launcher" (PID 7433) exited with exit code 1 2022-01-05 11:02:50.392 CST [7427] LOG: shutting down 2022-01-05 11:02:50.423 CST [7425] LOG: database system is shut down done server stopped [pgsql@easha1 ~]

转晨曦

暂无图片 评论
暂无图片 有用 0
心有阳光
暂无图片 评论
暂无图片 有用 0
huayumicheng
2022-12-30
学习了。。。。。。。。。。。。
huayumicheng

pt_ctl  start/stop/reload -D $PGDATA

暂无图片 评论
暂无图片 有用 0
鸿惊九天

kill -9 干掉进程…

暂无图片 评论
暂无图片 有用 0
Nightingale

select pg_terminate_backend(pid) ;

暂无图片 评论
暂无图片 有用 0
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏