PostgreSQL 문서 원본 보기
←
PostgreSQL
둘러보기로 가기
검색하러 가기
문서 편집 권한이 없습니다. 다음 이유를 확인해주세요:
요청한 명령은 다음 권한을 가진 사용자에게 제한됩니다:
사용자
.
이 문서는 편집하거나 다른 명령을 할 수 없도록 보호되어 있습니다.
문서의 원본을 보거나 복사할 수 있습니다.
PostgreSQL 8.3.1에 대한 전반적인 사항을 정리한다.<br> 일반적으로 널리 사용되는 관계형 데이터베이스이다. * 홈페이지 : http://www.postgresql.org/ * 다운로드 : http://www.postgresql.org/download/ * 라이센스 : BSD License * 플랫폼 : Windows, Unix, Linux <br> ==추가 컴포넌트 설치== *"Application Stack Builder" 메뉴를 선택하여 PostgreSQL에서 사용할 추가 컴포넌트를 설치한다. <br> *컴포넌트를 설치할 데이터베이스를 선택한다. :[[그림:PostgreSQL831_install_14.png|데이터베이스 지정]] <br> *데이터베이스에 접속하기 위한 드라이버를 선택한다. :*.NET으로 접속하기 위해 "Npgsql v1.0.0"을 선택한다. :*Java로 접속하기 위해 "psqlJDBC v8.3.603"을 선택한다. :ODBC로 접속하기 위해 "psqlODBC v08.03.0100"을 선택한다. :[[그림:PostgreSQL831_install_15.png|드라이버 선택]] <br> *컴포넌트를 다운로드할 사이트를 선택한다. :[[그림:PostgreSQL831_install_16.png|다운로드 사이트 선택]] <br> *다운로드한 컴포넌트를 임시 보관할 디렉토리를 지정한다. :[[그림:PostgreSQL831_install_17.png|임시 보관 디렉토리]] <br> *"Next" 버튼을 눌러 컴포넌트의 설치를 시작한다. :[[그림:PostgreSQL831_install_18.png|컴포넌트 설치 시작]] <br> ===PostgreSQL .NET Provider (Npgsql) 설치=== *"Next" 버튼을 눌러 설치를 시작한다. :[[그림:PostgreSQL831_install_19.png|설치 시작]] <br> *라이센스를 확인한다. :[[그림:PostgreSQL831_install_20.png|라이센스 확인]] <br> *설치할 디렉토리를 지정한다. :[[그림:PostgreSQL831_install_21.png|설치 디렉토리]] <br> *"Install" 버튼을 눌러 설치를 시작한다. :[[그림:PostgreSQL831_install_22.png|설치 시작]] <br> *"Finish" 버튼을 눌러 설치를 종료한다. :[[그림:PostgreSQL831_install_23.png|설치 종료]] <br> ===psqlODBC 설치=== *"Next" 버튼을 눌러 설치를 시작한다. :[[그림:PostgreSQL831_install_24.png|설치 시작]] <br> *라이센스를 확인한다. :[[그림:PostgreSQL831_install_25.png|라이센스]] <br> *설치할 디렉토리를 지정한다. :[[그림:PostgreSQL831_install_26.png|설치 디렉토리]] <br> *"Install" 버튼을 눌러 설치를 시작한다. :[[그림:PostgreSQL831_install_27.png|설치 시작]] <br> *"Finish" 버튼을 눌러 설치를 종료한다. :[[그림:PostgreSQL831_install_28.png|설치 종료]] <br> ===PostgreSQL JDBC Drivers (psqlJDBC) 설치=== *"Next" 버튼을 눌러 설치를 시작한다. :[[그림:PostgreSQL831_install_29.png|설치 시작]] <br> *라이센스를 확인한다. :[[그림:PostgreSQL831_install_30.png|라이센스]] <br> *설치할 디렉토리를 지정한다. :[[그림:PostgreSQL831_install_31.png|설치 디렉토리]] <br> *"Install" 버튼을 눌러 설치를 시작한다. :[[그림:PostgreSQL831_install_32.png|설치 시작]] <br> *"Finish" 버튼을 눌러 설치를 종료한다. :[[그림:PostgreSQL831_install_33.png|설치 종료]] <br> *"Finish" 버튼을 눌러 컴포넌트의 설치를 완료한다. :[[그림:PostgreSQL831_install_34.png|설치 완료]] <br> ==Linux용 설치 가이드== [[Ubuntu Server]] 8.10에서 PostgreSQL을 정리한다. *PostgreSQL 8.3 설치 :*sudo apt-get install postgresql *PostgreSQL의 Super User를 등록 한다. :*참고 문헌 : [https://support.eapps.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=68 User Guide - phpPgAdmin (Administer Your PostgreSQL Database)] :*Ubuntu Server에 root로 로그인하여 다음 명령을 실행 한다. su postgres createuser -P 관리자_아이디 //--- 관리자로 사용할 아이디를 등록 한다 Enter password for new role: Enter it again: Shall the new role be a superuser? (y/n) y *설치 정보 :*설치 폴더 : /usr/lib/postgresql/8.3/ :*환경 폴더 : /etc/postgresql/8.3/main, /etc/postgresql-common :*데이터 폴더 : :*작업 폴더 : /var/lib/postgresql/ :*로그 폴더 : /var/log/postgresql/ :*기동 종료 : /etc/init.d/postgresql-8.3 start, stop, restart, status :*서비스 확인 : ps -ef | grep postgre :*로그 정보 : :*postgres 사용자의 홈 디렉토리 : /var/lib/postgresql ==CentOS용 설치 가이드== *[[CentOS]]에서 PostgreSQL 설치 #--- CentOS에 root로 로그인 한다. yum -y install postgresql postgresql-server postgresql-odbc postgresql-jdbc postgresql-devel rpm -qa | grep postgresql #--- postgresql 설치 확인 *설치 정보 :*설치 폴더 : /usr/share/pgsql/ :*데이터 폴더 : /var/lib/pgsql/ :*실행 파일 : /usr/bin/ :*기동 종료 : /etc/init.d/postgresql start, stop, restart 또는 service postgresql start, stop, restart :*서비스 확인 : ps -ef | grep postmaster | grep -v grep ==사용자 가이드== *PostgreSQL Database Server를 시작/종료하는 방법 :"시작" 메뉴에서 "설정" 메뉴를 선택한 후 "제어판"을 선택한다. :"관리 도구"를 더블 클릭한 후 "서비스"를 더블 클릭한다. :[[그림:MySQL5051_control.png|시작 종료]] :"PostgreSQL Database Server 8.3"을 선택한 후 오른쪽 마우스를 클릭하여 PostgreSQL Database Server를 시작하거나 중지(종료)할 수 있다. <br> ==관리자 가이드== ===CentOS에서 DB Schema 추가 설정=== #--- useridDB : 데이터베이스명 #--- userid : 데이터베이스의 사용자 아이디 #--- userpassword : userid의 암호 su - postgres createuser -s -l userid createdb useridDB psql alter user userid with encrpted password 'userpassword'; alter database useridDB owner to userid; ===백업 및 복구=== *DB별 백업 및 복구 su - postgres pg_dumpall -f db_all.out //--- DB 전체 백업 pg_dump mydb > mydb.sql pg_dump -h localhost -U postgres -Ft -f mydb.backup mydb //--- DB 백업 pg_dump -h localhost -U postgres -Ft -f mydb.backup -t zipcode mydb //--- 테이블 백업 pg_restore -l mydb.backup > mydb.toc //--- 내용 보기 pg_restore -h localhost -U postgres -Ft -d mydb mydb.backup //--- DB 복구 //--- mydb.toc에서 복구가 필요없는 자료는 삭제하거나 ;로 표시한 후 아래 명령을 실행한다. pg_restore -h localhost -U postgres -L mydb.toc -d mydb mydb.backup //--- 부분 복구 *PostgreSQL database의 백업 및 복구 :*postgres 사용자로 백업 시 su - postgres pg_dumpall -f db_backup.sql psql -d ${DB_NAME} < db_backup.sql :*root 사용자로 백업 시 (DB_NAME. 데이터베이스 명, DB_USER. 데이터베이스 사용자) su - root pg_dump -h 127.0.0.1 -U ${DB_USER} -W -b -f db_backup.sql ${DB_NAME} psql -h 127.0.0.1 -U ${DB_USER} -W -d ${DB_NAME} < db_backup.sql == 라이센스 == *PostgreSQL, Slony, & JDBC are released under the BSD License. *GridSQL is released under the GPLv2 with the following license exception. *psqlODBC & Npgsql are released under the LGPL. *pgAdmin III is released under the Artistic Licence. *PostGIS & phpPgAdmin Server are released under the GPLv2. *PHP is released under the PHP License. *The Apache Webserver is released under the Apache License. *This product includes software released under the OpenSSL License. *This product includes Kerberos software released under the MIT License. == psql == Database <br/> jdbc:postgresql://localhost:5432/opencell_db<br/> opencell_db_user / opencell_db_password<br/> <br/> jdbc:postgresql://10.0.0.14:5432/meveo <br/> psql --host=10.0.0.14 --port=5432 --username=meveo --password --dbname=meveo<br/> \? : 도움말<br/> \h : SQL 명령어<br/> \l : Database 목록<br/> \d \d+ : Relationship 정보<br/> \dS : System Table<br/> \dt : Database table<br/> select relname as table_name from pg_stat_user_tables;<br/> select table_name, column_name, data_type, column_default from information_schema.columns where table_catalog = 'meveo' and table_name = 'rating_edr' order by ordinal_position;<br/> \dv : View<br/> \dn : Schema<br/> \e : Query 수정 후 실행<br/> \q : 종료<br/> pg_dump --host=10.0.0.14 --port=5432 --username=meveo --password --dbname=meveo > meveo.sql<br/> pg_restore --schema-only -v dumpfile ==참고 문헌== *[[Ubuntu Server|Ubuntu Server]]에서 PostgreSQL 설치하기 *http://wiki.kldp.org/wiki.php/PostgreSQLOnGentoo?date=200807 *http://database.sarang.net/?inc=read&aid=5187&criteria=pgsql *[http://database.sarang.net/?inc=read&aid=5996&criteria=pgsql 적용 사례] *http://entireboy.egloos.com/3677148 *http://www.powerdb.net/?inc=read&aid=7336&criteria=pgsql&subcrit=&id=&limit=&keyword=&page= [[Category:오픈소스]] [[Category:Database]]
PostgreSQL
문서로 돌아갑니다.
둘러보기 메뉴
개인 도구
로그인
이름공간
문서
토론
변수
보기
읽기
원본 보기
역사 보기
더 보기
검색
주요 메뉴
오픈소스 컨설팅
오픈소스
오픈소스 라이선스
오픈소스 커뮤니티
오픈소스 종류
오픈소스 현황
오픈소스 한글화
문자셋과 인코딩
Storage
Network
보안
고가용성
모니터링
오픈 API
오픈 서비스
Cloud
BigData
Android
산사랑 노트
둘러보기
인기 문서
최근 수정 문서
모든 문서
모든 분류
임의 문서
위키 사용법
자매 사이트
CMS
오비컨 홈페이지
오비컨 CMS
블로그
데모 - SuiteCRM
산사랑의 Twitter
산사랑의 Facebook
친구 사이트
공개SW 포털
OLIS
한국공개소프트웨어협회
AppCenter 지원본부
OLC
PSEG
개발자 블로그
블로터
개인 메뉴
메뉴 수정
양식함
도구
여기를 가리키는 문서
가리키는 글의 최근 바뀜
특수 문서 목록
문서 정보