Skip to content

Commit 6ab2816

Browse files
authored
Merge pull request #5 from utPLSQL/feature-database-18.3
Oracle Database 18c imag
2 parents 0681e42 + 1bebd3f commit 6ab2816

16 files changed

+941
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
/12.1.0.2/linuxamd64_12102_database_2of2.zip
44
/12.1.0.2/linuxamd64_12102_database_se2_2of2.zip
55
/12.1.0.2/linuxamd64_12102_database_se2_1of2.zip
6+
/18.3/LINUX.X64_180000_db_home.zip

18.3/Checksum.ee

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
99a7c4a088a8a502c261e741a8339ae8 LINUX.X64_180000_db_home.zip

18.3/Checksum.se2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
99a7c4a088a8a502c261e741a8339ae8 LINUX.X64_180000_db_home.zip

18.3/Dockerfile.se2

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# LICENSE UPL 1.0
2+
#
3+
# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved.
4+
#
5+
# ORACLE DOCKERFILES PROJECT
6+
# --------------------------
7+
# This is the Dockerfile for Oracle Database 12c Release 2 Enterprise Edition
8+
#
9+
# REQUIRED FILES TO BUILD THIS IMAGE
10+
# ----------------------------------
11+
# (1) db_home.zip
12+
# Download Oracle Database 18c Standard Edition 2 for Linux x64
13+
# from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
14+
#
15+
# HOW TO BUILD THIS IMAGE
16+
# -----------------------
17+
# Put all downloaded files in the same directory as this Dockerfile
18+
# Run:
19+
# $ docker build -t oracle/database:18.3.0-se2 .
20+
#
21+
# Pull base image
22+
# ---------------
23+
FROM oraclelinux:7-slim
24+
25+
# Maintainer
26+
# ----------
27+
MAINTAINER Pavel Kaplya <[email protected]>
28+
29+
# Environment variables required for this build (do NOT change)
30+
# -------------------------------------------------------------
31+
ENV ORACLE_BASE=/opt/oracle \
32+
ORACLE_HOME=/opt/oracle/product/18.3/dbhome_1 \
33+
PDB_BASE_DIR=/opt/oracle/oradata/pdbs \
34+
INSTALL_FILE_1="LINUX.X64_180000_db_home.zip" \
35+
INSTALL_RSP="db_inst.rsp" \
36+
CONFIG_RSP="dbca.rsp.tmpl" \
37+
PWD_FILE="setPassword.sh" \
38+
RUN_FILE="runOracle.sh" \
39+
START_FILE="startDB.sh" \
40+
STOP_FILE="stopDB.sh" \
41+
CREATE_DB_FILE="createDB.sh" \
42+
CREATE_PDB_FILE="createPDB.sh" \
43+
SETUP_LINUX_FILE="setupLinuxEnv.sh" \
44+
CLEANUP_FILE="cleanup.sh" \
45+
CHECK_SPACE_FILE="checkSpace.sh" \
46+
INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \
47+
ORACLE_PWD="oracle" \
48+
ORACLE_PDB="ORCLPDB1"
49+
50+
# Use second ENV so that variable get substituted
51+
ENV INSTALL_DIR=$ORACLE_BASE/install \
52+
PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch/:/usr/sbin:$PATH \
53+
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib \
54+
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
55+
56+
# Copy binaries
57+
# -------------
58+
RUN echo COPYING BINS
59+
COPY $INSTALL_FILE_1 $INSTALL_RSP $SETUP_LINUX_FILE $CHECK_SPACE_FILE $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/
60+
COPY $RUN_FILE $START_FILE $STOP_FILE $CREATE_DB_FILE $CREATE_PDB_FILE $CONFIG_RSP $PWD_FILE $CLEANUP_FILE $ORACLE_BASE/
61+
62+
RUN chmod ug+x $INSTALL_DIR/*.sh && \
63+
sync && \
64+
$INSTALL_DIR/$CHECK_SPACE_FILE && \
65+
$INSTALL_DIR/$SETUP_LINUX_FILE
66+
67+
# Install DB software binaries
68+
USER oracle
69+
RUN $INSTALL_DIR/$INSTALL_DB_BINARIES_FILE SE2
70+
71+
USER root
72+
RUN $ORACLE_BASE/oraInventory/orainstRoot.sh && \
73+
$ORACLE_HOME/root.sh && \
74+
rm -rf $INSTALL_DIR
75+
76+
USER oracle
77+
RUN $ORACLE_BASE/$CREATE_DB_FILE && \
78+
$ORACLE_BASE/$STOP_FILE && \
79+
$ORACLE_BASE/$CLEANUP_FILE
80+
81+
WORKDIR /home/oracle
82+
83+
VOLUME ["$PDB_BASE_DIR"]
84+
EXPOSE 1521 5500
85+
86+
# Define default command to start Oracle Database.
87+
CMD $ORACLE_BASE/$RUN_FILE

18.3/checkSpace.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
# LICENSE UPL 1.0
3+
#
4+
# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved.
5+
#
6+
# Since: January, 2017
7+
8+
# Description: Checks the available space of the system.
9+
#
10+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
11+
#
12+
13+
REQUIRED_SPACE_GB=18
14+
AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{ print $4 }'`
15+
16+
if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then
17+
script_name=`basename "$0"`
18+
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
19+
echo "$script_name: ERROR - There is not enough space available in the docker container."
20+
echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB, but only $AVAILABLE_SPACE_GB GB are available."
21+
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
22+
exit 1;
23+
fi;

18.3/cleanup.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Remove not needed components
2+
rm -rf $ORACLE_HOME/apex
3+
rm -rf $ORACLE_HOME/jdbc
4+
# ZDLRA installer files
5+
rm -rf $ORACLE_HOME/lib/ra*.zip
6+
rm -rf $ORACLE_HOME/ords
7+
rm -rf $ORACLE_HOME/sqldeveloper
8+
rm -rf $ORACLE_HOME/ucp
9+
# as we woun't install patches
10+
rm -rf $ORACLE_HOME/lib/*.a
11+
# OUI backup
12+
rm -rf $ORACLE_HOME/inventory/backup/*
13+
# Network tools help
14+
rm -rf $ORACLE_HOME/network/tools/help/mgr/help_*
15+
# Temp location
16+
rm -rf /tmp/*
17+
#remove templates
18+
19+
# Adviced by Gerald Venzl
20+
echo "Adviced by Gerald Venzl"
21+
rm -rf $ORACLE_HOME/assistants/dbca/templates
22+
rm -rf $ORACLE_HOME/.patch_storage/*
23+
rm -rf $ORACLE_HOME/R/*
24+
rm -rf $ORACLE_HOME/assistants/*
25+
rm -rf $ORACLE_HOME/cfgtoollogs/*
26+
rm -rf $ORACLE_HOME/dmu/*
27+
rm -rf $ORACLE_HOME/inventory/*
28+
rm -rf $ORACLE_HOME/javavm/*
29+
rm -rf $ORACLE_HOME/md/*
30+
rm -rf $ORACLE_HOME/suptools/*

18.3/createDB.sh

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#!/bin/bash
2+
# LICENSE UPL 1.0
3+
#
4+
# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved.
5+
#
6+
# Since: November, 2016
7+
8+
# Description: Creates an Oracle Database based on following parameters:
9+
# $ORACLE_SID: The Oracle SID and CDB name
10+
# $ORACLE_PDB: The PDB name
11+
# $ORACLE_PWD: The Oracle password
12+
#
13+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
14+
#
15+
16+
set -e
17+
18+
# Check whether ORACLE_SID is passed on
19+
export ORACLE_SID=${1:-ORCLCDB}
20+
21+
# Check whether ORACLE_PDB is passed on
22+
export ORACLE_PDB=${2:-ORCLPDB1}
23+
24+
# Auto generate ORACLE PWD
25+
#ORACLE_PWD="`openssl rand -base64 8`1"
26+
echo "ORACLE AUTO GENERATED PASSWORD FOR SYS, SYSTEM AND PDBAMIN: $ORACLE_PWD";
27+
28+
# Replace place holders in response file
29+
cp $ORACLE_BASE/$CONFIG_RSP $ORACLE_BASE/dbca.rsp
30+
sed -i -e "s|###ORACLE_SID###|$ORACLE_SID|g" $ORACLE_BASE/dbca.rsp
31+
sed -i -e "s|###ORACLE_PDB###|$ORACLE_PDB|g" $ORACLE_BASE/dbca.rsp
32+
sed -i -e "s|###ORACLE_PWD###|$ORACLE_PWD|g" $ORACLE_BASE/dbca.rsp
33+
sed -i -e "s|###ORACLE_CHARACTERSET###|$ORACLE_CHARACTERSET|g" $ORACLE_BASE/dbca.rsp
34+
35+
# If there is greater than 8 CPUs default back to dbca memory calculations
36+
# dbca will automatically pick 40% of available memory for Oracle DB
37+
# The minimum of 2G is for small environments to guarantee that Oracle has enough memory to function
38+
# However, bigger environment can and should use more of the available memory
39+
# This is due to Github Issue #307
40+
if [ `nproc` -gt 8 ]; then
41+
sed -i -e "s|totalMemory=2048||g" $ORACLE_BASE/dbca.rsp
42+
fi;
43+
44+
# Create network related config files (sqlnet.ora, tnsnames.ora, listener.ora)
45+
mkdir -p $ORACLE_HOME/network/admin
46+
echo "NAME.DIRECTORY_PATH= (TNSNAMES, EZCONNECT, HOSTNAME)" > $ORACLE_HOME/network/admin/sqlnet.ora
47+
48+
# Listener.ora
49+
echo "LISTENER =
50+
(DESCRIPTION_LIST =
51+
(DESCRIPTION =
52+
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
53+
(ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
54+
)
55+
)
56+
57+
DEDICATED_THROUGH_BROKER_LISTENER=ON
58+
DIAG_ADR_ENABLED = off
59+
" > $ORACLE_HOME/network/admin/listener.ora
60+
61+
# Start LISTENER and run DBCA
62+
lsnrctl start &&
63+
dbca -silent -createDatabase -responseFile $ORACLE_BASE/dbca.rsp ||
64+
cat /opt/oracle/cfgtoollogs/dbca/$ORACLE_SID/$ORACLE_SID.log ||
65+
cat /opt/oracle/cfgtoollogs/dbca/$ORACLE_SID.log
66+
67+
echo "$ORACLE_SID=localhost:1521/$ORACLE_SID" >> $ORACLE_HOME/network/admin/tnsnames.ora
68+
#echo "$ORACLE_PDB=
69+
#(DESCRIPTION =
70+
# (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
71+
# (CONNECT_DATA =
72+
# (SERVER = DEDICATED)
73+
# (SERVICE_NAME = $ORACLE_PDB)
74+
# )
75+
#)" >> $ORACLE_HOME/network/admin/tnsnames.ora
76+
77+
# Remove second control file, make PDB auto open
78+
sqlplus / as sysdba << EOF
79+
ALTER SYSTEM SET control_files='$ORACLE_BASE/oradata/$ORACLE_SID/control01.ctl' scope=spfile;
80+
--ALTER PLUGGABLE DATABASE $ORACLE_PDB SAVE STATE;
81+
exit;
82+
EOF
83+
84+
# Remove temporary response file
85+
rm $ORACLE_BASE/dbca.rsp
86+
87+
# Make dir for PDBs
88+
#mkdir -p $PDB_BASE_DIR

18.3/createPDB.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
# LICENSE CDDL 1.0 + GPL 2.0
3+
#
4+
# Copyright (c) 1982-2016 Oracle and/or its affiliates. All rights reserved.
5+
#
6+
# Since: November, 2016
7+
8+
# Description: Creates an Oracle Database based on following parameters:
9+
# $ORACLE_SID: The Oracle SID and CDB name
10+
# $ORACLE_PDB: The PDB name
11+
#
12+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
13+
#
14+
15+
sqlplus / as sysdba <<EOF
16+
CREATE PLUGGABLE DATABASE $ORACLE_PDB ADMIN USER PDBADMIN IDENTIFIED BY "$ORACLE_PWD"
17+
FILE_NAME_CONVERT=('$ORACLE_BASE/oradata/ORCLCDB/pdbseed/','$PDB_BASE_DIR/$ORACLE_PDB/');
18+
ALTER PLUGGABLE DATABASE $ORACLE_PDB SAVE STATE;
19+
ALTER PLUGGABLE DATABASE $ORACLE_PDB OPEN READ WRITE;
20+
ALTER PLUGGABLE DATABASE $ORACLE_PDB SAVE STATE;
21+
ALTER SESSION SET CONTAINER = $ORACLE_PDB;
22+
CREATE TABLESPACE users DATAFILE '$PDB_BASE_DIR/$ORACLE_PDB/users01.dbf' SIZE 50M AUTOEXTEND ON NEXT 1M;
23+
exit;
24+
EOF

18.3/db_inst.rsp

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
####################################################################
2+
## Copyright(c) Oracle Corporation 1998,2017. All rights reserved.##
3+
## ##
4+
## Specify values for the variables listed below to customize ##
5+
## your installation. ##
6+
## ##
7+
## Each variable is associated with a comment. The comment ##
8+
## can help to populate the variables with the appropriate ##
9+
## values. ##
10+
## ##
11+
## IMPORTANT NOTE: This file contains plain text passwords and ##
12+
## should be secured to have read permission only by oracle user ##
13+
## or db administrator who owns this installation. ##
14+
## ##
15+
####################################################################
16+
17+
18+
#-------------------------------------------------------------------------------
19+
# Do not change the following system generated value.
20+
#-------------------------------------------------------------------------------
21+
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.2.0
22+
23+
#-------------------------------------------------------------------------------
24+
# Specify the installation option.
25+
# It can be one of the following:
26+
# - INSTALL_DB_SWONLY
27+
# - INSTALL_DB_AND_CONFIG
28+
# - UPGRADE_DB
29+
#-------------------------------------------------------------------------------
30+
oracle.install.option=INSTALL_DB_SWONLY
31+
32+
#-------------------------------------------------------------------------------
33+
# Specify the Unix group to be set for the inventory directory.
34+
#-------------------------------------------------------------------------------
35+
UNIX_GROUP_NAME=dba
36+
37+
#-------------------------------------------------------------------------------
38+
# Specify the location which holds the inventory files.
39+
# This is an optional parameter if installing on
40+
# Windows based Operating System.
41+
#-------------------------------------------------------------------------------
42+
INVENTORY_LOCATION=###ORACLE_BASE###/oraInventory
43+
#-------------------------------------------------------------------------------
44+
# Specify the complete path of the Oracle Home.
45+
#-------------------------------------------------------------------------------
46+
ORACLE_HOME=###ORACLE_HOME###
47+
48+
#-------------------------------------------------------------------------------
49+
# Specify the complete path of the Oracle Base.
50+
#-------------------------------------------------------------------------------
51+
ORACLE_BASE=###ORACLE_BASE###
52+
53+
#-------------------------------------------------------------------------------
54+
# Specify the installation edition of the component.
55+
#
56+
# The value should contain only one of these choices.
57+
# - EE : Enterprise Edition
58+
# - SE2 : Standard Edition 2
59+
#-------------------------------------------------------------------------------
60+
oracle.install.db.InstallEdition=###ORACLE_EDITION###
61+
62+
###############################################################################
63+
# #
64+
# PRIVILEGED OPERATING SYSTEM GROUPS #
65+
# ------------------------------------------ #
66+
# Provide values for the OS groups to which SYSDBA and SYSOPER privileges #
67+
# needs to be granted. If the install is being performed as a member of the #
68+
# group "dba", then that will be used unless specified otherwise below. #
69+
# #
70+
# The value to be specified for OSDBA and OSOPER group is only for UNIX based #
71+
# Operating System. #
72+
# #
73+
###############################################################################
74+
75+
#------------------------------------------------------------------------------
76+
# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges.
77+
#-------------------------------------------------------------------------------
78+
oracle.install.db.OSDBA_GROUP=dba
79+
80+
#------------------------------------------------------------------------------
81+
# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges.
82+
# The value to be specified for OSOPER group is optional.
83+
#------------------------------------------------------------------------------
84+
oracle.install.db.OSOPER_GROUP=dba
85+
86+
#------------------------------------------------------------------------------
87+
# The OSBACKUPDBA_GROUP is the OS group which is to be granted SYSBACKUP privileges.
88+
#------------------------------------------------------------------------------
89+
oracle.install.db.OSBACKUPDBA_GROUP=dba
90+
91+
#------------------------------------------------------------------------------
92+
# The OSDGDBA_GROUP is the OS group which is to be granted SYSDG privileges.
93+
#------------------------------------------------------------------------------
94+
oracle.install.db.OSDGDBA_GROUP=dba
95+
96+
#------------------------------------------------------------------------------
97+
# The OSKMDBA_GROUP is the OS group which is to be granted SYSKM privileges.
98+
#------------------------------------------------------------------------------
99+
oracle.install.db.OSKMDBA_GROUP=dba
100+
101+
#------------------------------------------------------------------------------
102+
# The OSRACDBA_GROUP is the OS group which is to be granted SYSRAC privileges.
103+
#------------------------------------------------------------------------------
104+
oracle.install.db.OSRACDBA_GROUP=dba
105+
106+
#------------------------------------------------------------------------------
107+
# Specify whether to enable the user to set the password for
108+
# My Oracle Support credentials. The value can be either true or false.
109+
# If left blank it will be assumed to be false.
110+
#
111+
# Example : SECURITY_UPDATES_VIA_MYORACLESUPPORT=true
112+
#------------------------------------------------------------------------------
113+
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
114+
115+
#------------------------------------------------------------------------------
116+
# Specify whether user doesn't want to configure Security Updates.
117+
# The value for this variable should be true if you don't want to configure
118+
# Security Updates, false otherwise.
119+
#
120+
# The value can be either true or false. If left blank it will be assumed
121+
# to be true.
122+
#
123+
# Example : DECLINE_SECURITY_UPDATES=false
124+
#------------------------------------------------------------------------------
125+
DECLINE_SECURITY_UPDATES=true

0 commit comments

Comments
 (0)