時(shí)間:2024-03-11 15:08作者:下載吧人氣:19
邏輯備份在恢復(fù)時(shí),介于邏輯備份與故障時(shí)間點(diǎn)之間的數(shù)據(jù)難以恢復(fù),故一般不采取邏輯備份方式進(jìn)行數(shù)據(jù)庫備份,但邏輯適用于跨平臺跨版本的數(shù)據(jù)遷移;
邏輯備份恢復(fù)主要以下三種:
pg_dump
pg_dumpall
copy
本小節(jié)主要講解pg_dump
只能備份單個(gè)數(shù)據(jù)庫,不會導(dǎo)出角色和表空間相關(guān)的信息
-F c 備份為二進(jìn)制格式,壓縮存儲.并且可被pg_restore用于精細(xì)還原
-F p 備份為文本,大庫不推薦
psql dbname -U username < bakfile
或
pg_restore
– pg_restore [option] … [filename]
– pg_restore -d dbname bakfile
網(wǎng)友評論