Detailed tutorial on Docker pulling Oracle 11g image configuration

Detailed tutorial on Docker pulling Oracle 11g image configuration

Without further ado

Start recording docker pulling Alibaba's oracle11g image and configuring it.

Use pl/sql to log in as the final result

navicat connection is in the last step

Reference: https://www.jb51.net/article/223375.htm

But there are some problems with this configuration, so I wrote this article to record it, hoping it can help others

start:

①. Start pulling the image-execute command:

docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g

The download process will take a while, so wait, have a cup of coffee and take a break! (Image 6.8G)

After downloading, view the image: docker images

You can see that it has been downloaded

② Create a container

docker run -d -p 1521:1521 --name oracle11g registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g

Let me say here that the address after the command must be the image address you downloaded, that is, the name of the image you pulled, otherwise there will be problems such as the name already exists!

If the creation function is successful, the container id will be returned

③. Start the container

docker start oracle11g

④. Enter the image for configuration

1. docker exec -it oracle11g bash

2. Make a soft connection

sqlplus /nolog

I found that there is no such command and it cannot be used.

3. Switch to the root user

su root

Password: helowin

Note that this is still in the container. . Some friends withdrew. . . . . . .

4. Edit the profile file to configure the ORACLE environment variables

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

Add at the end

Save and exit: wq

5. Create a soft link

ln -s $ORACLE_HOME/bin/sqlplus /usr/bin

6. Switch to oracle user

I have to say here that you must write the inner strip in the middle - it is necessary, otherwise the soft link will be invalid

⑤. Log in to sqlplus and modify the passwords of sys and system users

sqlplus /nolog

conn /as sysdba

Then execute the following command

alter user system identified by system;

alter user sys identified by sys;

You can also create a user create user test identified by test;

And grant the user the permission grant connect,resource,dba to test;

Pay attention to the pitfalls here. When executing the password change, the following message appears: database not open

If the database is not open, please follow the steps below.

enter:

alter database open;

Note: There may also be a prompt here:

ORA-01507: database not mounted

No rush! continue!

=========== Solution===========

Input: alter database mount;

Input: alter database open;

Then you can execute the command to change the database password

After the change, enter: ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

Refresh the following table

exit is to retire sql soft connection

⑥. Use pl/sql to connect

Navicat connection directly skips step 6 , but Oracle's lsnrctl service is in step 6, so you should still read it and then step 7 (although you don't need to do anything). Step 7 is the last step for Navicat connection.

Previously we mapped the port to 1521, so we need to configure tnsnames.ora

Some friends didn't know where the ora file was, so they added this step

pl/sql installation package, Chinese package, key tool

http://xiazai.jb51.net/202109/yuanma/PLSQL_Developer_jb51.rar

Local download:

https://www.jb51.net/softs/737035.html

plsql installation and configuration toolkit

https://www.jb51.net/article/170088.htm

docker_oracle11=
 (DESCRIPTION =
   (ADDRESS_LIST =
     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.211.135)(PORT = 1521))
   )
   (CONNECT_DATA =
     (SERVICE_NAME = orcl)
   )
)

Open pl/sql to log in: prompt the listener currently cannot recognize the service requested in the connection descriptor

At this time we need to look at Oracle's lsnrctl service

See these two? Choose one and modify the service_name=helowinXDB in tnsnames.ora

docker_oracle11=
 (DESCRIPTION =
   (ADDRESS_LIST =
     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.211.135)(PORT = 1521))
   )
   (CONNECT_DATA =
     (SERVICE_NAME = helowinXDB)
   )
)

OK, login successful.

Step 7 is navicat connection

Some friends use navicat to connect, so I added this step

After opening Navicat (navicat12 does not need to configure the oci.dll file)

Create a new connection directly

This is the end of this article about Docker pulling oracle 11g image configuration. For more relevant Docker oracle 11g image configuration content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to install Oracle_11g using Docker
  • Detailed explanation of installing and configuring Oracle database in Docker
  • Tutorial on installing and configuring Oracle on Docker
  • Analyze the problem of pulling down the Oracle 11g image configuration in Docker

<<:  MySQL 1130 exception, unable to log in remotely solution

>>:  Use the CSS Paint API to dynamically create resolution-independent, variable background effects

Recommend

How to disable the automatic password saving prompt function of Chrome browser

Note: In web development, after adding autocomplet...

Mysql 5.6 "implicit conversion" causes index failure and inaccurate data

background When performing a SQL query, I tried t...

Detailed explanation of JavaScript's garbage collection mechanism

Table of contents Why do we need garbage collecti...

GDB debugging MySQL actual combat source code compilation and installation

Download source code git clone https://github.com...

The easiest way to debug stored procedures in Mysql

A colleague once told me to use a temporary table...

Example code for using text-align and margin: 0 auto to center in CSS

Use text-align, margin: 0 auto to center in CSS W...

Detailed explanation of Vue's ref attribute

Summarize This article ends here. I hope it can b...

Detailed explanation of Angular data binding and its implementation

Table of contents Preface What is data binding? T...

Detailed explanation of JavaScript clipboard usage

(1) Introduction: clipboard.js is a lightweight J...

Things about installing Homebrew on Mac

Recently, Xiao Ming just bought a new Mac and wan...

10 skills that make front-end developers worth millions

The skills that front-end developers need to mast...

Analyze Tomcat architecture principles to architecture design

Table of contents 1. Learning Objectives 1.1. Mas...