Oracle认证专家视频教程-OCP全套教程之学习笔记-闪回技术

前端之家收集整理的这篇文章主要介绍了Oracle认证专家视频教程-OCP全套教程之学习笔记-闪回技术前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

知识要点

闪回数据库

使用闪回日志。闪回需要关闭数据库,只能用于特殊情况

创建flashback
sqlplus>shutdown immediate;
sqlplus>start mount;
sqlplus>alter system set db_recovery_file_dest_size=1G;
sqlplus>alter system set db_recovery_file_dest=’/u01/app/oracle/’;
sqlplus>alter database flash_back on;

时间点闪回

sqlplus>shutdown immediate;
sqlplus>startup mount;
sqlplus>flashback database to timestamp to_timestamp(‘2017-07-04 14:30:00’,’yyyy-mm-dd hh24:mi:ss’);

还原点闪回

创建可靠还原点
sqlplus>create restore point b4 guarantee flashback database;
flashback database to restore point b4;
查询可靠还原点
sqlplus>select * from v$restore_point;

闪回表

使用undo历史记录
1. 打开行移动
sqlplus>alter table scott.emp enable row movement;
2. 还原点闪回恢复
sqlplus>flashback table scott.emp to restore point b5;
3. 时间点闪回
sqlplus>flashback table scott.emp to timestamp to_timestamp(‘2017-07-04 15:05:32’,’yyyy-mm-dd hh24:mi:ss’);

闪回查询

指定时间闪回

sqlplus>select * from scott.emp as of timestamp to_timestamp(‘2017-07-04 15:53:32’,’yyyy-mm-dd hh24:mi:ss’);

闪回版本查询

sqlplus>select sal,versions_startscn,versions_endscn,versions_operation from scott.emp versions between scn minvalue and maxvalue where empno=7839;
sqlplus>select sal,versions_xid,versions_operation from scott.emp versions between timestamp sysdate-5/1440 and sysdate where empno=7839;

闪回事务查询

sqlplus>select undo_sql from flashback_transaction_query;

原文链接:https://www.f2er.com/oracle/208612.html

猜你在找的Oracle相关文章