日期:2014-05-16  浏览次数:20289 次

oracle表恢复
如果不小心在plsql中将oracle中的某个重要表 drop 掉了,又没有备份
drop table LSETLIST
不用担心,drop 后的table 只是放在回收站里面,从一个view视图 user_recyclebin
中可以查出
SELECT * FROM user_recyclebin a WHERE a.original_name='LSETLIST'
然后有下面语句回复
FLASHBACK TABLE LSETLIST TO BEFORE DROP

user_recyclebin 的相关信息如下:

create or replace view sys.user_recyclebin
(object_name, original_name, operation, type, ts_name, createtime, droptime, dropscn, partition_name, can_undrop, can_purge, related, base_object, purge_object, space)
as
select o.name, r.original_name,
       decode(r.operation, 0, 'DROP', 1, 'TRUNCATE', 'UNDEFINED'),
       decode(r.type#, 1, 'TABLE', 2, 'INDEX', 3, 'INDEX',
                       4, 'NESTED TABLE', 5, 'LOB', 6, 'LOB INDEX',
                       7, 'DOMAIN INDEX', 8, 'IOT TOP INDEX',
                       9, 'IOT OVERFLOW SEGMENT', 10, 'IOT MAPPING TABLE',
                       11, 'TRIGGER', 12, 'CONSTRAINT', 13, 'Table Partition',
                       14, 'Table Composite Partition', 15, 'Index Partition',
                       16, 'Index Composite Partition', 17, 'LOB Partition',
                       18, 'LOB Composite Partition',
                       'UNDEFINED'),
       t.name,
       to_char(o.ctime, 'YYYY-MM-DD:HH24:MI:SS'),
       to_char(r.droptime, 'YYYY-MM-DD:HH24:MI:SS'),
       r.dropscn, r.partition_name,
       decode(bitand(r.flags, 4), 0, 'NO', 4, 'YES', 'NO'),
       decode(bitand(r.flags, 2), 0, 'NO', 2, 'YES', 'NO'),
       r.related, r.bo, r.purgeobj, r.space
from sys.obj$ o, sys.recyclebin$ r, sys.ts$ t
where r.owner# = userenv('SCHEMAID')
  and o.obj# = r.obj#
  and r.ts# = t.ts#(+);
希望对各位有所帮助