Oracle12C:drop table后,恢复表数据
发布时间:2020-12-12 15:15:11 所属栏目:百科 来源:网络整理
导读:前段时间,有个好友作死,不小心 删了自己的数据库,然后他找数据恢复的, 别人报价:由于有点技术难度,这样吧!一张表:7500块,好不? 我朋友:......你怎么不去抢?! 我:...... 哎,为了防止自己哪天手贱 删了数据库,所以匆忙学了表 恢复的方法。 一
前段时间,有个好友作死,不小心 删了自己的数据库,然后他找数据恢复的, 别人报价:由于有点技术难度,这样吧!一张表:7500块,好不? 我朋友:......你怎么不去抢?! 我:...... 哎,为了防止自己哪天手贱 删了数据库,所以匆忙学了表 恢复的方法。
一般oracle 删了数据库后,还是有闪回的,但是他的数据库是 mongodb
一、先创建表 -- 建表
create table student_score(
name varchar2(8),class varchar2(10),--班级
subject varchar2(8),--学科
grade int --分数
);
插入一点数据:
-- 插入数据
insert into student_score values
('小明','121','语文',88);
insert into student_score values
('小明','数学',75);
insert into student_score values
('小明','英语',40);
insert into student_score values
('小红',95);
insert into student_score values
('小红',55);
insert into student_score values
('小红',60);
insert into student_score values
('小白','122',70);
insert into student_score values
('小白',79);
insert into student_score values
('小白',66);
insert into student_score values
('小黑',69);
insert into student_score values
('小黑',99);
insert into student_score values
('小黑',77);
select * from student_score
二、删表 drop table student_score;
三、查看数据库表创建信息: --1、查询表创建时间
select object_name,created
from all_objects
where object_type = 'table'
and object_name ='student_score'
order by created desc;
四、查看回收站中表 select object_name,original_name,partition_name,type,ts_name,createtime,droptime from recyclebin;
recycle bin : 回收站
我的表:student_score 还在 回收站,晚了就不行了
五、恢复表 找到你bin开头的序号 SQL>flashback table test_drop to before drop; 或
SQL>flashback table "BIN$zGmbX+sxT2S3YtdqJWNa5g==$0" to before drop;
这样就OK了!
六、恢复索引 (呃,我这里没有索引呢) 索引名字:index_name select INDEX_NAME from user_indexs where table_name='STUDENT_SCORE'
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |