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.

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/
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
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
to use docker images Check the image and confirm that it has been downloaded
Start the container
- 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 - 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
View running statusdocker ps -a 
Container environment configuration
Enter the containerdocker exec -it oracle11g bash
Switch to the root usersu root, password The environment variables configured for the helowin
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
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 
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 
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
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”
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.

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

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!
How do you use Docker with Jenkins?Jul 21, 2025 am 03:25 AMTouseDockerwithJenkinsforCI/CD,firstinstallDockerontheJenkinsserveroragentandensuretheJenkinsuserhasDockerpermissions.TheninstalltheDockerPipelineplugintorunbuildsinsidecontainers.IfusingacontainerizedJenkinsagent,enableDockeraccessviaDinDorsocketmou
What is the difference between docker run and docker start?Jul 21, 2025 am 02:25 AMdockerrun is used to create and start a new container, while dockerstart is used to restart existing containers. The specific differences include: 1.dockerrun=Create Start, a new container will be generated every time you run; 2.dockerstart=Only start, it must be used on the created container; 3. Configurations such as port mapping and volume can only be set during dockerrun, and can not be changed afterwards; 4. If you want multiple instances, use dockerrun multiple times, and if you want to restart the same instance, use dockerstart. Therefore, dockerrun is equivalent to "create and start", while dockerstart is "start again".
How do you deploy applications to a Docker Swarm cluster?Jul 21, 2025 am 02:05 AMThe key to deploying applications to DockerSwarm is to use services rather than standalone containers, and to manage configurations, keys, and rolling updates through built-in tools. 1. First, containerize the application and push it to a mirror repository accessible to the Swarm node; 2. Use dockerservicecreate to define the service and its expected state, such as replica count, port mapping, etc.; 3. Use dockersecret and dockerconfig to manage sensitive information and non-sensitive configurations respectively and reference them in the service; 4. Use dockerservicescale to achieve scaling, use dockerserviceupdate to perform interrupted version updates, and can control the update policy through parameters.
What are Docker context, and how are they used?Jul 21, 2025 am 01:32 AMADockercontextisanamedconfigurationthatdefineshowtheDockerCLIconnectstoaDockerdaemon,enablingseamlessswitchingbetweenenvironments.Itincludesdetailslikethedaemon’slocation,TLSsettings,anddefaultorchestrator.Bydefault,Dockerusesthelocaldaemon,butyoucan
How do you share data between containers using volumes?Jul 20, 2025 am 03:38 AMTosharedatabetweenDockercontainersefficiently,usenamedvolumesforpersistentandreliableaccess.1.Createanamedvolumefirstusingdockervolumecreatemy_shared_data.2.Mountthevolumeintomultiplecontainerswiththe-vor--mountflagduringdockerrun.3.Managefilepermiss
How do you monitor Docker performance in a production environment?Jul 20, 2025 am 03:32 AMTomonitorDockerperformanceinproduction,combinereal-timechecks,historicalmetrics,andloganalysis.1)Usedockerstatsforreal-timeCPU,memory,andI/Odata.2)DeployPrometheuswithNodeExporterandcAdvisorforlong-termmetricstrackingandalerting.3)Monitorlogsandevent
What are the alternatives to Docker (e.g., Podman)?Jul 20, 2025 am 01:47 AMPodman, containerd, LXC/LXD and Buildah are the main alternatives to Docker. First, as a container tool without daemons, Podman provides Docker-compatible CLI commands, supports rootless containers, improves security, and integrates with systemd, suitable for environments that focus on security and simplicity; second, containerd is a lightweight container runtime, designed for orchestration, and is often used in Kubernetes environments, with high performance but low user-friendliness; third, LXC/LXD provides system containers, which are close to lightweight virtual machines, suitable for scenarios where complete Linux system testing or hosting multiple services are required; finally,
What are Pods, Deployments, and Services in Kubernetes?Jul 20, 2025 am 01:07 AMPods are the smallest deployment unit of Kubernetes. They usually contain a main container and optional auxiliary container, which share network and storage, but do not have the ability to heal; Deployment ensures that the Pod copy continues to run and supports rolling updates and rollbacks, realizing the automated management of the application; Service provides a stable access portal, forwarding requests to the backend Pod through a tag selector, and supports ClusterIP, NodePort, LoadBalancer, ExternalName and other types.


Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Zend Studio 13.0.1
Powerful PHP integrated development environment

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software








