环境准备
一、下载安装包
官方下载地址:http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
[root@oracle data]# ls
linuxamd64_12c_database_1of2.zip linuxamd64_12c_database_2of2.zip
二、安装依赖包
yum install -y binutils compat-libstdc++ gcc gcc-c++ \
glibc glibc-devel ksh libaio libaio-devel libgcc \
libstdc++ libstdc++-devel libXext libXtst libX11 \
libXau libXi make sysstat
三、添加用户
groupadd dba
groupadd oinstall
useradd -g oinstall -G dba oracle
echo 'ycig1234' | passwd oracle --stdin
chown -R oracle.oinstall /data/
[root@oracle data]# ll /data/
total 2419500
-rw-r--r-- 1 oracle oinstall 1361028723 Jan 28 08:06 linuxamd64_12c_database_1of2.zip
-rw-r--r-- 1 oracle oinstall 1116527103 Jan 28 08:05 linuxamd64_12c_database_2of2.zip
四、关闭selinux和iptables
setenforce 0
service iptables stop
chkconfig iptables off
五、修改环境配置
先备份
cp /etc/sysctl.conf{,.bak}
再修改
vim /etc/sysctl.conf
kernel.shmmni = 4096
kernel.sem =250 32000 100 128
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
net.ipv4.ip_local_port_range =9000 65500
fs.file-max=65536
fs.aio-max-nr=1048576
使其生效
sysctl -p
修改用户限制
vim /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 10240
vim /etc/profile
if [ $USER = "oracle" ]; then
ulimit -u 16384
ulimit -n 65536
fi
六、修改环境变量
su - oracle
vi ~/.bash_profile
export ORACLE_BASE=/data/oracle/app
export ORACLE_HOME=$ORACLE_BASE/oracle/product/12.1.0/dbhome_1
export ORACLE_SID=orcl
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export ORACLE_CLIENT=$ORACLE_HOME
安装
解压文件
cd /data
unzip linuxamd64_12c_database_1of2.zip
unzip linuxamd64_12c_database_2of2.zip
拷贝静默安装模板文件到/data目录下
cd /data/database/response/
cp * /data/
[oracle@ecs-5864 response]$ ll
total 96
-rwxrwxr-x 1 oracle oinstall 58021 Aug 30 2012 dbca.rsp
-rw-rw-r-- 1 oracle oinstall 26690 May 25 2013 db_install.rsp
-rwxrwxr-x 1 oracle oinstall 6038 Jun 19 2012 netca.rsp
db_install
修改db_install.rsp配置文件
(建议在原模板文件上修改,以下为修改了的配置项)
vim /data/db_install.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.1.0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=ecs-5864
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/data/oracle/app/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/data/oracle/app/oracle/product/12.1.0/dbhome_1
ORACLE_BASE=/data/oracle/app
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
oracle.install.db.BACKUPDBA_GROUP=dba
oracle.install.db.DGDBA_GROUP=dba
oracle.install.db.KMDBA_GROUP=dba
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=VMS3DEVDB
oracle.install.db.config.starterdb.SID=VMS3DEVDB
oracle.install.db.ConfigureAsContainerDB=false
oracle.install.db.config.starterdb.characterSet=ZHS16GBK
oracle.install.db.config.starterdb.password.ALL=123456
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
##安装
选项帮助可以用./runInstaller -h
cd /data/database/
./runInstaller -force -silent -noconfig -responseFile /data/db_install.rsp
安装完成后根据提示使用root执行两个脚本文件
su - root
sh /data/oracle/app/oraInventory/orainstRoot.sh
sh /data/oracle/app/oracle/product/12.1.0/dbhome_1/root.sh
netca
编辑netca.rsp响应文件
vim /data/netca.rsp
(建议在原模板上进行修改)
[GENERAL]
RESPONSEFILE_VERSION="12.1"
CREATE_TYPE="CUSTOM"
[oracle.net.ca]
INSTALLED_COMPONENTS={"server","net8","javavm"}
INSTALL_TYPE=""custom""
LISTENER_NUMBER=1
LISTENER_NAMES={"LISTENER"}
LISTENER_PROTOCOLS={"TCP;1521"}
LISTENER_START=""LISTENER""
NAMING_METHODS={"TNSNAMES","ONAMES","HOSTNAME"}
NSN_NUMBER=1
NSN_NAMES={"EXTPROC_CONNECTION_DATA"}
NSN_SERVICE={"PLSExtProc"}
NSN_PROTOCOLS={"TCP;HOSTNAME;1521"}
创建netca
netca -silent -responseFile /data/netca.rsp
查看状态
lsnrctl status
dbca
编辑dbca.rsp文件
vim /data/dbca.rsp
(建议在原模板上进行修改)
[GENERAL]
#"oracle版本"
RESPONSEFILE_VERSION = "12.1.0"
#"执行操作,详情看模板"
OPERATION_TYPE = "createDatabase"
#"CREATEDATABASE部分"
[CREATEDATABASE]
#"global database name全局数据库名"
GDBNAME = "VMS3DEVDB"
#"SID"
SID = "VMS3DEVDB"
#"临时文件名称"
TEMPLATENAME = "General_Purpose.dbc"
#"管理员密码"
SYSPASSWORD = "ycig1234"
SYSTEMPASSWORD = "ycig1234"
#"数据文件存放目录"
DATAFILEDESTINATION = /data/oracle/app/oradata
#"文件恢复目录"
RECOVERYAREADESTINATION = /data/oracle/app/fast_recovery_area
#"存储类型,FS即File System"
STORAGETYPE=FS
#"字符编码"
CHARACTERSET = "ZHS16GBK"
创建
dbca -silent -createDatabase -responseFile /data/dbca.rsp
来源:oschina
链接:https://my.oschina.net/u/4344137/blog/4872809