Skip to content

sixcolors/orasuck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

I needed a simple executable to explore and export data from an Oracle DB on a locked down corporate laptop/network. This was my starting point for an automated data retrieval program which I can't share publicly. This repo is public in hopes that someone else will find it useful.

Here's why:

  • Oracle CLI produces broken CSV files
  • Oracle Developer didn't work for me either.
  • This is lightweight and simple;

Of course, no one tool will serve all projects since your needs may be different. So you may also suggest changes by forking this repo and creating a pull request or opening an issue.

(back to top)

Built With

(back to top)

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

You will need to install Go.

Installation

To get this up and running:

  1. Clone the repo

    git clone https://github.com/sixcolors/orasuck.git
  2. Install Go mods

    go mod tidy
  3. Build orasuck

    go build -o orasuck main.go
    • for windows
    GOOS=windows GOARCH=386 go build -o orasuck.exe main.go

(back to top)

Usage

  • Query and display (pretty) to stdout
orasuck -server "oracle://user:pass@server/service_name" "select * from my_table"
  • Query and export to csv file
orasuck -server "oracle://user:pass@server/service_name" -file "out.csv" "select * from my_table"

(back to top)

Roadmap

  • Initial Release

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

Testing

We can test Orasuck using Oracle Database Free Edition. For more information, see Oracle Database Free Release Quickstart.

Run the Oracle DB container.

docker run --name oracle -p 1521:1521 -e ORACLE_PWD=Test123 container-registry.oracle.com/database/free:latest

Connect to the Oracle DB container.

docker exec -it oracle bash

Connect to the Oracle DB.

sqlplus sys@localhost:1521/FREE as sysdba

Create a user and grant privileges.

alter session set "_ORACLE_SCRIPT"=true;
CREATE USER test IDENTIFIED BY Test123;
GRANT CONNECT, RESOURCE TO test;
ALTER USER test QUOTA UNLIMITED ON USERS;

Create a table and insert some data.

CREATE TABLE test.test_table (id NUMBER, name VARCHAR2(50));
INSERT INTO test.test_table VALUES (1, 'John Doe');
INSERT INTO test.test_table VALUES (2, 'Jane Doe');

Grant select privileges.

GRANT SELECT ON test.test_table TO test;

Test the connection.

go run main.go -server "oracle://C##test:Test123@localhost:1521/FREE" "select * from test_table"

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

@sixcolors

Project Link: https://github.com/sixcolors/orasuck

(back to top)

Acknowledgments

I've used the following projects as dependencies.

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages