I have the following issus with DB 18c XE.
(on screen) issues when building image (./buildDockerImage.sh -v 18.4.0 -x):
Installing : binutils-2.27-34.base.0.1.el7.x86_64 11/120
install-info: /usr/share/info/dir: could not read (No such file or directory) and could not create (No such file or directory)
install-info: /usr/share/info/dir: could not read (No such file or directory) and could not create (No such file or directory)
install-info: /usr/share/info/dir: could not read (No such file or directory) and could not create (No such file or directory)
install-info: /usr/share/info/dir: could not read (No such file or directory) and could not create (No such file or directory)
install-info: /usr/share/info/dir: could not read (No such file or directory) and could not create (No such file or directory)
Installing : GeoIP-1.5.0-13.el7.x86_64 12/120
...
Installing : systemd-219-62.0.4.el7_6.5.x86_64 71/120
Failed to get D-Bus connection: Operation not permitted
Installing : elfutils-default-yama-scope-0.172-2.el7.noarch 72/120
...
Installing : ksh-20120801-139.0.1.el7.x86_64 85/120
failed to link /usr/share/man/man1/ksh.1.gz -> /etc/alternatives/ksh-man: No such file or directory
Installing : openssh-7.4p1-16.el7.x86_64 86/120
...
Installing : oracle-database-preinstall-18c-1.0-1.el7.x86_64 116/120
[WARNING] Container parameters not found, skipping parameters modification
Installing : oracle-database-xe-18c-1.0-1.x86_64 117/120
[INFO] Executing post installation scripts...
[INFO] Oracle home installed successfully and ready to be configured.
To configure Oracle Database XE, optionally modify the parameters in '/etc/sysconfig/oracle-xe-18c.conf' and then execute '/etc/init.d/oracle-xe-18c configure' as root.
...
[Warning] One or more build-args [DB_EDITION] were not consumed
Successfully built a00980fc4ba1
Successfully tagged oracle/database:18.4.0-xe
Oracle Database Docker Image for 'xe' version 18.4.0 is ready to be extended:
--> oracle/database:18.4.0-xe
Build completed in 443 seconds.
Running image:
docker run -dit --name oracledb_18cXE \
-p 1521:1521 -p 5500:5500 \
-e ORACLE_PWD=oracle \
-v /srv/oracle_db/18cXE/oradata:/opt/oracle/oradata \
-v /srv/oracle_db/18cXE/scripts/startup:/opt/oracle/scripts/startup \
-v /srv/oracle_db/18cXE/scripts/setup:/opt/oracle/scripts/setup \
oracle/database:18.4.0-xe
Container is now in unhealthy status with the following in docker logs:
********
Enter PDBADMIN User Password:
********
Prepare for db operation
Cannot create directory "/opt/oracle/oradata/XE".
7% complete
Copying database files
29% complete
100% complete
[FATAL] Recovery Manager failed to restore datafiles. Refer logs for details.
7% complete
0% complete
Look at the log file "/opt/oracle/cfgtoollogs/dbca/XE/XE.log" for further details.
Database configuration failed. Check logs under '/opt/oracle/cfgtoollogs/dbca'.
mkdir: cannot create directory '/opt/oracle/oradata/dbconfig': Permission denied
mv: cannot stat '/opt/oracle/product/18c/dbhomeXE/dbs/spfileXE.ora': No such file or directory
mv: cannot move '/opt/oracle/product/18c/dbhomeXE/dbs/orapwXE' to '/opt/oracle/oradata/dbconfig/XE/': No such file or directory
mv: cannot move '/opt/oracle/product/18c/dbhomeXE/network/admin/listener.ora' to '/opt/oracle/oradata/dbconfig/XE/': No such file or directory
mv: cannot move '/opt/oracle/product/18c/dbhomeXE/network/admin/tnsnames.ora' to '/opt/oracle/oradata/dbconfig/XE/': No such file or directory
cp: cannot create regular file '/opt/oracle/oradata/dbconfig/XE/': No such file or directory
ln: failed to create symbolic link '/opt/oracle/product/18c/dbhomeXE/dbs/orapwXE': File exists
cp: cannot stat '/opt/oracle/oradata/dbconfig/XE/oratab': No such file or directory
The Oracle base remains unchanged with value /opt/oracle
#####################################
########### E R R O R ###############
DATABASE SETUP WAS NOT SUCCESSFUL!
Please check output for further info!
########### E R R O R ###############
#####################################
The following output is now a tail of the alert.log:
Changing di2dbun from xe to XE
.... (PID:625): Redo network throttle feature is disabled at mount time
2019-03-11T19:38:48.102480+00:00
Successful mount of redo thread 1, with mount id 2883773187
2019-03-11T19:38:48.103177+00:00
Database mounted in Exclusive Mode
Lost write protection disabled
.... (PID:625): Using STANDBY_ARCHIVE_DEST parameter default value as /opt/oracle/product/18c/dbhomeXE/dbs/arch [krsd.c:17717]
Create Relation IPS_PACKAGE_UNPACK_HISTORY
Completed: ALTER DATABASE MOUNT
Can you please share docker info with us. Looks like some binaries couldn't be installed correctly during the image build.
Sure. Here it goes.
Containers: 3
Running: 3
Paused: 0
Stopped: 0
Images: 14
Server Version: 18.09.3
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: e6b3f5632f50dbc4e9cb6288d911bf4f5e95b18e
runc version: 6635b4f0c6af3810594d2770f662f34ddc15b40d
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.20.15-200.fc29.x86_64
Operating System: Fedora 29 (Server Edition)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 15.37GiB
Name: storage.localdomain
ID: ETUC:LOFC:ZENS:STMB:USAL:T4CH:KMZK:LE3G:GHNQ:E5OQ:H4TR:IR2X
Docker Root Dir: /docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
Hm, that looks all correct, Perhaps the rpm install isn't actually the root cause but just a red herring. I just noticed this error when running the container:
mkdir: cannot create directory '/opt/oracle/oradata/dbconfig': Permission denied
Can you verify that the user inside the container has write permissions to /srv/oracle_db/18cXE/oradata? Looks like it doesn't and hence the database cannot be created there.
Sorry for the late answer, I had some other work to do.
I'm not sure what you mean by checking if the user inside container has write permisions. I'm running all docker stuff as a root user, and the directories have also root privileges:
drwxr-xr-x. 3 root root 4096 Apr 4 17:16 .
drwxr-xr-x. 7 root root 4096 Mar 16 15:26 ..
-rwxr--r--. 1 root root 1095 Mar 11 17:52 COPYRIGHT
drwxr-xr-x. 7 root root 4096 Mar 11 17:52 dockerfiles
-rwxr--r--. 1 root root 2918 Mar 11 17:52 FAQ.md
-rwxr--r--. 1 root root 10 Mar 11 17:52 .gitignore
-rwxr--r--. 1 root root 1865 Mar 11 17:52 LICENSE
-rwxr--r--. 1 root root 15125 Mar 11 17:52 README.md
-rwxr-xr-x. 1 root root 332 Apr 4 17:00 run_docker.sh
Maybe the problem is little bit different. When I run my script run_docker.sh (just a commands, so I don't have to do it manually next time I need):
docker run -dit --restart unless-stopped --name orcl_18cXE \
-p 15021:1521 -p 55000:5500 \
-e ORACLE_PWD=Oracle18 \
-v /srv/oracle_db/18cXE/oradata:/opt/oracle/oradata \
-v /srv/oracle_db/18cXE/scripts/startup:/opt/oracle/scripts/startup \
-v /srv/oracle_db/18cXE/scripts/setup:/opt/oracle/scripts/setup \
oracle/database:18.4.0-xe
it will create new folders which are mapped via the volume:
drwxr-xr-x. 4 root root 4096 Apr 4 17:26 .
drwxr-xr-x. 7 root root 4096 Mar 16 15:26 ..
drwxr-xr-x. 4 root root 4096 Apr 4 17:26 18cXE
-rwxr--r--. 1 root root 1095 Mar 11 17:52 COPYRIGHT
drwxr-xr-x. 7 root root 4096 Mar 11 17:52 dockerfiles
-rwxr--r--. 1 root root 2918 Mar 11 17:52 FAQ.md
-rwxr--r--. 1 root root 10 Mar 11 17:52 .gitignore
-rwxr--r--. 1 root root 1865 Mar 11 17:52 LICENSE
-rwxr--r--. 1 root root 15125 Mar 11 17:52 README.md
-rwxr-xr-x. 1 root root 332 Apr 4 17:00 run_docker.sh
[root@storage 18cXE]# pwd
/srv/oracle_db/18cXE
[root@storage 18cXE]# ls -la
total 20
drwxr-xr-x. 4 root root 4096 Apr 4 17:26 .
drwxr-xr-x. 4 root root 4096 Apr 4 17:26 ..
drwxr-xr-x. 2 root root 4096 Apr 4 17:26 oradata
drwxr-xr-x. 4 root root 4096 Apr 4 17:26 scripts
I think that the problem is really with the permisions as when I check directory structure inside the container:
bash-4.2# pwd
/opt/oracle
bash-4.2# ls -la
total 88
drwxr-xr-x. 1 oracle oinstall 4096 Apr 4 15:26 .
drwxr-xr-x. 1 root root 4096 Apr 4 14:50 ..
drwxr-x---. 3 oracle oinstall 4096 Apr 4 15:26 admin
drwxr-x---. 2 oracle oinstall 4096 Apr 4 15:26 audit
drwxr-xr-x. 4 oracle oinstall 4096 Apr 4 15:26 cfgtoollogs
-rwxr-xr--. 1 root root 1068 Mar 11 16:52 checkDBStatus.sh
drwxrwx---. 2 oracle oinstall 4096 Apr 4 14:50 checkpoints
drwxrwxr-x. 1 oracle oinstall 4096 Apr 4 14:50 diag
drwxrwx---. 4 oracle oinstall 4096 Apr 4 14:50 oraInventory
drwxr-xr-x. 2 root root 4096 Apr 4 15:26 oradata
drwxr-xr-x. 1 oracle oinstall 4096 Apr 4 14:47 product
-rwxr-xr--. 1 root root 6132 Mar 11 16:52 runOracle.sh
drwxr-xr-x. 4 root root 4096 Apr 4 14:51 scripts
-rwxr-xr--. 1 root root 758 Mar 11 16:52 setPassword.sh
You can see the oradata folder is assigned to root, however in your scripts you are trying to create directories and copy / move files as user "oracle". This user is probably added to the container during pre-install steps automatically. So I guess that this is the problem, oradata inside the container has incorret privileges?
Hi @pocelka, yes, that's what I meant. The container is running as the oracle user and so files are stored under that UID and GID. If your volume belongs to another user, such as root, and you don't give write permissions to other users, then the user inside Docker will not be able to write to it.
So you have a choice between:
1) Giving write permissions of your folder to "others", i.e. chmod -R o+w /srv/oracle_db/18cXE/oradata
2) Change the UID for your volume to the UID inside the container, i.e. chown -R 54321:54321 /srv/oracle_db/18cXE/oradata
3) Use named volumes instead where Docker nicely hides all the permission issues, but it makes it harder to operate on the OS.
docker volume create oradata
docker run -dit --restart unless-stopped --name orcl_18cXE \
-p 15021:1521 -p 55000:5500 \
-e ORACLE_PWD=Oracle18 \
-v oradata:/opt/oracle/oradata \
oracle/database:18.4.0-xe
Thanks. This really helped. Wen with option 1 for now.
Most helpful comment
Hi @pocelka, yes, that's what I meant. The container is running as the
oracleuser and so files are stored under that UID and GID. If your volume belongs to another user, such as root, and you don't give write permissions to other users, then the user inside Docker will not be able to write to it.So you have a choice between:
1) Giving write permissions of your folder to "others", i.e.
chmod -R o+w /srv/oracle_db/18cXE/oradata2) Change the UID for your volume to the UID inside the container, i.e.
chown -R 54321:54321 /srv/oracle_db/18cXE/oradata3) Use named volumes instead where Docker nicely hides all the permission issues, but it makes it harder to operate on the OS.