The development of no communication mistakenly delete the customer database data search data path

Source: Internet
Author: User

Very sad, thought in the customer there is a problem with the data deleted on the line, the results tell me that is the customer's normal use of data, I am also a face confused force. It is important and important to warn myself and all of you that developing communication is important. Then began to retrieve the lost data of the long (day) road.

1. First I use the space of Plsql's Oracle visualization interface, I first look at the history of the execution of the statement record Ctrl+e, you can see all the recently executed SQL statements, found not to use the statement to delete, is directly in the database operation, or with the statement operation Good, The whole is still the norm. Another way to find him;

2. Use the Flash-back table feature in Oracle Database 10g.

2.1alter table name enable row movement; Allow move

2.2 Querying the data at the point in time at which the data was deleted (that is, data that was flashed back to that point in time)

SELECT * from Wms_test as of timestamp to_timestamp (' 2016-02-26 12:10:00 ', ' yyyy-mm-dd hh24:mi:ss '); (if not, continue narrowing)

2.3 Recovering deleted and committed data

Flashback table Wms_out_end_product_item to timestamp to_timestamp (' 2016-04-1 14:30:00 ', ' yyyy-mm-dd hh24:mi:ss ');

2.4 ALTER TABLE name disable row movement; Close when you are finished using

After manipulating this method, I did find a step in the data that was deleted around 8 o'clock last night, and in the process of execution, it reported an unusually long snapshot. OMG, found that the time is almost a day, to check the understanding, if Oracle has not set a snapshot save time, up to a day, some not a day, see the specific environment. Use this method to retrieve the data for two days.

3. There's no retreat. Had to find the original system set up a daily automatic Update database location, take out the early morning database automatic backup files. dbm, create a new database, bring the data, and then find the deleted records, say dry, do things, solve problems, you can not solve, do not think more, Feel change strategy to carry out the next problem, so that the efficiency of dealing with the problem is relatively high, people's ideas will be more positive (run off), continue to hold their compressed package to build a database. To export a database script statement:

EXPDP Zjshnew/[email protected] DIRECTORY=DIR_DP dumpfile=zhsh20171213.dmp logfile=zjshnew20171213.log schemas= Zjshnew

3.1 Create the database first, the name of the database and the user name password and the tablespace name are best aligned with the client, so as not to make an error.

3.2 Create a tablespace statement:

Create tablespace zczg Logging   ' D:\app\Administrator\oradata\zczg\zczg.dbf ' -- -Actual instance directory size 50m    on  Next 50m maxsize 20480m  extent management local;  

3.3 Create a database log file statement:

Create Temporary tablespace zczg_temp   ' D:\app\Administrator\oradata\zczg\zczg_temp.dbf ' -- -Actual instance directory size 50m    on  Next 50m maxsize 20480m  

3.4 Create USER statement:

Create User  by ZCZG   default tablespace zczg   temporary tablespace zczg_temp;

3.5 Authorization to User statement:

Grant  to  Grant to Zczg;

3.6 Make a script. bat, database import file:

IMPDP Zhgh/[email protected] DIRECTORY=DIR_DP dumpfile=zhgh_db_20170913.dmp remap_schema=zhgh:zhgh transform=segment _attributes:n Logfile=zhgh.log

The development of no communication mistakenly delete the customer database data search data path

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.