Flashing back after oracle11gdroptable

Source: Internet
Author: User

Flashing back after oracle11gdroptable

-- Initialize the data drop table test purge; create table test as select * from dba_objects; delete from test where object_id is null; alter table test add constraint pk_test_object_id primary key (object_id ); create index ind_t_object_name on test (object_name); -- execute the delete operation drop table test; select r. object_name, r. original_name, r. operation, r. type from recyclebin r; OBJECT_NAME ORIGINAL_NAME operation type items ------------------ -------- BIN $ tables = $0 test drop tablebin $ tables = $0 PK_TEST_OBJECT_ID drop indexbin $ tables = $0 IND_T_OBJECT_NAME drop index -- generate a flashback table select 'flashback table' | r. original_name | 'to before drop; 'ccfrom recyclebin rwhere type = 'table'; CC -------------------------------------- flashback table test to before drop; -- the index will be flashed back, but the name will be changed to select 'alter index "'| r. object_name | '"rename to"' | r. original_name | '"; 'cccfrom recyclebin rwhere type = 'index'; CCC reset alter INDEX" BIN $ ffq1sqrmvjguaoklg9c7a = $0 "rename to" IND_T_OBJECT_NAME "; alter index "BIN $ FfQ1SQRnVJjgUAoKlg9C7A = $0" rename to "PK_TEST_OBJECT_ID"; finally run: flashback table TEST to before drop; alter index "BIN $ partition = $0" rename to "IND_T_OBJECT_NAME"; alter index "BIN $ ffq1sq1_vjjguaoklg9c7a = $0" rename to "PK_TEST_OBJECT_ID ";

 

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.