我将放在 /opt/install 目录下
yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*i686 compat-libstdc++-33*.devel compat-libstdc++-33 compat-libstdc++-33*.devel gcc gcc-c++ glibc glibc*.i686 glibc-devel glibc-devel*.i686 ksh libaio libaio*.i686 libaio-devel libaio-devel*.devel libgcc libgcc*.i686 libstdc++ libstdc++*.i686 libstdc++-devel libstdc++-devel*.devel libXi libXi*.i686 libXtst libXtst*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686
rpm -q binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXi libXtst make sysstat unixODBC unixODBC-devel
[root@localhost install]# groupadd -g 502 oinstall
[root@localhost install]# groupadd -g 503 dba
[root@localhost install]# groupadd -g 504 oper
[root@localhost install]# groupadd -g 505 asmadmin
[root@localhost install]# useradd -u 502 -g oinstall -G oinstall,dba,asmadmin,oper -s /bin/bash -m oracle
//设置oracle
[root@localhost install]# passwd oracle
mkdir /oradata
将/oradata上当及目录内的所有文件和目录的归属都修改为oracle用户
chown -R oracle:oinstall /oradata
[root@localhost oradata]# vim /etc/security/limits.conf
在60行插入以下内容,前面数字为行数
60 oracle soft nproc 2047
61 oracle hard nproc 16384
62 oracle soft nofile 1024
63 oracle hard nofile 65536
64 oracle soft stack 10240
操作用户:oracle
[root@localhost oradata]# su oracle
[oracle@localhost oradata]$ mkdir -p /oradata/soft/oracle11g
[oracle@localhost oracle11g]$ cd
[oracle@localhost ~]$ pwd
/home/oracle
[oracle@localhost ~]$ vim .bash_profile
前面数字为行号
13 export ORACLE_BASE=/oradata/soft/oracle11g
14 export ORACLE_HOME=$ORACLE_BASE/product/11.2.0.3/dbhome_1
15 export ORACLE_SID=prod
16 export NLS_LANG=.AL32UTF8
17 export PATH=${PATH}:${ORACLE_HOME}/bin:$ORACLE_HOME/lib64
使环境变量生效
[oracle@localhost ~]$ source .bash_profile
[oracle@localhost ~]$ cd /oradata/
拷贝安装文件db_install.rsp到/oradata目录下
[oracle@localhost oradata]$ cp /oradata/database/response/db_install.rsp /oradata
编辑db_install.rsp
[oracle@localhost oradata]$ vim db_install.rsp
对应行参数如图
29 oracle.install.option=INSTALL_DB_AND_CONFIG
37 ORACLE_HOSTNAME=192.168.78.142 #这里为虚拟机的ip地址
42 UNIX_GROUP_NAME=oinstall
49 INVENTORY_LOCATION=/oradata/soft/oraInventory
86 SELECTED_LANGUAGES=en,zh_CN
91 ORACLE_HOME=/oradata/soft/oracle11g/product/11.2.0.3/dbhome_1
96 ORACLE_BASE=/oradata/soft/oracle11g
107 oracle.install.db.InstallEdition=EE
154 oracle.install.db.DBA_GROUP=dba
160 oracle.install.db.OPER_GROUP=oper
189 oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
194 oracle.install.db.config.starterdb.globalDBName=prod
199 oracle.install.db.config.starterdb.SID=prod
213 oracle.install.db.config.starterdb.characterSet=AL32UTF8
221 oracle.install.db.config.starterdb.memoryOption=true
229 oracle.install.db.config.starterdb.memoryLimit=1024
262 oracle.install.db.config.starterdb.password.ALL=oracle
336 oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE
344 oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/oradata/soft/oracle11g/data
351 oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=/oradata/soft/oracle11g/fast_recovery_area
400 DECLINE_SECURITY_UPDATES=true
操作用户oracle
安装前将/oradata文件及目录下的所有文件文件夹的权限都属于oracle用户
[root@localhost soft]# chown -R oracle:oinstall /oradata/
[oracle@localhost database]$ ./runInstaller -silent -ignoreSysPrereqs -responseFile /oradata/db_install.rsp -ignorePrereq
执行成功会出现以下字段
将以下两句执行命令将拷贝到root用户下执行
1. /oradata/soft/oraInventory/orainstRoot.sh
2. /oradata/soft/oracle11g/product/11.2.0.3/dbhome_1/root.sh
[oracle@localhost database]$ sqlplus / as sysdba