×
Community Blog Running Oracle 12c Database on Alibaba Cloud Containers

Running Oracle 12c Database on Alibaba Cloud Containers

This tutorial is shows you how to host Oracle 12c on Alibaba Cloud using Docker containers.

By Nikesh Gogia, Solution Architect

This tutorial is targeted for any organization that wants to host Oracle 12c on Alibaba Cloud using Docker containers. This document can be used by Solution Architects or Business Development teams for proof of concept (POC) of any customer requirement and gradually can be converted into production grade hosting.

We will be running our Docker containers on an Alibaba Cloud Elastic Compute Service (ECS) Ubuntu 16.04 64 bit 4 Core 8 GB RAM Virtual Machine.

Hosting Oracle 12c using Docker on Alibaba Cloud

With more than 500 new features, Oracle Database 12c is designed to give Oracle customers need for cloud computing, big data, security, and availability. Since Docker is the open source container software that packages applications in containers allowing them to be portal among systems running on Linux. Since Oracle has released the Docker image of Oracle 12 c and Alibaba Cloud has both Container and Linux VM's this helps to adopt oracle database 12c on Alibaba Cloud.

1. Install Docker on Ubuntu 16.04

The Docker installation package available in the official Ubuntu 16.04 repository may not be the latest version. To get the latest and greatest version, install Docker from the official Docker repository. This section shows you how to do just that.

First, add the GPG key for the official Docker repository to the system:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Add the Docker repository to APT sources:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release-cs) stable"

Next, update the package database with the Docker packages from the newly added repo:

sudo apt-get update

Make sure you are about to install from the Docker repo instead of the default Ubuntu 16.04 repo:

apt-cache policy docker-ce

You should see output similar to the follow:

Output of apt-cache policy docker-ce
docker-ce:
   Installed: (none)
   Candidate: 17.03.1~ce-0~ubuntu-xenial
   Version table:
      17.03.1~ce-0~ubuntu-xenial 500
500 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
      17.03.0~ce-0~ubuntu-xenial 500
500 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages

Notice that docker-ce is not installed, but the candidate for installation is from the Docker repository for Ubuntu 16.04. The docker-ce version number might be different.

Finally, install Docker:

sudo apt-get install -y docker-ce

Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it's running:

sudo systemctl status docker

The output should be similar to the following, showing that the service is active and running:

Output

docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2016-05-01 06:53:52 CDT; 1 weeks 3 days ago
Docs: https://docs.docker.com
Main PID: 749 (docker)

2. Setup Oracle Docker Image on Alibaba Cloud

Login to Docker Store with your credentials on above created VM

$ docker login
$ docker pull store/oracle/database-enterprise:12.2.0.1
$ docker run -d -it --name db1 -P store/oracle/database-enterprise:12.2.0.1

Once you do the following, you will see below output when you run docker images and docker ps –a commands.

root@iZt4neefbpoojkuy4fdvqzZ:~# docker images
REPOSITORY            TAG        IMAGE ID      CREATED         SIZE

store/oracle/database-enterprise 12.2.0.1     12a359cd0528   2 months ago  3.44GB

root@iZt4neefbpoojkuy4fdvqzZ:~# docker ps -a
CONTAINER
ID     IMAGE     COMMAND     CREATED     STATUS     PORTS     NAMES
92997757be9e     store/oracle/database-enterprise:12.2.0.1     "/bin/sh -c '/bin/..."     39 hours ago     Up 39 hours (healthy)     0.0.0.0:32775->1521/tcp, 0.0.0.0:32774->5500/tcp     db1

Congratulations! You have successfully configured a Docker image on Alibaba Cloud VM Container.

3. Connecting Oracle DB Container Outside VM from Local Desktop

Install Oracle Client from Oracle Site.

Make sure you have Oracle Client installed on your client machine. You can install it from the following link: http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html

Make sure you install and you have the PATH variable set where you can execute sqlplus command

Nikeshs-MacBook-Pro:~ nikeshgogia$ export PATH=$PATH:/Users/nikeshgogia/Downloads/instantclient_12_2
Nikeshs-MacBook-Pro:~ nikeshgogia$ sqlplus

b. Establish Connection from local desktop

nikeshgogia$ sqlplus sys/Oradoc_db1@47.74.181.105:32775/ORCLCDB.localdomain as sysdba

You will see the output as below and you will get Connection Developed.

Note: In the above command, sys/Oradoc_db1@47.74.181.105:32775, sys has the username Oradoc_db1 is password and port is 32775. Make sure you open this port in your security Group and the IP 47.74… is a public IP. Additionally, you need to make sure you keep ORCLCDB.localdomain as service name as it is.

Nikeshs-MacBook-Pro:~ nikeshgogia$ sqlplus sys/Oradoc_db1@47.74.181.105:32775/ORCLCDB.localdomain as
sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Sat Oct 28 11:16:44 2017
Copyright (c) 1982, 2017, Oracle. All rights reserved.
Last Successful login time: Thu Oct 26 2017 21:50:32 +05:30
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL>

Conclusion

With this we conclude that Alibaba Cloud is capable of hosting Oracle 12c. By running Oracle on Alibaba Cloud Container Service or ECS servers, you can enjoy the latest cloud enabled database with stable and advanced features.

1 0 0
Share on

Alibaba Clouder

2,599 posts | 762 followers

You may also like

Comments

5534756084376577 April 24, 2019 at 5:40 am

Does this installation ( oracle database on container and on alibaba cloud ) is officially supported by Oracle ?