zoukankan      html  css  js  c++  java
  • Oracle误删恢复

    query deleted datarows:
    	select * from 表名 as of timestamp to_timestamp('删除时间点','yyyy-mm-dd hh24:mi:ss')
    	
    //Needs Auth [flash any table]
    	data table flashback:
       alter table 表名 enable row movement;
       //then
       flashback table 表名 to timestamp to_timestamp(删除时间点','yyyy-mm-dd hh24:mi:ss');
       
    database flashback:
    	alter database flashback on
    	flashback database to scn SCNNO;
    	flashback database to timestamp to_timestamp('2007-2-12 12:00:00','yyyy-mm-dd hh24:mi:ss');
    	
    query droped tables;
    	select table_name,dropped from user_tables
    	select object_name,original_name,type,droptime from user_recyclebin   
    	
    restore droped table:
    	flashback table 原表名 to before drop
    	flashback table "回收站中的表名(如:Bin$DSbdfd4rdfdfdfegdfsf==$0)" to before drop rename to 新表名
    
    不使用安全机制,delete/drop时直接释放空间,purge(净化)
    	drop table 表名 purge
         
    删除表
    	drop table emp cascade constraints
    	purge table emp;
    删除当前用户的回收站:
        purge recyclebin;
    删除所有用户在回收站:
    	purge dba_recyclebin
    


  • 相关阅读:
    灭霸-个人冲刺第四天
    单词统计
    第十周总结
    灭霸-个人冲刺第三天
    07-代码大全阅读笔记之一
    灭霸-个人冲刺第二天
    灭霸-个人冲刺第一天
    06-梦断代码阅读笔记之三
    团队项目-用户场景分析
    第九周总结
  • 原文地址:https://www.cnblogs.com/riskyer/p/3217668.html
Copyright © 2011-2022 走看看