Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Can't connect as SYS on Docker for Windows #21

Open
TheOneTrueAnt opened this issue Nov 9, 2018 · 6 comments
Open

Can't connect as SYS on Docker for Windows #21

TheOneTrueAnt opened this issue Nov 9, 2018 · 6 comments

Comments

@TheOneTrueAnt
Copy link

When running the container on Docker for Windows connecting as SYS from outside the container fails with incorrect username/password. This appears to be due to the orapwXE file being symlinked onto a windows filesystem where ownership cannot be changed or persisted.

Is there a reason (other than tidiness) these files are symlinked rather than copied in on startup? I've modified runOracle.sh to copy the files and then chown oracle:oinstall them and everything seems fine. I assume we could copy them back out to the volume in shutdownDb.sh to ensure they stay in-sync.

Happy to put together a PR if I'm not missing something.

jeren-de added a commit to jeren-de/docker-oracle-xe that referenced this issue Nov 13, 2018
issue fuzziebrain#21 fix connecting to database from outside container on windows - ownership issue on scripts
@fuzziebrain
Copy link
Owner

This is based on how it was implemented in the official Docker image from Oracle. The ORACLE_HOME is not mounted on host and hence, any changes would not be preserved if the container was destroyed and re-created. Unfortunately, I will have to reject this PR and find a different solution.

@mrmaddx2
Copy link

Have solved an issue by using --mount. Unfortunately for a some reason it did not work from Windows and i had to run the command for the first time directly from docker VM.

docker run -d
-p 32118:1521
-p 35518:5500
-e ORACLE_PWD=Oracle18
--name=oracle-xe
--mount source=oracle-xe,target=/opt/oracle/oradata,volume-driver=local
--network=oracle_network
oracle-xe:18c

@hohwille
Copy link

I tried with the same but parameter -e ORACLE_PWD=... does not seem to have any effect.
Not a single clue what the password for sys or system is and how to use the DB.
Even worse when entering the docker container I can not logon to reset pwd:

sh-4.2# cd /opt/oracle/product/18c/dbhomeXE/
sh-4.2# ./bin/sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on Tue Nov 26 17:08:54 2019
Version 18.4.0.0.0

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

ERROR:
ORA-01017: invalid username/password; logon denied


Enter user-name: system
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied

I had the same running on my macbook before but somehow my APFS got corrupted and I had to format my disc and restart from scratch. As my docker mount before was on /data and I now have catalina I can not reuse my time-machine backup for docker as the root FS is now read-only and prevents creating /data (even as symlink). So I had to reinstall from scratch. Now I have an empty Oracle XE running in Docker but can neither connect as my password supplied as ORACLE_PWD does not seem to be the sys or system password and I do not know it nor can I reset PWD.

@hohwille
Copy link

Also tried Oradoc_db1 and XEPDB1 as passwords cause I found those in your sources. Did not work either...

@hohwille
Copy link

OK. Need to be oracle user and use this command instead:

[oracle@27b79a603a8e dbhomeXE]$ ./bin/sqlplus sys/Oracle18@localhost/XE as sysdba

@koppor
Copy link

koppor commented Nov 29, 2019

@hohwille Can one script the change of the password so that an app can login? - I want to run OracleXE in an automated test. The passwrod seems to be set using the environment variable ORACLE_PASSWORD in the Dockerfile. Still having troubles to connect using Oracle's JDBC. --> Discussed at https://stackoverflow.com/q/10101517/873282

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants