温馨提示×

温馨提示×

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

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

oracle闪回那些事

发布时间:2020-08-02 19:31:56 来源:网络 阅读:631 作者:叫你 栏目:关系型数据库

开启闪回数据库

alter database flashback on;

alter database open;

修改日期时间显示格式:

alter session  set nls_date_format='yyyy-mm-dd hh34:mi:ss';

查看系统视图 v$flashback_database_log中查看闪回数据库日志信息:

select * from v$flashback_database_log;

闪回数据库:

flashback database to timestamp(to_date('2014-10-11 12:20:11','yyyy-mm-dd hh34:mi:ss'));

闪回恢复后需要resetlogs 或者noresetlogs 打开:

alter database open resetlogs/noresetlogs;

闪回表:

flashback table tablename to timestamp(to_date('2014-11-10 12:12:12','yyyy-mm-dd hh34:mi:ss'));

闪回回收站:

flashback table tablename to before drop;

删除回收站中的数据可以使用以下命令:;

purge table tablename;

清空回收站:

purge dba_recyclebin;

闪回查询:

select * from tablename as of timestamp to timestamp(to_date('2014-11-12 10:10:10','yyyy-mm-dd hh34:mi:ss')) where ....;

闪回版本查询:

select versions_starttime,version_operation,name,score from tablename versions between timestamp minvalue and maxvalue;

闪回事务查询:

select table_name,undo_sql from flashback_tracsaction_query where rownum<5;


向AI问一下细节

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

AI