Skip to content

Instantly share code, notes, and snippets.

@diegopacheco
Created September 27, 2022 01:41
Show Gist options
  • Save diegopacheco/f34d2e18fd31a69db1102b7a318ecb06 to your computer and use it in GitHub Desktop.
Save diegopacheco/f34d2e18fd31a69db1102b7a318ecb06 to your computer and use it in GitHub Desktop.
Schema Crawler - oracle

Create user/schema on oracle

CREATE USER smith IDENTIFIED BY password;
GRANT CREATE TABLE TO smith;
GRANT CREATE SESSION TO smith;
commit;
SELECT username, account_status FROM dba_users
WHERE username = 'SMITH';

CREATE SCHEMA AUTHORIZATION smith;
CREATE TABLE smith.contact (id number PRIMARY KEY,name VARCHAR2(32),email VARCHAR2(32),phone VARCHAR2(32));
commit;

Install Schema Crawler

requires sdkman installed first.

sdk install schemacrawler

Run schema crawler

Assuming you are running oracle xe on docker

schemacrawler.sh --server=oracle --host=172.17.0.2 --port=1521 --database=XE --schema=smith --user=smith --password=password --info-level=standard --command=schema --output-format=html > result.html
@sualeh
Copy link

sualeh commented Oct 5, 2022

Thanks for putting this together, @diegopacheco
SchemaCrawler can be run along with Oracle XE in Docker Compose. Please take a look at https://github.com/schemacrawler/SchemaCrawler/tree/master/schemacrawler-docker-compose for a README and some scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment