DUL Oracle Data Unloader工具下载

Oracle DUL 是Oracle公司内部的数据库恢复工具,由在荷兰的Oracle Support,Bernard van Duijnen开发:

  • DUL不是Oracle的一个产品
  • DUL不是一个受Oracle支持的产品
  • DUL被严格限制为Oracle Support售后支持部门内部使用
  • DUL的使用在国外需要经过Oracle公司的内部审批,首先你必须购买了Oracle的标准服务PS才可能用到DUL,否则甚至没有资格使用DUL
  • DUL被严格控制的一个原因是其采用了部分Oracle源代码,所以必须被严格控制

 

大约从DUL 9开始,Bernard van Duijnen为了限制外界使用DUL,所以给DUL加上了软件时间锁,即他会定期编译不同平台上的DUL(DUL基于C语言编写)并定期上传到ORACLE 内部的DUL workspace(基于stbeehive的空间),Oracle Support可以使用内部VPN登陆后下载。就是说 好比bernard.van.duijnen 在10月1日发布了一个版本,日期锁是30天,那么这个版本到11月1日基本就失效了, DUL不是简单的读OS时间,所以改OS时间是没用的。 因为Oracle的datafile里也记录了一个当前时间,所以DUL读的是datafile里的时间。 一般用户不可能为了用DUL去改那个时间。

注意由于bernard.van.duijnen同学不提供HP-UX平台上的DUL,所以DUL没有HP-UX的对应版本。

同时早期的Oracle DUL版本用在现在的版本10g、11g、12c的数据库基本是用不了了,因为太老了。  在美国使用DUL是被严格控制的,在中国国内的话 基本就是Oracle ACS 高级客户服务部门对外在用,购买ORACLE ACS现场服务的价格还是很贵的。

附件为一个Oracle ACS提供DUL 服务的介绍文档(当然原厂现场服务是比较昂贵的,且前提是用户已经每年购买了PS标准服务,否则甚至无法购买ACS高级服务的现场服务):

https://www.askmac.cn/wp-content/uploads/2014/01/DUL.pdf

 

 

DUL 10的英文版使用手册:

DUL User’s and Configuration Guide V10.2.4.27

https://www.askmac.cn/wp-content/uploads/2014/01/DUL-Users-and-Configuration-Guide-V10.2.4.27.pdf

 

以下是DUL 10的下载链接,但是因为加锁了,所以会定期失效。

DUL FOR LINUX平台

DUL FOR Windows平台

 

诗檀软件(Maclean 所在的公司)开发了DUL的同类产品 ,PRM-DUL。 在DUL的基础上引入了图形化界面GUI和DataBridge(数据无需落地成为SQLLDR文件,直接像DBLINK一样传输到目标数据库)等功能;同时由于PRM-DUL是基于JAVA编写的,所以可以跨所有平台,包括HP-UX。

PRM-DUL的免费版本下载:

http://parnassusdata.com/sites/default/files/ParnassusData_PRMForOracle_3206.zip

PRM-DUL的使用手册 http://www.parnassusdata.com/sites/default/files/ParnassusData%20Recovery%20Manager%20For%20Oracle%20Database%E7%94%A8%E6%88%B7%E6%89%8B%E5%86%8C%20v0.3.pdf

 

PRM-DUL的免费版本默认每张表只能抽取一万行数据,如果你的数据库很小以至于没有超过一万行数据的表,那么可以直接使用免费的PRM-DUL。 如果你的数据库较大且数据十分重要,那么可以考虑购买企业版的PRM-DUL,企业版PRM-DUL 针对一套数据库提供一个License软件使用许可证,一个License的价格是7500元人民币(含17%增值税)。

同时PRM-DUL还提供部分免费的License:

免费开放几个PRM-DUL 企业版License Key

 

如果你的Oracle数据库恢复case在使用DUL后仍搞不定,那么可以考虑通过服务恢复:

诗檀软件目前提供几乎所有场景的Oracle恢复情况,包括:数据库无法打开,表被误DROP、TRUNCATE、DELETE等,ASM Diskgroup无法MOUNT等。

 

如果自己搞不定可以找诗檀软件专业ORACLE数据库修复团队成员帮您恢复!

诗檀软件专业数据库修复团队

服务热线 : 13764045638   QQ号:47079569    邮箱:service@parnassusdata.com

 

 

 

Current recovery options 
restore and rollforward
export/import
use SQL*Loader to re-load the data
(parallel) create table as select (PCTS)
Transportable Tablespace


Diagnostic tools
orapatch
BBED (block browser/editor) 
Undocumented parameters
_corrupted_rollback_segments, _allow_resetlogs_corruption  etc... 


No alternatives in the case of loss of SYSTEM tablespace datafile(s) 
The database must be in ‘reasonably’ good condition or else recovery is not possible (even with the undocumented parameters!) 
Patching is very ‘cumbersome’ and is not always guaranteed to work
Certain corruptions are beyond patching
Bottom line - loss of data!!


The most common problem is the fact that customer’s backup strategy does not match their business needs. 
Eg.  Customer takes weekly backups of the database, but in the event of a restore their business need is to be up and running within (say) 10 hours.   This is not feasible since the ‘rollforward’ of one week’s worth of archive logs would (probably) take more than 10 hours!!


Building a cloned database exporting data, and importing into the recovery database.
Building a cloned database and using Transportable Tablespaces for recovery. 


DUL could be a possible solution
DUL (?) - Bernard says ‘Life is DUL without it!’
bottom line - salvage as much data as possible



DUL is intended to retrieve data that cannot be retrieved otherwise
It is NOT an alternative for restore/rollforward, EXP, SQL*Plus etc. 
It is meant to be a last resort, not for normal production usage
Note: There are logical consistency issues with the data retrieved


DUL should not be used where data can be salvaged using one of the supported mechanisms (restore/rollforward, exp/imp etc…)


Doesn’t need the database or the instance to be open
Does not use recovery, archive logs etc…
It doesn’t care about data consistency
more tolerant to data corruptions
Does not require the SYTEM tablespace to recover


DUL is a utility that can unload data from “badly damaged” databases. 
DUL will scan a database file, recognize table header blocks, access extent information, and read all rows 
Creates a SQL*Loader or Export formatted output
matching SQL*Loader control file is also generated




DUL version 3 (still in testing!) supports IMP loadable dump file.  More on DUL version 3 later...



Read the Oracle data dictionary if the SYSTEM tablespace files are available 
Analyze all rows to determine 
number of columns, column datatypes and column lengths


If the SYSTEM tablespace datafiles are not available DUL does its own analysis, more on this later...



DUL can handle all row types
normal rows, migrated rows, chained rows, multiple extents, clustered tables, etc. 
The utility runs completely unattended, minimal manual intervention is needed.
Cross platform unloading is supported



DUL can open other datafile(s) if there are extents in that datafile(s).
Although DUL can handle it, LONG RAW presents a problem for SQL*Loader - we’ll talk about this shortly...

For cross platform unloading the configuration parameters within "init.dul" will have to be modified to match those of the original platform and O/S rather than the platform from which the unload is being done.
DUL unloads in the physical order of the columns. The cluster key columns are always unloaded first.


Recovers data directly from Oracle data files 
the Database (RDBMS) is bypassed 
Does dirty reads, it assumes that every transaction is committed
Does not check if media recovery has been done
DATABASE CORRUPT - BLOCKS OK 
Support for Locally Managed Tablespaces


DUL does not require that media recovery be done.
Since DUL reads the data directly from datafiles,  it  reads data that is committed as well as uncommitted.  Therefore the data that is salvaged by DUL can potentially be logically corrupt.  It is upto the DBA and/or the Application programmers to validate the data.


The database can be copied from a different operating system than the DUL-host 
Supports all database constructs: 
row chaining, row migration, hash/index clusters, longs, raws, rowids, dates, numbers, multiple free list groups, segment high water mark, NULLS, trailing NULL columns etc...
DUL should work with all versions 6 , 7, 8 and 9
Enhanced to support 9i functionality. 


DUL has been tested with versions from 6.0.36 up to 7.2.2. The old block header layout (pre 6.0.27.2) also works! 


The main new features are: 
  Support for Oracle version 6, 7, 8 and 9 
  Support for Automatic Space Managed Segments 
  New bootstrap procedure: just use ‘bootstrap;’.   No more 
       dictv6,7 or 8.ddl files 
  LOB are supported in SQL*Loader mode only 
  (Sub)Partitioned tables can be unloaded 
  Unload a single (Sub)Partition 
  Improved the scan tables 
  The timestamp and interval datatypes 
  Stricter checking of negative numbers 
  (Compressed) Index Organized Tables be unloaded 
  Very strict checking of row status flags 
  Unload index to see what rows you are missing 
  Objects, nested tables and varrays are not supported (internal  
        preparation for varray support ) 


DUL has been tested with versions from 6.0.36 up to 9.0.1. The old block header layout (pre 6.0.27.2) also works! 
DuL 92 is mostly bug fixes:
The latest version is DUL92. The main new features are: 
     fix for problem with startup when db_block_size = 16K 
     fix for scan database and Automatic Space Managed Segments 
     fix for block type errors high block types; new max is 51 
     Support for Automatic Space Managed Segments 
     phase zero of new unformat command 
     internal preparation for varray support 
     Bug fix in the stricter checking of negative numbers 
     Bug fix in the unloading of clustered tables 


The database can be corrupted, but an individual data block used must be 100% correct
blocks are checked to make sure that they are not corrupt and belong to the correct segment
DUL can and will only unload table/cluster data. 
it will not dump triggers, constraints, stored procedures nor create scripts for tables or views
But the data dictionary tables describing these can be unloaded


Note: If during an unload a bad block is encountered, an error message is printed in the loader file and to standard output. Unloading will continue with the next row or block. 


MLSLABELS (trusted oracle) are not supported
No special support for multi byte character sets
DUL can unload (LONG) RAWs, but there is no way to reload these 1-to-1 with SQL*Loader
SQL*Loader cannot be used to load  LONG RAW data.



DUL can unload (long) raws, but there is no way to reload these 1-to-1 with SQL*Loader. There is no suitable format in SQL*Loader
to preserve all long raws. Use the export mode instead or write a Pro*C program to load the data.



DUL and large files (files > 2GB) 
Starting from DUL version 8.0.6.7 DUL will report if it can do 32-bit i/o(no large file support) or 64-bit i/o with large file suport.
DUL support for raw devices
DUL will work on raw devices. But DUL is not raw device aware.


Raw Devices:
On some platforms we skip the first part of the raw device. DUL does not automatically skip this extra part. The easiest way to configure DUL in this is the optional extra offset in the control file. These extra offsets that I am aware of are 4K on AIX raw devices and 64K for Dec Unix. 
DUL does not use the size as stored in the file header. So DUL will read the whole raw device including the unused part at the end.


There are two configuration files for DUL
init.dul
control.dul
Configuration parameters are platform specific.


If you do decide that DUL is the only way to go, then here is how to go about configuring and using DUL.  Good Luck!!


Contains parameters to help DUL understand the format of the database files 
Has information on  
DUL cache size
Details of header layout
Oracle block size
Output file format
Sql*Loader format and record size. 
etc...


Sample init.dul file for Solaris looks like:
# The dul cache must be big enough to hold all entries from the Dictionary dollar tables.
dc_columns = 200000
dc_tables = 20000
dc_objects = 20000
dc_users = 40
# OS specific parameters
big_endian_flag = true
dba_file_bits = 6
align_filler = 1
db_leading_offset = 1
# Database specific parameters
db_block_size = 2048
# Sql*Loader format parameters
ldr_enclose_char = "
ldr_phys_rec_size = 81


Used to translate the file numbers to file names
Each entry on a separate line, first the file_number then the data_file_name
A third optional field is an extra positive or negative byte offset, that will be added to all fseek() operations for that datafile.


This optional field makes it possible to skip over the extra block for AIX on raw devices or to unload from fragments of a datafile.

The control file would look like : 
  1  /u04/bugmnt/tar9569610.6/gs/sysgs.dbf                                
  2  /u04/bugmnt/tar9569610.6/gs/rbs.dbf                                  
  3  /u04/bugmnt/tar9569610.6/gs/user.dbf         
  4  /u04/bugmnt/tar9569610.6/gs/index.dbf                   
  5  /u04/bugmnt/tar9569610.6/gs/test.dbf
When the database is up and running v$dbfile contains the above information.



# sample init.dul configuration parameters
# these must be big enough for the database in question
# the cache must hold all entries from the dollar tables.
dc_columns = 200000
dc_tables = 10000
dc_objects = 10000
dc_users = 40

# OS specific parameters
osd_big_endian_flag = false
osd_dba_file_bits = 6
osd_c_struct_alignment = 32
osd_file_leader_size = 1

# database parameters
db_block_size = 8192

# loader format definitions
LDR_ENCLOSE_CHAR = "
LDR_PHYS_REC_SIZE = 81

#ADD PARAMETERS
export_mode=true  # still needed with dul9
compatible=9


# AIX version 7 example with one file on raw device
   1 /usr/oracle/dbs/system.dbf
   8 /dev/rdsk/data.dbf 4096

   # Oracle8 example with a datafile split in multiple parts, each part smaller than 2GB
   0  1 /fs1/oradata/PMS/system.dbf
   1  2 /tmp/huge_file_part1 startblock 1 endblock 1000000
   1  2 /tmp/huge_file_part2 startblock 1000001 endblock 2000000
   1  2 /mnt3/huge_file_part3 startblock 2000001 endblock 2550000



Case1: Data dictionary usable


Case 1:  
SYSTEM tablespace available
Case 2:  
Using DUL without the SYSTEM tablespace


Straight forward method  	                     
Execute ‘dul’ from os prompt then ‘bootstrap’ from DUL
Don’t need to know about the application tables structure, column types etc...


DUL> unload table hr.emp_trunc;

DUL: Error: No entry in OBJ$ for "EMP_TRUNC" type = 2
DUL: Error: Could not resolve object id
DUL: Error: Missing dictionary information, cannot unload table
DUL> scan database;

Case2: Without the SYSTEM tablespace 

Needs an in depth knowledge about the application and the application tables
The unloaded data does not have any value, if you do not know from which table it came from
Column types can be guessed by DUL but table and column names are lost
The guessed column types can be wrong


Note: 
1) Any old SYSTEM tablespace from the same database but weeks old can be of great help!
2) If you recreate the tables (from the original CREATE TABLE scripts) then the structural information of a "lost" table can be matched to the "seen" tables scanned with two SQL*Plus scripts. (fill.sql andgetlost.sql)

Steps to follow: 
1.configure DUL for the target database. This means creating a correct init.dul and control.dul. 
2.SCAN DATABASE; : scan the database for extents and segments. 
3.SCAN TABLES; : scan the found segments for rows. 
4.SCAN EXTENTS; : scan the found extents. 
5.Identify the lost tables from the output of step 3. 
6.UNLOAD the identified tables. 



DUL will not find “last” columns that only contain NULL's
Trailing NULL columns are not stored in the database
Tables that have been dropped can be seen
When a table is dropped, the description is removed from the data dictionary only
Tables without rows will go unnoticed


During startup DUL goes through the following steps: 
the parameter file "init.dul" is processed
the DUL control file (default "control.dul") is scanned
try to load dumps of the USER$, OBJ$, TAB$ and COL$ if available into DUL's data dictionary cache
try to load seg.dat and col.dat. 
accept DDL-statements or run the DDL script specified as first argument



DUL version 3, 8, 9 and 92 are available. 
http://www-sup.nl.oracle.com/dul/index.html
 exceutables, user’s and configutration guide
Available on most common platforms
Solaris
AIX
NT
HP etc...


DUL version 9 is currently available on: 
aix
alphavms62
att3000
dcosx
hp.tar.bin
osf1
rm4000.tar.bin   
sco
sequen
sunos
sunsol2
vaxvms55
vaxvms61
win95
winnt 

DuL with Dictionary


 Configure init.dul and control.dul
 Load DuL
 Bootstrap
 Unload database, user, table


DuL without Dictionary


 Configure init.dul and control.dul (control will include
   the datafiles needing to be recovered only).
 Load DuL
 alter session set use_scanned_extent_map = true
 scan database
 scan tables
 Using the found table definitions construct an uload 
   statement:
unload table dul2.emp (EMPLOYEE_ID number(22), FIRST_NAME varchar2(20), 
LAST_NAME varchar2(25), 
EMAIL varchar2(25),PHONE_NUMBER varchar2(20), HIRE_DATE date, JOB_ID varchar2 (10),
SALARY number(22), COMMISSION_PCT number(22),MANAGER_ID number(22), 
DEPARTMENT_ID number(22))
storage (dataobjno 28200);







Comment

*

沪ICP备14014813号-2

沪公网安备 31010802001379号