oracle / docker-images

Official source of container configurations, images, and examples for Oracle products and projects
https://developer.oracle.com/use-cases/#containers
Universal Permissive License v1.0
6.51k stars 5.41k forks source link

First startup of docker container takes forever #274

Closed vikceo closed 7 years ago

vikceo commented 7 years ago

so i build oracle db ee image and all went fine. However, on starting the docker container for the first time it takes forever. I have tried redoing it 2-3 times but no luck. Here are the current output logs I see while it is still configuring

VSKUMAR-mac:ora-xe-db-docker vskumar$ docker run --name oracle-db -p 1521:1521 -p 5500:5500 oracle/database:12.1.0.2-ee ORACLE AUTO GENERATED PASSWORD FOR SYS, SYSTEM AND PDBAMIN: M6Pa6cCoWcw=1

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 10-FEB-2017 08:37:04

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

Starting /opt/oracle/product/12.1.0.2/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 12.1.0.2.0 - Production System parameter file is /opt/oracle/product/12.1.0.2/dbhome_1/network/admin/listener.ora Log messages written to /opt/oracle/diag/tnslsnr/df7950c05727/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1))) STATUS of the LISTENER

Alias LISTENER Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production Start Date 10-FEB-2017 08:37:06 Uptime 0 days 0 hr. 0 min. 1 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /opt/oracle/product/12.1.0.2/dbhome_1/network/admin/listener.ora Listener Log File /opt/oracle/diag/tnslsnr/df7950c05727/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521))) The listener supports no services The command completed successfully Copying database files 1% complete 2% complete 27% complete Creating and starting Oracle instance 29% complete 32% complete 33% complete 34% complete 38% complete 42% complete 43% complete 45% complete Completing Database Creation 48% complete 51% complete 53% complete 62% complete 64% complete 72% complete Creating Pluggable Databases 78% complete 100% complete Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log" for further details.

SQL*Plus: Release 12.1.0.2.0 Production on Fri Feb 10 08:54:31 2017

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

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> System altered.

SQL> Pluggable database altered.

SQL> Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options ######################### DATABASE IS READY TO USE! ######################### Fri Feb 10 08:54:08 2017

XDB installed.

XDB initialized. Resize operation completed for file# 4, old size 245760K, new size 250880K Fri Feb 10 08:54:32 2017 ALTER SYSTEM SET control_files='/opt/oracle/oradata/ORCLCDB/control01.ctl' SCOPE=SPFILE; ALTER PLUGGABLE DATABASE ORCLPDB1 SAVE STATE Completed: ALTER PLUGGABLE DATABASE ORCLPDB1 SAVE STATE Fri Feb 10 17:53:03 2017 Warning: VKTM detected a time drift. Time drifts can result in an unexpected behavior such as time-outs. Please check trace file for more details. Fri Feb 10 17:54:02 2017 Shared IO Pool defaulting to 80MB. Trying to get it from Buffer Cache for process 1330. Fri Feb 10 17:54:03 2017 Thread 1 advanced to log sequence 17 (LGWR switch) Current log# 2 seq# 17 mem# 0: /opt/oracle/oradata/ORCLCDB/redo02.log Fri Feb 10 17:55:01 2017 Resize operation completed for file# 3, old size 645120K, new size 655360K Fri Feb 10 17:55:02 2017 Resize operation completed for file# 3, old size 655360K, new size 675840K Fri Feb 10 17:58:52 2017 Resize operation completed for file# 9, old size 563200K, new size 583680K Fri Feb 10 19:23:29 2017 Warning: VKTM detected a time drift. Time drifts can result in an unexpected behavior such as time-outs. Please check trace file for more details.

mikostov commented 7 years ago

Hi @vikceo, why you think it's still configuring? Your database is already running and ready to use.

For convenience purposes the container startup script also runs a tail -f on the Oracle Database alert.log file. This is done for convenience purposes only so that any potential issues can be easily spotted. Once you see the line DATABASE IS READY TO USE! in the output you can connect to the database.

Open an another session and try: docker exec -it oracle-db /bin/bash

gvenzl commented 7 years ago

This works as designed. In order to expose files into data containers (volumes) the actual database has to be created on container startup. If the database would be part of the image already, you wouldn't be able to get the data files into a volume when mounting a host directory (unfortunately). See Docker documentation: Volumes are initialized when a container is created. If the container’s base image contains data at the specified mount point, that existing data is copied into the new volume upon volume initialization. (Note that this does not apply when mounting a host directory.)

Also the ReadMe refers to that: IMPORTANT: The resulting images will be an image with the Oracle binaries installed. On first startup of the container a new database will be created, the following lines highlight when the database is ready to be used: