KingbaseES 引入回收站功能,实现drop table操作的数据恢复。回收站功能默认关闭,参数名称:kdb_flashback.db_recyclebin。如果不允许一个删除的表进回收站,需要在drop 语句后面加上“PUGRE“X 选项。flashback 支持将一个已经删除到回收站中的表及相关对象闪回到删除之前状态。如果在当前schema 下已经存在同名的表,则闪回失败,需要使用rename to 选项指定一个新的表名。
举例如下:
1、开启参数
test=# alter system set kdb_flashback.db_recyclebin=on; ALTER SYSTEM test=# select pg_reload_conf(); pg_reload_conf ---------------- t (1 row)
2、删除表
test=# drop table t_clob; DROP TABLE test=# select * from recyclebin; oid | object_name | drop_time | type --------+-----------------------+-----------------+------- 534204 | t_clob | 693305543707139 | TABLE 534209 | pg_toast_534204_index | 693305543707039 | INDEX (2 rows) test=# select relname,reloptions from pg_class where relname like '%t_clob%'; relname | reloptions --------------------------------------+--------------------- BIN$$t_clob$$534204$$693305543707139 | {deletestatus=true} (1 row)
3、恢复已删除的表
flashback table t_clob to before drop
4、清楚recyclebin
purge recyclebin
purge table t_clob
drop table t_clob purge
标签:clob,drop,test,recyclebin,table,flashback From: https://www.cnblogs.com/kingbase/p/15711742.html