1、创建组
groupadd oinstall
groupadd dba
2、创建用户
useradd -g oinstall -G dba oracle
3、创建密码
passwd oracle
4、为oracle创建文件夹
mkdir -p /u01/app/
chown -R oracle.oinstall /u01/app
chmod -R 775 /u01/app
5、优化内核参数
vim /etc/sysctl.conf
#写入
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1200000000
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
6、使参数生效
sysctl -p
7、限制oracle用户 shell权限
vim /etc/security/limits.conf
#写入
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
8、修改登陆程序login
vim /etc/pam.d/login
#写入
session required /lib64/security/pam_limits.so
9、使参数生效
source /etc/profile
10、切换用户
su - oracle
11、添加oracle环境变量
vim .bash_profile
#写入
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
PATH=$PATH:$ORACLE_HOME/bin
ORACLE_SID=orcl
NLS_LANG="SIMPLIFIED CHINESE_CHINA.UTF8"
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
12、刷新环境变量
source .bash_profile
13、切换用户
su - root
14、配置yum源
cd /etc
mv yum.repos.d yum.repos.d.bak
mkdir yum.repos.d
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
15、缓存
# 清理缓存
yum clean all
# 建缓存
yum makecache
#安装epel源
yum -y install epel-release
16、安装依赖
yum -y install \
binutils \
compat-libcap1 \
compat-libstdc++-33 \
compat-libstdc++-33*.i686 \
elfutils-libelf-devel \
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 \
make \
sysstat \
unixODBC \
unixODBC*.i686 \
unixODBC-devel \
unixODBC-devel*.i686 \
libXp
17、检查依赖
rpm -q \
binutils \
compat-libstdc++-33 \
elfutils-libelf \
elfutils-libelf-devel \
expat \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
make \
pdksh \
sysstat \
unixODBC \
unixODBC-devel | grep "not installed"
18、wget下载paksh的rpm包,下载到/tmp/
wget -O /tmp/pdksh-5.2.14-37.el5_8.1.x86_64.rpm http://vault.centos.org/5.11/os/x86_64/CentOS/pdksh-5.2.14-37.el5_8.1.x86_64.rpm
19、安装paksh
rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm
20、查看防火墙状态 " 绿色的 active(running) " 表示防火将打开
systemctl status firewalld.service
21、关闭防火墙
systemctl stop firewalld.service
22、禁用防火墙
systemctl disable firewalld.service
23、创建目录
mkdir /u01/db/
24、切换用户
su - oracle
25、上传压缩包至/u01/db/
解压
unzip linux.x64_11gR2_database_1of2.zip && unzip linux.x64_11gR2_database_2of2.zip
26、切换用户
su - root
27、创建目录
mkdir /home/oracle/etc/
28、复制
cp /db/database/response/* /home/oracle/etc/
29、授权
chmod 777 /home/oracle/etc/*.rsp
30、切换用户(注意主机用户必须是oracle!!!)
su - oracle
31、运行(按照自己的jie路径写)
./runInstaller -jreloc /opt/java/jdk1.8.0_181/jre
32、出现问题/u01/app/oracle/product/11.2.0/db_1/ctx/lib/ins_ctx.mk
再点击Retry继续安装
vim /u01/app/oracle/product/11.2.0/db_1/ctx/lib/ins_ctx.mk
#将
ctxhx: $(CTXHXOBJ) $(LINK_CTXHX) $(CTXHXOBJ) $(INSO_LINK)
#修改为
ctxhx: $(CTXHXOBJ) -static $(LINK_CTXHX) $(CTXHXOBJ) $(INSO_LINK) /usr/lib64/stdc.a
33、接下来问题/u01/app/oracle/product/11.2.0/db_1/sysman/lib/ins_emagent.mk.
再点击Retry继续安装
vim /u01/app/oracle/product/11.2.0/db_1/sysman/lib/ins_emagent.mk.
#将
$(MK_EMAGENT_NMECTL)
#修改为
$(MK_EMAGENT_NMECTL) -lnnz11
最后运行两个脚本就可以了!