oracle linux 10 +pg18 源码安装要点

9月25日PG18发布,赶紧下来看看。

环境:

Oracle linux 10.0 + pg18.0

1. 建用户

useradd postgres

echo "sztech@4U" |passwd --stdin postgres

2.创建软件目录

mkdir /software/pg18

mkdir /pg18/soft

mkdir /data

chown postgres: /software/pg18 /data /pg18/soft

chmod -R 775 /data

3.下载源码到 /software/pg18

cd /software/pg18

wget https://ftp.postgresql.org/pub/s ... tgresql-18.0.tar.gz

4.解压源码

tar -xvf postgresql-18.0.tar.gz

5.安装依赖包

使用root用户执行

yum install e2fsprogs-devel libuuid-devel perl-core

yum install bison tcl tcl-devel perl-ExtUtils-Embed readline-devel zlib-devel pam-devel libxml2-devel libxslt-devel libicu-devel openldap-devel python3-devel gcc-c++ openssl-devel cmake gcc* readline-devel

yum install docbook-dtds docbook-style-xsl libxml2 libxml2-devel libxslt libxslt-devel xmlto perl-XML-SAX

6.配置

su - postgres

cd /software/pg18/postgresql-18.0

./configure --prefix=/pg18/soft --with-openssl --with-pgport=5432 --with-tcl --with-perl --with-python --with-libxml --with-libxslt --with-uuid=e2fs --with-pam --with-ldap

7.编译

gmake world

8.安装

gmake install-world

9.配置环境变量

vim /home/postgres/.bash_profile

export PGHOME=/pg18/soft

export PGDATA=/data/

export PATH=PGHOME/bin:PATH

export LD_LIBRARY_PATH=PGHOME/lib:LD_LIBRARY_PATH

10.初始化数据库

/pg18/soft/bin/initdb -D /data --encoding=UTF8 --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8

11.登录测试一下

postgres@pg16:~$ psql

psql (18.0)

Type "help" for help.

postgres=# select version();

version


PostgreSQL 18.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 14.2.1 20250110 (Red Hat 14.2.1-7), 64-bit

(1 row)

postgres=#

到此,PG18安装完成。

其他自动启动脚本,后续再搞,不影响使用。

相关推荐
我要升天!20 小时前
Linux中《网络基础》
linux·运维·网络
YMatrix 官方技术社区20 小时前
YMatrix 存储引擎解密:MARS3 存储引擎如何超越传统行存、列存实现“时序+分析“场景性能大幅提升?
开发语言·数据库·时序数据库·数据库架构·智慧工厂·存储引擎·ymatrix
鸽芷咕20 小时前
【2025年度总结】时光知味,三载同行:落笔皆是沉淀,前行自有光芒
linux·c++·人工智能·2025年度总结
羑悻的小杀马特20 小时前
指尖敲代码,笔尖写成长:2025年度总结与那些没说出口的碎碎念
linux·c++·博客之星·2025年度总结
辞砚技术录20 小时前
MySQL面试题——索引2nd
数据库·mysql·面试
linweidong21 小时前
C++thread pool(线程池)设计应关注哪些扩展性问题?
java·数据库·c++
欧亚学术21 小时前
突发!刚刚新增17本期刊被剔除!
数据库·论文·sci·期刊·博士·scopus·发表
晴天¥1 天前
VMware+Oracle linux LVM/非LVM磁盘扩容
linux·运维·服务器
oMcLin1 天前
如何在Oracle Linux 8.4上搭建并优化Kafka集群,确保高吞吐量的实时数据流处理与消息传递?
linux·oracle·kafka
worilb1 天前
journalctl 与 tail 使用对比
linux