【Oracle Database】在CentOS 7.5 安装 Oracle Database 11gR2
原创
©著作权归作者所有:来自51CTO博客作者dbprofessional的原创作品,谢绝转载,否则将追究法律责任
[root@node01 ~]# yum -y install gcc gcc-c++ glibc glibc-common ksh make sysstat \
binutils elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static \
glibc-devel glibc-headers libaio libaio-devel libstdc++ libstdc++-devel \
compat-libcap1 compat-libstdc++-33 libXext unixODBC unixODBC-devel
[root@node01 ~]# groupadd oinstall
[root@node01 ~]# groupadd dba
[root@node01 ~]# useradd -g oinstall -G dba oracle
[root@node01 ~]# echo oracle | passwd --stdin oracle
Changing password for user oracle.
passwd: all authentication tokens updated successfully.
[root@node01 ~]# cat >> /etc/sysctl.conf <<EOF
kernel.shmmax = 2141192192
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
fs.aio-max-nr=1048576
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
EOF
[root@node01 ~]# sysctl -p
[root@node01 ~]# cat >> /etc/security/limits.conf <<EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF
[root@node01 ~]# cat >> /etc/pam.d/login <<EOF
session required pam_limits.so
EOF
[root@node01 ~]# cat >> /etc/profile <<EOF
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
EOF
[root@node01 ~]# mkdir -p /u01/app/oracle
[root@node01 ~]# chown -R oracle:oinstall /u01/app
[root@node01 ~]# chmod -R 775 /u01/app
[oracle@node01 ~]$ vim .bash_profile
export ORACLE_SID=core
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
export DISPLAY=192.168.1.100:0
stty erase ^H
[oracle@node01 ~]$ source .bash_profile
[oracle@node01 ~]$ unzip p13390677_112040_Linux-x86-64_1of7.zip
[oracle@node01 ~]$ unzip p13390677_112040_Linux-x86-64_2of7.zip
[oracle@node01 ~]$ cd database
[oracle@node01 database]$ ./runInstaller
[oracle@node01 ~]$ vim $ORACLE_HOME/sysman/lib/ins_emagent.mk
将$(MK_EMAGENT_NMECTL)修改为:$(MK_EMAGENT_NMECTL) -lnnz11
[oracle@node01 ~]$ sqlplus / as sysdba
SQL> select * from dual;
D
-
X
[oracle@node01 ~]$ dbca -silent -deleteDatabase -sourcedb core -sid core -sysDBAUserName sys -sysDBAPassword oracle
[oracle@node01 ~]$ cd /u01/app/oracle/product/11.2.0/db_1/deinstall/
[oracle@node01 deinstall]$ ./deinstall
[root@node01 ~]# rm -rf /etc/oraInst.loc
[root@node01 ~]# rm -rf /opt/ORCLfmap
[root@node01 ~]# rm -rf /etc/oratab