oracledockersqlplusdocker-registryoracle21c

How to find default password of official Oracle database 21c (images) what run inside docker?


I run

docker pull container-registry.oracle.com/database/enterprise:latest
docker run -d --name oracle-db container-registry.oracle.com/database/enterprise:21.3.0.0
docker logs oracle-db

enter image description here

log


C:\Users\fffdfd>docker logs oracle-db
[2022:09:15 03:28:08]: Acquiring lock .ORCLCDB.create_lck with heartbeat 30 secs
[2022:09:15 03:28:08]: Lock acquired
[2022:09:15 03:28:08]: Starting heartbeat
[2022:09:15 03:28:08]: Lock held .ORCLCDB.create_lck
ORACLE EDITION: ENTERPRISE

LSNRCTL for Linux: Version 21.0.0.0.0 - Production on 15-SEP-2022 03:28:08

Copyright (c) 1991, 2021, Oracle.  All rights reserved.

Starting /opt/oracle/product/21c/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 21.0.0.0.0 - Production
System parameter file is /opt/oracle/homes/OraDB21Home1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/3ffbbd06854e/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 21.0.0.0.0 - Production
Start Date                15-SEP-2022 03:28:09
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/homes/OraDB21Home1/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/3ffbbd06854e/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
The listener supports no services
The command completed successfully
Prepare for db operation
8% complete
Copying database files

C:\Users\fffdfd>docker exec oracle-db ./setPassword.sh 12345678
The Oracle base remains unchanged with value /opt/oracle

SQL*Plus: Release 21.0.0.0.0 - Production on Thu Sep 15 03:29:55 2022
Version 21.3.0.0.0

Copyright (c) 1982, 2021, Oracle.  All rights reserved.


Connected to:
Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0

SQL>       ALTER USER SYS IDENTIFIED BY "12345678"
*
ERROR at line 1:
ORA-01109: database not open


SQL>       ALTER USER SYSTEM IDENTIFIED BY "12345678"
*
ERROR at line 1:
ORA-01109: database not open


SQL> ERROR:
ORA-65011: Pluggable database ORCLPDB1 does not exist.


SQL>       ALTER USER PDBADMIN IDENTIFIED BY "12345678"
*
ERROR at line 1:
ORA-01109: database not open


SQL> Disconnected from Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0

C:\Users\fffdfd>

enter image description here

Reference document at https://container-registry.oracle.com/ords/f?p=113:4:6576055923728:::4:P4_REPOSITORY,AI_REPOSITORY,AI_REPOSITORY_NAME,P4_REPOSITORY_NAME,P4_EULA_ID,P4_BUSINESS_AREA_ID:9,9,Oracle%20Database%20Enterprise%20Edition,Oracle%20Database%20Enterprise%20Edition,1,0&cs=3JV3L51pi5D5R69u0j2JIq9bovtnbkAkvZz0_bP7Tu1zHiE-Z_0Nrw_Cqh3q1gdQ5peQaDVEO2_JXEXQ0D_p_jA said

Note: Refer to the section titled "Changing the Default Password for SYS User" to obtain the password.

but I don't see this. How to find default password of official Oracle database 21c (images) what run inside docker?


Solution

  • Reference document was wrong. Manual set password for user sys when create docker container, for example

    docker run -d --name vyora -p 1521:1521 -p 5500:5500 -e ORACLE_SID=vyora -e ORACLE_PDB=vypdb -e ORACLE_PWD=12345678 -e INIT_SGA_SIZE=2000 -e INIT_PGA_SIZE=1000 -e ORACLE_EDITION=ee-or-se-database-edition -e ORACLE_CHARACTERSET=AL32UTF8 -e ENABLE_ARCHIVELOG=true -v "D:\oracle":/opt/oracle/oradata container-registry.oracle.com/database/enterprise:21.3.0.0
    

    passowrd is 12345678 .

    See https://docs.oracle.com/en/database/oracle/oracle-database/21/deeck/index.html#DEEDK-GUID-6589D4A1-14F3-42B3-8461-C9A7B840D148