Link to home
Start Free TrialLog in
Avatar of Omega002
Omega002Flag for Afghanistan

asked on

How To Find Out Whether AN Oracle Export File is Binary or Flat File in Unix?

Greetings,

I have an oracle export file that has given me an error that indicates that is was restored as a flat file. The SA is unable to verify his methods of backing up my oracle export file. How can I tell from the unix environment whether this file is a binary or flat file? Is there a unix command that will show me whether it's a binary file or a flat file?
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Try
file filename
wmp
Avatar of Omega002

ASKER

with both commands what am I looking for as the results?
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

cat -v displays non-printable characters so if you get anything back it's likely a binary file.

the file command guesses at a file type based on 'known patterns' not really binary or not.
"file" should give you hints whether it's e.g.
"... ASCII text ..."
or
".... executable ..."
or
" ... MP32, Mono ..."
or the like. When you see "ASCII" showing up, it's in almost any case a text file, and not binary.
 
as an example /etc/hosts is a text file (flat file), /bin/ls is a binary

suse10sp2db3:/etc # file /bin/ls
/bin/ls: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.4, dynamically linked (uses shared libs), for GNU/Linux 2.6.4, stripped

suse10sp2db3:/etc # file /etc/hosts
/etc/hosts: ASCII English text
suse10sp2db3:/etc #
cat filename | more

Above will dump it to the screen.  If you see squiggly characters then it is binary.   The more command lets you hit space bar to continue, or just CTRL-C to stop viewing.
'file' is great for what it knows about. The question is about an Oracle export dump file.

Unless things have changed radically in the UNIX world, 'file' doesn't know what those are.

Granted if you want to take the time to figure out a recognizable pattern and properly configure your system you can have 'file oracledumpfile.dmp' return 'This is an Oracle 10g dump file' but not by default.
Ok this question is for the oracle dba guys. I created this export from oracle database control and I am trying to import from command line. When attempting to import from command line I get the following error?

IMP-00010 not a valid export file, header failed verification
OK,

this IMP-00010 can have several causes.

- Which way did you create the file? Must be "exp" or "expdp"!

- Did you transfer the file across the net? If FTP, "binary" transfer is mandatory, "ascii" will corrupt the file.

- Or did you manipulate the file some other way? Compression? Splitting? Joining? All those things will corrupt it.

- Are the versions of the exporting and the importing DB the same?
At least the importing DB's version must be equal to or higher than the exporting DB's version.

wmp

 
NA