Oracle 7.7 下单机部署Oracle Database 11.2.0.4

一、准备用户环境

1.1、计划将数据库安装在 /dev/sdb 磁盘上

mkdir /u01
echo "/dev/sdb    /u01   ext4    defaults   0 0 " >> /etc/fstab
mount -a
df -h

1.2、添加用户、组及安装目录

groupadd -g 6000 oinstall
groupadd -g 6001 dba
groupadd -g 6002 oper

useradd -g oinstall -G dba,oper oracle

mkdir -p /u01/app/oracle
mkdir -p /u01/app/oracle/product/11.2.0/db_1

chown -R oracle:oinstall /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle/product/11.2.0/db_1

chmod -R 775 /u01/app

mkdir /u01/app/oraInventory
chown oracle:oinstall /u01/app/oraInventory/

passwd oracle <<EOF
Admin@123Pass
Admin@123Pass
EOF

1.3、配置Oracle用户环境变量

echo "export PATH=/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
export ORACLE_BASE=/u01/app/oracle # Oracle Base 
export ORACLE_HOME=\$ORACLE_BASE/product/11.2.0/db_1 # Oracle Home 
export PATH=\$ORACLE_HOME/bin:\$PATH 
export ORACLE_SID=orcl
export ORACLE_UNQNAME=orcl
export NLS_LANG=\"AMERICAN_AMERICA.UTF8\"
alias ss=\"rlwrap sqlplus / as sysdba\"
alias sqlplus=\"rlwrap sqlplus\"
alias rman=\"rlwrap rman\"
export HISTTIMEFORMAT=\"%d/%m/%y %T\"
" >> /home/oracle/.bash_profile

echo "export alfs=\"/u01/app/oracle/diag/rdbms/orcl/orcl/trace/alert_orcl1.log\"
" >> /root/.bash_profile

1.4、修改 /etc/security/limits.conf

echo "
#oracle SETTING
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536" >> /etc/security/limits.conf

1.5、修改 /etc/sysctl.conf

echo "
#oracle SETTING
kernel.shmall = 4294967296
fs.aio-max-nr = 1048576
fs.file-max = 6815744
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 = 1048586
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.tcp_rmem = 4194304 4194304 4194304 " >> /etc/sysctl.conf

sysctl -p

1.6、修改 /etc/pam.d/login

echo "
#oracle SETTING
session required pam_limits.so " >> /etc/pam.d/login

1.7、修改 /etc/profile

echo "
#oracle SETTING
if [ \$USER = \"oracle\" ]; then
    if [ \$SHELL = \"/bin/ksh\" ]; then
       ulimit -u 16384 
       ulimit -n 65536
    else
       ulimit -u 16384 -n 65536
    fi
fi" >>  /etc/profile

1.8、关闭transparent_hugepage的配置

echo " if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
   echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi" >> /etc/rc.local

chmod +x /etc/rc.d/rc.local

echo never > /sys/kernel/mm/transparent_hugepage/enabled
cat /sys/kernel/mm/transparent_hugepage/enabled

1.9、配置本地源:

echo "[local]
name=local
baseurl=file:///media
gpgcheck=0
enabled=1" > /etc/yum.repos.d/local.repo

1.10、安装依赖的软件包

yum clean all
yum list
yum grouplist

yum groupinstall 'Development tools'  'Compatibility libraries'  'Desktop Platform Development' -y

yum install libaio-devel unixODBC unixODBC-devel ksh elfutils-libelf-devel -y

yum install -y binutils compat-libstdc++-33 compat-libcap1 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat ksh unixODBC unixODBC-devel

rpm -q --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" binutils compat-libstdc++-33 compat-libcap1 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat ksh unixODBC unixODBC-devel

1.11、默认启动级别设置为图形界面

systemctl set-default multi-user.target
systemctl set-default graphical.target

1.12、网卡配置(使用nmcli配置)

nmcli con add con-name ens192 ifname ens192 autoconnect yes type ethernet ip4 192.168.10.25/24 gw4 192.168.10.250

nmcli con up ens192

二、开始安装

2.1、准备安装文件,开始安装(使用本地JDK,则不会出现中文乱码)

mv p13390677_112040_Linux-x86-64_* /u01/app/oracle/
chown oracle:oinstall /u01/app/oracle/ -R
su - oracle
cd /u01/app/oracle/
unzip p13390677_112040_Linux-x86-64_1of7.zip
unzip p13390677_112040_Linux-x86-64_2of7.zip

export DISPLAY=":0"

[root@emrdb soft]# java -version
openjdk version "1.8.0_222-ea"
OpenJDK Runtime Environment (build 1.8.0_222-ea-b03)
OpenJDK 64-Bit Server VM (build 25.222-b03, mixed mode)

cd /u01/app/oracle/database
./runInstaller -jreLoc /usr/lib/jvm/jre-1.8.0 &

2.2、缺少 pdksh-5.2.14,可选择忽略

解决办法:

vim /u01/app/oracle/database/stage/cvu/cvu_config
将 CV_ASSUME_DISTID=OEL4 改为: CV_ASSUME_DISTID=OEL7

或者运行以下命令安装:
./runInstaller -ignorePrereq  -jreLoc /usr/lib/jvm/jre-1.8.0

2.3、安装Oracle 11g 86%报错:Error in invoking target 'agent nmhs' of makefile

编辑 ins_emagent.mk 后,重试即可。

在$(MK_EMAGENT_NMECTL) 后 添加 -lnnz11【注:-前有个空格,第一个是字母l,后面两个是数字1】

vim /u01/app/oracle/product/11.2.0/db_1/sysman/lib/ins_emagent.mk
vim $ORACLE_HOME/sysman/lib/ins_emagent.mk
$(MK_EMAGENT_NMECTL) -lnnz11

2.4、执行配置脚本,完成数据库软件安装

点赞

发表评论

电子邮件地址不会被公开。必填项已用 * 标注