GithubHelp home page GithubHelp logo

wnameless / docker-oracle-xe-11g Goto Github PK

View Code? Open in Web Editor NEW
1.3K 73.0 802.0 402.69 MB

Dockerfile of Oracle Database Express Edition 11g Release 2

License: Apache License 2.0

Shell 96.58% Dockerfile 3.42%
oracle-11g dockerfile

docker-oracle-xe-11g's People

Contributors

bneumann-conservis avatar bpneumann avatar candrews avatar d1231 avatar darylbanttaripearson avatar devfbe avatar jenaye avatar marcosvidolin avatar morozov avatar nicolo-ribaudo avatar nubs avatar ramon-balaguer avatar wnameless avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-oracle-xe-11g's Issues

disable password expiration

The password_life_time is currently set to 180 which results in SYSTEM and custom users being locked out after 180 days. PASSWORD_VERIFY_FUNCTION=NULL doesn't seem to be enough if PASSWORD_LIFE_TIME is set to 180.

The workaround is to execute the following queries at the beginning of the init script, before any other users are created. It would be nice to have this address on the image level. Thank you!

alter profile DEFAULT limit password_life_time UNLIMITED;
alter user SYSTEM identified by oracle account unlock;

docker build error

Setting up libexpat1:amd64 (2.1.0-7ubuntu0.16.04.2) ...
Setting up python3.5-minimal (3.5.2-2ubuntu0~16.04.1) ...
Fatal Python error: getrandom() failed
Aborted (core dumped)

dpkg: error processing package python3.5-minimal (--configure):
subprocess installed post-installation script returned error exit status 134
dpkg: dependency problems prevent configuration of python3-minimal:
python3-minimal depends on python3.5-minimal (>= 3.5.1-2~); however:
Package python3.5-minimal is not configured yet.

dpkg: error processing package python3-minimal (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Errors were encountered while processing:
python3.5-minimal
python3-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)

init scripts move causes failure for volumes

since the commit: feadff2 I have a problem, that script that I used for DB initialization propagated to container via volume now causes volume failure on startup.

my docker-compose chunk:

version: "3.0"

services:   

oracle:
	image: wnameless/oracle-xe-11g:latest
	ports:
  	- "1522:1521"
  	- "8081:8080"
	volumes:
  	- ./script/docker/oracle/create_user.sql:/docker-entrypoint-initdb.d/create_user.sql

running docker-compose up results in:

oracle_1    | mv: cannot move '/docker-entrypoint-initdb.d/create_user.sql' to '/docker-entrypoint-initdb.d.bak/create_user.sql': Device or resource busy    
[secure]_oracle_1 exited with code 1

(full log: https://travis-ci.org/p6spy/p6spy/jobs/268948826 )

What would be the proper way to propagate the script to container? Obviously volume I used to use before is not working any more.

Honestly I don't consider modifying (in the particular case: moving to another location) init scripts a good idea, other DBs don't do that, as far as I can see:

would you mind rolling back to original behaviour?

What was the motivation behind this change? Am I now forced to build new container (FROM wnameless/oracle-xe-11g ... ADD ./script/docker/oracle/create_user.sql /docker-entrypoint-initdb.d/ ) to support the init script functionality?

Restarting docker image wipes out all Oracle DB data

I stop and start Docker container and I see that all of my Oracle DB data is wiped out. Why ?
I see that someone has posted to run like this:
docker run -d -p 49160:22 -p 49161:1521 -e ORACLE_ALLOW_REMOTE=true -v /local_path/to/oracle_home:/u01/app/oracle wnameless/oracle-xe-11g
When i try above option for mounting the volume to host machine I get following error:

cp: cannot stat '/u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora.tmpl': No such file or directory
/usr/sbin/startup.sh: line 19: sqlplus: command not found
/usr/sbin/startup.sh: ignoring /docker-entrypoint-initdb.d/*

Cannot use this image in travis-ci due errors ORA-12528 and TNS-00515

First of all thanks for image.
I want to use it in my integration tests on travis-ci in my project
But I cannot connect to database due
ORA-12528, TNS:listener: all appropriate instances are blocking new connections

I try to wait 10 min after image starts and then restart oracle listener, but with no luck.

Sample build with error
with the sample travis.yml

$ docker exec -i oracle bash -c '/u01/app/oracle/product/11.2.0/xe/bin/lsnrctl start'

LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 02-DEC-2016 18:10:18

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

Message 1070 not found; No message file for product=network, facility=TNSTNS-12545: Message 12545 not found; No message file for product=network, facility=TNS

 TNS-12560: Message 12560 not found; No message file for product=network, facility=TNS

  TNS-00515: Message 515 not found; No message file for product=network, facility=TNS

   Linux Error: 2: No such file or directory

System user's password expired (in grace period)

This image used to work fine. A couple of days ago the init script for our database started throwing errors/warnings because the system user's password is about to expire in 7 (today, 22.08.2017) days.

We worked around this by connecting as "sys as sysdba" and unlocking the system account.

Can the image be rebuilt with a non-expiring system account?

Error when running SQL commands- ORA-01034: ORACLE not available

Hi,

I just tried to use this oracle image but I am getting the following error for any command that I issue.

ORA-01034: ORACLE not available

Following are the steps I did:

docker pull wnameless/docker-oracle-xe-11g
docker run -d --name oracledb -p 41960:22 -p 49161:1521 wnameless/oracle-xe-11g
ssh root@localhost -p 41960

On providing the password, it logs in and then to the SQL prompt as well but can't do anything since then. The screen also shows Connected to an idle instance.!
Could someone help me out with this immediately?

oracledockererror

Thanks very much!

How to execute init sql scripts?

hi!I want my container to execute init.sql when container startup.I tried my ways,but it didn't work.Thanks for help!!!!!

dockerfile
FROM wnameless/oracle-xe-11g:14.04.4
ADD init.sql /docker-entrypoint-initdb.d/
ADD init.sh /docker-entrypoint-initdb.d/
WORKDIR /docker-entrypoint-initdb.d/
RUN chmod +x init.sh
CMD ["sh", "/docker-entrypoint-initdb.d/init.sh"]

init.sh
#!/bin/bash
/usr/sbin/startup.sh
/usr/sbin/sshd -D

sqlplus -S /nolog >test.log <<EOF
conn system/oracle
@init.sql
exit
EOF
~

Connection not work in node-oracledb

I run this docker in a Azure VM and now I want to access from my personal computer (Not from azure VM) with node-oracledb.

I replace this:

hostname: localhost
port: 49161
sid: xe
username: system
password: oracle

To this:

{
    "user":  "system",
    "password": "oracle",
    "connectString": "//myIP:49161/xe" 
}

Replacing myIP to my Azure Virtual IP

But not work... Any suggestions? Thank you very much! ๐Ÿ˜Š

connecting through PHP, no ORA-12541: TNS:no listener

Hello, thanks for your help.

I'm using your image with docker compose, to connect my PHP(laravel 5) application to this image.

I use these configurations

        'oracle' => array(
            'driver' => "oracle",
            'host' => "127.0.0.1",
            'port' => "1521",
            'username' => 'system',
            'password' => 'oracle',
            'charset' => 'AL32UTF8',
            'prefix' => '',
            'tns' => '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=xe)))',
            'service_name' => 'xe',
        )

I keep getting error messages:

Oci8Exception in Oci8.php line 454: ORA-12541: TNS:no listener

Even though I am able to connect using Navicat and Toad for Oracle.

Any ideas ?

Create a Dockerfile which works with the original Oracle installer

The current image violates the Oracle 11g Express license which prevents me from using your work.

Can you please create a second Dockerfile which contains the commands necessary to convert the RPM into the split DEB archive (which I can then copy out to replace the files you provide) or, even better, a Dockerfile which installs from the downloaded RPM (i.e. which contains the commands to convert the RPM to DEB, installs and then deletes the RPM and DEP archives).

Cannot connect to the DB

I can no longer connect to the DB after running this docker image on my mac. It used to work fine

docker pull wnameless/oracle-xe-11g
docker run -d -p 49160:22 -p 49161:1521 -e ORACLE_ALLOW_REMOTE=true wnameless/oracle-xe-11g

Cannot connect using the below
hostname: localhost
port: 49161
sid: xe
username: system
password: oracle

Error in docker logs
Starting Oracle Net Listener.
Starting Oracle Database 11g Express Edition instance.

ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0

SP2-0306: Invalid option.
Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM}] [edition=value]]
where ::= [/][@<connect_identifier>]
::= [][/][@<connect_identifier>]
/usr/sbin/startup.sh: ignoring /docker-entrypoint-initdb.d/*

OID generation failed

I never had problems with this container, however today I get this message:

Connection Failed

ORA-21561: OID generation failed

Any idea? Thanks.

OS X 10.10

the image can't run

I have the same problem at here: #50
I have tried your two version :16/14,both failed for the same reason.
how can I fix it?

setting disk_asynch_io = false improves rspec unit test elapsed time when running on Travis CI Trusty

Thanks for providing useful Dockerfile to run Oracle XE 11g. Oracle enhanced adapter unit tests at Travis CI rely on this Dockerfile.

This is not an issue but wanted to inform my experience. Recently Travis CI Ubuntu is migrating from Ubuntu Precise (12.04) to Ubuntu Trusty(14.04) then Oracle enhanced adapter unit tests elapsed time is getting slower.

I opened a support request with Travis CI and finally this slowness has been resolved by setting disk_asynch_io = false

Here are elapsed time differences between these settings/OS version.

CRuby about 4 min
JRuby about 7 min

CRuby about 8 min
JRuby about 26 min

CRuby about 4 min
JRuby about 10 min

please feel free to close this issue since I just wanted to inform this parameter change.
Thanks.

Yesterday I was able to run this image but not today!

First of all, thank you for your job!

I created a virtual machine with Ubuntu 16.04 x64, I installed docker and then I ran:

docker pull wnameless/oracle-xe-11g
docker run -d -p 49160:22 -p 49161:1521 -e ORACLE_ALLOW_REMOTE=true wnameless/oracle-xe-11g

I could do sqlplus system/oracle without any problem.

Today I tried the same in another fresh virtual machine and I did the same, but every time I do sqlplus system/oracle I see:

SQL*Plus: Release 11.2.0.2.0 Production on Fri Dec 2 19:57:58 2016

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

ERROR:
ORA-01033: ORACLE initialization or shutdown in progress
Process ID: 0
Session ID: 0 Serial number: 0

What I'm missing?

how to wait on db

It takes a while for the db to be ready for a connection, so when I start my stack with docker-compose, my client app breaks. I have set my client app to check and wait for the tcp listener, but it takes awhile longer for the database to actually be ready. What is a successful pattern of using wnameless/docker-oracle-xe-11g in a stack?

init scripts to be executed only once

Hi,

I have an automated exported SQL script I use to initialize the database. My expectation is this init script to be executed only once, for initialization purpose. Now they are executed every time I start the container.

As a reference, please have a look to official MySQL docker image to see how it only executes the init scripts if the database is not initialized:

https://github.com/docker-library/mysql/blob/master/8.0/docker-entrypoint.sh

You can see:
if [ ! -d "$DATADIR/mysql" ]; then
...
for f in /docker-entrypoint-initdb.d/*; do
case "$f" in
*.sh) echo "$0: running $f"; . "$f" ;;
*.sql) echo "$0: running $f"; "${mysql[@]}" < "$f"; echo ;;
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${mysql[@]}"; echo ;;
*) echo "$0: ignoring $f" ;;
esac
echo
done
...
fi

Listener does not know the SID xe (remote)

I'm using this commannd to start the oracle docker in an amazon ec2:
docker run -d -p 49160:22 -p 49161:1521 -e ORACLE_ALLOW_REMOTE=true wnameless/oracle-xe-11g

But when i try to connect it in my develop machine sql developer, it says the listener does not currently know the SID xe.

I read about it happening when you try to connect from remote but i'm using the ORACLE_ALLOW_REMOTE X.X

anyone knows what can i do?

User Name and Password for the Web Console

Hi,
This is not an issue per say rather a question
Can you help with logging into Apex web console? I have tried sys/oracle and system/oracle but both won't work.

Thanks,
Shoaib

New commit image increase 2 Gb

Something I confuse is that when I change little things(for example, add a new user) in conteneur Oracle, then I commit this conteneur, why everytime it add 2 Gb into image? How can I avoid this ?
Thank you

Make log available on STDOUT

Is it possible to log to stdout?
This will make it easy to see the logs using docker log <container>.

It would also be nice to be able to change the loglevel via environment variable.

First run takes long time on startup.

Since the last update, we have discovered that the startup of the container the first time takes several minutes, compared to starting later on which takes seconds. This have been tested on newly started, clean amazon instances.

Commands run:

docker run -d -p 49160:22 -p 49161:1521 wnameless/oracle-xe-11g
docker exec -it <name> bash

When trying to access the db with

sqlplus system/oracle

we get the following error messages

SQL*Plus: Release 11.2.0.2.0 Production on Thu May 7 07:43:10 2015

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

ERROR:
ORA-01033: ORACLE initialization or shutdown in progress
Process ID: 0
Session ID: 0 Serial number: 0

First startup

Thu May 07 00:00:45 2015
ALTER DATABASE OPEN
Thu May 07 00:06:16 2015
Thread 1 opened at log sequence 3
Current log# 1 seq# 3 mem# 0: /u01/app/oracle/fast_recovery_area/XE/onlinelog/o1_mf_1_bbqv44l7_.log
Successful open of redo thread 1
Thu May 07 00:06:16 2015
SMON: enabling cache recovery
Thu May 07 00:06:17 2015
[100] Successfully onlined Undo Tablespace 2.
Undo initialization finished serial:0 start:173426 end:173646 diff:220 (2 seconds)
Verifying file header compatibility for 11g tablespace encryption..
Verifying 11g file header compatibility for tablespace encryption completed
SMON: enabling tx recovery
Database Characterset is AL32UTF8
Opening with Resource Manager plan: INTERNAL_PLAN_XE
Thu May 07 00:06:17 2015
Starting background
process VKRM
Thu May 07 00:06:17 2015
VKRM started with pid=23, OS id=125
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC
Thu May 07 00:06:18 2015
QMNC started with pid=24, OS id=127
Completed: ALTER DATABASE OPEN
Thu May 07 00:06:18 2015

Second startup

Thu May 07 00:10:41 2015
ALTER DATABASE OPEN
Thu May 07 00:10:49 2015
Thread 1 opened at log sequence 3
Current log# 1 seq# 3 mem# 0: /u01/app/oracle/fast_recovery_area/XE/onlinelog/o1_mf_1_bbqv44l7_.log
Successful open of redo thread 1
Thu May 07 00:10:50 2015
SMON: enabling cache recovery
[92] Successfully onlined Undo Tablespace 2.
Undo initialization finished serial:0 start:446776 end:446796 diff:20 (0 seconds)
Verifying file header compatibility for 11g tablespace encryption..
Verifying 11g file header compatibility for tablespace encryption completed
SMON: enabling tx recovery
Thu May 07 00:10:54 2015
Database Characterset is AL32UTF8
Opening with Resource Manager plan: INTERNAL_PLAN_XE
Thu May 07 00:10:54 2015
Starting background p
rocess VKRM
Thu May 07 00:10:54 2015
VKRM started with pid=23, OS id=95
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC
Thu May 07 00:10:54 2015
QMNC started with pid=24, OS id=97
Completed: ALTER DATABASE OPEN

ORACLE not available when i run this image

hi team, i use this image to run a oracle container on centos 7, but when i run this, these error throw out, what mistake i made ?

Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM}] [edition=value]]

where ::= [/][@<connect_identifier>]
::= [][/][@<connect_identifier>]
/usr/sbin/startup.sh: ignoring /docker-entrypoint-initdb.d/*
Starting Oracle Net Listener.
Starting Oracle Database 11g Express Edition instance.
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0
SP2-0306: Invalid option.
Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM}] [edition=value]]
where ::= [/][@<connect_identifier>]
::= [][/][@<connect_identifier>]

Image probably doesn't need SSL (suggestion)

If I execute

docker exec -it <name_of_running_container> bash

then I will have a shell on the running container.

So, I don't see a need for ssh on this container and in general it is best to keep things as clean as possible and with as few running processes as possible.

Just a suggestion that you can likely remove SSH from this image.

Default listener listens to wrong interface

Hi,

when running a wnameless/docker-oracle-xe-11g container using docker-compose with a configured link to another container, you got more than one interface.
The listener listens to the docker interface of the host, but I expected that it listens to the docker-compose interface.
Example:
docker interface: eth1
IP: 172.18.0.4
docker-compose interface: eth2
IP: 10.0.0.5

/etc/hosts is also configured to use the eth2 IP:
10.0.0.5 f4c4a3638c11

hostname resolves into eth2 IP. The linked docker-compose container reaches the wnameless/docker-oracle-xe-11g container through the eth2 IP address as well.

Default listener:

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
      (PROGRAM = extproc)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
      (ADDRESS = (PROTOCOL = TCP)(HOST = f4c4a3638c11)(PORT = 1521))
    )
  )

DEFAULT_SERVICE_LISTENER = (XE)

A fix could be an environment variable that sets a specific interface or using the configured IP address in /etc/hosts instead of the hostname.

If you need more information please have a look at this link or just ask:
https://stackoverflow.com/questions/46254132/jdbc-connection-between-docker-containers-docker-compose

Can't "sqlplus"

While ssh'ed in -p 49160, when I run "sqlplus system/oracle" I get the following error:


SQL*Plus: Release 11.2.0.2.0 Production on Mon Oct 17 18:39:48 2016

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

ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0

did the username and password change?

Hard-coded container name in tnsnames.ora

The published image on dockerhub keep a bad hostname in the tnsnames.ora.

$ cat /u01/app/oracle/product/11.2.0/xe/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File:                             

XE =                                                                   
  (DESCRIPTION =                                                       
    (ADDRESS = (PROTOCOL = TCP)(HOST = 914cf42a3e15)(PORT = 1521))     
    (CONNECT_DATA =                                                    
      (SERVER = DEDICATED)                                             
      (SERVICE_NAME = XE)                                              
    )                                                                  
  )                                                                    

EXTPROC_CONNECTION_DATA =                                              
  (DESCRIPTION =                                                       
    (ADDRESS_LIST =                                                    
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))               
    )                                                                  
    (CONNECT_DATA =                                                    
      (SID = PLSExtProc)                                               
      (PRESENTATION = RO)                                              
    )                                                                  
  )                                                                    

It must depend on the container name when building the image.
I spent some time understanding it when using sqlplus commands :-)

A workaround would be to add this host to /etc/hosts when building.
Adding in a RUN :

echo -e "\n$(hostname)  127.0.0.1" >> /etc/hosts

Not sure it's the only file referencing the container hostname.

Avoid long delay during SSH login

Hi, may I suggest to add the following line to the dockerfile to disable DNS reverse lookup at SSH login time?

echo "UseDNS no" >> /etch/ssh/sshd_config

Regards,
R

Invalid installation folders

I have just used the docker file to create a new container.
Once done and the docker run command issued I accessed the container via the docker exec -it {containerId} bash only to find that oracle was not running. After much searching I discovered that the install had installed oracle to this path:
/u01/app/oracle/oracle-product rather than where I expected it to be eg: /u01/app/oracle/product.

I modified the setup.sh script and moved all of the lines under:

dpkg --install /home/assets/oracle-xe_11.2.0-1.0_amd64.deb &&

and moved them to the top of the startup.sh script and added as the first command line:
mv /u01/app/oracle/oracle-product /u01/app/oracle/product

This fixed the problem and oracle now starts.

I am just curious as to why the installer installed to .../oracle/oracle-product rather than .../oracle/product

Ian

Different environment variables values on root user

Hello,
may someone please tell me why I get very different environment variables values in the following cases:

  1. docker exec -it reteyel_oracle env
  2. docker exec -it reteyel_oracle bash -c "env"
  3. launching the bash on the container with "docker exec -it reteyel_oracle bash" and then launching "env" from the shell
    ?
    I'd expect to have the same environment in the three but it is very different indeed...

The same does not happen with other docker images.
Do someone know why?

wnameless/xe-temp

Would you care to elaborate what's inside wnameless/xe-temp?

Thanks in advance

Shutown and startup fails when I try creating a Backup

After I have started the docker instance and ssh in I try to follow these commands:

shutdown immediate;
startup mount;

I get a
RMAN-03002: failure of startup command at 09/27/2016 19:14:14
RMAN-06171: not connected to target database

examples such as this one seem to do this fine.
http://stackoverflow.com/questions/6946586/database-not-open

The goal is to create a backup of our oracledb for testing purposes, but we need to close the database, backup, and remount the database in order to do this. Currently all we've been able to do is shutdown the database, and restart the docker instance to get it back up.

Please help us with creating a backup file.

ORA-12545 because of tnsnames.ora entry

Not sure if something could be done, but when trying to explicitely connect to XE from docker itself I got ORA-12545 Connect failed because target host or object does not exist.
Checking with LSNRCTL I found the following

LSNRCTL> status XE
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=33817b96c0aa)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=XE)))
TNS-12545: Connect failed because target host or object does not exist
 TNS-12560: TNS:protocol adapter error
  TNS-00515: Connect failed because target host or object does not exist
   Linux Error: 110: Connection timed out

I can see docker is giving me a different hostname: (d57f5951434b), so updating the file solved this. I don't know if this could or should be achieved programatically in the startup.sh

Im running elementary OS 0.3.2 64 bits (Ubuntu 14.04) with 14.04 xe image and custom DNS in the run parameters.

ORA-01034: ORACLE not available on startup

Hi,

after I lunch the container with 2 sql files to initialize the db I get the following errors:

Starting Oracle Net Listener.
Starting Oracle Database 11g Express Edition instance.
/usr/sbin/startup.sh: running /docker-entrypoint-initdb.d/1-create-tables.sql
SQL*Plus: Release 11.2.0.2.0 Production on Wed Dec 7 16:33:25 2016
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0
Enter user-name: Enter password: 
ERROR:
ORA-01005: null password given; logon denied
Enter user-name: 
/usr/sbin/startup.sh: running /docker-entrypoint-initdb.d/1-insert-alerts.sql
SQL*Plus: Release 11.2.0.2.0 Production on Wed Dec 7 16:33:25 2016
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0
Enter user-name: Enter password: 
ERROR:
ORA-01005: null password given; logon denied
Enter user-name: 

I start it with:

docker run -d -p 49160:22 -p 49161:1521 oracle

And I create oracle from this Dockerfile

FROM wnameless/oracle-xe-11g

# Initialise with testing data
ADD database_creation.sql /docker-entrypoint-initdb.d/1-create-tables.sql
ADD alerts.sql /docker-entrypoint-initdb.d/1-insert-alerts.sql

Users

Is it possible to change the sys/system password? In order to give different privileges.

Delete files after executing them

Would it make sense to delete SQL scripts added to docker-entrypoint-initdb.d after executing them? That way they will not be executed twice when the same container is stopped and stared again.

ORA-24324: service handle not initialized

Update :
My host is CentOS 7.0 64bit.
The image runs on Ubuntu. I think the issue is the difference of distrib.

Do exactly what the doc. says, ie connecting to the container with ssh, then within :
sqlplus /nolog
connect sys as sysdba
startup
ORA-03113: end-of-file on communication channel
startup mount
ORA-24324: service handle not initialized

In log I can see that
Exception [type: SIGSEGV, Address not mapped to object]

docker version:

Client:
Version: 1.10.3
API version: 1.22
Package version: docker-common-1.10.3-44.el7.centos.x86_64
Go version: go1.4.2
Git commit: 9419b24-unsupported
Built: Fri Jun 24 12:09:49 2016
OS/Arch: linux/amd64

Server:
Version: 1.10.3
API version: 1.22
Package version: docker-common-1.10.3-44.el7.centos.x86_64
Go version: go1.4.2
Git commit: 9419b24-unsupported
Built: Fri Jun 24 12:09:49 2016
OS/Arch: linux/amd64

sysdba

Is there a way to connect as sysdba? I need to grant the ability to access utl_file to the system user.

init.sql cannot work around.

hii, my init.sql can't work around, user can create success, but table can't create, can u help me ,thanks a lot. my init.sql content is below.

sqlplus system/oracle;

create user alexander identified by rtm;
alter user alexander account unlock;
grant create session to alexander;
grant dba to alexander;
GRANT CREATE USER,DROP USER,ALTER USER ,
CREATE ANY VIEW , DROP ANY VIEW,
EXP_FULL_DATABASE,IMP_FULL_DATABASE,
DBA,CONNECT,RESOURCE,CREATE SESSION TO alexander;

connect alexander/rtm;

CREATE TABLE PT_TD_GROUP
(
GROUP_ID VARCHAR2(32) NOT NULL,
GROUP_NAME VARCHAR2(64) NOT NULL,
GROUP_TYPE INTEGER NOT NULL,
GROUP_PARENTID VARCHAR2(32),
GROUP_MTIME TIMESTAMP NOT NULL,
GROUP_CTIME TIMESTAMP NOT NULL,
GROUP_INDEX INTEGER,
GROUP_DESC VARCHAR2(512),
CONSTRAINT PK_PT_TD_GROUP PRIMARY KEY (GROUP_ID)
);
CREATE TABLE PT_TD_STAT
(
STAT_TASKID VARCHAR2(32) NOT NULL,
TASK_NAME VARCHAR2(64),
STAT_STIME DATE,
STAT_FAILED INTEGER,
STAT_SUCCESS INTEGER,
STAT_RUNNING INTEGER,
STAT_AVGTIME INTEGER,
STAT_TOTALTIME INTEGER,
STAT_ETIME DATE,
STAT_MAXTIME INTEGER,
STAT_MINTIME INTEGER,
CONSTRAINT PK_PT_TD_STAT PRIMARY KEY (STAT_TASKID)
);
CREATE TABLE PT_TD_TASK
(
TASK_ID VARCHAR2(32) NOT NULL,
TEC_ID VARCHAR2(32) NOT NULL,
GROUP_ID VARCHAR2(32) NOT NULL,
TASK_NAME VARCHAR2(64) NOT NULL,
TASK_STATUS VARCHAR2(64),
TASK_TIMEOUT INTEGER,
TASK_TRGTYPE VARCHAR2(64) NOT NULL,
TASK_STIME DATE,
TASK_ETIME DATE,
TASK_TRGTIMES INTEGER,
TASK_TRGINTERVAL INTEGER,
TASK_INTERVALUNIT VARCHAR2(64),
TASK_CRON VARCHAR2(64),
TASK_INDEX INTEGER,
TASK_CTIME TIMESTAMP,
TASK_MTIME TIMESTAMP,
TASK_DESC VARCHAR2(512),
CONSTRAINT PK_PT_TD_TASK PRIMARY KEY (TASK_ID)
);

unable to run init sql files

i tried adding init.sql into docker, but it is not doing anything.

i tried creating users in that sql file, is it possible ?

my docker file is

# Dockerfile
FROM wnameless/oracle-xe-11g

ADD init.sql /docker-entrypoint-initdb.d/

and my init.sql file is

CREATE user KAR_MASTER identified by KAR_ax;
GRANT create session to KAR_MASTER;
GRANT create table to KAR_MASTER;
GRANT CREATE CLUSTER to KAR_MASTER;
GRANT CREATE SYNONYM to KAR_MASTER;
GRANT CREATE VIEW to KAR_MASTER;
GRANT CREATE SEQUENCE to KAR_MASTER;
GRANT CREATE DATABASE LINK to KAR_MASTER;
GRANT CREATE PUBLIC DATABASE LINK to KAR_MASTER;
GRANT CREATE PROCEDURE to KAR_MASTER;
GRANT CREATE TRIGGER to KAR_MASTER;
GRANT CREATE MATERIALIZED VIEW to KAR_MASTER;
GRANT CREATE TYPE to KAR_MASTER;
GRANT CREATE OPERATOR to KAR_MASTER;
GRANT CREATE INDEXTYPE to KAR_MASTER;
GRANT CREATE DIMENSION to KAR_MASTER;
GRANT CREATE ANY CONTEXT to KAR_MASTER;
GRANT CREATE JOB to KAR_MASTER;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.