Skip to content

root-hunter/oracle-linux-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIT License LinkedIn


Logo Logo

Oracle Linux Docker

Table of Contents
  1. Getting Started
  2. License

Getting Started

Prerequisites

The main prequisite is docker and docker compose.

Installation

Below is an example of how to create Oracle Linux container and how to configure Oracle Database FREE.

  1. Clone the repo
    git clone https://github.com/root-hunter/oracle-docker.git
  2. Download dependencies, build image and initialize container
    make build-all
  3. Enter in the container shell with docker exec command or with Exec menu in Docker Desktop, run following command (Initialize Oracle Database FREE)
    /etc/init.d/oracle-free-23c configure

4a.a. Log into database (Shell - Pluggable Database (PDB))

sqlplus sys@localhost:1521/FREEPDB1 as sysdba

4a.b. Log into database (Shell - Container Database (CDB))

sqlplus sys@localhost:1521/FREE as sysdba

4b. Log into database (Java)

OracleDataSource ods = new OracleDataSource();
ods.setURL("jdbc:oracle:thin:@localhost:1521/FREEPDB1"); // jdbc:oracle:thin@[hostname]:[port]/[DB service name]
ods.setUser("[Username]");
ods.setPassword("[Password]");
Connection conn = ods.getConnection();

PreparedStatement stmt = conn.prepareStatement("SELECT 'Hello World!' FROM dual");
ResultSet rslt = stmt.executeQuery();
while (rslt.next()) {
System.out.println(rslt.getString(1));
}

4c. Log into database (Python)

import oracledb

conn = oracledb.connect(user="[Username]", password="[Password]", dsn="localhost:1521/FREEPDB1")
with conn.cursor() as cur:
cur.execute("SELECT 'Hello World!' FROM dual")
res = cur.fetchall()
print(res)

4x. For more log snippet visit: https://www.oracle.com/in/database/free/get-started/

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published