diff --git a/libs/connector-oracle/README.md b/libs/connector-oracle/README.md index 7d0978d21..e79790b88 100644 --- a/libs/connector-oracle/README.md +++ b/libs/connector-oracle/README.md @@ -24,3 +24,52 @@ If you need to develop on multiple libs at the same time (ex: want to update a c - Depend on a local lib: `pnpm add `, ex: `pnpm add @azimutt/models` - "Publish" lib locally by building it: `pnpm run build` + +## Oracle Setup + +### Run in Docker + +You can use the free version of Oracle Database + +```bash +docker pull container-registry.oracle.com/database/free:latest +``` + +To launch a container, the needed configuration is the `ORACLE_PWD` of the `SYS` user. You can also map the default 1521 port to your computer. + +```bash +docker run -d --name oracle -p 1521:1521 -e ORACLE_PWD=oracle container-registry.oracle.com/database/free:latest +``` + +To connect, you can use a jdbc driver with the URL `jdbc:oracle:thin:/@//localhost:1521/FREE` + +### Setup a user + +Create a user + +```sql +CREATE USER "C##AZIMUTT" IDENTIFIED BY "azimutt"; +``` + +Grand permissions + +```sql +GRANT CONNECT, RESOURCE, DBA TO "C##AZIMUTT"; +``` + +Update user quota on `Users` tablespace + +```sql +ALTER USER "C##AZIMUTT" QUOTA UNLIMITED ON USERS; +``` + +### Create a table + +```sql +CREATE TABLE "C##AZIMUTT"."USERS"( + user_id NUMBER GENERATED BY DEFAULT AS IDENTITY, + first_name VARCHAR2(50) NOT NULL, + last_name VARCHAR2(50) NOT NULL, + PRIMARY KEY(user_id) +); +```