Skip to content

ceyhunkerti/oracle_tocsv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Oracle to CSV Extraction Utility

  • Extracts data from an oracle query and outputs to csv.
  • ~3.7x faster than a plugin based JDBC implementation. (with same parameters.)

Build from source

You may need to setup instant client paths if you don't have it already.

  • Download oracle instant client from here
  • Extract it to a path and set the LD_LIBRARY_PATH.
export LD_LIBRARY_PATH=/path/to/instantclient_[version]
  • Install zig.

  • You may need to install libaio required by oracle client.

sudo apt install libaio1
  • todo: implement this in Makefile and remove Justfile.

  • Download ODPI-C and place the extracted resources to project-root/lib/odpi

  • Build the binary.

zig build -Doptimize=ReleaseFast
  • See the binary ox at zig-out/bin/.

Running

zig-out/bin/ox run \
    # change below to actual connection string.
    --connection-string "localhost:1521/ORCLCDB" \
    --username oracle_username \
    # optional (auth mode if you need SYSDBA)
    --auth-mode SYSDBA \
    --password oracle_password \
    # You can use multi line strings see examples folder.
    --sql "SELECT * FROM my_schema.my_table_name" \
    # output-file can be an absolute path.
    --output-file "output.csv" \
    --fetch-size 10000

todo

  • Documentation
  • Add benchmark results

About

oracle query to csv fast extraction utility

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors