Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Commands not found while starting image #5

Closed
wwarlock opened this issue Jul 30, 2015 · 17 comments
Closed

Commands not found while starting image #5

wwarlock opened this issue Jul 30, 2015 · 17 comments

Comments

@wwarlock
Copy link
Contributor

After successfull building, I've started container by command

$ docker run -i -t -p 1521:1521 oracle/database12101:latest

And got the next log:

: command not found:
Change hostname in the listener.ora
: No such file or directoryduct/12.1/db/network/admin/listener.ora
: command not found:
Start the listener and database
: command not found0:
just to be sure, start the listener again
The Oracle base has been set to /oracle

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 30-JUL-2015 11:12:39

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

".  Try "help"fined command "start
: command not found3:
Done
: command not found5:
Show all ora processes, should see listener and ora db processes
: command not found7:
root        34     6  0 11:12 ?        00:00:00 grep ora

Even I tried to use startup.sh and got the next:

[root@1a2130d0a1e0 /]# ./startup.sh
bash: ./startup.sh: /bin/sh^M: bad interpreter: No such file or directory

What do I need to fix in that case ?

@biemond
Copy link
Owner

biemond commented Jul 30, 2015

Ah damn windows as a host
it goes wrong here
https://github.com/biemond/docker-database-puppet/blob/master/Dockerfile#L43

maybe we need to add dos2unix

@wwarlock
Copy link
Contributor Author

Maybe it will be helpfull, but I've pulled the git repo, created the image and working with it from the Cygwin.
And Cygwin has the unix-style line-endings by default.

@wwarlock
Copy link
Contributor Author

I have converted /startup.sh by dos2unix and yes, it's beginning to start.

@biemond
Copy link
Owner

biemond commented Jul 30, 2015

nice

we can add this to the docker file
add dos2unix to yum and convert this after adding the startup script to VM

@wwarlock
Copy link
Contributor Author

Yes, also add the directory with Oracle tools (like sqlplus) to the PATH please

@wwarlock
Copy link
Contributor Author

Also, please set the correct ORACLE_HOME

@biemond
Copy link
Owner

biemond commented Jul 30, 2015

does '. oraenv' with the right SID works?

@wwarlock
Copy link
Contributor Author

Looks like listener not fully started or some misconfiguration.
It is presented only as stream. I couldn't see that it occupied the port.

[root@0ebcbd187ec8 /]# netstat -a | grep 1521
unix  2      [ ACC ]     STREAM     LISTENING     69072  /var/tmp/.oracle/sEXTPROC1521

And could not connect via sqlplus

[root@0ebcbd187ec8 /]# /oracle/product/12.1/db/bin/sqlplus sys/Welcome01@orcl as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Thu Jul 30 13:12:24 2015

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

ERROR:
ORA-12545: Connect failed because target host or object does not exist

Even after . oraenv still getting the same.

[root@0ebcbd187ec8 /]# . oraenv
ORACLE_SID = [] ? orcl
The Oracle base has been set to /oracle

@biemond
Copy link
Owner

biemond commented Jul 30, 2015

ok will also test it with 12.1.0.2

@wwarlock
Copy link
Contributor Author

Tried to setup 12.1.0.1 (EE), the problem with port exists too.

[root@d057cc4bd68f /]# ./startup.sh
Change hostname in the listener.ora
Start the listener and database
Processing Database instance "orcl": log file /oracle/product/12.1/db/startup.log
just to be sure, start the listener again
The Oracle base has been set to /oracle

LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 30-JUL-2015 16:10:36

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

TNS-01106: Listener using listener name LISTENER has already been started
Done
Show all ora processes, should see listener and ora db processes
oracle      64     1  0 16:08 ?        00:00:00 /oracle/product/12.1/db/bin/tnslsnr LISTENER -inherit
oracle     155     1  0 16:08 ?        00:00:00 ora_pmon_orcl
oracle     157     1  0 16:08 ?        00:00:00 ora_psp0_orcl
oracle     159     1  0 16:08 ?        00:00:00 ora_vktm_orcl
oracle     163     1  0 16:08 ?        00:00:00 ora_gen0_orcl
oracle     165     1  0 16:08 ?        00:00:00 ora_mman_orcl
oracle     169     1  0 16:08 ?        00:00:00 ora_diag_orcl
oracle     171     1  0 16:08 ?        00:00:00 ora_dbrm_orcl
oracle     173     1  0 16:08 ?        00:00:00 ora_dia0_orcl
oracle     175     1  0 16:08 ?        00:00:00 ora_dbw0_orcl
oracle     177     1  0 16:08 ?        00:00:00 ora_lgwr_orcl
oracle     179     1  0 16:08 ?        00:00:00 ora_ckpt_orcl
oracle     181     1  0 16:08 ?        00:00:00 ora_lg00_orcl
oracle     183     1  0 16:08 ?        00:00:00 ora_smon_orcl
oracle     185     1  0 16:08 ?        00:00:00 ora_lg01_orcl
oracle     187     1  0 16:08 ?        00:00:00 ora_reco_orcl
oracle     189     1  0 16:08 ?        00:00:00 ora_lreg_orcl
oracle     191     1  1 16:08 ?        00:00:01 ora_mmon_orcl
oracle     193     1  0 16:08 ?        00:00:00 ora_mmnl_orcl
oracle     195     1  0 16:08 ?        00:00:00 ora_d000_orcl
oracle     197     1  0 16:08 ?        00:00:00 ora_s000_orcl
oracle     209     1  0 16:10 ?        00:00:00 ora_p000_orcl
oracle     211     1  0 16:10 ?        00:00:00 ora_p001_orcl
oracle     213     1  0 16:10 ?        00:00:00 ora_p002_orcl
oracle     215     1  0 16:10 ?        00:00:00 ora_tmon_orcl
oracle     217     1  0 16:10 ?        00:00:00 ora_tt00_orcl
oracle     219     1  0 16:10 ?        00:00:00 ora_smco_orcl
oracle     221     1  0 16:10 ?        00:00:00 ora_fbda_orcl
oracle     223     1  0 16:10 ?        00:00:00 ora_w000_orcl
oracle     225     1  0 16:10 ?        00:00:00 ora_aqpc_orcl
oracle     229     1  0 16:10 ?        00:00:00 ora_p003_orcl
oracle     231     1  0 16:10 ?        00:00:00 ora_p004_orcl
oracle     233     1  0 16:10 ?        00:00:00 ora_p005_orcl
oracle     235     1  0 16:10 ?        00:00:00 ora_p006_orcl
oracle     237     1  0 16:10 ?        00:00:00 ora_p007_orcl
oracle     239     1  0 16:10 ?        00:00:00 ora_p008_orcl
oracle     241     1  0 16:10 ?        00:00:00 ora_p009_orcl
oracle     243     1  0 16:10 ?        00:00:00 ora_p00a_orcl
oracle     245     1  0 16:10 ?        00:00:00 ora_p00b_orcl
oracle     247     1  0 16:10 ?        00:00:00 ora_p00c_orcl
oracle     249     1  0 16:10 ?        00:00:00 ora_p00d_orcl
oracle     251     1  0 16:10 ?        00:00:00 ora_p00e_orcl
oracle     253     1  0 16:10 ?        00:00:00 ora_p00f_orcl
oracle     255     1  4 16:10 ?        00:00:00 ora_cjq0_orcl
oracle     333     1  4 16:10 ?        00:00:00 ora_m000_orcl
oracle     340     1  3 16:10 ?        00:00:00 ora_m001_orcl
oracle     344     1  3 16:10 ?        00:00:00 ora_m002_orcl
oracle     346     1  7 16:10 ?        00:00:00 ora_m003_orcl
oracle     350     1  0 16:10 ?        00:00:00 ora_qm02_orcl
oracle     352     1  9 16:10 ?        00:00:00 ora_m005_orcl
oracle     354     1  0 16:10 ?        00:00:00 ora_qm03_orcl
oracle     356     1  3 16:10 ?        00:00:00 ora_m006_orcl
oracle     360     1  4 16:10 ?        00:00:00 ora_q002_orcl
oracle     362     1  1 16:10 ?        00:00:00 ora_q003_orcl
oracle     366     1  2 16:10 ?        00:00:00 ora_m004_orcl
oracle     368     1 13 16:10 ?        00:00:00 ora_m007_orcl
root       370    46  0 16:10 ?        00:00:00 grep ora
[root@d057cc4bd68f /]# netstat -a | grep 1521
unix  2      [ ACC ]     STREAM     LISTENING     112903 /var/tmp/.oracle/sEXTPROC1521

@wwarlock
Copy link
Contributor Author

And with connection via sqlplus too:

[root@782d32fab664 /]# export ORACLE_HOME=/oracle/product/12.1/db/
[root@782d32fab664 /]# . oraenv
ORACLE_SID = [] ? orcl
The Oracle base has been set to /oracle
[root@782d32fab664 /]# /oracle/product/12.1/db/bin/sqlplus sys/Welcome01@orcl as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Thu Jul 30 17:01:40 2015

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

ERROR:
ORA-12545: Connect failed because target host or object does not exist

@biemond
Copy link
Owner

biemond commented Jul 30, 2015

by the way after login you should do sudo su - oracle else you are root
this contains the .profile with all the oracle env vars

@wwarlock
Copy link
Contributor Author

Thanks for that info, maybe it is good idea to include this to instruction.

But from oracle user still the same result as from root.

[root@782d32fab664 /]# su - oracle
[oracle@782d32fab664 ~]$ netstat -a | grep 1521
unix  2      [ ACC ]     STREAM     LISTENING     120037 /var/tmp/.oracle/sEXTPROC1521
[oracle@782d32fab664 ~]$ netstat -a | grep -i ora
unix  2      [ ACC ]     STREAM     LISTENING     120037 /var/tmp/.oracle/sEXTPROC1521
unix  2      [ ACC ]     STREAM     LISTENING     120036 /var/tmp/.oracle/s#137.1
unix  2      [ ACC ]     STREAM     LISTENING     120038 /var/tmp/.oracle/s#137.2
[oracle@782d32fab664 ~]$ sqlplus -V
-bash: sqlplus: command not found
[oracle@782d32fab664 ~]$ /oracle/product/12.1/db/bin/sqlplus -V
Error 6 initializing SQL*Plus
SP2-0667: Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
[oracle@782d32fab664 ~]$ . oraenv
ORACLE_SID = [oracle] ?
ORACLE_HOME = [/home/oracle] ?
ORACLE_BASE environment variable is not being set since this
information is not available for the current user ID oracle.
You can set ORACLE_BASE manually if it is required.
Resetting ORACLE_BASE to its previous value or ORACLE_HOME
The Oracle base has been set to /home/oracle
[oracle@782d32fab664 ~]$ /oracle/product/12.1/db/bin/sqlplus sys/Welcome01@oracle as sysdba
Error 6 initializing SQL*Plus
SP2-0667: Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
[oracle@782d32fab664 ~]$ export ORACLE_HOME=/oracle/product/12.1/db/
[oracle@782d32fab664 ~]$ /oracle/product/12.1/db/bin/sqlplus sys/Welcome01@oracle as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Thu Jul 30 18:07:50 2015

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

ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified

@biemond
Copy link
Owner

biemond commented Jul 30, 2015

thanks I will also check this

@biemond
Copy link
Owner

biemond commented Jul 30, 2015

So listener is working
.oraenv is working
sqlplus is working

I tested it all from a ubuntu vagrant image

[root@842e293c16f5 /]# ./startup.sh
Change hostname in the listener.ora
Start the listener and database
Processing Database instance "orcl": log file /oracle/product/12.1/db/startup.log
just to be sure, start the listener again
The Oracle base has been set to /oracle

LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 30-JUL-2015 20:33:25

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

TNS-01106: Listener using listener name LISTENER has already been started
Done
Show all ora processes, should see listener and ora db processes
oracle      34     1  0 20:32 ?        00:00:00 /oracle/product/12.1/db/bin/tnslsnr LISTENER -inherit
oracle     125     1  0 20:32 ?        00:00:00 ora_pmon_orcl
oracle     127     1  0 20:32 ?        00:00:00 ora_psp0_orcl
oracle     129     1  0 20:32 ?        00:00:00 ora_vktm_orcl
oracle     133     1  0 20:32 ?        00:00:00 ora_gen0_orcl
oracle     135     1  0 20:32 ?        00:00:00 ora_mman_orcl
oracle     139     1  0 20:32 ?        00:00:00 ora_diag_orcl
oracle     141     1  0 20:32 ?        00:00:00 ora_dbrm_orcl
oracle     143     1  0 20:32 ?        00:00:00 ora_dia0_orcl
oracle     145     1  0 20:32 ?        00:00:00 ora_dbw0_orcl
oracle     147     1  0 20:32 ?        00:00:00 ora_lgwr_orcl
oracle     149     1  0 20:32 ?        00:00:00 ora_ckpt_orcl
oracle     151     1  0 20:32 ?        00:00:00 ora_lg00_orcl
oracle     153     1  0 20:32 ?        00:00:00 ora_lg01_orcl
oracle     155     1  0 20:32 ?        00:00:00 ora_smon_orcl
oracle     157     1  0 20:32 ?        00:00:00 ora_reco_orcl
oracle     159     1  0 20:32 ?        00:00:00 ora_lreg_orcl
oracle     161     1  2 20:32 ?        00:00:00 ora_mmon_orcl
oracle     163     1  0 20:32 ?        00:00:00 ora_mmnl_orcl
oracle     165     1  0 20:32 ?        00:00:00 ora_d000_orcl
oracle     167     1  0 20:32 ?        00:00:00 ora_s000_orcl
oracle     179     1  0 20:33 ?        00:00:00 ora_tmon_orcl
oracle     181     1  1 20:33 ?        00:00:00 ora_tt00_orcl
oracle     183     1  0 20:33 ?        00:00:00 ora_smco_orcl
oracle     185     1  1 20:33 ?        00:00:00 ora_fbda_orcl
oracle     187     1  0 20:33 ?        00:00:00 ora_aqpc_orcl
oracle     191     1  0 20:33 ?        00:00:00 ora_cjq0_orcl
root       270    16  0 20:33 ?        00:00:00 grep ora
[root@842e293c16f5 /]#
[root@842e293c16f5 /]#
[root@842e293c16f5 /]#
[root@842e293c16f5 /]#
[root@842e293c16f5 /]# netstat -a
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 842e293c16f5:55512          842e293c16f5:ncube-lm       ESTABLISHED
tcp        0      0 *:52643                     *:*                         LISTEN
tcp        0      0 *:ncube-lm                  *:*                         LISTEN
tcp        0      0 842e293c16f5:ncube-lm       842e293c16f5:55512          ESTABLISHED
tcp        0      0 842e293c16f5:ncube-lm       842e293c16f5:55555          TIME_WAIT
tcp        0      0 842e293c16f5:ncube-lm       842e293c16f5:55503          TIME_WAIT
udp        0      0 localhost:isnetserv         *:*
udp        0      0 localhost:52824             *:*
udp        0      0 localhost:45456             *:*
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node Path
unix  2      [ ACC ]     STREAM     LISTENING     75036  /var/tmp/.oracle/sEXTPROC1521
unix  2      [ ACC ]     STREAM     LISTENING     75035  /var/tmp/.oracle/s#34.1
unix  2      [ ACC ]     STREAM     LISTENING     75037  /var/tmp/.oracle/s#34.2
unix  3      [ ]         STREAM     CONNECTED     75055
unix  3      [ ]         STREAM     CONNECTED     75047
unix  3      [ ]         STREAM     CONNECTED     75052
unix  3      [ ]         STREAM     CONNECTED     75054
unix  3      [ ]         STREAM     CONNECTED     75053
unix  3      [ ]         STREAM     CONNECTED     75048
unix  3      [ ]         STREAM     CONNECTED     75049
unix  3      [ ]         STREAM     CONNECTED     75046
[root@842e293c16f5 /]# netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 172.17.0.44:55512           172.17.0.44:1521            ESTABLISHED
tcp        0      0 :::52643                    :::*                        LISTEN
tcp        0      0 :::1521                     :::*                        LISTEN
tcp        0      0 ::ffff:172.17.0.44:1521     ::ffff:172.17.0.44:55512    ESTABLISHED
tcp        0      0 ::ffff:172.17.0.44:1521     ::ffff:172.17.0.44:55555    TIME_WAIT
tcp        0      0 ::ffff:172.17.0.44:1521     ::ffff:172.17.0.44:55503    TIME_WAIT
udp        0      0 ::1:48128                   :::*
udp        0      0 ::1:52824                   :::*
udp        0      0 ::1:45456                   :::*
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node Path
unix  2      [ ACC ]     STREAM     LISTENING     75036  /var/tmp/.oracle/sEXTPROC1521
unix  2      [ ACC ]     STREAM     LISTENING     75035  /var/tmp/.oracle/s#34.1
unix  2      [ ACC ]     STREAM     LISTENING     75037  /var/tmp/.oracle/s#34.2
unix  3      [ ]         STREAM     CONNECTED     75055
unix  3      [ ]         STREAM     CONNECTED     75047
unix  3      [ ]         STREAM     CONNECTED     75052
unix  3      [ ]         STREAM     CONNECTED     75054
unix  3      [ ]         STREAM     CONNECTED     75053
unix  3      [ ]         STREAM     CONNECTED     75048
unix  3      [ ]         STREAM     CONNECTED     75049
unix  3      [ ]         STREAM     CONNECTED     75046
[root@842e293c16f5 /]#



[root@842e293c16f5 /]# su - oracle
[oracle@842e293c16f5 ~]$
[oracle@842e293c16f5 ~]$
[oracle@842e293c16f5 ~]$ env
HOSTNAME=842e293c16f5
SHELL=/bin/bash
TERM=xterm
HISTSIZE=1000
USER=oracle
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:
MAIL=/var/spool/mail/oracle
PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin
PWD=/home/oracle
LANG=en_US.UTF-8
HISTCONTROL=ignoredups
SHLVL=1
HOME=/home/oracle
LOGNAME=oracle
LESSOPEN=||/usr/bin/lesspipe.sh %s
G_BROKEN_FILENAMES=1
_=/bin/env
[oracle@842e293c16f5 ~]$ . oraenv
ORACLE_SID = [oracle] ? orcl
The Oracle base has been set to /oracle
[oracle@842e293c16f5 ~]$
[oracle@842e293c16f5 ~]$
[oracle@842e293c16f5 ~]$ env
HOSTNAME=842e293c16f5
SHELL=/bin/bash
TERM=xterm
HISTSIZE=1000
USER=oracle
LD_LIBRARY_PATH=/oracle/product/12.1/db/lib
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:
ORACLE_SID=orcl
ORACLE_BASE=/oracle
MAIL=/var/spool/mail/oracle
PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin:/oracle/product/12.1/db/bin
PWD=/home/oracle
LANG=en_US.UTF-8
HISTCONTROL=ignoredups
SHLVL=1
HOME=/home/oracle
LOGNAME=oracle
LESSOPEN=||/usr/bin/lesspipe.sh %s
ORACLE_HOME=/oracle/product/12.1/db
G_BROKEN_FILENAMES=1
_=/bin/env
[oracle@842e293c16f5 ~]$ sqlplus /nolog

SQL*Plus: Release 12.1.0.1.0 Production on Thu Jul 30 20:36:16 2015

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

SQL> connect / as sysdba
Connected.
SQL>


[oracle@842e293c16f5 ~]$ lsnrctl status

LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 30-JUL-2015 20:37:55

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=842e293c16f5)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date                30-JUL-2015 20:32:54
Uptime                    0 days 0 hr. 5 min. 1 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/12.1/db/network/admin/listener.ora
Listener Log File         /oracle/diag/tnslsnr/842e293c16f5/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=842e293c16f5)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "orcl.example.com" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB.example.com" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@842e293c16f5 ~]$

@wwarlock
Copy link
Contributor Author

Yes, now I see too.
I forgot about n key in the netstat.
The port is active. The sqlplus / as sysdba and sqlplus sys/Welcome01 as sysdba commands works too.
But the sqlplus sys/Welcome01@orcl as sysdba command not working because of incorrect tnsname:

[oracle@782d32fab664 ~]$ tnsping orcl

TNS Ping Utility for Linux: Version 12.1.0.1.0 - Production on 30-JUL-2015 20:56:19

Copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:
/oracle/product/12.1/db/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = cef1db7c4dbd)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl.example.com)))
TNS-12545: Connect failed because target host or object does not exist

Though it works from outside of container. I've succesfully connected to it through JDBC, for example.

Many thanks for your advice and project once more.

@biemond
Copy link
Owner

biemond commented Jul 31, 2015

Perfect,

tnsnames and listener is a bit tricky because every container has its own hostname, ip etc and you cannot use a fix one ( and not allowed in docker ).

So I am updating the listener.ora and probably also need to do this for the tnsnames.ora. But the need for using tnsnames inside the box is not really necessary.

have fun

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

2 participants