Accidental deletion and data recovery of Oracle learning notes

Source: Internet
Author: User

Note: When I changed the bug, I accidentally deleted a piece of data from the generated database, so I was shocked and found it again.

You can use the following methods to delete a file:

Use the followingCommand to view the current database ParametersUndo_retention.

 
Show parameter undo;

Shown as follows:

 
Undo_managementStringAuto
Undo_retention integer
900
Undo_tablespaceStringUndotbs1

Undo_retention (Persistence),The Unit is 900 seconds. 15Minutes.

Modify the defaultUndo_retentionParameter settings:

 
AlterSystemSetUndo_retention=10800Scope=Both;

1.If the data is deleted

For example:

Select * FromOrder_listAs Of TimestampTo_timestamp ('2013-05-29 09:33:00','Yyyy-mm-dd hh24: MI: SS')WherePop='20130319016';

Then the flashback data is inserted into the table again:

Insert IntoOrder_list (Select * FromOrder_listAs Of TimestampTo_timestamp ('2013-05-29 09:33:00','Yyyy-mm-dd hh24: MI: SS')WherePop='20130319016');

 You can also create a temporary table to restore all data to the temporary table.

The above time point is the time before accidental deletion, preferably very close to the time

2. If the table is deleted

Restore the deleted base table

 
FlashbackTableTable NameToBeforeDrop;

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.