4

I'm trying to use sqlplus in Oracle database docker container (for Windows 10).

Commands given:

"docker run -d -p 8080:8080 -p 1521:1521 --name OracleDB store/oracle/database/enterprise:12.2.0.1"
"docker start OracleDB"
"docker exec -it OracleDB bash"
"sqlplus / as sysdba"

And now I get the error message:

"bash: sqlplus: command not found"

Image01

image02

4
  • What is your ORACLE_HOME directory? Commented Jan 28, 2019 at 10:41
  • [oracle@fdbf97e3a5fe /]$ ls ORCL boot etc lib media opt root sbin sys u01 u03 usr bin dev home lib64 mnt proc run srv tmp u02 u04 var [oracle@fdbf97e3a5fe /]$ - If this is what you asked? Commented Jan 28, 2019 at 11:01
  • this is not what I am asking... You need ORALE_HOME dir before proceeding to next step. I know what your problem is but I cannot help you without knowing your ORACLE_HOME directory Commented Jan 28, 2019 at 12:22
  • 1
    /u01/app/oracle/product/12.2.0/dbhome_1 Commented Jan 28, 2019 at 13:08

5 Answers 5

8

Try with this:

"docker run -d -p 8080:8080 -p 1521:1521 --name OracleDB store/oracle/database/enterprise:12.2.0.1"
"docker start OracleDB"
"docker exec -it OracleDB bash"
"/u01/app/oracle/product/12.2.0/dbhome_1/bin/sqlplus / as sysdba"
Sign up to request clarification or add additional context in comments.

Comments

3

While with @dervis answer it is possible to start SQL Plus, it introduced further issues on my side such as ORA-12547: TNS:lost contact or Connected to an idle instance.

What it solved for me is updating the PATH environment variable as shown below:

PATH=$ORACLE_HOME/bin:$PATH
export PATH

See: https://dba.stackexchange.com/questions/112702/bash-sqlplus-command-not-found

Afterwards I was able to start SQL Plus as usual with:

source /home/oracle/.bashrc; sqlplus /nolog

Comments

0

Try connect to container:

docker exec -u oracle -it OracleDB bash

Comments

0

Try

docker exec -it <container-name> bash -l -c "source /home/oracle/.bashrc; sqlplus /nolog"

1 Comment

While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
0
docker exec -it <container-name> bash -l -c "source /home/oracle/.bashrc; sqlplus /nolog"

This is working for me

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.