├── .gitignore ├── LICENSE ├── README.md ├── step1 ├── Dockerfile ├── db_install.rsp ├── install ├── oraInst.loc └── sysctl.conf ├── step2 ├── Dockerfile ├── conf_finish.sql ├── create ├── createdb.sql └── initORCL.ora └── step3 ├── Dockerfile ├── start └── startdb.sql /.gitignore: -------------------------------------------------------------------------------- 1 | step1/*.zip 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | [GNU Lesser General Public License (LGPL)](http://www.gnu.org/licenses/lgpl-3.0.txt) for the contents of this GitHub repo; for Oracle's database software, see their Licensing Information 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Instant Oracle datase server 2 | A [Docker](https://www.docker.com/) [image](https://registry.hub.docker.com/u/wscherphof/oracle-12c/) with [Oracle Database 12c Enterprise Edition Release 12.1.0.2.0](http://www.oracle.com/technetwork/database/enterprise-edition/overview/index.html) running in [Oracle Linux 7](http://www.oracle.com/us/technologies/linux/overview/index.html) 3 | - Default ORCL database on port 1521 4 | 5 | ## Install 6 | 1. [Install Docker](https://docs.docker.com/installation/#installation) 7 | 1. `$ docker pull wscherphof/oracle-12c` 8 | 2. That worked once, but the image was removed by Docker Support on Oracle's request, so you'll need to [build](https://github.com/wscherphof/oracle-12c#build) it yourself 9 | 10 | ## Run 11 | Create and run a container named orcl: 12 | ``` 13 | $ docker run --shm-size=4g -dP --name orcl wscherphof/oracle-12c 14 | 989f1b41b1f00c53576ab85e773b60f2458a75c108c12d4ac3d70be4e801b563 15 | ``` 16 | 17 | ## Connect 18 | The default password for the `sys` user is `change_on_install`, and for `system` it's `manager` 19 | The `ORCL` database port `1521` is bound to the Docker host through `run -P`. To find the host's port: 20 | ``` 21 | $ docker port orcl 1521 22 | 0.0.0.0:49189 23 | ``` 24 | So from the host, you can connect with `system/manager@localhost:49189/orcl` 25 | Though if using [Boot2Docker](https://github.com/boot2docker/boot2docker), you need the actual ip address instead of `localhost`: 26 | ``` 27 | $ boot2docker ip 28 | 29 | The VM's Host only interface IP address is: 192.168.59.103 30 | 31 | ``` 32 | If you're looking for a databse client, consider [sqlplus](http://www.oracle.com/technetwork/database/features/instant-client/index-100365.html) 33 | ``` 34 | $ sqlplus system/manager@192.168.59.103:49189/orcl 35 | 36 | SQL*Plus: Release 11.2.0.4.0 Production on Mon Sep 15 14:40:52 2014 37 | 38 | Copyright (c) 1982, 2013, Oracle. All rights reserved. 39 | 40 | 41 | Connected to: 42 | Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production 43 | With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options 44 | 45 | SQL> | 46 | ``` 47 | 48 | ## Monitor 49 | The container runs a process that starts up the database, and then continues to check each minute if the database is still running, and start it if it's not. To see the output of that process: 50 | ``` 51 | $ docker logs orcl 52 | 53 | LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 16-SEP-2014 11:34:56 54 | 55 | Copyright (c) 1991, 2014, Oracle. All rights reserved. 56 | 57 | Starting /u01/app/oracle/product/12.1.0/dbhome_1/bin/tnslsnr: please wait... 58 | 59 | TNSLSNR for Linux: Version 12.1.0.2.0 - Production 60 | Log messages written to /u01/app/oracle/diag/tnslsnr/e90ad7cc75a1/listener/alert/log.xml 61 | Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=e90ad7cc75a1)(PORT=1521))) 62 | 63 | Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) 64 | STATUS of the LISTENER 65 | ------------------------ 66 | Alias LISTENER 67 | Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production 68 | Start Date 16-SEP-2014 11:34:56 69 | Uptime 0 days 0 hr. 0 min. 0 sec 70 | Trace Level off 71 | Security ON: Local OS Authentication 72 | SNMP OFF 73 | Listener Log File /u01/app/oracle/diag/tnslsnr/e90ad7cc75a1/listener/alert/log.xml 74 | Listening Endpoints Summary... 75 | (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=e90ad7cc75a1)(PORT=1521))) 76 | The listener supports no services 77 | The command completed successfully 78 | 79 | SQL*Plus: Release 12.1.0.2.0 Production on Tue Sep 16 11:34:56 2014 80 | 81 | Copyright (c) 1982, 2014, Oracle. All rights reserved. 82 | 83 | Connected to an idle instance. 84 | ORACLE instance started. 85 | 86 | Total System Global Area 1073741824 bytes 87 | Fixed Size 2932632 bytes 88 | Variable Size 721420392 bytes 89 | Database Buffers 343932928 bytes 90 | Redo Buffers 5455872 bytes 91 | Database mounted. 92 | Database opened. 93 | Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production 94 | With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options 95 | 96 | LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 16-SEP-2014 11:35:24 97 | 98 | Copyright (c) 1991, 2014, Oracle. All rights reserved. 99 | 100 | Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) 101 | STATUS of the LISTENER 102 | ------------------------ 103 | Alias LISTENER 104 | Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production 105 | Start Date 16-SEP-2014 11:34:56 106 | Uptime 0 days 0 hr. 0 min. 28 sec 107 | Trace Level off 108 | Security ON: Local OS Authentication 109 | SNMP OFF 110 | Listener Log File /u01/app/oracle/diag/tnslsnr/e90ad7cc75a1/listener/alert/log.xml 111 | Listening Endpoints Summary... 112 | (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=e90ad7cc75a1)(PORT=1521))) 113 | Services Summary... 114 | Service "ORCL" has 1 instance(s). 115 | Instance "ORCL", status READY, has 1 handler(s) for this service... 116 | The command completed successfully 117 | ``` 118 | 119 | ## Enter 120 | There's no ssh daemon or similar configured in the image. If you need a command prompt inside the container, consider [nsenter](https://github.com/jpetazzo/nsenter) (and mind the [Boot2Docker note](https://github.com/jpetazzo/nsenter#docker-enter-with-boot2docker) there) 121 | 122 | ## Build 123 | Should you want to modify & build your own image: 124 | 125 | #### Step 1 126 | 1) Download `linuxamd64_12102_database_1of2.zip` & `linuxamd64_12102_database_2of2.zip` from [Oracle Tech Net](http://www.oracle.com/technetwork/database/enterprise-edition/downloads/database12c-linux-download-2240591.html) 127 | 128 | 2) Put the 2 zip files in the `step1` directory 129 | 130 | 3) `cd` to the `oracle-12c` repo directory 131 | 132 | 4) `$ docker build -t oracle-12c:step1 step1` 133 | 134 | 5) `$ docker run --shm-size=4g -ti --name step1 oracle-12c:step1 /bin/bash` 135 | 136 | 6) ` # /tmp/install/install` (takes about 5m) 137 | ``` 138 | Tue Sep 16 08:48:00 UTC 2014 139 | Starting Oracle Universal Installer... 140 | 141 | Checking Temp space: must be greater than 500 MB. Actual 40142 MB Passed 142 | Checking swap space: must be greater than 150 MB. Actual 1392 MB Passed 143 | Preparing to launch Oracle Universal Installer from /tmp/OraInstall2014-09-16_08-48-01AM. Please wait ...[root@51905aa48207 /]# You can find the log of this install session at: 144 | /u01/app/oraInventory/logs/installActions2014-09-16_08-48-01AM.log 145 | The installation of Oracle Database 12c was successful. 146 | Please check '/u01/app/oraInventory/logs/silentInstall2014-09-16_08-48-01AM.log' for more details. 147 | 148 | As a root user, execute the following script(s): 149 | 1. /u01/app/oracle/product/12.1.0/dbhome_1/root.sh 150 | 151 | 152 | 153 | Successfully Setup Software. 154 | As install user, execute the following script to complete the configuration. 155 | 1. /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/configToolAllCommands RESPONSE_FILE= 156 | 157 | Note: 158 | 1. This script must be run on the same host from where installer was run. 159 | 2. This script needs a small password properties file for configuration assistants that require passwords (refer to install guide documentation). 160 | 161 | ``` 162 | 7) ` ` 163 | 164 | 8) ` # exit` (the scripts mentioned are executed as part of the step2 build) 165 | 166 | 9) `$ docker commit step1 oracle-12c:installed` 167 | 168 | #### Step 2 169 | 1) `$ docker build -t oracle-12c:step2 step2` 170 | 171 | 2) `$ docker run --shm-size=4g -ti --name step2 oracle-12c:step2 /bin/bash` 172 | 173 | 3) ` # /tmp/create` (takes about 15m) 174 | ``` 175 | Tue Sep 16 11:07:30 UTC 2014 176 | Creating database... 177 | 178 | SQL*Plus: Release 12.1.0.2.0 Production on Tue Sep 16 11:07:30 2014 179 | 180 | Copyright (c) 1982, 2014, Oracle. All rights reserved. 181 | 182 | Connected to an idle instance. 183 | 184 | File created. 185 | 186 | ORACLE instance started. 187 | 188 | Total System Global Area 1073741824 bytes 189 | Fixed Size 2932632 bytes 190 | Variable Size 721420392 bytes 191 | Database Buffers 343932928 bytes 192 | Redo Buffers 5455872 bytes 193 | 194 | Database created. 195 | 196 | 197 | Tablespace created. 198 | 199 | 200 | Tablespace created. 201 | 202 | Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production 203 | With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options 204 | 205 | Tue Sep 16 11:07:50 UTC 2014 206 | Creating password file... 207 | 208 | Tue Sep 16 11:07:50 UTC 2014 209 | Running catalog.sql... 210 | 211 | Tue Sep 16 11:08:51 UTC 2014 212 | Running catproc.sql... 213 | 214 | Tue Sep 16 11:19:38 UTC 2014 215 | Running pupbld.sql... 216 | 217 | Tue Sep 16 11:19:38 UTC 2014 218 | Create is done; commit the container now 219 | ``` 220 | 4) ` # exit` 221 | 222 | 5) `$ docker commit step2 oracle-12c:created` 223 | 224 | #### Step 3 225 | 1) `$ docker build -t oracle-12c step3` 226 | 227 | ## License 228 | [GNU Lesser General Public License (LGPL)](http://www.gnu.org/licenses/lgpl-3.0.txt) for the contents of this GitHub repo; for Oracle's database software, see their [Licensing Information](http://docs.oracle.com/database/121/DBLIC/toc.htm) 229 | -------------------------------------------------------------------------------- /step1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM wscherphof/oracle-linux-7 2 | MAINTAINER Wouter Scherphof 3 | 4 | ADD linuxamd64_12102_database_1of2.zip /tmp/install/linuxamd64_12102_database_1of2.zip 5 | ADD linuxamd64_12102_database_2of2.zip /tmp/install/linuxamd64_12102_database_2of2.zip 6 | RUN yum -y install unzip binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33.i686 gcc gcc-c++ glibc.i686 glibc glibc-devel glibc-devel.i686 ksh libgcc.i686 libgcc libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 libaio libaio.i686 libaio-devel libaio-devel.i686 libXext libXext.i686 libXtst libXtst.i686 libX11 libX11.i686 libXau libXau.i686 libxcb libxcb.i686 libXi libXi.i686 make sysstat vte3 smartmontools 7 | RUN cd /tmp/install && unzip linuxamd64_12102_database_1of2.zip && unzip linuxamd64_12102_database_2of2.zip && rm *.zip 8 | 9 | RUN groupadd -g 54321 oinstall && groupadd -g 54322 dba 10 | RUN userdel oracle && rm -rf /home/oracle && rm /var/spool/mail/oracle 11 | RUN useradd -m -u 54321 -g oinstall -G dba oracle 12 | RUN echo "oracle:oracle" | chpasswd 13 | 14 | ENV ORACLE_BASE /u01/app/oracle 15 | 16 | RUN mkdir -p $ORACLE_BASE && chown -R oracle:oinstall $ORACLE_BASE && chmod -R 775 $ORACLE_BASE 17 | RUN mkdir -p /u01/app/oraInventory && chown -R oracle:oinstall /u01/app/oraInventory && chmod -R 775 /u01/app/oraInventory 18 | ADD oraInst.loc /etc/oraInst.loc 19 | RUN chmod 664 /etc/oraInst.loc 20 | 21 | ADD sysctl.conf /etc/sysctl.conf 22 | RUN echo "oracle soft stack 10240" >> /etc/security/limits.conf 23 | 24 | ENV CVUQDISK_GRP oinstall 25 | RUN cd /tmp/install/database/rpm && rpm -iv cvuqdisk-1.0.9-1.rpm 26 | 27 | ADD db_install.rsp /tmp/db_install.rsp 28 | ADD install /tmp/install/install 29 | -------------------------------------------------------------------------------- /step1/db_install.rsp: -------------------------------------------------------------------------------- 1 | #################################################################### 2 | ## Copyright(c) Oracle Corporation 1998,2014. 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.1.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 hostname of the system as set during the install. It can be used 34 | # to force the installation to use an alternative hostname rather than using the 35 | # first hostname found on the system. (e.g., for systems with multiple hostnames 36 | # and network interfaces) 37 | #------------------------------------------------------------------------------- 38 | ORACLE_HOSTNAME=oradb12c 39 | 40 | #------------------------------------------------------------------------------- 41 | # Specify the Unix group to be set for the inventory directory. 42 | #------------------------------------------------------------------------------- 43 | UNIX_GROUP_NAME=oinstall 44 | 45 | #------------------------------------------------------------------------------- 46 | # Specify the location which holds the inventory files. 47 | # This is an optional parameter if installing on 48 | # Windows based Operating System. 49 | #------------------------------------------------------------------------------- 50 | INVENTORY_LOCATION=/u01/app/oraInventory 51 | #------------------------------------------------------------------------------- 52 | # Specify the languages in which the components will be installed. 53 | # 54 | # en : English ja : Japanese 55 | # fr : French ko : Korean 56 | # ar : Arabic es : Latin American Spanish 57 | # bn : Bengali lv : Latvian 58 | # pt_BR: Brazilian Portuguese lt : Lithuanian 59 | # bg : Bulgarian ms : Malay 60 | # fr_CA: Canadian French es_MX: Mexican Spanish 61 | # ca : Catalan no : Norwegian 62 | # hr : Croatian pl : Polish 63 | # cs : Czech pt : Portuguese 64 | # da : Danish ro : Romanian 65 | # nl : Dutch ru : Russian 66 | # ar_EG: Egyptian zh_CN: Simplified Chinese 67 | # en_GB: English (Great Britain) sk : Slovak 68 | # et : Estonian sl : Slovenian 69 | # fi : Finnish es_ES: Spanish 70 | # de : German sv : Swedish 71 | # el : Greek th : Thai 72 | # iw : Hebrew zh_TW: Traditional Chinese 73 | # hu : Hungarian tr : Turkish 74 | # is : Icelandic uk : Ukrainian 75 | # in : Indonesian vi : Vietnamese 76 | # it : Italian 77 | # 78 | # all_langs : All languages 79 | # 80 | # Specify value as the following to select any of the languages. 81 | # Example : SELECTED_LANGUAGES=en,fr,ja 82 | # 83 | # Specify value as the following to select all the languages. 84 | # Example : SELECTED_LANGUAGES=all_langs 85 | #------------------------------------------------------------------------------- 86 | SELECTED_LANGUAGES=en 87 | 88 | #------------------------------------------------------------------------------- 89 | # Specify the complete path of the Oracle Home. 90 | #------------------------------------------------------------------------------- 91 | ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1 92 | 93 | #------------------------------------------------------------------------------- 94 | # Specify the complete path of the Oracle Base. 95 | #------------------------------------------------------------------------------- 96 | ORACLE_BASE=/u01/app/oracle 97 | 98 | #------------------------------------------------------------------------------- 99 | # Specify the installation edition of the component. 100 | # 101 | # The value should contain only one of these choices. 102 | # - EE : Enterprise Edition 103 | 104 | #------------------------------------------------------------------------------- 105 | oracle.install.db.InstallEdition=EE 106 | 107 | ############################################################################### 108 | # # 109 | # PRIVILEGED OPERATING SYSTEM GROUPS # 110 | # ------------------------------------------ # 111 | # Provide values for the OS groups to which OSDBA and OSOPER privileges # 112 | # needs to be granted. If the install is being performed as a member of the # 113 | # group "dba", then that will be used unless specified otherwise below. # 114 | # # 115 | # The value to be specified for OSDBA and OSOPER group is only for UNIX based # 116 | # Operating System. # 117 | # # 118 | ############################################################################### 119 | 120 | #------------------------------------------------------------------------------ 121 | # The DBA_GROUP is the OS group which is to be granted OSDBA privileges. 122 | #------------------------------------------------------------------------------- 123 | oracle.install.db.DBA_GROUP=dba 124 | 125 | #------------------------------------------------------------------------------ 126 | # The OPER_GROUP is the OS group which is to be granted OSOPER privileges. 127 | # The value to be specified for OSOPER group is optional. 128 | #------------------------------------------------------------------------------ 129 | oracle.install.db.OPER_GROUP=dba 130 | 131 | #------------------------------------------------------------------------------ 132 | # The BACKUPDBA_GROUP is the OS group which is to be granted OSBACKUPDBA privileges. 133 | #------------------------------------------------------------------------------ 134 | oracle.install.db.BACKUPDBA_GROUP=dba 135 | 136 | #------------------------------------------------------------------------------ 137 | # The DGDBA_GROUP is the OS group which is to be granted OSDGDBA privileges. 138 | #------------------------------------------------------------------------------ 139 | oracle.install.db.DGDBA_GROUP=dba 140 | 141 | #------------------------------------------------------------------------------ 142 | # The KMDBA_GROUP is the OS group which is to be granted OSKMDBA privileges. 143 | #------------------------------------------------------------------------------ 144 | oracle.install.db.KMDBA_GROUP=dba 145 | 146 | ############################################################################### 147 | # # 148 | # Grid Options # 149 | # # 150 | ############################################################################### 151 | #------------------------------------------------------------------------------ 152 | # Specify the type of Real Application Cluster Database 153 | # 154 | # - ADMIN_MANAGED: Admin-Managed 155 | # - POLICY_MANAGED: Policy-Managed 156 | # 157 | # If left unspecified, default will be ADMIN_MANAGED 158 | #------------------------------------------------------------------------------ 159 | oracle.install.db.rac.configurationType= 160 | 161 | #------------------------------------------------------------------------------ 162 | # Value is required only if RAC database type is ADMIN_MANAGED 163 | # 164 | # Specify the cluster node names selected during the installation. 165 | # Leaving it blank will result in install on local server only (Single Instance) 166 | # 167 | # Example : oracle.install.db.CLUSTER_NODES=node1,node2 168 | #------------------------------------------------------------------------------ 169 | oracle.install.db.CLUSTER_NODES= 170 | 171 | #------------------------------------------------------------------------------ 172 | # This variable is used to enable or disable RAC One Node install. 173 | # 174 | # - true : Value of RAC One Node service name is used. 175 | # - false : Value of RAC One Node service name is not used. 176 | # 177 | # If left blank, it will be assumed to be false. 178 | #------------------------------------------------------------------------------ 179 | oracle.install.db.isRACOneInstall= 180 | 181 | #------------------------------------------------------------------------------ 182 | # Value is required only if oracle.install.db.isRACOneInstall is true. 183 | # 184 | # Specify the name for RAC One Node Service 185 | #------------------------------------------------------------------------------ 186 | oracle.install.db.racOneServiceName= 187 | 188 | #------------------------------------------------------------------------------ 189 | # Value is required only if RAC database type is POLICY_MANAGED 190 | # 191 | # Specify a name for the new Server pool that will be configured 192 | # Example : oracle.install.db.rac.serverpoolName=pool1 193 | #------------------------------------------------------------------------------ 194 | oracle.install.db.rac.serverpoolName= 195 | 196 | #------------------------------------------------------------------------------ 197 | # Value is required only if RAC database type is POLICY_MANAGED 198 | # 199 | # Specify a number as cardinality for the new Server pool that will be configured 200 | # Example : oracle.install.db.rac.serverpoolCardinality=2 201 | #------------------------------------------------------------------------------ 202 | oracle.install.db.rac.serverpoolCardinality= 203 | 204 | ############################################################################### 205 | # # 206 | # Database Configuration Options # 207 | # # 208 | ############################################################################### 209 | 210 | #------------------------------------------------------------------------------- 211 | # Specify the type of database to create. 212 | # It can be one of the following: 213 | # - GENERAL_PURPOSE 214 | # - DATA_WAREHOUSE 215 | # GENERAL_PURPOSE: A starter database designed for general purpose use or transaction-heavy applications. 216 | # DATA_WAREHOUSE : A starter database optimized for data warehousing applications. 217 | #------------------------------------------------------------------------------- 218 | oracle.install.db.config.starterdb.type=GENERAL_PURPOSE 219 | 220 | #------------------------------------------------------------------------------- 221 | # Specify the Starter Database Global Database Name. 222 | #------------------------------------------------------------------------------- 223 | oracle.install.db.config.starterdb.globalDBName=ORCL 224 | 225 | #------------------------------------------------------------------------------- 226 | # Specify the Starter Database SID. 227 | #------------------------------------------------------------------------------- 228 | oracle.install.db.config.starterdb.SID=ORCL 229 | 230 | #------------------------------------------------------------------------------- 231 | # Specify whether the database should be configured as a Container database. 232 | # The value can be either "true" or "false". If left blank it will be assumed 233 | # to be "false". 234 | #------------------------------------------------------------------------------- 235 | oracle.install.db.ConfigureAsContainerDB= 236 | 237 | #------------------------------------------------------------------------------- 238 | # Specify the Pluggable Database name for the pluggable database in Container Database. 239 | #------------------------------------------------------------------------------- 240 | oracle.install.db.config.PDBName= 241 | 242 | #------------------------------------------------------------------------------- 243 | # Specify the Starter Database character set. 244 | # 245 | # One of the following 246 | # AL32UTF8, WE8ISO8859P15, WE8MSWIN1252, EE8ISO8859P2, 247 | # EE8MSWIN1250, NE8ISO8859P10, NEE8ISO8859P4, BLT8MSWIN1257, 248 | # BLT8ISO8859P13, CL8ISO8859P5, CL8MSWIN1251, AR8ISO8859P6, 249 | # AR8MSWIN1256, EL8ISO8859P7, EL8MSWIN1253, IW8ISO8859P8, 250 | # IW8MSWIN1255, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE, 251 | # KO16MSWIN949, ZHS16GBK, TH8TISASCII, ZHT32EUC, ZHT16MSWIN950, 252 | # ZHT16HKSCS, WE8ISO8859P9, TR8MSWIN1254, VN8MSWIN1258 253 | #------------------------------------------------------------------------------- 254 | oracle.install.db.config.starterdb.characterSet=AL32UTF8 255 | 256 | #------------------------------------------------------------------------------ 257 | # This variable should be set to true if Automatic Memory Management 258 | # in Database is desired. 259 | # If Automatic Memory Management is not desired, and memory allocation 260 | # is to be done manually, then set it to false. 261 | #------------------------------------------------------------------------------ 262 | oracle.install.db.config.starterdb.memoryOption=true 263 | 264 | #------------------------------------------------------------------------------- 265 | # Specify the total memory allocation for the database. Value(in MB) should be 266 | # at least 256 MB, and should not exceed the total physical memory available 267 | # on the system. 268 | # Example: oracle.install.db.config.starterdb.memoryLimit=512 269 | #------------------------------------------------------------------------------- 270 | oracle.install.db.config.starterdb.memoryLimit=512 271 | 272 | #------------------------------------------------------------------------------- 273 | # This variable controls whether to load Example Schemas onto 274 | # the starter database or not. 275 | # The value can be either "true" or "false". If left blank it will be assumed 276 | # to be "false". 277 | #------------------------------------------------------------------------------- 278 | oracle.install.db.config.starterdb.installExampleSchemas= 279 | 280 | ############################################################################### 281 | # # 282 | # Passwords can be supplied for the following four schemas in the # 283 | # starter database: # 284 | # SYS # 285 | # SYSTEM # 286 | # DBSNMP (used by Enterprise Manager) # 287 | # # 288 | # Same password can be used for all accounts (not recommended) # 289 | # or different passwords for each account can be provided (recommended) # 290 | # # 291 | ############################################################################### 292 | 293 | #------------------------------------------------------------------------------ 294 | # This variable holds the password that is to be used for all schemas in the 295 | # starter database. 296 | #------------------------------------------------------------------------------- 297 | oracle.install.db.config.starterdb.password.ALL=Comply123 298 | 299 | #------------------------------------------------------------------------------- 300 | # Specify the SYS password for the starter database. 301 | #------------------------------------------------------------------------------- 302 | oracle.install.db.config.starterdb.password.SYS= 303 | 304 | #------------------------------------------------------------------------------- 305 | # Specify the SYSTEM password for the starter database. 306 | #------------------------------------------------------------------------------- 307 | oracle.install.db.config.starterdb.password.SYSTEM= 308 | 309 | #------------------------------------------------------------------------------- 310 | # Specify the DBSNMP password for the starter database. 311 | #------------------------------------------------------------------------------- 312 | oracle.install.db.config.starterdb.password.DBSNMP= 313 | 314 | #------------------------------------------------------------------------------- 315 | # Specify the PDBADMIN password required for creation of Pluggable Database in the Container Database. 316 | #------------------------------------------------------------------------------- 317 | oracle.install.db.config.starterdb.password.PDBADMIN= 318 | 319 | #------------------------------------------------------------------------------- 320 | # Specify the management option to use for managing the database. 321 | # Options are: 322 | # 1. CLOUD_CONTROL - If you want to manage your database with Enterprise Manager Cloud Control along with Database Express. 323 | # 2. DEFAULT -If you want to manage your database using the default Database Express option. 324 | #------------------------------------------------------------------------------- 325 | oracle.install.db.config.starterdb.managementOption=DEFAULT 326 | 327 | #------------------------------------------------------------------------------- 328 | # Specify the OMS host to connect to Cloud Control. 329 | # Applicable only when oracle.install.db.config.starterdb.managementOption=CLOUD_CONTROL 330 | #------------------------------------------------------------------------------- 331 | oracle.install.db.config.starterdb.omsHost= 332 | 333 | #------------------------------------------------------------------------------- 334 | # Specify the OMS port to connect to Cloud Control. 335 | # Applicable only when oracle.install.db.config.starterdb.managementOption=CLOUD_CONTROL 336 | #------------------------------------------------------------------------------- 337 | oracle.install.db.config.starterdb.omsPort= 338 | 339 | #------------------------------------------------------------------------------- 340 | # Specify the EM Admin user name to use to connect to Cloud Control. 341 | # Applicable only when oracle.install.db.config.starterdb.managementOption=CLOUD_CONTROL 342 | #------------------------------------------------------------------------------- 343 | oracle.install.db.config.starterdb.emAdminUser= 344 | 345 | #------------------------------------------------------------------------------- 346 | # Specify the EM Admin password to use to connect to Cloud Control. 347 | # Applicable only when oracle.install.db.config.starterdb.managementOption=CLOUD_CONTROL 348 | #------------------------------------------------------------------------------- 349 | oracle.install.db.config.starterdb.emAdminPassword= 350 | 351 | ############################################################################### 352 | # # 353 | # SPECIFY RECOVERY OPTIONS # 354 | # ------------------------------------ # 355 | # Recovery options for the database can be mentioned using the entries below # 356 | # # 357 | ############################################################################### 358 | 359 | #------------------------------------------------------------------------------ 360 | # This variable is to be set to false if database recovery is not required. Else 361 | # this can be set to true. 362 | #------------------------------------------------------------------------------- 363 | oracle.install.db.config.starterdb.enableRecovery=false 364 | 365 | #------------------------------------------------------------------------------- 366 | # Specify the type of storage to use for the database. 367 | # It can be one of the following: 368 | # - FILE_SYSTEM_STORAGE 369 | # - ASM_STORAGE 370 | #------------------------------------------------------------------------------- 371 | oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE 372 | 373 | #------------------------------------------------------------------------------- 374 | # Specify the database file location which is a directory for datafiles, control 375 | # files, redo logs. 376 | # 377 | # Applicable only when oracle.install.db.config.starterdb.storage=FILE_SYSTEM_STORAGE 378 | #------------------------------------------------------------------------------- 379 | oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/u01/app/oracle/oradata 380 | 381 | #------------------------------------------------------------------------------- 382 | # Specify the recovery location. 383 | # 384 | # Applicable only when oracle.install.db.config.starterdb.storage=FILE_SYSTEM_STORAGE 385 | #------------------------------------------------------------------------------- 386 | oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=/u01/app/oracle/fast_recovery_area 387 | 388 | #------------------------------------------------------------------------------- 389 | # Specify the existing ASM disk groups to be used for storage. 390 | # 391 | # Applicable only when oracle.install.db.config.starterdb.storageType=ASM_STORAGE 392 | #------------------------------------------------------------------------------- 393 | oracle.install.db.config.asm.diskGroup= 394 | 395 | #------------------------------------------------------------------------------- 396 | # Specify the password for ASMSNMP user of the ASM instance. 397 | # 398 | # Applicable only when oracle.install.db.config.starterdb.storage=ASM_STORAGE 399 | #------------------------------------------------------------------------------- 400 | oracle.install.db.config.asm.ASMSNMPPassword= 401 | 402 | #------------------------------------------------------------------------------ 403 | # Specify the My Oracle Support Account Username. 404 | # 405 | # Example : MYORACLESUPPORT_USERNAME=abc@oracle.com 406 | #------------------------------------------------------------------------------ 407 | MYORACLESUPPORT_USERNAME= 408 | 409 | #------------------------------------------------------------------------------ 410 | # Specify the My Oracle Support Account Username password. 411 | # 412 | # Example : MYORACLESUPPORT_PASSWORD=password 413 | #------------------------------------------------------------------------------ 414 | MYORACLESUPPORT_PASSWORD= 415 | 416 | #------------------------------------------------------------------------------ 417 | # Specify whether to enable the user to set the password for 418 | # My Oracle Support credentials. The value can be either true or false. 419 | # If left blank it will be assumed to be false. 420 | # 421 | # Example : SECURITY_UPDATES_VIA_MYORACLESUPPORT=true 422 | #------------------------------------------------------------------------------ 423 | SECURITY_UPDATES_VIA_MYORACLESUPPORT=false 424 | 425 | #------------------------------------------------------------------------------ 426 | # Specify whether user doesn't want to configure Security Updates. 427 | # The value for this variable should be true if you don't want to configure 428 | # Security Updates, false otherwise. 429 | # 430 | # The value can be either true or false. If left blank it will be assumed 431 | # to be false. 432 | # 433 | # Example : DECLINE_SECURITY_UPDATES=false 434 | #------------------------------------------------------------------------------ 435 | DECLINE_SECURITY_UPDATES=true 436 | 437 | #------------------------------------------------------------------------------ 438 | # Specify the Proxy server name. Length should be greater than zero. 439 | # 440 | # Example : PROXY_HOST=proxy.domain.com 441 | #------------------------------------------------------------------------------ 442 | PROXY_HOST= 443 | 444 | #------------------------------------------------------------------------------ 445 | # Specify the proxy port number. Should be Numeric and at least 2 chars. 446 | # 447 | # Example : PROXY_PORT=25 448 | #------------------------------------------------------------------------------ 449 | PROXY_PORT= 450 | 451 | #------------------------------------------------------------------------------ 452 | # Specify the proxy user name. Leave PROXY_USER and PROXY_PWD 453 | # blank if your proxy server requires no authentication. 454 | # 455 | # Example : PROXY_USER=username 456 | #------------------------------------------------------------------------------ 457 | PROXY_USER= 458 | 459 | #------------------------------------------------------------------------------ 460 | # Specify the proxy password. Leave PROXY_USER and PROXY_PWD 461 | # blank if your proxy server requires no authentication. 462 | # 463 | # Example : PROXY_PWD=password 464 | #------------------------------------------------------------------------------ 465 | PROXY_PWD= 466 | 467 | #------------------------------------------------------------------------------ 468 | # Specify the Oracle Support Hub URL. 469 | # 470 | # Example : COLLECTOR_SUPPORTHUB_URL=https://orasupporthub.company.com:8080/ 471 | #------------------------------------------------------------------------------ 472 | COLLECTOR_SUPPORTHUB_URL= 473 | -------------------------------------------------------------------------------- /step1/install: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | date 4 | su -s /bin/bash oracle -c "cd /tmp/install/database/ && ./runInstaller -ignoreSysPrereqs -ignorePrereq -silent -noconfig -responseFile /tmp/db_install.rsp" 5 | -------------------------------------------------------------------------------- /step1/oraInst.loc: -------------------------------------------------------------------------------- 1 | inventory_loc=/u01/app/oraInventory 2 | inst_group=oinstall 3 | -------------------------------------------------------------------------------- /step1/sysctl.conf: -------------------------------------------------------------------------------- 1 | # System default settings live in /usr/lib/sysctl.d/00-system.conf. 2 | # To override those settings, enter new settings here, or in an /etc/sysctl.d/.conf file 3 | # 4 | # For more information, see sysctl.conf(5) and sysctl.d(5). 5 | kernel.sem = 250 32000 100 128 6 | fs.file-max = 6815744 7 | net.ipv4.ip_local_port_range = 9000 65500 8 | net.core.rmem_default = 262144 9 | net.core.rmem_max = 4194304 10 | net.core.wmem_default = 262144 11 | net.core.wmem_max = 1048576 12 | fs.aio-max-nr = 1048576 13 | -------------------------------------------------------------------------------- /step2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM oracle-12c:installed 2 | MAINTAINER Wouter Scherphof 3 | 4 | RUN rm -rf /tmp/install 5 | 6 | ENV ORACLE_SID ORCL 7 | ENV ORACLE_HOME $ORACLE_BASE/product/12.1.0/dbhome_1 8 | ENV PATH $ORACLE_HOME/bin:$PATH 9 | 10 | RUN $ORACLE_HOME/root.sh 11 | 12 | RUN mkdir -p $ORACLE_BASE/oradata && chown -R oracle:oinstall $ORACLE_BASE/oradata && chmod -R 775 $ORACLE_BASE/oradata 13 | RUN mkdir -p $ORACLE_BASE/fast_recovery_area && chown -R oracle:oinstall $ORACLE_BASE/fast_recovery_area && chmod -R 775 $ORACLE_BASE/fast_recovery_area 14 | 15 | ADD initORCL.ora $ORACLE_HOME/dbs/initORCL.ora 16 | ADD createdb.sql $ORACLE_HOME/config/scripts/createdb.sql 17 | ADD conf_finish.sql $ORACLE_HOME/config/scripts/conf_finish.sql 18 | ADD create /tmp/create 19 | -------------------------------------------------------------------------------- /step2/conf_finish.sql: -------------------------------------------------------------------------------- 1 | -- Setting Enterprise Manager Express HTTP ports. 2 | exec dbms_xdb_config.sethttpsport(5500); 3 | exec dbms_xdb_config.sethttpport(8080); 4 | 5 | -- Shutdown. 6 | shutdown immediate; 7 | 8 | exit; 9 | -------------------------------------------------------------------------------- /step2/create: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cat >> /home/oracle/.bash_profile <> catalog-e.sql 33 | su -s /bin/bash oracle -c "sqlplus / as sysdba @?/rdbms/admin/catalog-e.sql > /tmp/catalog.log" 34 | rm catalog-e.sql 35 | echo "" 36 | 37 | date 38 | echo "Running catproc.sql..." 39 | cd $ORACLE_HOME/rdbms/admin 40 | cp catproc.sql catproc-e.sql 41 | echo "exit" >> catproc-e.sql 42 | su -s /bin/bash oracle -c "sqlplus / as sysdba @?/rdbms/admin/catproc-e.sql > /tmp/catproc.log" 43 | rm catproc-e.sql 44 | echo "" 45 | 46 | date 47 | echo "Running pupbld.sql..." 48 | cd $ORACLE_HOME/sqlplus/admin 49 | cp pupbld.sql pupbld-e.sql 50 | echo "exit" >> pupbld-e.sql 51 | su -s /bin/bash oracle -c "sqlplus system/manager @?/sqlplus/admin/pupbld-e.sql > /tmp/pupbld.log" 52 | rm pupbld-e.sql 53 | echo "" 54 | 55 | echo "Finalizing install and shutting down the database..." 56 | su -s /bin/bash oracle -c "sqlplus / as sysdba @?/config/scripts/conf_finish.sql" 57 | echo "" 58 | 59 | date 60 | echo "Create is done; commit the container now" 61 | -------------------------------------------------------------------------------- /step2/createdb.sql: -------------------------------------------------------------------------------- 1 | connect / as sysdba 2 | create spfile from pfile; 3 | startup nomount 4 | CREATE DATABASE ORCL 5 | EXTENT MANAGEMENT LOCAL 6 | DEFAULT TEMPORARY TABLESPACE temp 7 | UNDO TABLESPACE undotbs1 8 | DEFAULT TABLESPACE users 9 | CHARACTER SET AL32UTF8 10 | NATIONAL CHARACTER SET UTF8; 11 | CREATE TABLESPACE apps_tbs LOGGING 12 | DATAFILE '/u01/app/oracle/oradata/ORCL/apps01.dbf' 13 | SIZE 500M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED 14 | EXTENT MANAGEMENT LOCAL; 15 | CREATE TABLESPACE indx_tbs LOGGING 16 | DATAFILE '/u01/app/oracle/oradata/ORCL/indx01.dbf' 17 | SIZE 100M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED 18 | EXTENT MANAGEMENT LOCAL; 19 | exit 20 | -------------------------------------------------------------------------------- /step2/initORCL.ora: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # Example INIT.ORA file 3 | # 4 | # This file is provided by Oracle Corporation to help you start by providing 5 | # a starting point to customize your RDBMS installation for your site. 6 | # 7 | # NOTE: The values that are used in this file are only intended to be used 8 | # as a starting point. You may want to adjust/tune those values to your 9 | # specific hardware and needs. You may also consider using Database 10 | # Configuration Assistant tool (DBCA) to create INIT file and to size your 11 | # initial set of tablespaces based on the user input. 12 | ############################################################################### 13 | 14 | db_name='ORCL' 15 | memory_target=1G 16 | processes = 150 17 | # db_block_size=8192 18 | # db_domain='' 19 | db_create_file_dest='/u01/app/oracle/oradata' 20 | db_recovery_file_dest='/u01/app/oracle/fast_recovery_area' 21 | db_recovery_file_dest_size=2G 22 | diagnostic_dest='/u01/app/oracle' 23 | dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)' 24 | open_cursors=300 25 | remote_login_passwordfile='EXCLUSIVE' 26 | undo_tablespace='UNDOTBS1' 27 | # You may want to ensure that control files are created on separate physical 28 | # devices 29 | # control_files = (ora_control1, ora_control2) 30 | compatible ='12.1.0' 31 | -------------------------------------------------------------------------------- /step3/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM oracle-12c:created 2 | MAINTAINER Wouter Scherphof 3 | 4 | RUN rm /tmp/create 5 | 6 | # Exposes the default TNS port, as well as the Enterprise Manager Express HTTP 7 | # (8080) and HTTPS (5500) ports. 8 | EXPOSE 1521 5500 8080 9 | 10 | ADD startdb.sql $ORACLE_HOME/config/scripts/startdb.sql 11 | ADD start /tmp/start 12 | CMD /tmp/start 13 | -------------------------------------------------------------------------------- /step3/start: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | while true; do 4 | status=`ps -ef | grep tns | grep oracle` 5 | pmon=`ps -ef | egrep pmon_$ORACLE_SID'\>' | grep -v grep` 6 | if [ "$status" == "" ] || [ "$pmon" == "" ] 7 | then 8 | su -s /bin/bash oracle -c "lsnrctl start" 9 | su -s /bin/bash oracle -c "sqlplus /nolog @?/config/scripts/startdb.sql" 10 | su -s /bin/bash oracle -c "lsnrctl status" 11 | fi 12 | sleep 1m 13 | done; 14 | -------------------------------------------------------------------------------- /step3/startdb.sql: -------------------------------------------------------------------------------- 1 | connect / as sysdba 2 | startup 3 | exit 4 | --------------------------------------------------------------------------------