Oracle Flashback table的使用 Oracle确保recyclebin是打开的 SQLgt; show parameter recyclebin NAME
oracle flashback table的使用
Oracle确保recyclebin是打开的
SQL> show parameter recyclebin
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
recyclebin string ON创建一张表
SQL> create table tab01(id int);
Table created.
SQL> insert into tab01 values(1);
1 row created.
ReportPlust意在打造一套精美的数据报表模板,里面高度封装日历组件、表格组件、排行榜组件、条形进度条组件、文本块组件以及ucharts的多个图表组件,用户只需要按照虚拟数据的格式,传特定数据即可方便、快捷地打造出属于自己的报表页面。该小程序主要使用了ucharts和wyb-table两插件实现的数据报表功能。 特点使用的是uni-app中最受欢迎的图表uCharts插件完成图表展示,该插件
0
SQL> commit;
Commit complete.
SQL> select * from tab01;
ID
----------
1
SQL> create index ind_id on tab01(id);
Index created.删除表TAB01
18:18:26 SQL> select index_name from ind where table_name='TAB01';
INDEX_NAME
------------------------------
IND_ID
18:18:33 SQL> drop table tab01;
Table dropped.
18:18:41 SQL> show recyclebin
ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME
---------------- ------------------------------ ------------ -------------------
TAB01 BIN$7E8nf4eZQZzgQKjACzgfMg==$0 TABLE 2013-11-29:18:18:41
18:18:43 SQL> select index_name from ind where table_name='TAB01';
no rows selected
18:18:50 SQL> select * from tab01;
select * from tab01
*
ERROR at line 1:
ORA-00942: table or view does not exist
发现TAB01上的index也被rename,flashback TAB01
18:19:41 SQL> flashback table tab01 to before drop;
Flashback complete.
18:19:51 SQL> select * from tab01;
ID
----------
1
18:19:54 SQL> select index_name from ind where table_name='TAB01';
INDEX_NAME
------------------------------
BIN$7E8nf4eYQZzgQKjACzgfMg==$0rename index
18:23:09 SQL> ALTER INDEX "BIN$7E8nf4eYQZzgQKjACzgfMg==$0" RENAME TO IDX_ID;
Index altered.
18:23:45 SQL> select index_name,status from ind where table_name='TAB01';
INDEX_NAME STATUS
------------------------------ --------
IDX_ID VALID
如果多次删除同一张表也可以指定recyclebin的名称flashback
18:25:29 SQL> select * from tab01;
ID
----------
1
18:25:36 SQL> drop table tab01;
Table dropped.
18:25:50 SQL> create table tab01(id int);
Table created.
18:26:17 SQL> insert into tab01 values (2);
1 row created.
18:26:30 SQL> commit;
Commit complete.
18:26:33 SQL> select * from tab01;
ID
----------
2
18:26:37 SQL> drop table tab01;
Table dropped.
18:26:43 SQL> create table tab01(id int);
Table created.
18:26:46 SQL> insert into tab01 values(3);
1 row created.
18:26:55 SQL> commit;
Commit complete.
18:26:56 SQL> select * from tab01;
ID
----------
3
18:26:59 SQL> drop table tab01;
Table dropped.
18:27:02 SQL> select * from tab01;
select * from tab01
*
ERROR at line 1:
ORA-00942: table or view does not exist18:27:10 SQL> show recyclebin
ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME
---------------- ------------------------------ ------------ -------------------
TAB01 BIN$7E8nf4edQZzgQKjACzgfMg==$0 TABLE 2013-11-29:18:27:02
TAB01 BIN$7E8nf4ecQZzgQKjACzgfMg==$0 TABLE 2013-11-29:18:26:43
TAB01 BIN$7E8nf4ebQZzgQKjACzgfMg==$0 TABLE 2013-11-29:18:25:50flashback tab01中id值为2的
18:27:51 SQL> flashback table "BIN$7E8nf4ecQZzgQKjACzgfMg==$0" to before drop;
Flashback complete.
18:29:17 SQL> select * from tab01;
ID
----------
2
flashback同时rename
18:30:54 SQL> flashback table "BIN$7E8nf4edQZzgQKjACzgfMg==$0" to before drop rename to tab02;
Flashback complete.
18:31:17 SQL> select * from tab02;
ID
----------
3
也可以根据timestamp或者scn进行表级别的基于时间点的恢复,需要开启row movement
18:32:42 SQL> create table tab03(id int);
Table created.
18:32:55 SQL> insert into tab03 values(1);
1 row created.
18:33:08 SQL> insert into tab03 values(2);
1 row created.
18:33:10 SQL> insert into tab03 values(3);
1 row created.
18:33:12 SQL> commit;
Commit complete.
18:33:14 SQL>
18:33:16 SQL> insert into tab03 values(4);
1 row created.
18:33:23 SQL> commit;
Commit complete.
18:33:25 SQL> select * from tab03;
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号