# How to Install Oracle Database 23ai Free Container Image on MacBook Pro

\*\*\*TLDR:\*\*\**Oracle Database 23ai, rebranded from 23c, introduces over 300 new features focused on AI, development, and mission-critical data. This guide explains how to install and connect to Oracle Database 23ai using a free container image on a MacBook Pro with an Intel chip, utilising Podman for container management. The process includes setting up Podman, creating the container, and connecting to the database both inside and outside the container.*

[Oracle Database 23ai's general availability was announced earlier this month](https://blogs.oracle.com/database/post/oracle-23ai-now-generally-available). It includes over 300 new features and thousands of enhancements, focusing on three key areas:

* AI for Data
    
* Dev for Data
    
* Mission Critical for Data
    

If you're wondering about Oracle Database 23c, it has been rebranded as Oracle Database 23ai due to the significant AI technology in this release. Oracle Database 23ai is version 23.4.0.0.0 and will be referred to as such from now on.

### Oracle Database 23ai - How to Access

Oracle Database 23ai can be installed or used through various options:

1. **Local System or On-Premises Machine or Any Cloud Provider VMs**
    
    * Oracle Database 23ai Free
        
    * Autonomous Database 23ai Free Container Image
        
2. **Oracle Cloud Infrastructure - Oracle Database Managed Services**
    
    * Oracle Database 23ai on Exadata Cloud@Customer
        
    * Oracle Database 23ai on Exadata Database Service
        
    * Oracle Database 23ai on Base Database Service
        
    * Oracle Database 23ai on Oracle Autonomous Database (only free tier)
        
3. **Microsoft Azure - Oracle Database 23ai on Exadata Database Service**
    

Please take a look at [My Oracle Support (MOS) note 742060.1](https://support.oracle.com/epmos/faces/DocumentDisplay?id=742060.1) for updates on our release schedule for on-premises deployment.

**In this blog, I will explain how to install Oracle Database 23c using an Oracle Database 23ai Free container image on a MacBook Pro with an Intel chip.**

### Create Oracle Database 23ai using Free Container Image

1. We will use [Podman](https://podman.io/) to install and manage Oracle Database containers. I will install Podman Desktop using the Homebrew package manager. Open a terminal and run the following command:
    

```plaintext
brew install podman-desktop
```

Install the homebrew package manager in case you don't have that

```plaintext
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

**<mark>If you're using a Mac with M1, M2, or M3 chips, you'll need to install Colima and Docker. For all the commands throughout the rest of the blog, replace every 'podman' command with 'docker'.</mark>**

```plaintext
brew install docker

brew install docker-compose

brew install colima

brew reinstall qemu

colima start --cpu 4 --memory 8 --arch x86_64
```

2. **All the instructions are applicable for MacBook Pro with Intel chip and using Podman.** After installing Podman, you need to create and start your first Podman machine:
    

```plaintext
podman machine init
podman machine set --cpus 4 --memory 8192
podman machine start
```

***Modify the CPU and memory size based on your requirements***

3. Open the Podman Desktop and verify the Podman machine is running.
    

![Podman Machine](https://cdn.hashnode.com/res/hashnode/image/upload/v1715862473101/632a8b3d-1e85-473e-adf8-151b8ad9adfe.png align="center")

4. To start an Oracle Database 23ai instance, run the following command, where **23aidb** is the container name. If you'd like to use a different name, please just change the container's name. I am also mapping port **1522** (the local host) to the container port (**1521**); this will help when connecting to the database from outside the container.
    

```plaintext
podman run -d --name 23aidb \
-p 1522:1521 \
container-registry.oracle.com/database/free:latest
```

Depending on the network bandwidth,pulling the container image and starting the container will take a few minutesr.

![Oracle DB 23ai container](https://cdn.hashnode.com/res/hashnode/image/upload/v1716467620863/d7c278a6-4608-48e5-84e8-dc776b2b8c18.png align="center")

In case you want to create a database with a custom configuration, you can do that using the reference below.

```plaintext
podman run --name <container name> \
-P | -p <host port>:1521 \
-e ORACLE_PWD=<your database passwords> \
-e ORACLE_CHARACTERSET=<your character set> \
-e ENABLE_ARCHIVELOG=true \
-e ENABLE_FORCE_LOGGING=true \
-v [<host mount point>:]/opt/oracle/oradata \
container-registry.oracle.com/database/free:latest
```

Parameters:

\--name: The name of the container (default: auto generated)

\-P | -p: The port mapping of the host port to the container port. Only one port is exposed: 1521 (Oracle Listener)

\-e ORACLE\_PWD: The Oracle Database SYS, SYSTEM and PDB\_ADMIN password (default: auto generated)

\-e ORACLE\_CHARACTERSET: The character set to use when creating the database (default: AL32UTF8)

\-e ENABLE\_ARCHIVELOG: To enable archive log mode when creating the database (default: false)

\-e ENABLE\_FORCE\_LOGGING: To enable force logging mode when creating the database (default: false)

\-v /opt/oracle/oradata The data volume to use for the database. Has to be writable by the Unix "oracle" (uid: 54321) user inside the container. If omitted the database will not be persisted over container recreation.

\-v /opt/oracle/scripts/startup Optional: A volume with custom scripts to be run after database startup. For further details see the "Running scripts after setup and on startup" section below.

5. Verify the container using the below command.
    

```plaintext
podman container ls
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716469343983/cbe6a215-8e0f-4479-9916-f248f700f6cd.png align="center")

<mark>Status should show Up(healthy)</mark>

6. During container creation, random passwords are assigned to SYS, SYSTEM and PDBADMIN users. You can change passwords for those users using the below command. Replace the container name and password.
    

```plaintext
podman exec 23aidb ./setPassword.sh m#P52sap$V
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716469460536/a4640d37-e506-4227-bee4-33b32a25c783.png align="center")

7. You can monitor the database alert log using
    

```plaintext
podman logs 23aidb
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716469499248/2caec1c3-ce59-4fef-af77-0873571cb908.png align="center")

### Connect the Oracle Database 23ai

You can connect the database if the container has started and shows a 'healthy' status.

1. Connect to the Database using any of the preferred users. Replace the container name and passwords accordingly.
    

```plaintext
podman exec -it 23aidb sqlplus sys/m#P52sap$V@FREE as sysdba
podman exec -it 23aidb sqlplus system/m#P52sap$V@FREE
podman exec -it 23aidb sqlplus pdbadmin/m#P52sap$V@FREEPDB1
```

I have connected to the database using sys user.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716465964253/e21b67fe-fe0f-4820-980d-b9c066218ff8.png align="center")

2. If you want to connect to the database from outside the container, you can through TNS using the ports which was used during the container creation. I am using [Oracle SQL Developer Command Line (SQLcl)](https://www.oracle.com/database/sqldeveloper/technologies/sqlcl/) to connect to the database. If you don't have SQLcl, you can install it using the command below or use sqlplus.
    

```plaintext
brew install sqlcl
```

3. Export the SQLcl location to the PATH variable
    

```plaintext
export PATH=/usr/local/Caskroom/sqlcl/24.2.0.180.1721/sqlcl/bin:"$PATH"
```

4. Connect to the database from outside the container. I have used port 1522 during the container creation, modify the port number if you have used a different one.
    

```plaintext
sql sys/m#P52sap$V@//localhost:1522/FREE as sysdba
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716468377601/33eb15f0-9da5-43a7-a869-78de36457c66.png align="center")

### Conclusion:

Getting started with Oracle Database 23ai using the Free container image is straightforward and allows you to leverage the latest advancements in AI, development, and mission-critical features. By following the steps outlined, you can efficiently set up and connect to Oracle Database 23ai on your MacBook Pro, enabling you to explore its robust capabilities and integrate them into your projects. Whether you're a developer, data scientist, or database administrator, Oracle Database 23ai offers powerful tools to enhance your data management and application development endeavours.

In the upcoming blogs, we will explore some of the exciting Oracle Database 23ai features. Stay tuned!

**Update**: A [video recording](https://www.youtube.com/watch?v=6jiCo0zytw0&t=183s) is available for this blog.

### References:

1. [https://medium.com/oracledevs/run-oracle-23ai-as-a-free-autonomous-db-container-on-macbook-pro-d83a90a44906](https://medium.com/oracledevs/run-oracle-23ai-as-a-free-autonomous-db-container-on-macbook-pro-d83a90a44906)
    
2. Oracle Database 23ai - [https://www.oracle.com/database/23ai/](https://www.oracle.com/database/23ai/)
    
3. Oracle Database 23ai get started- [https://www.oracle.com/in/database/free/get-started/](https://www.oracle.com/in/database/free/get-started/)
    
4. Podman - [https://podman.io/](https://podman.io/)
