[DB] POSTGRESQL

[PostgreSQL] 디렉토리 구조 및 환경 변수 파일

mewoni 2020. 3. 31. 10:36
반응형

postgresql를 설치하고나면 다음과 같은 구조가 생성된다.

[표]POSTGRESQL 엔진 디렉토리 구조

directory contents
bin postgreSQL(DB)에서 사용하는 실행파일 위치
data db의 data directory
doc documentation 파일 위치
pg_env.sh 환경변수 설정 파일
include header files 위치(cluster 생성 시 사용됨)
installer/scripts installer files
lib PostgreSQL(DB)에 필요한 library 위치
pgAdmin3/4 그래픽 관리자 tool
stackbuilder GUI 기반 업데이트 관리 tool

uninstall-postgresql/

uninstall-postgresal.dat

PostgreSQL 제거를 위한 uninstall 파일

 

디렉토리 구조 중 data 디렉터리는 postgresql의 data정보가 저장되는 디렉터리로 data에 대한 정보, 트랜잭션 로그 정보, 환경 설정 부분 등에 대한 파일들이 위치하게 된다.

 

● default data directory 경로 : [root@localhost ~]$ cd /var/lib/pgsql/11/data 

 

- data directory 구조

 - data directory 내 base 라는 디렉토리가 있으며, 이 밑으로 database가 각 디렉토리로 생성된다. 해당 디렉토리에 테이블이나 인덱스와 같은 오브젝트들이 파일 형식으로 저정된다. 

 

 - postgresql은 tablespace를 지원하며, 테이블스페이스 생성을 위해 특정 디렉토리를 지정하고 테이블스페이스를 생성하면, 해당 경로가 pg_tblspc 디렉토리 밑에 심볼릭 링크로 걸리게 되고, 이 링크를 통해 디렉토리의 파일을 조회할 수 있다.

 

 - psql로 접속하여 pg_database를 통해 각 데이터베이스의 oid값을 조회해 db 구조를 파악할 수 있다.

 

주요 환경설정 파일에 대한 설명은 centos에 postgresql 설치하기 게시글 하단 [더보기]란에서 설명 

https://kwomy.tistory.com/2

 

Cent os에 postgresql 설치하기

centos 환경에서 postgresql database 설치 1. OS 환경 확인 [root@localhost ~]# cat /etc/os-release NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="..

kwomy.tistory.com

 

반응형