#将下面文字保存io.sh脚本文件,选择unix编码格式保存脚本和oracle压缩包传入linux, linux进入io.sh 所在目录,下面我们就来聊聊关于centos7.4如何测试安装oracle成功?接下来我们就一起去了解一下吧!

centos7.4如何测试安装oracle成功(安装前配置环境脚本)

centos7.4如何测试安装oracle成功

#将下面文字保存io.sh脚本文件,选择unix编码格式保存。脚本和oracle压缩包传入linux, linux进入io.sh 所在目录。

##chmod x io.sh 赋予执行权限, ./io.sh 运行脚本。更多内容看视频。

linux-centos7.5,xshell脚本安装oracle11g全程

setenforce 0 #临时关闭selinux

systemctl stop firewalld.service #关闭firewalld

yum -y install iptables-services #安装iptables

systemctl restart iptables.service

systemctl enable iptables.service

#安装依赖

yum -y install binutils compat compat-libstdc gcc gcc-c glibc glibc-devel ksh libaio libaio-devel libgcc libstdc libstdc -devel libXi libXtst make sysstat unixODBC unixODBC-devel unzip net-tools telnet

#chmod x

#、创建用户

groupadd oinstall

groupadd dba

useradd -g oinstall -G dba -m oracle

#passwd oracle

#、创建安装目录,解压文件

mkdir -p /ora/oracle

chown -R oracle:oinstall /ora

chmod 755 -R /ora

unzip -d /ora/ /home/io/linux.x64_11gR2_database_1of2.zip

unzip -d /ora/ /home/io/linux.x64_11gR2_database_2of2.zip

#修改内核

echo 'fs.aio-max-nr = 1048576' >>/etc/sysctl.conf

echo 'fs.file-max = 6815744' >>/etc/sysctl.conf

echo 'kernel.shmall = 2097152' >>/etc/sysctl.conf

echo 'kernel.shmmax = 4294967295' >>/etc/sysctl.conf

echo 'kernel.shmmni = 4096' >>/etc/sysctl.conf

echo 'kernel.sem = 250 32000 100 128' >>/etc/sysctl.conf

echo 'net.ipv4.ip_local_port_range = 9000 65500' >>/etc/sysctl.conf

echo 'net.core.rmem_default = 262144' >>/etc/sysctl.conf

echo 'net.core.rmem_max = 4194304' >>/etc/sysctl.conf

echo 'net.core.wmem_default = 262144' >>/etc/sysctl.conf

echo 'net.core.wmem_max = 1048576' >>/etc/sysctl.conf

#修改认证模块

echo 'oracle soft nproc 131072' >>/etc/security/limits.conf

echo 'oracle hard nproc 131072' >>/etc/security/limits.conf

echo 'oracle soft nofile 131072' >>/etc/security/limits.conf

echo 'oracle hard nofile 131072' >>/etc/security/limits.conf

echo 'oracle soft core unlimited' >>/etc/security/limits.conf

echo 'oracle hard core unlimited' >>/etc/security/limits.conf

echo 'oracle soft memlock 50000000' >>/etc/security/limits.conf

echo 'oracle hard memlock 50000000' >>/etc/security/limits.conf

#修改Oracle用户环境变量,或者改.bash_profile

echo 'export PATH' >>/home/oracle/.bashrc

echo 'export ORACLE_BASE=/ora/oracle' >>/home/oracle/.bashrc

echo 'export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1' >>/home/oracle/.bashrc

echo 'export ORACLE_SID=orcl' >>/home/oracle/.bashrc

echo 'export ORACLE_UNQNAME=orcl' >>/home/oracle/.bashrc

echo 'export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH' >>/home/oracle/.bashrc

echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib' >>/home/oracle/.bashrc

echo 'export LANG=C' >>/home/oracle/.bashrc

echo 'export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK' >>/home/oracle/.bashrc

#环境变量生效

sysctl -p

source /home/oracle/.bashrc

,