Skip to content

Create an Oracle database

Fill in the variables above and set the user’s password in the script (Oracle creates the database with the same name as the username):

oracle-init.sql
ALTER SESSION SET "_ORACLE_SCRIPT"=true;
CREATE USER ${{ USERNAME }} IDENTIFIED BY "put_your_password";
GRANT CONNECT, RESOURCE TO ${{ USERNAME }};
GRANT CREATE SESSION TO ${{ USERNAME }};
GRANT UNLIMITED TABLESPACE TO ${{ USERNAME }};
GRANT SELECT ON SYS.DBA_RECYCLEBIN TO ${{ USERNAME }};
QUIT

Set the SYS password in your shell, then run the script:

Terminal window
export SYS_PASSWORD=put_your_sys_password
sqlplus sys/$SYS_PASSWORD@${{ HOSTNAME }}:1521/ORCLCDB as SYSDBA @/oracle-init.sql;