zoukankan      html  css  js  c++  java
  • 【转】oracle回闪操作

    在9i上执行的操作

    查询test表中记录
    select * from test;
    删除test表中记录
    delete from test;
    获得过去的会话
    exec dbms_flashback.disable;
    查询出3分钟前这个test表的情况
    select * from test as of timestamp(systimestamp - interval '3' minute );
    将查出的记录插入到误删除数据的表中
    insert into test select * from test as of timestamp(systimestamp - interval '30' minute );


    两种方法:
    1、使用dbms_flshback
    闪回:DBMS_FLASHBACK.enable_at_time(to_timestamp('2006-5-24 8:26:0', 'yyyy-mm-dd hh24:mi:ss'))
    _changexec dbms_flashback.enable_at_systeme_number(4143031890000);--change number
    取消闪回:exec dbms_flashback.disable
    2、语句级
    select * from dept as of scn 4143031890000);--change number
    select * from dept as of timestamp(to_timestamp('2006-5-24 8:26:0', 'yyyy-mm-dd hh24:mi:ss'));

    在10G上执行的操作
    例:执行将test表闪回到2005年5月7日下午3点。
    SQL>flashback table test to timestamp to_timestamp('2005-05-07 15:00:00','yyyy-mm-dd hh24:mi:ss');


    修改数据库中某些字段存在的空格
    update laagent set name=replace(name,' ','') where agentcode='116000001'

  • 相关阅读:
    MYSQL常用命令集合(转载)
    Spring(七)持久层
    Spring(六)AOP切入方式
    面试题目
    11 集合
    10 常用类
    9 异常机制
    8 面向对象之抽象类+接口+内部类
    7 面向对象的三大特征
    6 面向对象之类和对象
  • 原文地址:https://www.cnblogs.com/telwanggs/p/5848322.html
Copyright © 2011-2022 走看看