Oracle cannot delete table

Source: Internet
Author: User

Oracle10g. A table similar to BIN $ nJ5JuP9cQmqPaArFei384g ==$ 0 will appear after you select and delete it in pl/SQL.

1. view the recycle bin

Select * from user_recyclebin;

2. Clear the recycle bin

Purge recyclebin;

3. Clear a table in the recycle bin

-- The following message is displayed when you delete the SQL command.

Purge table BIN $/UpBuh + LQ9yZGN95BFsk5Q = $0

-- The correct syntax is as follows:

Purge table "BIN $/UpBuh + LQ9yZGN95BFsk5Q = $0 ";

-- The following message is displayed when you delete the SQL command.

Drop table BIN $/UpBuh + LQ9yZGN95BFsk5Q = $0

-- If you write the statement as follows, a prompt is displayed: you cannot execute DDL/DML 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
In 10 Gb, if the flash drop function is enabled, the database will not directly Delete the table during drop, but will put it in the recycle bin. When the space is insufficient, will gradually recycle this part of the space.
Bin $ indicates that the table is placed in the recycle bin. You can retrieve the table if you want it.
To delete a table, you can directly delete the tanle bin $ .....;
Another method is to use purge table table_name;

Modify your drop statement without generating them when you drop the table.
Written:

Drop table TABLE_NAME PURGE;

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 that the table is still in the Oracle recycle bin:

SELECT * FROM user_recyclebin WHERE original_name = 'drop _ test ';

Now, you can use the following statement to restore data:

Flashback table drop_test TO BEFORE DROP

However, it should be noted that if you use the toad tool for mouse operations, that is, when you right-click the drop table, if you select the purge option, it is permanently deleted, 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.

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.