zoukankan      html  css  js  c++  java
  • ORACLE闪回操作(转载)

    ORACLE闪回操作:
    2010-09-01 07:05

    表的闪回操作:
    SQL>show parameter bin
    SQL>alter system set recyclebin=off;
    SQL>alter system set recyclebin=on;
    SQL>select * from cat; //查看当前用户所有的表
    SQL>show recyclebin
    SQL>purge table 表名;
    SQL>purge recyclebin; //清空回收站
    SQL>drop table 表名;
    SQL>select object_name,ts_name,space from user_recyclebin;
    SQL>flashback table 刚删除的表名 to before drop;
    SQL>drop table 表名 purge; //直接删除表,而不将改变放入会后站
    闪回技术只能保护非系统表空间中的表,而且这些表还必须存放在本地管理
    的表空间中。

    闪回错误的DML操作
    SQL>show parameter undo_retention
    默认值是900秒(15分钟),可根据需要延长时间,例如设置成1个小时。
    SQL>alter system set undo_retention=3600;

    SQL>connect scott/tiger
    SQL>update emp_dump set sal=9999;
    SQL>select versions_xid,empno,ename,sal from emp_dump
    2 versions between scn minvalue and maxvalue
    3 where empno=7900;
    SQL>commit;

    SQL>connect system/manager
    SQL>col OPERATION for a10
    SQL>col UNDO_SQL for a80
    SQL>select operation,undo_sql
    2 from flashback_transaction_query
    3 where xid=hextoraw('查询出来的versions_xid值');

    SQL>select operation,START_SCN
    2 from flashback_transaction_query
    3 where xid=hextoraw('查询出来的versions_xid值');

    SQL>alter table scott.emp_dump enable row movement;
    SQL>flashback table scott.emp_dump to SCN 查询出来的START_SCN值

    SQL>flashback table scott.emp_dump to timestamp
    2 to_timestamp('2010-09-01 17:30:00','YYYY-MM-DD HH24:MI:SS')

    转载自:http://hi.baidu.com/%C9%E1%B5%C30710/blog/item/ba1cf9dedd73e81d485403e2.html

  • 相关阅读:
    随机id
    vue关于父组件调用子组件的方法
    ES6——块级作用域
    在vue中引用superMap
    MSSQL备份脚本
    Ubuntu 使用命令导出数据库
    CSS before 中文乱码
    CentOS7 安装linux 网络不联通问题
    SVN update failed问题解决
    JQ实现树形菜单点击高亮
  • 原文地址:https://www.cnblogs.com/wuhenke/p/1863576.html
Copyright © 2011-2022 走看看