DEV Community

Cover image for 🤩 Free Oracle Database: Download, Install, Tutorial… My Getting Started Guide 🚀🦭🐳
Loïc
Loïc

Posted on • Edited on

🤩 Free Oracle Database: Download, Install, Tutorial… My Getting Started Guide 🚀🦭🐳

TL;DR — In this post, I share the tricks I’ve learned for getting started fast with the Oracle Database for free.


Download, Install: Free and Fast

Here are the 2 paths I use when speed is needed:

  • Free Oracle Database 23c Free container image (more in this post)
  • Free Oracle Autonomous Database 19c/21c (_requires an Oracle Cloud Infrastructure Always Free account and an Internet connection)

Free Oracle Database 23c Free container image

Given you have a running Podman or Docker setup for x86_64 architecture (I work on both Linux and Windows), you can start an Oracle database 23c in less than 2 minutes (depending upon your Internet bandwidth) using this command:

podman run --rm --name oracle -p 1521:1521 \
       -e ORACLE_PASSWORD=free \
       gvenzl/oracle-free:23-slim
Enter fullscreen mode Exit fullscreen mode

Gerald Venzl maintains images with different characteristics (full, regular, slim; normal or faststart; for 21c and 23c versions).

When the container is up and running, you get a Pluggable Database (aka PDB) named freepdb1 which is ready to accept your commands.

Oracle SQL Developer Extension for VSCode or SQLcl

The very next step is to get this SQL Developer extension:

Oracle SQL Developer Extension for VSCode

This is the next generation of SQL Developer. Over time all features will be there with additional ones.

If you are more in the CLI team, you can get the latest version of SQLcl in one click. This requires a JDK 11 or 17. In case you didn’t know, SQLcl is the next generation of sqlplus, developed by the same team as SQL Developer; bringing console history, and powerful commands (Liquibase integration for changes management, DDL generation, formats conversion, color display, auto-completion, repeat command, status bar, vi mode, etc.). There is also a possibility to integrate JavaScript based plugins.

SQLcl syntax highlighting and status bar

Jeff Smith has a lot to share about SQLcl and the SQL Developer extension.

Create a User and connect to your Database

With the SQL Developer extension or SQLcl, you can now access your running Pluggable Database to create the user account you’ll use to develop your application.

This step requires some kind of root access (as for Linux). The root user of an Oracle database is named SYS and can use the highest privileges SYSDBA. Hence let’s register a new Connection in SQL Developer extension (remember password is free):

Registration of a connection to SYS as SYSDBA privileged user.

Now you can connect to the database and open an SQL Worksheet:

Connect by clicking on the connection name and then open an SQL Worksheet to run SQL commands.

Copy and paste the SQL commands below:

create user developer identified by "free";

-- no quota on USERS tablespace
alter user developer quota unlimited on users;

-- quick setup for developers
grant DB_DEVELOPER_ROLE to developer;

-- To drop: drop user developer cascade;
Enter fullscreen mode Exit fullscreen mode

Running the script with F5 will create a user named developer with free as its password. It grants unlimited quota on the USERS tablespace (so you can insert data) and the new 23c DB_DEVELOPER_ROLE role is granted; it provides just enough privileges to let you develop and use numerous capabilities.

DONE

You now just need to register a new connection for this newly created developer user and you’re done, you can now connect to your Pluggable Database and create tables, views, sequences, JSON collections, etc.

Following are some links to continue your journey:

Happy dev!

Top comments (0)