Use PRM to restore table data truncated by truncate in the Oracle database
Recovery scenario 1 conventional recovery of the Truncate table by mistake
Company D's business maintenance personnel mistakenly TRUNCATE all the data on a table because they mistakenly treated the product database as a test environment database. DBA tried to recover but found that the recent backup was unavailable, as a result, records in the data table cannot be recovered from the backup. At this time, the DBA decided to use PRM to restore data that has been TRUNCATE.
Because all database files in this environment are available and healthy, you only need to load the data files in the SYSTEM tablespace and the data files in the TRUNCATED table in dictionary mode. For example:
Create table ParnassusData. torderdetail_his1 tablespace users
Select * from parnassusdata. torderdetail_his;
SQL> desc ParnassusData. TORDERDETAIL_HIS
Name Null? Type
---------------------------------------------
SEQ_ID not null number (10)
SI_STATUS NUMBER (38)
D_CREATEDATE CHAR (20)
D_UPDATEDATE CHAR (20)
B _ISDELETE CHAR (1)
N_SHOPID NUMBER (10)
N_ORDERID NUMBER (10)
C_ORDERCODE CHAR (20)
N_MEMBERID NUMBER (10)
N_SKUID NUMBER (10)
C_PROMOTION NVARCHAR2 (5)
N_AMOUNT NUMBER (7,2)
N_UNITPRICE NUMBER (7,2)
N_unitsellinuplice NUMBER (7, 2)
N_QTY NUMBER (7,2)
N_QTYFREE NUMBER (7,2)
N_POINTSGET NUMBER (7,2)
N_OPERATOR NUMBER (10)
C_TIMESTAMP VARCHAR2 (20)
H_SEQID NUMBER (10)
N_RETQTY NUMBER (7, 2)
N_QTYPOS NUMBER (7, 2)
Select count (*) from ParnassusData. TORDERDETAIL_HIS;
COUNT (*)
----------
984359
Select bytes/1024/1024 from dba_segments where segment_name = 'torderdetail _ HIS 'and owner = 'parnassusdata ';
BYTES/1024/1024
---------------
189.71875
SQL> truncate table ParnassusData. TORDERDETAIL_HIS;
Table truncated.
SQL> select count (*) from ParnassusData. TORDERDETAIL_HIS;
COUNT (*)
----------
0
Installing Oracle 12C in Linux-6-64
Install Oracle 11gR2 (x64) in CentOS 6.4)
Steps for installing Oracle 11gR2 in vmwarevm
Install Oracle 11g XE R2 In Debian
Start PRM and select Tools => Recovery Wizard
Click Next
In this TRUNCATE scenario, ASM storage is not used, so you only need to select the Dictionary Mode:
In the next step, we need to select several parameters, including the Endian byte order and db name.
Since ORACLE data files use different Endian bytecode formats on different operating system platforms, the list of bytecode and platform correspondence is as follows:
Solaris [tm] OE (32-bit)
Big
Solaris [tm] OE (64-bit)
Big
Microsoft Windows IA (32-bit)
Little
Linux IA (32-bit)
Little
AIX-Based Systems (64-bit)
Big
HP-UX (64-bits)
Big
HP Tru64 UNIX
Little
HP-UX IA (64-bit)
Big
Linux IA (64-bit)
Little
HP Open VMS
Little
Microsoft Windows IA (64-bit)
Little
IBM zSeries Based Linux
Big
Linux x86 64-bit
Little
Apple Mac OS
Big
Microsoft Windows x86 64-bit
Little
Solaris Operating System (x86)
Little
IBM Power Based Linux
Big
Hp ia Open VMS
Little
Solaris Operating System (x86-64)
Little
Apple Mac OS (x86-64)
Little
For more details, please continue to read the highlights on the next page: