PostgreSQL中怎么使用snapshot操作接口函数

发布时间:2021-11-10 16:32:07 作者:iii
来源:亿速云 阅读:241

本篇内容介绍了“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操作接口函数”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注亿速云网站,小编将为大家输出更多高质量的实用文章!

推荐阅读:
  1. 使用Nodejs怎么操作postgresql
  2. 怎么使用PostgreSQL12的存储接口

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

postgresql snapshot

上一篇:如何使用Amazon Athena和 Amazon QuickSight进行天气数据可视化分析

下一篇:Django中的unittest应用是什么

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》