[中文]
Author:
fuyuncat
Source:
www.HelloDBA.com
Date:
2016-04-24 06:28:01
What if your oracle crashed and can not be recovered? FyDul (AKA FySafe) is the last chance for you to save your data. It's is small program to read the data from data files directly.
I wrote this program in 2006, and now I improved it to make it easier be used. In most scenarios, you just need to issue below 3 commands.
s df <data files>
pp
dt <data file id>
Note: This tool is NOT for business purpose, I wrote it just for fun :P
Example:
SQL代码
- oracle@syddbd1::> java -jar FYDul.jar
- FYDul: Release v1.0.1
- Copyright (c) 2006, 2013, Fuyuncat, www.HelloDBA.com. All rights reserved.
- Trail Version, limited to recover 1000 rows only.
- FYDul CMD>s df /u01/app/oracle/oradata/dbat1/system01.dbf /u01/app/oracle/oradata/dbat1/example01.dbf
- ok7!
- FYDul CMD>pp
- ... ...
- ....*
- ....*
- .*
- .*
- .*
- .*
- INFO: End analyze file /u01/app/oracle/oradata/dbat1/example01.dbf at: 2014-04-24 01:37:00: 1919 tables detected!
- .................................................................................................*(Rows:92989)
- Got atrributes!
- FYDul CMD>ls
- File 1 is located at:/u01/app/oracle/oradata/dbat1/system01.dbf
- File 5 is located at:/u01/app/oracle/oradata/dbat1/example01.dbf
- FYDul CMD>df 5
- ... ...
- Dul table SH.DIMENSION_EXCEPTIONS
- ........*(Rows:0)
- Dul table SH.CAL_MONTH_SALES_MV
- ........*(Rows:48)
- Dul table SH.FWEEK_PSCAT_SALES_MV
- ........................................................................*(Rows:11266)
- Dul table T_76064.0
- ........*(Rows:0)
- Dul table T_76065.0
- ........*(Rows:0)
- Dul table T_76066.0
- ........*(Rows:0)
- Dul table T_76067.0
- ........*(Rows:0)
- FYDul CMD>show
- INFO: There are 5525 tables with data found in 2 files; The output folder is /tmp/dul/output/; Output file format is sql; Log file is located at /tmp/dul20140424_161544.log.
- ok26!
- FYDul CMD>exit
- Good bye!
- oracle@syddbd1::> ls /tmp/dul/output/SH/
- create_tb_CAL_MONTH_SALES_MV.sql create_tb_PROMOTIONS.sql insert_DR$SUP_TEXT_IDX$R.sql
- create_tb_CHANNELS.sql create_tb_SUPPLEMENTARY_DEMOGRAPHICS.sql insert_FWEEK_PSCAT_SALES_MV.sql
- create_tb_COUNTRIES.sql create_tb_TIMES.sql insert_PRODUCTS.sql
- create_tb_CUSTOMERS.sql insert_CAL_MONTH_SALES_MV.sql insert_PROMOTIONS.sql
- create_tb_DIMENSION_EXCEPTIONS.sql insert_CHANNELS.sql insert_SUPPLEMENTARY_DEMOGRAPHICS.sql
- create_tb_DR$SUP_TEXT_IDX$I.sql insert_COUNTRIES.sql insert_TIMES.sql
- create_tb_DR$SUP_TEXT_IDX$R.sql insert_CUSTOMERS.sql lob
- create_tb_FWEEK_PSCAT_SALES_MV.sql insert_DIMENSION_EXCEPTIONS.sql
- create_tb_PRODUCTS.sql insert_DR$SUP_TEXT_IDX$I.sql
- oracle@syddbd1::> tail -3 /tmp/dul/output/SH/insert_CUSTOMERS.sql
- insert into "CUSTOMERS"(CUST_ID, CUST_FIRST_NAME, CUST_LAST_NAME, CUST_GENDER, CUST_YEAR_OF_BIRTH, CUST_MARITAL_STATUS, CUST_STREET_ADDRESS, CUST_POSTAL_CODE, CUST_CITY, CUST_CITY_ID, CUST_STATE_PROVINCE, CUST_STATE_PROVINCE_ID, COUNTRY_ID, CUST_MAIN_PHONE_NUMBER, CUST_INCOME_LEVEL, CUST_CREDIT_LIMIT, CUST_EMAIL, CUST_TOTAL, CUST_TOTAL_ID, CUST_SRC_ID, CUST_EFF_FROM, CUST_EFF_TO, CUST_VALID) values(100680,'Joshua','Prabu','M',1954,'Mabsent','67 North Evans Avenue','59918','Cleveland',051330,'WI',052760,052790,'379-481-4535','L: 300,000 and above',011000,'Prabu@company.com','Customer total',052772,NULL,to_date('1998-1-1 0:0:0', 'yyyy-mm-dd hh24:mi:ss'),NULL,'A');
- insert into "CUSTOMERS"(CUST_ID, CUST_FIRST_NAME, CUST_LAST_NAME, CUST_GENDER, CUST_YEAR_OF_BIRTH, CUST_MARITAL_STATUS, CUST_STREET_ADDRESS, CUST_POSTAL_CODE, CUST_CITY, CUST_CITY_ID, CUST_STATE_PROVINCE, CUST_STATE_PROVINCE_ID, COUNTRY_ID, CUST_MAIN_PHONE_NUMBER, CUST_INCOME_LEVEL, CUST_CREDIT_LIMIT, CUST_EMAIL, CUST_TOTAL, CUST_TOTAL_ID, CUST_SRC_ID, CUST_EFF_FROM, CUST_EFF_TO, CUST_VALID) values(100055,'Andrew','Clark','F',1978,'Married','77 Cumberland Avenue','74673','Duncan',051402,'SC',052722,052790,'260-755-4130','J: 190,000 - 249,999',011000,'Clark@company.com','Customer total',052772,NULL,to_date('1998-1-1 0:0:0', 'yyyy-mm-dd hh24:mi:ss'),NULL,'A');
- commit;
--- Fuyuncat ---