Oracle recycle bin Management

Source: Internet
Author: User

Oracle recycle BIN manages oracle10g. After you select and delete from pl/SQL, a table similar to BIN $ nJ5JuP9cQmqPaArFei384g ==$ 0 is displayed. 1. view the recycle bin select * from user_recyclebin; 2. Clear the recycle bin purge recyclebin; 3. Clear a table in the recycle bin. If you delete the table in the following way, the following message is displayed: the SQL command has not ended correctly. Purge table BIN $/UpBuh + LQ9yZGN95BFsk5Q = $0 -- the correct syntax is as follows: purge table "BIN $/UpBuh + LQ9yZGN95BFsk5Q = $0"; -- the following message is displayed when deleting: the SQL command is not completed correctly. Drop table BIN $/UpBuh + LQ9yZGN95BFsk5Q = $0 -- if you write as follows, the system will prompt that DDL/DML cannot be executed on objects in the recycle BIN. Drop table "BIN $0iJ7/rWFQrSGdZexvGv3qQ = $0" 4. restore the recycle bin flashback table "BIN $0iJ7/rWFQrSGdZexvGv3qQ = $0" to before drop. This is a new 10g feature. If the flash drop function is enabled, when you drop a TABLE, instead of deleting the database directly, the database is placed in the recycle bin. When the space is insufficient, the database will gradually recycle the space. Bin $ indicates that the table is placed in the recycle bin. If you want to delete the table, you can directly delete the tanle bin $ .....; another method is to use purge table table_name; when drop table, do not generate them. Modify your drop statement to write as: drop table TABLE_NAME PURGE; reprinted: Previously only know that Windows has a recycle bin, today I heard that Oracle also has a recycle bin! In Oracle, a table may be accidentally dropped. If regular backup is not performed, it will cause a lot of trouble. In some cases, daily data is very important, and the regular backup cycle is a little longer. I am afraid the situation is not optimistic! But fortunately, Oracle has a recycle bin, which is exactly the same as the recycle bin in Windows. For example, the following error occurs: drop table drop_test; when you use the SELECT statement to query this TABLE, the system will prompt that the TABLE or view does not exist. However, you can use the following statement to query the table in the Oracle recycle bin: SELECT * FROM user_recyclebin WHERE original_name = 'drop _ test'; now you can use the following statement to restore the table: flashback table drop_test TO BEFORE DROP, the recycle bin does not exist in oracle, so do not select this option when deleting a table, unless you are sure that the table is no longer used.

Related Article

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.