How to retrieve deleted data via bbed

Source: Internet
Author: User

Project case: Customer deleted delete important data, no backup, customer contact me, request to restore the corresponding data. This time through the experimental way to reproduce the customer site. Backup above everything, backup first, then operate

To create a table:

  1. CREATE TABLE King (age number,name varchar2 (20));

  2. Insert INTO King values ("Rick");

  3. Insert into King values (' Wuzy ');

  4. Commit

  5. Select Dbms_rowid.rowid_relative_fno (ROWID) rel_fno,dbms_rowid.rowid_block_number (ROWID) Blockno from King

    4 303

  6. Delete from King where age=30;

  7. Commit

Results:

650) this.width=650; "title=" Qq20160613232321.png "alt=" wkiol1de0tmbqwcqaaajzhw7uwa846.png "src="/HTTP/ S5.51cto.com/wyfs02/m02/82/b4/wkiol1de0tmbqwcqaaajzhw7uwa846.png "/>

bbed Recovery (it is recommended to close the database):

Set File 4,303

FIND/C Wuzy

File:/U01/APP/ORACLE/ORADATA/ORCL/USERS01.DBF (4)
block:303 offsets:8173 to 8191 dba:0x0100012f
------------------------------------------------------------------------
77757a79 2c000202 c1150472 69636b01 064a2f

P KDBR

Bbed> P KDBR
SB2 Kdbr[0] @118 8077
SB2 Kdbr[1] @120 8066

Bbed> P *kdbr[0]
ROWDATA[11]
-----------
Ub1 rowdata[11] @8177 0x2c

Bbed> P *kdbr[1]
ROWDATA[0]
----------
Ub1 Rowdata[0] @8166 0x2c

Bbed> Set DBA 4,303 offset 8173
DBA 0x0100012f (16777519 4,303)
OFFSET 8173

bbed> d/v dba 4,303 offset 8173
File:/U01/APP/ORACLE/ORADATA/ORCL/USERS01.DBF (4)
block:303 offsets:8173 to 8191 dba:0x0100012f
-------------------------------------------------------
77757a79 2c000202 c1150472 69636b01 l wuzy,.... Rick.
06c42f L.

<16 bytes per line>

bbed> d/v Offset 8166
File:/U01/APP/ORACLE/ORADATA/ORCL/USERS01.DBF (4)
block:303 offsets:8166 to 8191 dba:0x0100012f
-------------------------------------------------------
3c020202 c11f0477 757a792c 000202c1 l <....wuzy,...
15047269 636b0106 c42f L.. Rick..

<16 bytes per line>

Bbed> modify/x 2c
File:/U01/APP/ORACLE/ORADATA/ORCL/USERS01.DBF (4)
block:303 offsets:8166 to 8191 dba:0x0100012f
------------------------------------------------------------------------
2c020202 c11f0477 757a792c 000202c1 15047269 636b0106 c42f

<32 bytes per line>

bbed> sum apply
Check value for File 4, Block 303:
Current = 0x6436, required = 0x6436

results:650) this.width=650; "title=" 1.png "alt=" Wkiol1de0zdsc0qlaaam8q4vjvs581.png "src=" http://s2.51cto.com/ Wyfs02/m02/82/b4/wkiol1de0zdsc0qlaaam8q4vjvs581.png "/>

The deletion data has been restored.

Note: 3 C is the data that has been deleted 2 C is not deleted

How to retrieve deleted data via bbed

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.