ceyhunkerti/oracle_tocsv
oracle query to csv fast extraction utility
You may need to setup instant client paths if you don't have it already.
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
ox
at zig-out/bin/
.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