This article covers: Container deployment of Oracle.

Download image:

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

Mirror list:

REPOSITORY TAG IMAGE ID CREATED SIZE registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g latest 3fa112fd3642 4 years A line 6.85 GBCopy the code

Start container:

Docker run - itd - p - 1521-1521 the name oracle registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g data persistence:  docker run -itd -p 1521:1521 \ --name=oracle \ -v $PWD/helowin:/home/oracle/app/oracle/oradata/helowin \ -v $PWD/flash_recovery_area:/home/oracle/app/oracle/flash_recovery_area \ registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g bash --restart=alwaysCopy the code

Status:

# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d3b1cd3efbc7 registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g "/bin/sh -c '/home..." 32 seconds ago Up 6 seconds 0.0.0.0:1521->1521/ TCP OracleCopy the code

Default account and password:

#username: system
#password: helowin
Copy the code

Enter the container:

docker exec -it oracle bash
Copy the code

Connect to the database.

source /home/oracle/.bash_profile sqlplus /nolog SQL> conn / as sysdba Connected. Or $up sqlplus SQL * Plus: Release 11.2.0.1.0 Production on Mon Oct 26 09:17:43 2020 Copyright (c) 1982, 2009, Oracle. All rights reserved. Enter user-name: system # Enter password: # Oracle Database 11G Enterprise Edition Release 11.2.0.1.0-64bit ProductionCopy the code

Change the account password.

SQL> alter user system identified by system; SQL> alter User sys identified by sys; SQL> SQL> ALTER profile default limit password_life_time unlimited; Profile altered. SQL> exit $ lsnrctl status LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 30-Aug 2020 00:54:57 Copyright (C) 1991, 2009, Version 11.2.0.1.0 - Production on 30-Aug 2020 00:54:57 Copyright (C) 1991, 2009, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production Start Date 27-Aug -2020 23:26:21 Uptime 2 days 1 hr. 28 min. 36 SEC Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File / home/oracle/app/oracle/product / 11.2.0 / dbhome_2 / network/admin/listener. Ora listener Log File /home/oracle/app/oracle/diag/tnslsnr/d3b1cd3efbc7/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=d3b1cd3efbc7)(PORT=1521))) Services Summary... Service "helowin" has 1 instance(s). Instance "helowin", status READY, has 1 handler(s) for this service... Service "helowinXDB" has 1 instance(s). Instance "helowin", status READY, has 1 handler(s) for this service... The command completed successfullyCopy the code

The problem

Ora-12528: TNS: Listeners: All applicable routines could not establish a new connection. The view status is BLOCKED:

$ lsnrctl status LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 26-OCT-2020 11:05:00 Copyright (C) 1991, 2009, Version 11.2.0.1.0 - Production on 26-OCT-2020 11:05:00 Copyright (C) 1991, 2009, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production Start Date 26-OCT-2020 10:11:00 Uptime 0 days 0 hr.53 min.59 SEC Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File / home/oracle/app/oracle/product / 11.2.0 / dbhome_2 / network/admin/listener. Ora listener Log File /home/oracle/app/oracle/diag/tnslsnr/5041887d0189/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=5041887d0189)(PORT=1521))) Services Summary... Service "helowin" has 1 instance(s). Instance "helowin", status BLOCKED, has 1 handler(s) for this service... The command completed successfullyCopy the code

summary

You tried to mount the database directory, but could not access it for unknown reasons. All content is in the container and ready to use.

The attached

Default startup commands:

"Volumes": { "/home/oracle/app/oracle/oradata": {} }, "WorkingDir": "", "Entrypoint": [ "/bin/sh", "-c", "/ home/oracle/app/oracle/product / 11.2.0 / dbhome_2 / bin/dbstart/home/oracle/app/oracle/product / 11.2.0 / dbhome_2 && tail -f / home/oracle/app/oracle/product / 11.2.0 / dbhome_2 / startup log"Copy the code

reference

www.cnblogs.com/qiuxiangmuy… www.cnblogs.com/YsirSun/p/1… Blog.csdn.net/chenjin_csd… Github.com/oracle/dock… www.cnblogs.com/yxb-blog/p/… www.imooc.com/article/184… www.cnblogs.com/lovling/p/1… Blog.csdn.net/qq_27050005…