반응형
/********************************************************************************************
-- Title : [PGS9.2] PostgreSQL의 백업 종류
-- Reference : www.raghavt.blogspot.kr/
-- Key word : backup restore recovery 백업 복구 복원 postgresql
********************************************************************************************/
-- Cold Backup
ㅇ B1. Database will be down
B2. OS Level copy the /data <dir>
B3. Using tar -cvf <data dir>
ㅇ R1. It's a simple restoring, by starting the backup data directory.
-- Hot Backup
ㅇ B1. Database will be Up and Running
B2. DB must be Archive Log Mode
B3. Two commands for HB
=# pg_start_backup('lable');
=# pg_stop_backup();
ㅇ R1. Performing Point-In-Time-Recovery by creating recovery.conf in data directory
ㅇ Over PostgreSQL 9.1, You can do this 'pg_basebackup' easily.
ㅇ Over PostgreSQL 9.1, You can do this 'pg_basebackup' easily.
-- Cluster Level
ㅇ B1. Using pg_dumpall
B2. Generates .sql file
ㅇ R1. Using psql -f optin or \i in the psql terminal
-- Palin SQL Format
ㅇ B1. pg_dump -Fp
ㅇ R1. Using psql -f optin or \i in the psql terminal
-- Custom Format
ㅇ B1. pg_dump -Fc
ㅇ R1. pg_restore with -Fc
-- Tar Format
ㅇ B1. pg_dump -Ft
ㅇ R1. pg_restore with -Ft
반응형