postgres9.5.3升级postgres11.6

旧城冷巷雨未停 提交于 2019-12-06 20:02:26

 

附上postgres下载地址:

https://yum.postgresql.org/11/redhat/rhel-7-x86_64/repoview/postgresqldbserver11.group.html

 分别下载rpm包,并安装

https://yum.postgresql.org/11/redhat/rhel-7-x86_64/postgresql11-11.6-1PGDG.rhel7.x86_64.rpm
https://yum.postgresql.org/11/redhat/rhel-7-x86_64/postgresql11-contrib-11.6-1PGDG.rhel7.x86_64.rpm
https://yum.postgresql.org/11/redhat/rhel-7-x86_64/postgresql11-libs-11.6-1PGDG.rhel7.x86_64.rpm
https://yum.postgresql.org/11/redhat/rhel-7-x86_64/postgresql11-server-11.6-1PGDG.rhel7.x86_64.rpm
https://yum.postgresql.org/11/redhat/rhel-7-x86_64/postgresql11-devel-11.6-1PGDG.rhel7.x86_64.rpm
yum localinstall postgresql11-*

  

检查升级条件是否具备
/usr/pgsql-11/bin/pg_upgrade --link -b /usr/local/pgsql/9.5/bin -B /usr/pgsql-11/bin/ -d /data/pgsql/data_159 -D /data/pgsql/11/data/ -p 5432 -P 5433
通过硬连接进行升级(切记注意升级前进行数据完整备份,防止出现不可预料的问题)
/usr/pgsql-11/bin/pg_upgrade -b /usr/local/pgsql/9.5/bin -B /usr/pgsql-11/bin/ -d /data/pgsql/data_159/ -D /data/pgsql/11/data/ -p 5432 -P 5433 -U postgres -j 8 --link --check
启动新版的postgres数据库
/usr/pgsql-11/bin/pg_ctl -D /data/pgsql/11/data start

  

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!