Oracle Recycle Bin Management

Source: Internet
Author: User

oracle10g,在pl/sql中选中删除后会出现类似:BIN$nJ5JuP9cQmqPaArFei384g==$0的表。 1.查看回收站 select from user_recyclebin; 2.清空回收站 purge recyclebin; 3.清空回收站中的某个表 --如下方式删除会提示:SQL命令未正确结束。 purge  table BIN$/UpBuh+LQ9yZGN95BFsk5Q==$0 --正确写法如下: purge  table "BIN$/UpBuh+LQ9yZGN95BFsk5Q==$0" ; --如下方式删除会提示:SQL命令未正确结束。 drop table BIN$/UpBuh+LQ9yZGN95BFsk5Q==$0 --而如下这样写,则会提示:无法对回收站中的对象执行DDL/DML。 drop table "BIN$0iJ7/rWFQrSGdZexvGv3qQ==$0" 4.恢复回收站 FLASHBACK  TABLE "BIN$0iJ7/rWFQrSGdZexvGv3qQ==$0" TO BEFORE  DROP 这是10g 的新特性 在10g中,如果启用flash  drop 功能,在 drop 表时,数据库不会直接删除,而是将其放在回收站中,当空间出现短缺时,才会逐渐回收这部分空间。 bin$表示表放在了回收站,你想要的话还可以找回来 删除的话一个方法是直接删 delete tanle bin$.....; 另一种方法就是使用 purge  table table_name; drop table 时, 不产生他们,修改你的 drop 语句 写成 : DROP TABLE TABLE_NAME PURGE ; 转载: 以前只知道Windows有个回收站,今天听说Oracle也有个回收站! 在Oracle中可能不小心会 DROP 掉一个表,如果没有定期做备份的话,将会带来很大的麻烦。如果有的情况下,每天的数据都很重要,而定期备份的周期又稍长,情况恐怕也不容乐观! 不过还好Oracle有个回收站,概念就跟Windows里的回收站一模一样。 比如有以下误操作: DROP TABLE drop_test; 这个时候再用 SELECT 语句查询此表时,将会提示表或视图不存在。但可以用如下语句查询到这个表还在Oracle回收站中: SELECT FROM user_recyclebin  WHERE original_name=‘drop_test’; 那么现在就可以用如下语句进行恢复: FLASHBACK  TABLE drop_test  TO BEFORE  DROP 但是,要注意的是,如果用toad工具进行鼠标操作,即右键 drop table 时,如果选择了purge选项,那么就是永久性删除,在oracle的回收站也不会存在了,所以在进行表的删除的时候一般不要选择该选项,除非你很肯定该表不再使用。

Oracle Recycle Bin Management

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.