Skip to content

Commit

Permalink
prepare for 12.1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitrii.Sulimchuk committed Sep 14, 2017
1 parent fe79a18 commit ab909d6
Show file tree
Hide file tree
Showing 8 changed files with 261 additions and 133 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Created by .ignore support plugin (hsz.mobi)
/.idea/
50 changes: 32 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,37 @@
FROM sath89/docker-oracle-ee-12c-base:latest
FROM centos:7

ENV DBCA_TOTAL_MEMORY 4096
ENV WEB_CONSOLE true
RUN yum install -y wget unzip binutils.x86_64 compat-libcap1.x86_64 gcc.x86_64 gcc-c++.x86_64 glibc.i686 glibc.x86_64 \
glibc-devel.i686 glibc-devel.x86_64 ksh compat-libstdc++-33 libaio.i686 libaio.x86_64 libaio-devel.i686 libaio-devel.x86_64 \
libgcc.i686 libgcc.x86_64 libstdc++.i686 libstdc++.x86_64 libstdc++-devel.i686 libstdc++-devel.x86_64 libXi.i686 libXi.x86_64 \
libXtst.i686 libXtst.x86_64 make.x86_64 sysstat.x86_64 && yum clean all

ENV ORACLE_SID=EE
ENV ORACLE_HOME=/u01/app/oracle/product/12.2.0/EE
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/u01/app/oracle/product/12.2.0/EE/bin
ENV DISPLAY :0
ENV VNC_PASSWORD oracle
ENV MANUAL_DBCA false
ARG DB_DOWNLOAD_URL_P1
ARG DB_DOWNLOAD_URL_P2

RUN yum install -y epel-release && yum install -y xorg-x11-server-Xvfb x11vnc fluxbox xterm novnc && yum clean all
ADD install /install

ADD entrypoint.sh /entrypoint.sh
RUN /install/oracle_12c_install.sh /install/oracle-12c-ee.rsp

EXPOSE 1521
EXPOSE 8080
EXPOSE 6800
VOLUME ["/docker-entrypoint-initdb.d"]

ENTRYPOINT ["/entrypoint.sh"]
CMD [""]
#DEFINE MAIN CONFIGS
#ENV DBCA_TOTAL_MEMORY 4096
#ENV WEB_CONSOLE true
#
#ENV ORACLE_SID=EE
#ENV ORACLE_HOME=/u01/app/oracle/product/12.1.0/EE
#ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/u01/app/oracle/product/12.1.0/EE/bin
#ENV DISPLAY :0
#ENV VNC_PASSWORD oracle
#ENV MANUAL_DBCA false
#
#RUN yum install -y epel-release && yum install -y xorg-x11-server-Xvfb x11vnc fluxbox xterm novnc && yum clean all
#
#ADD entrypoint.sh /entrypoint.sh
#
#EXPOSE 1521
#EXPOSE 8080
#EXPOSE 6800
#VOLUME ["/docker-entrypoint-initdb.d"]
#
#ENTRYPOINT ["/entrypoint.sh"]
#CMD [""]
#
85 changes: 85 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
Oracle EE 12.1 Release 1
============================
######forked from [MaksymBilenko/docker-oracle-ee-12c](#https://github.com/MaksymBilenko/docker-oracle-ee-12c)

### Build instruction

To build container you must provide URLs where installation script can download Oracle Enterprise Edition Software (12.1.0.2.0) [http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html].
It consist of 2 parts, so you define DB_DOWNLOAD_URL_P1 & DB_DOWNLOAD_URL_P2:

docker build --tag company.name/oracle-ee:12.1.0.2 \
--build-arg DB_DOWNLOAD_URL_P1="http://example.com/linuxamd64_12102_database_1of2.zip" \
--build-arg DB_DOWNLOAD_URL_P2="http://example.com/linuxamd64_12102_database_2of2.zip" \
.
### Usage

Run with 8080 and 1521 ports opened:

docker run -d -p 8080:8080 -p 1521:1521 company.name/oracle-ee:12.1.0.2

Run with data on host and reuse it:

docker run -d -p 8080:8080 -p 1521:1521 -v /my/oracle/data:/u01/app/oracle company.name/oracle-ee:12.1.0.2

Run with Custom DBCA_TOTAL_MEMORY (in Mb):

docker run -d -p 8080:8080 -p 1521:1521 -v /my/oracle/data:/u01/app/oracle -e DBCA_TOTAL_MEMORY=1024 company.name/oracle-ee:12.1.0.2

Connect database with following setting:

hostname: localhost
port: 1521
sid: xe
service name: xe
username: system
password: oracle

To connect using sqlplus:

<pre>
sqlplus system/oracle@//localhost:1521/xe
</pre>

Password for SYS & SYSTEM:

oracle

Connect to Oracle Application Express web management console with following settings:

http://localhost:8080/apex
workspace: INTERNAL
user: ADMIN
password: 0Racle$

Apex upgrade up to v 5.*

docker run -it --rm --volumes-from ${DB_CONTAINER_NAME} --link ${DB_CONTAINER_NAME}:oracle-database -e PASS=YourSYSPASS sath89/apex install

Details could be found here: https://github.com/MaksymBilenko/docker-oracle-apex

Connect to Oracle Enterprise Management console with following settings:

http://localhost:8080/em
user: sys
password: oracle
connect as sysdba: true

By Default web management console is enabled. To disable add env variable:

docker run -d -e WEB_CONSOLE=false -p 1521:1521 -v /my/oracle/data:/u01/app/oracle company.name/oracle-ee:12.1.0.2
#You can Enable/Disable it on any time

Start with additional init scripts or dumps:

docker run -d -p 1521:1521 -v /my/oracle/data:/u01/app/oracle -v /my/oracle/init/SCRIPTSorSQL:/docker-entrypoint-initdb.d company.name/oracle-ee:12.1.0.2

By default Import from `docker-entrypoint-initdb.d` is enabled only if you are initializing database (1st run).

To customize dump import use `IMPDP_OPTIONS` env variable like `-e IMPDP_OPTION="REMAP_TABLESPACE=FOO:BAR"`
To run import at any case add `-e IMPORT_FROM_VOLUME=true`

**In case of using DMP imports dump file should be named like ${IMPORT_SCHEME_NAME}.dmp**

**User credentials for imports are ${IMPORT_SCHEME_NAME}/${IMPORT_SCHEME_NAME}**

If you have an issue with database init like DBCA operation failed, please reffer to this [issue](https://github.com/MaksymBilenko/docker-oracle-12c/issues/16)
16 changes: 8 additions & 8 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ln -s /u01/app/oracle-product /u01/app/oracle/product

#Run Oracle root scripts
/u01/app/oraInventory/orainstRoot.sh > /dev/null 2>&1
echo | /u01/app/oracle/product/12.2.0/EE/root.sh > /dev/null 2>&1 || true
echo | /u01/app/oracle/product/12.1.0/EE/root.sh > /dev/null 2>&1 || true

impdp () {
set +e
Expand Down Expand Up @@ -57,10 +57,10 @@ case "$1" in
echo "EE:$ORACLE_HOME:N" >> /etc/oratab
chown oracle:dba /etc/oratab
chown 664 /etc/oratab
rm -rf /u01/app/oracle-product/12.2.0/EE/dbs
ln -s /u01/app/oracle/dbs /u01/app/oracle-product/12.2.0/EE/dbs
rm -rf /u01/app/oracle-product/12.1.0/EE/dbs
ln -s /u01/app/oracle/dbs /u01/app/oracle-product/12.1.0/EE/dbs
#Startup Database
su oracle -c "/u01/app/oracle/product/12.2.0/EE/bin/tnslsnr &"
su oracle -c "/u01/app/oracle/product/12.1.0/EE/bin/tnslsnr &"
su oracle -c 'echo startup\; | $ORACLE_HOME/bin/sqlplus -S / as sysdba'
else
echo "Database not initialized. Initializing database."
Expand All @@ -72,17 +72,17 @@ case "$1" in

#printf "Setting up:\nprocesses=$processes\nsessions=$sessions\ntransactions=$transactions\n"

mv /u01/app/oracle-product/12.2.0/EE/dbs /u01/app/oracle/dbs
ln -s /u01/app/oracle/dbs /u01/app/oracle-product/12.2.0/EE/dbs
mv /u01/app/oracle-product/12.1.0/EE/dbs /u01/app/oracle/dbs
ln -s /u01/app/oracle/dbs /u01/app/oracle-product/12.1.0/EE/dbs

echo "Starting tnslsnr"
su oracle -c "/u01/app/oracle/product/12.2.0/EE/bin/tnslsnr &"
su oracle -c "/u01/app/oracle/product/12.1.0/EE/bin/tnslsnr &"
#create DB for SID: EE
if [ "${MANUAL_DBCA}" == 'true' ]; then
echo "Open in Browser http://localhost:6800/vnc_auto.html with password ${VNC_PASSWORD} for future configuration"
su oracle -c "$ORACLE_HOME/bin/dbca"
else
su oracle -c "$ORACLE_HOME/bin/dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname EE.oracle.docker -sid EE -responseFile NO_VALUE -characterSet $CHARACTER_SET -totalMemory $DBCA_TOTAL_MEMORY -emConfiguration LOCAL -pdbAdminPassword oracle -sysPassword oracle -systemPassword oracle"
su oracle -c "$ORACLE_HOME/bin/dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname EE.oracle.docker -sid $ORACLE_SID -responseFile NO_VALUE -characterSet $CHARACTER_SET -totalMemory $DBCA_TOTAL_MEMORY -emConfiguration LOCAL -pdbAdminPassword oracle -sysPassword oracle -systemPassword oracle"
fi

# echo "Configuring Apex console"
Expand Down
Loading

0 comments on commit ab909d6

Please sign in to comment.