Flashback drop table Technology in Oracle

Source: Internet
Author: User

Flashback is not completely restored. drop table: The table name of the deleted table does not seem to have been changed, and it is not actually dropped (the recycle bin of windows) --> flash dropped table Technology
SQL> show recyclebin
ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME
-----------------------------------------------------------------------------
EDU234 BIN $ kW6q/O9z4TDgQKjAFAEkeg = $0 TABLE 2010-09-30: 07: 53: 27

SQL> purge recyclebin;

Recyclebin purged.
SQL> show recyclebin
No, so we can delete the table. If purge is not added, we can use the Flashback Technology to restore the table.
SQL> create table tsql01 (a number );

Table created.

SQL> insert into tsql01 values (1); // create a table, insert a value, and submit

1 row created.

SQL> commit;

Commit complete.

SQL> show recyclebin // check whether there are items in the recycle bin. If yes, purge recyclebin
SQL> drop table tsql01; // There is no purge table tsql01 purge

Table dropped.

SQL> show recyclebin // it will appear in recyclebin. The table that was deleted just now has a messy name.
ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME
-----------------------------------------------------------------------------
TSQL01 BIN $ lIkhIeT93AfgQKjAWgAetg = $0 TABLE 2010-11-08: 18: 31: 39
SQL> select * from "BIN $ lIkhIeT93AfgQKjAWgAetg = $0"; // we can find the value

A
----------
1

SQL> select * from tsql01; // the original table name cannot be found because it has been deleted.
Select * from tsql01
*
ERROR at line 1:
ORA-00942: table or view does not exist

SQL> flashback table tsql01 to before drop; // you do not need to enable the flashback function when deleting a table.

Flashback complete.
SQL> conn/as sysdba
Connected.
SQL> select flashback_on from v $ database; // The Flash back function is disabled.

FLASHBACK_ON
------------------
NO

SQL>

SQL> select * from tsql01; // The table has been restored.

A
----------
1
So if we are sure we don't want the table, and we want to prevent others from seeing it, add purge.
SQL> create table tsql02 (a number );

Table created.

SQL> insert into tsql02 values (2 );

1 row created.

SQL> commit;

Commit complete.

SQL> drop table tsql02 purge; // The purge is added when the table is deleted.

Table dropped.

SQL> show recyclebin // does not enter recyclebin. recycle is on by default.
SQL>
#########################

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.