首页 电脑 电脑学堂 查看内容

oracle数据恢复

2013-10-29 10:35 763 0

摘要: oracle数据恢复 oracle 数据恢复 drop del1、delete后恢复最好是立即进行恢复   insert into mytest   ...
关键词: nbsp select recyclebin scn mytest timestamp random table 数据恢复 回收站

oracle数据恢复 oracle 数据恢复 drop del1、delete后恢复最好是立即进行恢复   insert into mytest    ( select *      from mytest as of timestamp to_timestamp('2013-07-11 15:18:04','yyyy-mm-dd hh24:mi:ss'))2 drop table 恢复a 先确保  show parameter recyclebin 状态是 on b select * from recyclebin / show recyclebin   select * from recyclebin  where original_name='MYTEST'; c、如果有对应的表,则进行恢复  flashback table mytest to before drop  ok,搞定 其他sql语句总结 清空回收站  purge recyclebin; 清空所有用户的回收站  purge dba_recyclebin;  批量生成数据 create table mytest as select rownum as id, to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') as inc_time, trunc(dbms_random.value(0,1000)) as random_id, dbms_random.string('x',20) as random_string from dual connect by level<=1000;  查询可用空间 SELECT text,view_name FROM dba_views WHERE view_name='DBA_FREE_SPACE'; select text,view_name from dba_views  查询当前的scn select dbms_flashback.get_system_change_number from dual;   -- 548966 查询符合条件的scn,并且保持到临时表 create table scn_temp(count int,scn int); declarei int :=548000;beginfor i in 548000 .. 548966 loopinsert into scn_temp(scn)values(i);update scn_temp  set count=( select count(*) from ccc as of scn i) where scn=i;end loop;end;  //推荐使用这种方式select * from ccc as of timestamp to_timestamp('2013-07-12 00:09:22','yyyy-mm-dd hh24:mi:ss');    删除索引 drop index "index_bbb";//不能少了引号
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部