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


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?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slightwv (䄆 Netminder) Commented:
My unix is old and rusty but I don't remember a way that is 100% but you can try cat -v

That said:  An Oracle export is binary 100% of the time.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
file filename
Omega002Author Commented:
with both commands what am I looking for as the results?
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

slightwv (䄆 Netminder) Commented:
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 ..."
".... executable ..."
" ... 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.
slightwv (䄆 Netminder) Commented:
'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.
Omega002Author Commented:
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

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.


Omega002Author Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.