Oracle recycle bin solves accidental table Deletion

Source: Internet
Author: User

Use it accidentallyDrop table
Statement to delete the table, data is not backed up. It means that data will still be lost when the data is backed up and restored, so you don't have to worry too much at this time. MaybeOracleRecycle Bin (Recyclebin) To solve the problem.

[Environment ]:Oracle 10g r1
,Oracle 10g r2,Oracle 11g r1,Oracle 11g r2

1,
Check whether the recycle bin function is enabled for the database.--Enabled by default

Select value from V $ parameter where name = 'recyclebin'; the result is on.

2,
Check whether the deleted table is in the recycle bin.

Under the current user

Select * From user_recyclebin where original_name = upper ('table _ name ');

Shows the query result.

Note: If you see multiple identical tables, referObject_nameAndDroptime. Select the table to be restored based on the time.

3,
If I want to restore2013-01-08 11:36:41Time Table

Flashback table "bin $ 0r + nc4afudbgqkjaznwsja ==$ 0" to before drop;

4,
Check whether the data in the table is what you want.Drop.

OracleThe recycle bin is similarWindowsNote the following: 

1,
IfDrop tableTable_namePurge;
EquivalentWindowsOfShift + Delete, There is no data in the recycle bin.

2,
It takes too long. If you want to use the recycle bin for restoration1The table deleted a week ago cannot be recovered. The recycle bin will also be full, depending on the user's space. If the user wants to insert data, the space is insufficient. FirstOracleThe recycle bin is automatically cleared. In addition, if you delete a large table (for example:1gThe deleted table is not stored in the recycle bin.

3,
Deleting the following objects will not be placed in the recycle bin

Drop a user

Drop a cluster

Drop a type

Drop a tablespace

Delete from table; commit;

Truncate table xxx;

Reference:Oracle DatabaseAdministrator's Guide 11GRelease 2 (11.2)

E17120-07

 

 

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.