Minggu, 11 September 2022

ORACLE-docker

 

How to install Oracle 19c on Ubuntu 18.04 with Docker

https://mkc110891.medium.com/oracle-19c-on-ubuntu-18-04-docker-6898cd2916f9

If you have landed here that means you are struggling to install oracle 19c on Ubuntu. If this is your first search result on the internet, you are lucky!! I have spent 3 days figuring out the solution. Let's move to the solution.

There are some pre-requisite:

  • The root access in the terminal in Ubuntu
  • Docker installed in Ubuntu
  • Git installed in Ubuntu
  • 8GB+ RAM
  • 20GB+ free space
  • Good Internet
  1. Check Docker version
> docker version

If you get Client and Server details in output, you are ready to move to the next step. If Docker is not installed please refer to another blog for Docker installation.

2. Clone Oracle Docker Images

Oracle has created a repository on GitHub with all supported docker images. You just have to clone that repository.

Create a directory in Ubuntu where you want to host the show. Let's say its /var/docker/.

> cd /var/docker
> git clone https://github.com/oracle/docker-images

This will download all available images to /var/docker folder.

3. Download Oracle 19c zip from Oracle website

You can download the zip from https://www.oracle.com/database/technologies/oracle-database-software-downloads.html#19c. I hope you have a good internet speed because the size of this zip file is 2.8 GB. Download Linux x 86–64 from 19.3 section.

Copy zip file in docker-images/OracleDatabase/SingleInstance/dockerfiles/19.3.0/.

> cp <path-of-download-directory>/LINUX.X64_193000_db_home.zip /var/docker/docker-images/OracleDatabase/SingleInstance/dockerfiles/19.3.0/

Now you have copied the Linux binary zip into oracle’s docker files.

4. Run Docker

The next step is to run docker. Go to /var/docker/docker-images/OracleDatabase/SingleInstance/dockerfiles directory. There is a file buildContainerImage.sh, you need to execute that file.

Note: This process can take time, based on your system configuration.

> cd /var/docker/docker-images/OracleDatabase/SingleInstance/dockerfiles
> ./buildContainerImage.sh -v 19.3.0 -e

You will see the message “Build completed in xxx seconds.” once it's done. Check the docker image created for oracle 19c by typing the below command:

> docker images

You can see the docker image with tag 19.3.0-ee. Now its time to run that image. Docker image successfully created.

5. Run Docker Image

Now its time to run the image. Before that, we need to create a directory where all Oracle Data will be stored. Let’s create a directory /u01/oracle to store all oracle data.

Use the below command to run the docker image.

> docker  run --name oracle19c --network host -p 1521:1521 -p 5500:5500 -v /u01/oracle:/opt/oracle oracle/database:19.3.0-ee

You will see the password in the first line as an output of the above command. It’s similar to:

ORACLE PASSWORD FOR SYS, SYSTEM AND PDBADMIN: ET10BpTqpVg=1
...

Note: This process can take time, based on your system configuration.

You will see “DATABASE IS READY TO USE” once it’s done. The last line should be “XDB initialized”. You will notice that process will not end here and the terminal keeps running without any further logs or information.

Tip: You can close that process by ctrl + c and wait for the process to end. Check docker by entering below command:

> docker ps -a

It will list the image created by the previous command. Now start the oracle database.

> docker start oracle19c

You can access the Oracle Enterprise Manager Database Express on, https://localhost:5500/em/shell.
Username: system
Password: <<Use that you have copied from the previous step>>
Container: orclpdb1

If you have lost the password or you want to change the password, use command — docker exec oracle19c ./setPassword.sh <new-password>

> docker exec oracle19c ./setPassword.sh oracle

Connect database from docker terminal:

> docker exec -ti oracle19c sqlplus system/oracle@orclpdb1

That's it!!!
Happy coding…

=================

error docker run

=====================

https://github.com/steveswinsburg/oracle19c-docker

Running

To use the sensible defaults:

docker run \
--name oracle19c \
-p 1521:1521 \
-p 5500:5500 \
-e ORACLE_PDB=orcl \
-e ORACLE_PWD=password \
-e INIT_SGA_SIZE=3000 \
-e INIT_PGA_SIZE=1000 \
-v /opt/oracle/oradata \
-d \
oracle/database:19.3.0-ee

On first run, the database will be created and setup for you. This will take about 10-15 minutes. Open Docker Dashboard and watch the progress. Then you can connect.


Tidak ada komentar:

Posting Komentar