search
HomeOperation and MaintenanceDockerCan docker install oracle?

docker can install oracle. Installation method: 1. Pull the official Oracle image and use "docker images" to view the image; 2. After starting the container, use "docker exec -it oracle11g bash" to enter the container and edit the environment variables; 3. Use "sqlplus /nolog" Just enter the oracle command line.

Can docker install oracle?

The operating environment of this tutorial: linux7.3 system, docker version 19.03, Dell G3 computer.

Can docker install oracle?

You can use docker to deploy oracle, and it has many benefits. It can not only reduce the installation time, but also enable rapid deployment.

The benefits of using docker for deployment are as follows:

(1) Simplify the configuration, build it once and package it, and then it can be used as a test environment, production environment or pre-production environment. A lot of testing sessions can be saved. For example, one server can test multiple versions without waiting.

(2) can solve the difficulty of developers deploying the environment. For example, it may take half a day for a new colleague to install the environment, but it will be much more convenient to directly run an already configured container.

(3) Application isolation and server integration. One server can use docker to deploy multiple sets of services, and the isolation is very high (except for virtual machines).

(4) For development, after deployment, it can be run everywhere to facilitate development and debugging.

(5) It can reduce the utilization of resources. Compared with virtual machines, it saves a lot of unnecessary resources. The loss of isolation is more than compensated for by other advantages.

(6) For operation and maintenance, it can quickly expand the capacity and reduce the original utilization rate

(7) Each small service can be clustered, and docker’s resource utilization comparison It is small and can start multiple servers on one server. Compared with other products, it uses more I/O on the server.

(8) Can be deployed on multiple platforms

The examples are as follows:

It is very troublesome to install oracle in Linux, I believe everyone will encounter various problems. Plant pit. In order to install it once and make it easier to export the image for transplantation on various platforms in the future, I chose to install it with docker

Pull the image

Search for Oracle on DockerHub to find the official image of Oracle. Address: https://hub.docker.com/
Can docker install oracle?

Note that if you use the docker pull oraclelinux command here, you cannot pull the image because it does not have latest tag. Therefore, you can only manually specify its version number
For example docker pull oraclelinux
Can docker install oracle?
Using the official image download speed is very slow, therefore, we can use the Ali image docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g

can be found on dockerHub (the second one), you can refer to this configuration
Can docker install oracle?Can docker install oracle? to use docker images Check the image and confirm that it has been downloaded
Can docker install oracle?

Start the container

  1. The default way to start the container
    docker run -d -it -p 1521:1521 --name oracle11g --restart=always registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
  2. How to start persistence
    docker run -d -it -p 1521:1521 --name oracle --restart=always --mount source=oracle_vol,target=/home/oracle/app/oracle/oradata registry.cn-hangzhou.aliyuncs.com /helowin/oracle_11g

View started threadsnetstat -tulnp
Can docker install oracle?
View running statusdocker ps -a
Can docker install oracle?

Container environment configuration

Enter the containerdocker exec -it oracle11g bash
Can docker install oracle?
Switch to the root usersu root, password The environment variables configured for the helowin
Can docker install oracle?
docker container are not in /etc/profile, and this file will not be used when the container is started.
You can set the environment variable configuration in the /home/oracle/.bashrc file, which can omit the creation of soft connections ln -s $ORACLE_HOME/bin/sqlplus /usr/ bin
Can docker install oracle?
Edit environment variablesvi /home/oracle/.bashrc, add the following command at the end of the file

export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
export ORACLE_SID=helowin
export PATH=$ORACLE_HOME/bin:$PATH

wq Save and exit. Then use source /home/oracle/.bashrc to refresh the environment variables and make them effective

Enter the oracle command line

Use sqlplus /nolog Enter the oracle command line
Can docker install oracle?
Use the "operating system authentication" method to log in to oracle conn / as sysdba
If you directly use the default root user to log in, a login failure will be reported . The su - oracle command must be used here to switch the current user to oracle, and then execute the login command
Can docker install oracle?

ORA-12514, TNS:listener does not currently know of service requested in connect descriptor

Can docker install oracle?This error is due to the wrong database name

su - oracle
sqlplus /nolog
conn / as sysdba
select instance_name from v$instance;
show user;

Using the above command to find out, it is all available "database names" ” and “user name”
Can docker install oracle?

In this image of Ali, all passwords are unifiedhelowin

The system user has DBA authority, but No SYSDBA permissions. This account is usually used to manage the database.
The sys user is the account with the highest authority in the Oracle database. It has "SYSDBA" and "SYSOPER" permissions and is generally not allowed to log in from the outside.

Can docker install oracle?

Configuring the firewall

The firewall must allow port 1521 so that external database management tools can connect

# 打开防火墙
systemctl start firewalld
# 查询端口状态
firewall-cmd --query-port=1521/tcp
# 永久性开放端口
firewall-cmd --permanent --zone=public --add-port=1521/tcp
# 重启防火墙
firewall-cmd --reload
firewall-cmd --query-port=1521/tcp

Can docker install oracle?

Recommended study: "docker video tutorial"

The above is the detailed content of Can docker install oracle?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Docker on Linux: Containerization for Linux SystemsDocker on Linux: Containerization for Linux SystemsApr 22, 2025 am 12:03 AM

Docker is important on Linux because Linux is its native platform that provides rich tools and community support. 1. Install Docker: Use sudoapt-getupdate and sudoapt-getinstalldocker-cedocker-ce-clicotainerd.io. 2. Create and manage containers: Use dockerrun commands, such as dockerrun-d--namemynginx-p80:80nginx. 3. Write Dockerfile: Optimize the image size and use multi-stage construction. 4. Optimization and debugging: Use dockerlogs and dockerex

Docker: The Containerization Tool, Kubernetes: The OrchestratorDocker: The Containerization Tool, Kubernetes: The OrchestratorApr 21, 2025 am 12:01 AM

Docker is a containerization tool, and Kubernetes is a container orchestration tool. 1. Docker packages applications and their dependencies into containers that can run in any Docker-enabled environment. 2. Kubernetes manages these containers, implementing automated deployment, scaling and management, and making applications run efficiently.

Docker's Purpose: Simplifying Application DeploymentDocker's Purpose: Simplifying Application DeploymentApr 20, 2025 am 12:09 AM

The purpose of Docker is to simplify application deployment and ensure that applications run consistently in different environments through containerization technology. 1) Docker solves the environmental differences problem by packaging applications and dependencies into containers. 2) Create images using Dockerfile to ensure that the application runs consistently anywhere. 3) Docker's working principle is based on images and containers, and uses the namespace and control groups of the Linux kernel to achieve isolation and resource management. 4) The basic usage includes pulling and running images from DockerHub, and the advanced usage involves managing multi-container applications using DockerCompose. 5) Common errors such as image building failure and container failure to start, you can debug through logs and network configuration. 6) Performance optimization construction

Linux and Docker: Docker on Different Linux DistributionsLinux and Docker: Docker on Different Linux DistributionsApr 19, 2025 am 12:10 AM

The methods of installing and using Docker on Ubuntu, CentOS, and Debian are different. 1) Ubuntu: Use the apt package manager, the command is sudoapt-getupdate&&sudoapt-getinstalldocker.io. 2) CentOS: Use the yum package manager and you need to add the Docker repository. The command is sudoyumininstall-yyum-utils&&sudoyum-config-manager--add-repohttps://download.docker.com/lin

Mastering Docker: A Guide for Linux UsersMastering Docker: A Guide for Linux UsersApr 18, 2025 am 12:08 AM

Using Docker on Linux can improve development efficiency and simplify application deployment. 1) Pull Ubuntu image: dockerpullubuntu. 2) Run Ubuntu container: dockerrun-itubuntu/bin/bash. 3) Create Dockerfile containing nginx: FROMubuntu;RUNapt-getupdate&&apt-getinstall-ynginx;EXPOSE80. 4) Build the image: dockerbuild-tmy-nginx. 5) Run container: dockerrun-d-p8080:80

Docker on Linux: Applications and Use CasesDocker on Linux: Applications and Use CasesApr 17, 2025 am 12:10 AM

Docker simplifies application deployment and management on Linux. 1) Docker is a containerized platform that packages applications and their dependencies into lightweight and portable containers. 2) On Linux, Docker uses cgroups and namespaces to implement container isolation and resource management. 3) Basic usages include pulling images and running containers. Advanced usages such as DockerCompose can define multi-container applications. 4) Debug commonly used dockerlogs and dockerexec commands. 5) Performance optimization can reduce the image size through multi-stage construction, and keeping the Dockerfile simple is the best practice.

Docker: Containerizing Applications for Portability and ScalabilityDocker: Containerizing Applications for Portability and ScalabilityApr 16, 2025 am 12:09 AM

Docker is a Linux container technology-based tool used to package, distribute and run applications to improve application portability and scalability. 1) Dockerbuild and dockerrun commands can be used to build and run Docker containers. 2) DockerCompose is used to define and run multi-container Docker applications to simplify microservice management. 3) Using multi-stage construction can optimize the image size and improve the application startup speed. 4) Viewing container logs is an effective way to debug container problems.

How to start containers by dockerHow to start containers by dockerApr 15, 2025 pm 12:27 PM

Docker container startup steps: Pull the container image: Run "docker pull [mirror name]". Create a container: Use "docker create [options] [mirror name] [commands and parameters]". Start the container: Execute "docker start [Container name or ID]". Check container status: Verify that the container is running with "docker ps".

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor