本篇内容介绍了“Postgresql中怎么使用snapshot操作接口函数”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
snapshot 操作接口函数
1、创建快照,当BLOCK发生变更时,变更之前的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、将数据库恢复到指定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、查看数据库过去的某个状态。(并不是恢复到过去的状态)
/* * 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、仅仅将当前的BACKEND PID,切换到数据库过去某个SNAPSHOT ID的状态,而不是将所有BACKEND切换到过去的某个状态。
/* * 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操作接口函数”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注编程之家网站,小编将为大家输出更多高质量的实用文章!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。