本篇內(nèi)容介紹了“PostgreSQL中怎么使用snapshot操作接口函數(shù)”的有關(guān)知識,在實(shí)際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!
韶山ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:028-86922220(備注:SSL證書合作)期待與您的合作!
1、創(chuàng)建快照,當(dāng)BLOCK發(fā)生變更時(shí),變更之前的BLOCK(舊版本),寫入*.snapmap.SNAP_ID file
文件中。直到snapshot被刪除。
/* * Create new snapshot. Starting from this moment Postgres will store original copies of all updated pages. * Them will be stored in shanpshot file (*.snap.SNAP_ID and addressed through *.snapmap.SNAP_ID file) until * snapshot is deleted by sfs_remove_snapshot function or new snapshot is created. */ extern SnapshotId sfs_make_snapshot(void);
2、刪除snapshot.
/* * Remove snapshot with all it's files */ extern void sfs_remove_snapshot(SnapshotId sid);
3、將數(shù)據(jù)庫恢復(fù)到指定snapshot.
/* * Reset database state to the paritcular snapshot. * It will be not possible any more to recover to any of more recent snashots or to the most recent database state. */ extern void sfs_recover_to_snapshot(SnapshotId sid);
4、查看數(shù)據(jù)庫過去的某個狀態(tài)。(并不是恢復(fù)到過去的狀態(tài))
/* * Temporary switch instance to the particular snashot. It will be possible to return back to the most recent database state or to switch to any other snapshot */ extern void sfs_switch_to_snapshot(SnapshotId sid);
5、僅僅將當(dāng)前的BACKEND PID,切換到數(shù)據(jù)庫過去某個SNAPSHOT ID的狀態(tài),而不是將所有BACKEND切換到過去的某個狀態(tài)。
/* * Set snapshot for backend, unlike sfs_switch_to_snapshot function, it switchces snapshot for the current backend and not for all server instance. */ extern void sfs_set_backend_snapshot(SnapshotId sid);
這些接口與ZFS的SNAPSHOT功能非常類似。
“PostgreSQL中怎么使用snapshot操作接口函數(shù)”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!