I would like to play with Stack Overflow's data dump in Oracle. The format that they gave me is in XML and it is very very huge (one XML file is about 3GB). I would like to do an import of this data to my Oracle DB. I know one other guy in this topic managed to work on it using the XML directly. Any ideas or suggestions to make this happen easily?
Asked
Active
Viewed 1,381 times
1
-
How do you want it in your Oracle database? A table with an XMLTYPE column? In relational format? – Rob van Wijk Mar 23 '11 at 09:58
-
I want it in a relational format – aherlambang Mar 23 '11 at 13:56
-
1And what's wrong with the method shown by Vincent Malgrat in that other thread? – Rob van Wijk Mar 23 '11 at 13:59
-
I don't know how to put the xml into the directory... – aherlambang Mar 23 '11 at 15:58
-
You just place the xml file somewhere on your server, you remember the OS directory you've put it in and you define an Oracle directory object on that OS directory. – Rob van Wijk Mar 24 '11 at 08:07
1 Answers
1
Check out the groovy SQL and XML libraries--you should be able to get up and running pretty quick even with minimal Java/Groovy experience.
http://docs.codehaus.org/display/GROOVY/Tutorial+6+-+Groovy+SQL
You'll need to install groovy and get the ojdbc14.jar drivers from Oracle. Put your code in a file and run:
groovy -cp ojdbc14.jar myscript.groovy

Justin Thomas
- 5,680
- 3
- 38
- 63