📜  oracle docker images - Shell-Bash (1)

📅  最后修改于: 2023-12-03 14:44:55.464000             🧑  作者: Mango

Oracle Docker Images - Shell-Bash

Introduction

Oracle Docker Images are pre-built Docker containers that provide a standardized environment for running Oracle software. These images are designed to be lightweight, portable, and easy to use. In this guide, we will explore the various Oracle Docker images available and learn how to work with them using Shell-Bash commands.

Prerequisites

Before getting started, make sure you have the following installed:

  • Docker: Docker is required to run the Oracle Docker images. You can install Docker by following the instructions provided in the official Docker documentation.
Obtaining Oracle Docker Images

You can obtain Oracle Docker images by pulling them from the official Oracle Container Registry or the Docker Store. To pull an Oracle Docker image, use the following command:

docker pull <oracle_image_name>:<tag>

Replace <oracle_image_name> with the name of the Oracle Docker image you want to pull and <tag> with the version or tag of the image. For example, to pull the Oracle Database 19c Enterprise Edition image, you can use the following command:

docker pull container-registry.oracle.com/database/enterprise:19.3.0.0
Running Oracle Docker Images

Once you have pulled an Oracle Docker image, you can run it using the docker run command. For example, to run the Oracle Database 19c Enterprise Edition image, you can use the following command:

docker run -d --name <container_name> -p 1521:1521 -e ORACLE_SID=<sid> -e ORACLE_PDB=<pdb> -e ORACLE_PWD=<password> <oracle_image_name>:<tag>

Replace <container_name> with the name you want to give to the container, <sid> and <pdb> with the desired Oracle System ID and Pluggable Database name respectively, <password> with the password for the Oracle administrative user, <oracle_image_name> with the name of the Oracle Docker image, and <tag> with the version or tag of the image.

Connecting to Oracle Database

To connect to the Oracle Database running inside the Docker container, you can use SQLPlus or any Oracle SQL client. Use the following shell command to connect using SQLPlus:

docker exec -it <container_name> sqlplus sys/<password>@<sid> as sysdba

Replace <container_name> with the name of the Oracle Docker container and <password> and <sid> with the Oracle administrative user password and System ID respectively.

Useful Shell-Bash Commands

Here are some useful Shell-Bash commands that you can use with Oracle Docker images:

  • docker start <container_name> - Starts a stopped Oracle Docker container.
  • docker stop <container_name> - Stops a running Oracle Docker container.
  • docker rm <container_name> - Removes an Oracle Docker container.
  • docker ps -a - Lists all the Docker containers on your system.
  • docker images - Lists all the Docker images on your system.
Conclusion

Oracle Docker images provide a convenient and easy way to run Oracle software in a standardized and portable environment. In this guide, we learned how to obtain, run, and connect to Oracle Docker images using Shell-Bash commands. Feel free to explore the various Oracle Docker images available and experiment with different versions and configurations to meet your specific development or testing requirements.