Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running sqlplus in the container (but from a script). #109

Open
bkbonner opened this issue Oct 17, 2018 · 2 comments
Open

running sqlplus in the container (but from a script). #109

bkbonner opened this issue Oct 17, 2018 · 2 comments

Comments

@bkbonner
Copy link

We'd like to run sqlplus in the container from a script. Is there an easy way to do this?

When I run:

docker exec -i -t <container> /bin/bash

I can run sqlplus at the command line.

However, if I try to run:

docker exec -i -t dbtemp /bin/bash -c "sqlplus"

I get : /bin/bash: sqlplus: command not found

I'm looking for some advice on how to handle this. Thanks.

@bkbonner
Copy link
Author

nvmd. I looked at the setup.sh. and tried the following:

docker exec -i -t -w /tmp dbtemp /bin/bash -c 'export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe; export ORACLE_SID=XE; echo exit | /u01/app/oracle/product/11.2.0/xe/bin/sqlplus system/oracle @initialize.sql'

where dbtemp is the name of my container, /tmp is where I copy my scripts, and initialize.sql is a script I copied under the /tmp directory.

It would be nice if there was an 'initenv' that initialized the ORACLE_HOME and exported the appropriate stuff separate from this that we could call the script to set things up....so it would be maintained consistently by the image.

@gerbil
Copy link

gerbil commented Oct 26, 2018

/bin/bash: /u01/app/oracle/product/11.2.0/xe/bin/sqlplus: No such file or directory
/bin/bash: sqlplus: No such file or directory

env:
ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
ORACLE_SID=XE

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

No branches or pull requests

2 participants