Pete's Log: F*** you, Oracle
Entry #1469, (Coding, Hacking, & CS stuff)(posted when I was 28 years old.)
How to make a frustrating day worse, courtesy of Oracle...
For some reason, Sql*Loader has decided to start overwriting my input data files with its log files. It didn't take too long to figure out, but it was just incredibly frustrating.
I've used commands like this often enough in the past:
sqlldr user/pass control=foo.ctl data=foo.txt
Without trouble. But today, for some reason, sqlldr did not display any errors, and my db table did not receive any new records. I quickly discovered the output normally reserved for the log file was being written to the file I had specified as data file on the command line. Huh? So the sequence of events sqlldr seems to be happily engaging in:
- Open my data file for writing (clearing the contents)
- Open my data file for reading (now empty, thanks to step 1)
- Write to my data file that 0 records were imported, because the file is empty
I am positive this did not happen this way in the past, and I even went back and looked at old scripts to ensure my usage did not change.
Grrrrr. Quickly solved, however:
sqlldr user/pass control=foo.ctl data=foo.txt log=foo.log