Oracle Autonomous DB deploy

Deploy Oracle Autonomous Database on your Computer

Yes, it is possible. Oracle Autonomous Database can be deployed locally using container systems such as Kubernetes or Podman, with some limitations.

Oracle Autonomous Database on OCI offers a serverless cloud service with three types of workloads:

  • ATP (Autonomous Transaction Processing – OLTP)
  • ADW (Autonomous Data Warehouse – OLAP)
  • AJD (Autonomous JSON Database)

For testing and training purposes, Oracle provides free container images that support two types of database workloads: ADW and ATP each limited to 20 GB storage. These images not only allow you to run the databases in containers but also include the following key features:

  • Oracle REST Data Services (ORDS)
  • Oracle APEX
  • Database Actions
  • Mongo API
  • Oracle Estate Explorer (OEE)

Although these images have been available since September 2023, I only became aware of them through Virtual Classroom #22: Migration to Oracle Autonomous Database – Part 1: Planning.

What’s great about this is that it not only provides an Autonomous Database similar to OCI ADB Serverless offerings, but also includes a similar web interface through ORDS (Oracle REST Data Services, also known as the REST API layer).

Actually, all the information is available in the Oracle Autonomous Database Free Container Image documentation on the official GitHub page of adb-free. The documentation is simple to follow, and the setup process is straightforward for both Windows and Linux environments.

Currently, there is no available image for ARM-based systems, but it is possible to run it using Apple’s new virtualization framework (Rosetta) on macOS and I will show how. Rosetta is a binary translation framework developed by Apple that allows applications built for Intel-based Macs (x86_64 architecture) to run on Apple Silicon Macs (ARM architecture). Rosetta 2 translates Intel-based code into ARM-based code at runtime, so apps that haven’t been recompiled for Apple Silicon can still run smoothly on newer Macs (like those with M1, M2, or M3 chips).

We will install colima and docker to emulate x86_64 architecture.

Also I will install Rosetta 2.

Oracle Autonomous Database Free container requires 4 CPUs and 8 GB memory. Running x86_64 arch containers can have issues translating instructions for ARM. We give higher memory to the VM to avoid such issues and used commands provided below.

Verify the colima architecture whether it is running with x86_64 architecture.

Now I will download and start Oracle Database 23ai Autonomous Database docker. For Database version 19c, you should use the ghcr.io/oracle/adb-free:latest image.

ADMIN_PASSWORD must be between 12 and 30 characters long and must include at least one uppercase letter, one lowercase letter, and one numeric character.  WALLET_PASSWORD must be between 8 and 30 characters long and include alphabetic characters combined with numeric characters or special characters.

I disabled archive logging (default is enabled) because this environment is for testing and learning, and I want to avoid generating unnecessary archive logs that would increase container size.

Monitoring the creation process:

Now, we have a running Autonomous 23ai Database on our laptop, complete with a management console that uses REST calls. By that, I mean the Database Actions page, similar to the one in the OCI Console.

The container hostname is used to generate self-signed SSL certificates for serving HTTPS traffic on port 8443. Both APEX and Database Actions can be accessed via the container hostname or simply through localhost.

ApplicationURL
APEXhttps://localhost:8443/ords/apex
Database Actionshttps://localhost:8443/ords/sql-developer

I will add this self-signed SSL cerificate to trusted certificates. I will copy this certificate to my host from container.

Now, I will open the Keychain Access app and drag and drop this certificate into System Keychains > System. Then, in the certificate’s trust settings, I will select “Always Trust” for When Using This Certificate.

Now, we can access this site from a browser like Safari without any warnings. I will use “ADMIN” as the username and the ADMIN_PASSWORD “Welcome123456” that I specified in the docker run command. This password is case sensitive because Oracle Autonomous Database does not support SEC_CASE_SENSITIVE_LOGON = FALSE and does not allow passwords from versions earlier than 11g.

Here we have the Database Actions web page with its well-known hamburger menu.

Autonomous Database Actions
Database Actions Menu

Now I will connect to the database using SQLcl. Since I’m using mTLS (mutual TLS) over TCPS with SSL_SERVER_DN_MATCH=TRUE for database access (all via port 1522), I need to copy the tls_wallet to my host machine.

For my Autonomous Transaction Processing (ATP) instance, I have the following mTLS connection options:

  • myatp_medium
  • myatp_high
  • myatp_low
  • myatp_tp
  • myatp_tpurgent

As shown in the banner, we have Oracle Cloud and Engineered Systems version 23.8.0.25.05 running in our local environment and it looks great.

First I will download sample schemas from github repo.

Now I will create the HR sample schema using hr_install.sql through SQLcl. The script will prompt three times:

First, it will ask for the HR schema password. The password must be between 12 and 30 characters long and include at least one uppercase letter, one lowercase letter, and one numeric character.

Second, it will prompt for the default tablespace. The default is DATA for Autonomous Databases, which cannot be changed, just press Enter to accept it.

Third, it will ask whether to overwrite existing objects. Again, press Enter to continue with the default.

Now we have the HR sample schema loaded on our Autonomous Database 23ai instance running locally. This provides a great opportunity for testing and learning purposes.

Hope it helps.


Discover More from Osman DİNÇ


Comments

2 responses to “Deploy Oracle Autonomous Database on your Computer”

  1. ckorkut4228 Avatar
    ckorkut4228

    I ‘ve never considered such an issue. Creative, intriguing, congrats…

    Like

Leave your comment