Today's lesson is one in being careful using tab completion

Today I was exporting a complete schema from one production oracle database (11.2) and importing the same data into a test Oracle database (10.2), also changing the schema it was going to.  Not rocket science, a few corners with versions that you forget about and swear about, but nothing too hard:

This was the export:
expdp SYSTEM \
dumpfile=xxx_10_2_export.dmp \
full=n \
schemas=xxxxxxxx \
directory=DMP \
logfile=xxx_10_2_export.log \
version=10.2
I transferred the dump file using rsync, and this is the import that I used:
impdp SYSTEM \
dumpfile=xxx_10_2_export.dmp \
schemas=xxxxxxxx \
remap_schema=xxxxxxxx:yyyyyyyy \
directory=IMPDIR \
logfile=xxx_10_2_export.dmp \
version=10.2
Look at what I got back...
Connected to: Oracle Database 10g Release 10.2.0.4.0 - 64bit Production
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31619: invalid dump file "/home/oracle/imp/xxx_10_2_export.dmp"
ORA-27091: unable to queue I/O
ORA-27072: File I/O error
Linux-x86_64 Error: 9: Bad file descriptor
Additional information: 4
Additional information: 1
Erk!  I checked the MD5sum of the file, it was different to the one on the prod box.

I transferred the file over to the test box again, checked the MD5 of the file and it was the same.  Phew.  Just a transfer error.  Run the import again with a couple of taps (yay for command history!), but the same thing happened.

I tried all sorts ; reading the docs, different switches, transferred the file again and again only to find it failed every time.  Google really wasn't helping me today, lots of hits about space and corrupt files and failing disks, none of which I thought was really the answer.

It was only when I did the following process that I twigged what was going on:

  1. Transfer the file from prod
  2. Check the MD5.  It's the same as on the prod box.
  3. Attempt the import again
  4. Check the MD5 again.  It's now different to the one on prod box?

How can the MD5 be different after attempting an import?  It's a read-only operation on the file it's reading from.  The only writes are to... oh.... the log file.

Have a careful look at the logfile= line of my impdp:
logfile=xxx_10_2_export.dmp
I was appending the logs from the operation to the dump file.  This obviously won't work.

The take-away?  Don't get complacent when using tab-completion or copy & paste. Check your filenames.

Comments

Popular posts from this blog

Data Guard with Transparent Application Failover (TAF)

RMAN-05531 During RMAN Duplicate from Active Data Guard Standby

Data pump - "ORA-39786: Number of columns does not match between export and import databases"