05
11
2008


DBase DBF import to Oracle freeware tool – console version
Posted by: Andrei in Database, OracleAs I had a request and I must agree it really makes sense, I developed a console version of the DBF2Oracle tool. Functionality is the same, just that you need to give it parameters from command line.
Usage is:
C:\>DBFImportConsole.exe [file] [username] [password] [TNS]
Example
C:\>DBFImportConsole.exe "C:\test.dbf" HR HR XE
In the end it will give you (hopefully) a result as above.
How to use it:
- Make sure that you have .Net Framework 2.0 installed
- Make sure that you have an available Oracle 10g or 11g database
- Download the DBF2OracleConsole from here
- Unzip it into a folder close to root folder and avoid spaces in path
- Copy the .DBF file to the above folder or put it into the same kind of folder
- Run the console application and supply all parameters in the command line
- Check the log and statistics file
- Connect to Oracle to see your data (table name is DBF file name)
Download here: DBF2OracleConsole.zip
As an alternative, you can use this file, archived with 7-Zip: DBF2OracleConsole_
In my test here is how the folder looks like:
If you will find it useful or if you have any kind of suggestions just leave a comment.
Good luck!
Read also:
Hello,
Thanks for your update but i have some problem. First can i have the option “keep tempory file” and “drop table is exist” to run the program in console. And i can’t run the program with the data file (dbf) in another directory. Can you try this. Than you for all.
kinds regards
Nicolas
Nicolas, I did exactly as you requested. The parameters are even in your order.
The temporary files are kept by default. The table is dropped by default.
Can you at least try it ?
Sorry, i have already try this but it will be better if i can choose to kept tempory file end dropped table like this:
C:\>DBFImportConsole.exe [file] [username] [password] [TNS] [Kept file (1 or 0)] [drop table(1 or 0)]
like this youo have exactly the same options that the graphical interface.
And do you have try “And i can’t run the program with the data file (dbf) in another directory.”. Thanks for all. kinds regards.
Do you have solve my problem and update your software with the optuin “keep file” and “drop table” configurable in command line describe on my previous post. Thanks
Kind regards
I solved your problem as you initially described.
Remember, right now is hardcoded to keep the files and to drop the table. I will update and add this as parameters later, if someone else will need them, as right now I don’t have the time to make these changes.
However, I am absolutely sure that the lack of these parameters from the command line is not causing you any trouble for the moment.
ok, i understand, i hope to do this modification before monday because i will go to see a client to do a project. Thanks for all.
Hi, I download DBF2Oracle_console101.zip file, but can’t unpack it. I get message \Unsupported format\. I try download several times on various PC at different times, but result the same. Can you help me? Thanks.
Andy, I downloaded the archive available on my blog and I successfully unzipped it with WinZip and Total Commander’s internal zip archiver. Nicholas here was able to do this as well.
Can you try to re-download it?
Thanks. I installed WinZip 11.2 and successfully unpacked DBF2Oracle_console101.zip file. Before this moment I tried to use 7-Zip v.7.54, WinRAR v.3.60 and other console unpackers and suffered a failure at unpacking of the file whereas the GUI-version of the tool (dbf2oracle101.zip) was unpacked without problems.
HI I download file dbfimportconsole.exe and execute him:
dbfimportconsole.exe c:archagua.dbf myuser mypasswd mytns kept file(1) drop table(0) but and was insuccessfully.
if not use parameters: dropped table agua in Oracle databases.
help , socorro
Rodolfo
Yes, in fact, the file is corrupted.
Waste of time.
Can’t unpack the zip file . Can you fix this ?
L3X, Luca,
I made a new archive with 7-Zip and you can download it here: http://www.webxpert.ro/andrei/wp-content/uploads/2008/11/dbf2oracle_console101_.zip
Just let me know please if it’s working now!
Andrei
I found a problem while handling an large DBF file (some 100000 records, 60MB). The program crashes. Could you fix it?
Unhandled Exception: System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length,
Boolean fAlwaysCopy) at DBFImportConsole.Importer.GenerateExecute(String strFile, String strUser,
String strPass, String strTNS) at DBFImportConsole.Program.Main(String[] args)
it doesn’t look like it has something to do with the file size. Can you please try with just a smaller chunk of that file (100 records for example) ?
my strong belief is that the error is coming from a wrong path of filename.
however, if you still have the same error on a small file, you can send me the file and I’ll debug the application quickly.
Andrei
Hi Andrei,
I have tried the console version of the converted with multiple small files executed form a bat file and it worked fine.
Unfortunately, when I try to process a large file (+ 100 MB), it hangs up.
Do you have a work-around for large files? (breaking up the files into smaller ones isn’t an option)
Thanks,
Phil
[…] http://www.webxpert.ro/andrei/2008/11/05/dbase-dbf-import-to-oracle-freeware-tool-console-version/ […]
Phil, sorry for my late reply. Is it any chance to get a replica of such a DBF? I’ll fix it next week if I can replicate the behavior.
Andrei