[CBM] 自行開發Centralize Backup Server

1. NFS:
# yum install nfs-utils nfs-utils-lib
# chkconfig nfs on
# mkdir -p /data/xdbha1
# vi /etc/hosts
------------------------------------------------------------------------------------------------

192.168.38.121  xdbha1  # 加入db server的ip與名稱
------------------------------------------------------------------------------------------------

# vi /etc/exports
------------------------------------------------------------------------------------------------
/data/xdbha1/ xdbha1(rw,no_root_squash,no_all_squash,sync)
------------------------------------------------------------------------------------------------
# service nfs start | stop | restart

於各PostgreSQL Database機器上:
# vi /etc/hosts
------------------------------------------------------------------------------------------------

192.168.38.99   CBM  # 加入CBM server的ip與名稱
------------------------------------------------------------------------------------------------
# mkdir -p /cbm_data

# showmount -e CBM 
Export list for CBM:
/data/xdbha1 xdbha1
# mount -t nfs CBM:/data/xdbha1 /cbm_data

測試後如果沒問題,就設定開機mount
# vi /etc/fstab
------------------------------------------------------------------------------------------------

CBM:/data/xdbha1        /cbm_data               nfs     rw              0 0
------------------------------------------------------------------------------------------------

2.PG_RMAN:


























[SymmetricDS/CrystalDB CRS] SMR - DB2 to CrystalDB(PostgreSQL)

1.環境:
db2_server
--------------------------------------
ip : 192.168.38.22
帳號 : db2inst1 / 1qaz2wsx, tmp / tmp , crs /crs
ibm db2 udb (9.5)
共有兩個要做replication的schema: db2inst1, tmp
CRS使用的schema: crs
共有五個table要複製 :
DB2INST1.item
DB2INST1.item_selling_price
DB2INST1.sale_return_line_item
DB2INST1.sale_transaction
TMP.TB1
--------------------------------------

CrystalDB
--------------------------------------
ip : 192.168.38.121
帳號 : db2inst1 / 1qaz2wsx, tmp / tmp , crs /crs
CrystalDB (9.3 base on PostgreSQL 9.3)
共有三個schema對應db2上的三個, db2inst1, tmp, crs
--------------------------------------

[PostgreSQL/PPAS] How to do point in time recovery with PostgreSQL 9.3 - PITR

PITR一般在PostgreSQL中的應用有兩種:

  • 用在Hot Streaming中shipping log用
  • 用在Incremental backup做為Archive log用(continuous archiving)

實作PITR,從設定、備份到還原主要有幾個步驟,以下將實作每個步驟並針對各步驟說明。

0. 準備工作
    a. 建立Archive要存放的資料夾,並設定權限 (mkdir -p /pg_backup/arlog  && chown postgres.postgres /pg_backup/arlog)
    b. 建立Full Backup檔要存放的資料夾,並設定權限   (mkdir -p /pg_backup/fullbackup && chown postgres.postgres /pg_backup/fullbackup)
    c. 建立Restore要存放的資料夾,並設定權限 (mkdir -p /pg_backup/restore  && chown postgres.postgres /pg_backup/restore)

1.設定WAL(Write Ahead Log) archiving
於postgresql.conf內定義三個主要參數
wal_level = archive # or hot_standby for hot streaming...
archive_mode = on
archive_command = 'cp %p /pg_backup/arlog/%f'
設定完成後重啟Service當超過conf檔定義的wal log大小跟segement後就會開始copy到archive folder.