Docker下安装oracle 11.2.0.4

本文提供Oracle 11g在Docker容器中的安装步骤,包括准备安装包、配置响应文件、安装软件及数据库等关键环节。特别强调了几个常见问题及其解决方法。
该文章已生成可运行项目,

开发板推荐:天空星STM32F407VET6开发板

超高性价比 STM32主控 | 超高主频 | 一板兼容百芯 | 比赛神器 | 沉金彩色丝印

https://github.com/sunrainwater/oracle-11g.git 上已经有完善的安装代码

克隆git代码,生成镜像

直接执行:

docker run -it –privileged –name oracle11g -p 1521:1521 -v /data:/install oracle-11g-scripts
(最后面不加bash,不然不会自动执行,而是进去到容器里了)


1、将oracle安装包上传到宿主机,并解压(例:/data目录下)
[root@localhost data]# ll

total 2487256
drwxr-xr-x. 7  440  200       4096 Aug 27  2013 database
drwx------. 2 root root      16384 Aug 30 23:23 lost+found
-rw-r--r--. 1 root root 1395582860 Aug 30 23:59 p13390677_112040_Linux-x86-64_1of7.zip
-rw-r--r--. 1 root root 1151304589 Aug 30 23:59 p13390677_112040_Linux-x86-64_2of7.zip

2、用Docker官网的镜像启动,并将/data 挂载到/install 下

docker run -it --privileged --name oracle11g -p 1521:1521 -v /data:/install jaspeen/oracle-11g bash

3、将db_install.rsp拷贝到 /assets 下 (因为镜像里的是oracle 11.2.0.1),并授予x权限

[root@37ad936c72bf ~]# cd /install/database/response/

[root@37ad936c72bf response]# ll
total 80
-rw-r--r--. 1 oracle oinstall 25116 Aug 27  2013 db_install.rsp
-rwxr-xr-x. 1 oracle oinstall 44533 Aug 27  2013 dbca.rsp
-rwxr-xr-x. 1 oracle oinstall  5871 Aug 27  2013 netca.rsp

[root@37ad936c72bf assets]chmod +x db_install.rsp

4、修改 db_install.rsp

可将文件修改好,只需要修改其中的主机名即可

sed -i "s/localhost/$HOSTNAME/g" db_install.rsp

或
直接修改文件

####################################################################
## Copyright(c) Oracle Corporation 1998,2013. All rights reserved.##
##                                                                ##
## Specify values for the variables listed below to customize     ##
## your installation.                                             ##
##                                                                ##
## Each variable is associated with a comment. The comment        ##
## can help to populate the variables with the appropriate        ##
## values.                            ##
##                                                                ##
## IMPORTANT NOTE: This file contains plain text passwords and    ##
## should be secured to have read permission only by oracle user  ##
## or db administrator who owns this installation.                ##
##                                                                ##
####################################################################

#------------------------------------------------------------------------------
# Do not change the following system generated value. 
#
# 标注响应文件版本,这个版本必须和要#安装的数据库版本相同,安装检验无法通过,不能更改
#------------------------------------------------------------------------------
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0

#------------------------------------------------------------------------------
# Specify the installation option.
# It can be one of the following:
#
# 选择安装类型:1.只装数据库软件 2.安装数据库软件并建库 3.升级数据库
#   - INSTALL_DB_SWONLY
#   - INSTALL_DB_AND_CONFIG
#   - UPGRADE_DB
#-------------------------------------------------------------------------------
oracle.install.option=INSTALL_DB_SWONLY

#-------------------------------------------------------------------------------
# Specify the hostname of the system as set during the install. It can be used
# to force the installation to use an alternative hostname rather than using the
# first hostname found on the system. (e.g., for systems with multiple hostnames 
# and network interfaces)
#
# 指定操作系统主机名,通过hostname命令获得
#-------------------------------------------------------------------------------
ORACLE_HOSTNAME=bcd668678bfe

#-------------------------------------------------------------------------------
# Specify the Unix group to be set for the inventory directory. 
#
# 指定oracle inventory目录的所有者,通常会是oinstall或者dba 
#-------------------------------------------------------------------------------
UNIX_GROUP_NAME=oinstall

#-------------------------------------------------------------------------------
# Specify the location which holds the inventory files.
# This is an optional parameter if installing on
# Windows based Operating System.
#
# 指定产品清单oracle inventory目录的路径,如果是Win平台下可以省略
#-------------------------------------------------------------------------------
INVENTORY_LOCATION=/opt/oracle/oraInventory

#-------------------------------------------------------------------------------
# Specify the languages in which the components will be installed.             
# 
# en   : English                  ja   : Japanese                  
# fr   : French                   ko   : Korean                    
# ar   : Arabic                   es   : Latin American Spanish    
# bn   : Bengali                  lv   : Latvian                   
# pt_BR: Brazilian Portuguese     lt   : Lithuanian                
# bg   : Bulgarian                ms   : Malay                     
# fr_CA: Canadian French          es_MX: Mexican Spanish           
本文章已经生成可运行项目

开发板推荐:天空星STM32F407VET6开发板

超高性价比 STM32主控 | 超高主频 | 一板兼容百芯 | 比赛神器 | 沉金彩色丝印

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值