标签云
asm恢复 asm 恢复 bbed bootstrap$ dul In Memory kcbzib_kcrsds_1 kccpb_sanity_check_2 kfed MySQL恢复 ORA-00312 ORA-00607 ORA-00704 ORA-01110 ORA-01555 ORA-01578 ORA-08103 ORA-600 2662 ORA-600 2663 ORA-600 3020 ORA-600 4000 ORA-600 4137 ORA-600 4193 ORA-600 4194 ORA-600 16703 ORA-600 kcbzib_kcrsds_1 ORA-600 KCLCHKBLK_4 ORA-15042 ORA-15196 ORACLE 12C oracle dul ORACLE PATCH Oracle Recovery Tools oracle加密恢复 oracle勒索 oracle勒索恢复 oracle异常恢复 Oracle 恢复 ORACLE恢复 ORACLE数据库恢复 oracle 比特币 OSD-04016 YOUR FILES ARE ENCRYPTED 勒索恢复 比特币加密文章分类
- Others (2)
- 中间件 (2)
- WebLogic (2)
- 操作系统 (101)
- 数据库 (1,629)
- DB2 (22)
- MySQL (71)
- Oracle (1,493)
- Data Guard (50)
- EXADATA (8)
- GoldenGate (21)
- ORA-xxxxx (158)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (13)
- ORACLE 21C (3)
- Oracle 23ai (3)
- Oracle ASM (65)
- Oracle Bug (7)
- Oracle RAC (48)
- Oracle 安全 (6)
- Oracle 开发 (27)
- Oracle 监听 (27)
- Oracle备份恢复 (545)
- Oracle安装升级 (89)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (75)
- PostgreSQL (18)
- PostgreSQL恢复 (6)
- SQL Server (27)
- SQL Server恢复 (8)
- TimesTen (7)
- 达梦数据库 (2)
- 生活娱乐 (2)
- 至理名言 (11)
- 虚拟化 (2)
- VMware (2)
- 软件开发 (37)
- Asp.Net (9)
- JavaScript (12)
- PHP (2)
- 小工具 (20)
-
最近发表
- oracle 23ai(23.5.0.24.07)完整功能版安装体验
- win平台安装oracle遭遇INS-30131处理
- 配置win环境ssh和sftp并实现免密登录
- 11.2.0.4最新psu-202407
- Oracle 19c 2024.07补丁(RUs+OJVM)
- ORA-00756 ORA-10567故障处理
- ORA-01092 ORA-00604 ORA-08103故障处理
- 数据库启动报ORA-600 6711故障分析处理
- RMAN SBT_TAPE备份无法被DISK通道识别
- ORA-27154 ORA-27300 ORA-27301 ORA-27302故障处理
- Patch SCN工具for Linux
- awr创建snapshot等待library cache: mutex X
- exadata换flash卡的一些操作
- RMAN-06207 RMAN-06208报错解决
- RAC主机相差超过10分钟导致crs无法启动
- O/S-Error: (OS 23) 数据错误(循环冗余检查)—故障处理
- 异常断电数据库恢复-从ORA-600 2131到ORA-08102: 未找到索引关键字, 对象号 39
- 数据泵迁移Wrapped PLSQL之后报PLS-00753
- 数据库open报ORA-600 kcratr_scan_lastbwr故障处理
- resetlogs强制拉库失败并使用备份system文件还原数据库故障处理
标签归档:PostgreSQL编译
PostgreSQL 16 源码安装
空闲中尝试在linux 8的版本上,源码安装PostgreSQL 16,参考文章:PostgreSQL16.2源码部署教程
[root@xifenfei tmp]# cat /etc/redhat-release Red Hat Enterprise Linux release 8.7 (Ootpa) [root@xifenfei tmp]# uname -osr Linux 5.15.0-3.60.5.1.el8uek.x86_64 GNU/Linux
下载pg源码程序:PostgreSQL 16源码下载
linux配置
--关闭selinux sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config setenforce 0 --安装相应的包 yum -y install readline readline-devel zlib zlib-devel gettext \ gettext-devel openssl openssl-devel pam pam-devel libxml2 \ libxml2-devel libxslt libxslt-devel perl perl-devel tcl-devel \ libuuid-devel gcc gcc-c++ make flex bison perl-ExtUtils* libicu libicu-devel --修改内核参数 cat>>/etc/sysctl.conf<<EOF fs.file-max = 76724200 kernel.sem = 10000 10240000 10000 1024 kernel.shmmni = 4096 kernel.shmall = 253702 kernel.shmmax = 1039163392 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 262144 net.core.wmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_max = 1048576 fs.aio-max-nr = 40960000 vm.dirty_ratio=20 vm.dirty_background_ratio=3 vm.dirty_writeback_centisecs=100 vm.dirty_expire_centisecs=500 vm.swappiness=10 vm.min_free_kbytes=524288 vm.swappiness=0 vm.overcommit_memory=2 vm.overcommit_ratio=75 net.ipv4.ip_local_port_range = 10000 65535 EOF sysctl -p --创建组和用户 groupadd postgres -g 3000 useradd postgres -g 3000 -u 3000 --用户 limits 配置 cat>>/etc/security/limits.conf<<EOF postgres soft nofile 1048576 postgres hard nofile 1048576 postgres soft nproc 131072 postgres hard nproc 131072 postgres soft stack 10240 postgres hard stack 32768 postgres soft core 6291456 postgres hard core 6291456 EOF --创建相关目录和权限 mkdir -p /pg/database/server mkdir -p /pg/database/data mkdir -p /pg/database/wal mkdir -p /pg/database/archive chown -R postgres:postgres /pg -R chmod 0775 /pg chmod 0700 /pg/database/data --设置环境变量 vi /home/postgres/.bash_profile export PGPORT=5432 export PGUSER=postgres export PGHOME=/pg/database/server export PGDATA=/pg/database/data export PATH=$PGHOME/bin:$PATH --编译pg软件 su - postgres tar xzvf postgresql-16.2.tar.gz cd /tmp/postgresql-16.2 ./configure --prefix=/pg/database/server --with-pgport=5432 make make install --确认软件安装成功(检查编译日志和测试如下命令) [postgres@xifenfei ~]$ postgres --version postgres (PostgreSQL) 16.2
创建数据库
[postgres@xifenfei ~]$ /pg/database/server/bin/initdb -D/pg/database/data\ -X/pg/database/wal -EUTF8 -Upostgres -W The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale "en_US.UTF-8". The default text search configuration will be set to "english". Data page checksums are disabled. Enter new superuser password: Enter it again: fixing permissions on existing directory /pg/database/data ... ok fixing permissions on existing directory /pg/database/wal ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... America/New_York creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok initdb: warning: enabling "trust" authentication for local connections initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: /pg/database/server/bin/pg_ctl -D /pg/database/data -l logfile start
启动数据库
[postgres@xifenfei ~]$ /pg/database/server/bin/pg_ctl -D /pg/database/data -l logfile start waiting for server to start.... done server started [postgres@xifenfei ~]$ psql psql (16.2) Type "help" for help. postgres=# \d pg_class Table "pg_catalog.pg_class" Column | Type | Collation | Nullable | Default ---------------------+--------------+-----------+----------+--------- oid | oid | | not null | relname | name | | not null | relnamespace | oid | | not null | reltype | oid | | not null | reloftype | oid | | not null | relowner | oid | | not null | relam | oid | | not null | relfilenode | oid | | not null | reltablespace | oid | | not null | relpages | integer | | not null | reltuples | real | | not null | relallvisible | integer | | not null | reltoastrelid | oid | | not null | relhasindex | boolean | | not null | relisshared | boolean | | not null | relpersistence | "char" | | not null | relkind | "char" | | not null | relnatts | smallint | | not null | relchecks | smallint | | not null | relhasrules | boolean | | not null | relhastriggers | boolean | | not null | relhassubclass | boolean | | not null | relrowsecurity | boolean | | not null | relforcerowsecurity | boolean | | not null | relispopulated | boolean | | not null | relreplident | "char" | | not null | relispartition | boolean | | not null | relrewrite | oid | | not null | relfrozenxid | xid | | not null | relminmxid | xid | | not null | relacl | aclitem[] | | | reloptions | text[] | C | | relpartbound | pg_node_tree | C | | Indexes: "pg_class_oid_index" PRIMARY KEY, btree (oid) "pg_class_relname_nsp_index" UNIQUE CONSTRAINT, btree (relname, relnamespace) "pg_class_tblspc_relfilenode_index" btree (reltablespace, relfilenode)
配置开机自动启动
[root@xifenfei tmp]# cp /tmp/postgresql-16.2/contrib/start-scripts/linux /etc/init.d/PostgreSQL [root@xifenfei tmp]# vi /etc/init.d/PostgreSQL --修改如下值 prefix=/pg/database/server PGDATA="/pg/database/data" [root@xifenfei tmp]# chkconfig --add PostgreSQL [root@xifenfei tmp]# chkconfig --list Note: This output shows SysV services only and does not include native systemd services. SysV configuration data might be overridden by native systemd configuration. If you want to list systemd services use 'systemctl list-unit-files'. To see services enabled on particular target use 'systemctl list-dependencies [target]'. PostgreSQL 0:off 1:off 2:on 3:on 4:on 5:on 6:off