PG-软件目录结构

1. 软件目录结构

[postgres@pxc 11]$ ls -l /ups/app/pgsql-11/
total 16
drwxr-xr-x 2 root root 4096 Oct  8 15:06 bin     # 二进制可执行文件,是PG数据库的所有相关命令
drwxr-xr-x 6 root root 4096 Oct  8 15:06 include # 头文件目录
drwxr-xr-x 4 root root 4096 Oct  8 15:06 lib     # 动态库目录,PostgreSQL运行所需要的动态库
drwxr-xr-x 8 root root 4096 Oct  8 15:06 share   # 文档和配置模板文件,拓展插件的SQL文件在此目录下的extension中
[postgres@pxc 11]$

2. 数据目录结构

[postgres@pxc 11]$ ls -l ${PGDATA}
total 72
-rw------- 1 postgres postgres   224 backup_label.old      # 
drwx------ 5 postgres postgres    41 base                  # 默认表空间的位置
-rw------- 1 postgres postgres    35 current_logfiles      # 
drwx------ 2 postgres postgres  4096 global                # 共享系统表的目录
drwx------ 2 postgres postgres   231 log                   # 日志目录
drwx------ 2 postgres postgres     6 pg_commit_ts          # 
drwx------ 2 postgres postgres     6 pg_dynshmem           # 
-rw------- 1 postgres postgres  4724 pg_hba.conf           # 认证配置文件,配置了已许可的IP主机
-rw------- 1 postgres postgres  1636 pg_ident.conf         # "ident"认证方式的用户映射文件
drwx------ 4 postgres postgres    68 pg_logical            # 
drwx------ 4 postgres postgres    36 pg_multixact          # 
drwx------ 2 postgres postgres    18 pg_notify             # 
drwx------ 2 postgres postgres     6 pg_replslot           # 
drwx------ 2 postgres postgres     6 pg_serial             # 
drwx------ 2 postgres postgres     6 pg_snapshots          # 
drwx------ 2 postgres postgres     6 pg_stat               # 
drwx------ 2 postgres postgres     6 pg_stat_tmp           # 统计信息的存储目录
drwx------ 2 postgres postgres    18 pg_subtrans           # 
drwx------ 2 postgres postgres    19 pg_tblspc             # 存储用户创建表空间链接文件
drwx------ 2 postgres postgres     6 pg_twophase           # 使用两阶段提交功能时分布式事务的存储目录
-rw------- 1 postgres postgres     3 PG_VERSION            # 软件版本
drwx------ 3 postgres postgres    92 pg_wal                # wal日志存储的目录
drwx------ 2 postgres postgres    18 pg_xact               # 
-rw------- 1 postgres postgres   166 postgresql.auto.conf  # 配置文件,使用alter命令配置的参数写入此文件
-rw------- 1 postgres postgres 24044 postgresql.conf       # 实例的主配置文件
-rw------- 1 postgres postgres    66 postmaster.opts       # 
-rw------- 1 postgres postgres    99 postmaster.pid        # 主进程PID文件
-rw-r--r-- 1 postgres postgres  5968 recovery.conf         # 从库配置文件,12版本已丢弃
[postgres@pxc 11]$


2.1 控制文件

# 控制文件路径
${PGDATA}/global/pg_control
# 查看控制文件内容
${PGHOME}/bin/pg_controldata

clipboard

posted @ 2020-03-31 22:10  KuBee  阅读(361)  评论(0编辑  收藏  举报