LobShooter for Oracle (oraload)
0.2
LobShooter for Oracle (oraload) is a utility to easily up- and download Lob-Files to and from an Oracle database. You are able to directly load binary (blob) and char data with it. oraload comes with a library (libloadutil) and the main program. For the moment oraload is a command line utility, that takes parameters like this
oraload [-v] user pass db DC|UC|DB|UB SqlString filename[,file2,...] [options]
, where
- user = database user
- pass = database password
- db = database tnsname
- DC = Download a char lob
- UC = Upload a char lob
- DB = Download a bin lob
- UB = Upload a bin lob
- SqlString = the sql which sais where to put the lob (or where to get it from)
- filename = the filename for input or output (the file that you want to make a database lob from) in case you use option -ml, filename holds the list of files to be processed
Options
- -l logfile_name => path to the file where oraload should put the logging infos.
- -c char set => assign a Char Set when dealing with Char Lobs. (available sets, see in Oracle Globalization Support Guide, Appendix A)
- -v show version number
Download from
Prerequisites:
You need a working Oracle-Install, i.e
- Oracle Server
- Oracle Client (you may compile the sources, of course you need a server somewhere to get it to work)
- Oracle XE
- Oracle Instant Client
You need cmake for the build process. Try "apt-cache search cmake" and then install from your Debian-Repositories or get it from cmake.org
Set your Oracle Home Environment variable
- for a standard xe install this would be /usr/lib/oracle/xe/app/oracle/product/10.2.0/server
- for an InstantClient install this would be sth like /path/to/InstantClient_top_level_dir
The build-process:
- CD to the source directory and type
- cmake . (that is a dot here)
- make all
- make install (as root).
On runtime, set your library path like this:
- LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib
- LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/lib
- export LD_LIBRARY_PATH
- oraload hr hr xe UB "select blob_field from blob_table where pk_field = 4711 for update" music.mp3
- note that you always have to lock the row with "for update", if you upload something. You do not need that when downloading.
Example with EasyConnect (e.g. if you have InstantClient and no TNSNAMES.ora)
- oraload hr hr //lynx:1521/xe DCB "select blob_field from blob_table where pk_field = 4711" music.mp3 -l ./log.txt
Generated on Mon Apr 20 15:04:34 2009 for LobShooter for Oracle (oraload) by
1.5.1