Docker中安装Oracle 11.2.0.4

宿主机:CentOS Linux release 7.3.1611

Docker Version: 1.12.5

Oracle 11.2.0.4

基础镜像: docker.io/centos

主要步骤

1. 使用centos镜像运行容器

docker run -it -p 192.168.10.51:1521:1521 --name os4oracle -v /container_data/oracle_data:/oracle docker.io/centos

PS: 已在宿主机上解压Oracle安装文件到/container_data/oracle_data/database中

2. 在容器中执行如下操作

groupadd dba

groupadd oinstall

useradd -m -g oinstall -G dba oracle

passwd oracle

useradd nobody

mkdir -p /opt/oracle

mkdir -p /opt/oracle/product/11.2.0/db_1

chown -R oracle:dba /opt

chmod -R 775 /opt

yum -y install gcc

yum -y install make

yum -y install binutils

yum -y install gcc-c++

yum -y install compat-libstdc++-33

yum -y install elfutils-libelf-devel

yum -y install elfutils-libelf-devel-static

yum -y install ksh

yum -y install libaio

yum -y install libaio-devel

yum -y install numactl-devel

yum -y install sysstat

yum -y install unixODBC

yum -y install unixODBC-devel

yum -y install pcre-devel

/etc/security/limits.conf

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

/etc/sysctl.conf

fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmall = 2097152

kernel.shmmax = 936870912

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048576

/home/oracle/.bash_profile

export ORACLE_BASE=/opt/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1

export ORACLE_SID=orcl

export ORACLE_TERM=xterm

export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

export LANG=en_US

export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

3.准备静默安装需要的应答文件和创建数据库需要的模板文件(在可视化的环境中生成)

本例中db_install.rsp 内容如下:

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0

oracle.install.option=INSTALL_DB_SWONLY

ORACLE_HOSTNAME

UNIX_GROUP_NAME=dba

INVENTORY_LOCATION=/opt/oraInventory

SELECTED_LANGUAGES=en,zh_CN

ORACLE_HOME=/opt/oracle/product/11.2.0/db_1

ORACLE_BASE=/opt/oracle

oracle.install.db.InstallEdition=EE

oracle.install.db.EEOptionsSelection=true

oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.4.0,oracle.oraolap:11.2.0.4.0,oracle.rdbms.dm:11.2.0.4.0,oracle.rdbms.dv:11.2.0.4.0,oracle.rdbms.lbac:11.2.0.4.0,oracle.rdbms.rat:11.2.0.4.0

oracle.install.db.DBA_GROUP=dba

oracle.install.db.OPER_GROUP=dba

oracle.install.db.CLUSTER_NODES=

oracle.install.db.isRACOneInstall=

oracle.install.db.racOneServiceName=

oracle.install.db.config.starterdb.type=GENERAL_PURPOSE

oracle.install.db.config.starterdb.globalDBName=orcl

oracle.install.db.config.starterdb.SID=orcl

oracle.install.db.config.starterdb.characterSet=ZHS16GBK

oracle.install.db.config.starterdb.memoryOption=true

oracle.install.db.config.starterdb.memoryLimit=512

oracle.install.db.config.starterdb.installExampleSchemas=false

oracle.install.db.config.starterdb.enableSecuritySettings=true

oracle.install.db.config.starterdb.password.ALL=oracle

oracle.install.db.config.starterdb.password.SYS=

oracle.install.db.config.starterdb.password.SYSTEM=

oracle.install.db.config.starterdb.password.SYSMAN=

oracle.install.db.config.starterdb.password.DBSNMP=

oracle.install.db.config.starterdb.control=DB_CONTROL

oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=

oracle.install.db.config.starterdb.automatedBackup.enable=false

oracle.install.db.config.starterdb.automatedBackup.osuid=

oracle.install.db.config.starterdb.automatedBackup.ospwd=

oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE

oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/oracle/oracle_data

oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=

oracle.install.db.config.asm.diskGroup=

oracle.install.db.config.asm.ASMSNMPPassword=

MYORACLESUPPORT_USERNAME=

MYORACLESUPPORT_PASSWORD=

SECURITY_UPDATES_VIA_MYORACLESUPPORT=

DECLINE_SECURITY_UPDATES=true

PROXY_HOST=

PROXY_PORT=

PROXY_USER=

PROXY_PWD=

PROXY_REALM=

COLLECTOR_SUPPORTHUB_URL=

oracle.installer.autoupdates.option=

oracle.installer.autoupdates.downloadUpdatesLoc=

AUTOUPDATES_MYORACLESUPPORT_USERNAME=

AUTOUPDATES_MYORACLESUPPORT_PASSWORD=

建库模板文件

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/17db841d67b3065bfd87f25a1b7e9aad.html