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'

  • 相关阅读:
    chr(9) chr(10) chr(13) chr(32)
    分割字符串
    日期提取函数EXTRACT
    数据泵在本地导出数据到远程数据库中
    CEIL与FLOOR
    GROUPING SETS与GROUP_ID
    LISTAGG
    AVG
    COUNT
    Scala 泛型类型和方法
  • 原文地址:https://www.cnblogs.com/luofuxian/p/2279241.html
Copyright © 2011-2022 走看看