š¤© Free Oracle Database: Download, Install, Tutorialā¦ My Getting Started Guide šš¦š³
LoĆÆc
Posted on March 25, 2024
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
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:
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.
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
):
Now you can connect to the database and open an SQL Worksheet:
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;
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:
- SQL Reference Guide
- New 23c Features
- My blog post about the JDBC driver
- Tutorials: LiveLabs and LiveSQL
Happy dev!
Posted on March 25, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
March 25, 2024