1.Oracle 19c RAC For Linux安装部署 (视频讲解)
https://edu.csdn.net/course/detail/35792
2.Oracle数据库 底层原理解析_解析oracle数据库内部实现(视频讲解)
https://edu.csdn.net/course/detail/35647
3.Oracle11gR2数据库安装
https://edu.csdn.net/course/detail/27750
4.Oracle 12c 数据库安装
https://edu.csdn.net/course/detail/35882
5.Oracle 19c 数据库一键安装
https://edu.csdn.net/course/detail/39198
6.Oracle 19c RAC For Linux安装部署 (视频讲解)
https://edu.csdn.net/course/detail/35792
7.oracle 19c 数据库基础和日常管理
https://edu.csdn.net/course/detail/36112
8.Oracle 11g DataGuard RAC集群到单节点部署
https://edu.csdn.net/course/detail/35959
9.Oracle数据库 底层原理解析_解析oracle数据库内部实现(视频讲解)
https://edu.csdn.net/course/detail/35647
10.MySQL数据库基础实战教程
https://edu.csdn.net/course/detail/26743
本章节详细介绍了Oracle19c RAC集群在Linux系统上的部署步骤。
部署环境信息
以下安装步骤以节点1为例
1.系统配置
1.1.修改主机名
[root@localhost ~]# hostnamectl set-hostname node1
1.2.修改hosts文件
vim /etc/hosts
127.0.0.1 localhost
# Public ip
192.168.1.21 node1
192.168.1.22 node2
# Private ip
10.0.60.21 node1-priv
10.0.60.22 node2-priv
# Virture ip
192.168.1.23 node1-vip
192.168.1.24 node2-vip
# Scan ip
192.168.1.25 scanip
1.3.配置服务器ip地址
cd /etc/sysconfig/network-scripts
[root@node1 network-scripts]# cat ifcfg-ens33
TYPE=Ethernet
BOOTPROTO=static
NAME=ens33
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.1.21
GATEWAY=192.168.120.2
NETMASK=255.255.255.0
[root@node1 network-scripts]#cat ifcfg-ens34
TYPE=Ethernet
BOOTPROTO=static
NAME=ens34
DEVICE=ens34
ONBOOT=yes
IPADDR=10.0.60.21
NETWORK=10.0.60.1
NETMASK=255.255.255.0
1.4.配置yum
[root@node1 ~]# > /etc/yum.repos.d/my.repo
[root@node1 ~]#cat >> /etc/yum.repos.d/my.repo << EOF
[Oracle]
name=oracle_install
baseurl=file:///mnt/
gpgcheck=0
enabled=1
EOF
1.5.安装相关rpm包
yum install -y binutils \
compat-libcap1 \
compat-libstdc++-33 \
gcc \
gcc-c++ \
elfutils-libelf \
elfutils-libelf-devel \
glibc \
glibc-devel \
ksh \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
libxcb \
libX11 \
libXau \
libXi \
libXtst \
libXrender \
libXrender-devel \
make \
net-tools \
nfs-utils \
smartmontools \
sysstat \
e2fsprogs \
e2fsprogs-libs \
fontconfig-devel \
expect \
unzip \
openssh-clients \
readline* \
bc
yum install -y gnome*
单独上传compat-libstdc++-33,并安装
rpm -ivh compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
检查rpm包安装情况
rpm -q bc binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ elfutils-libelf elfutils-libelf-devel glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libxcb libX11 libXau libXi libXtst libXrender libXrender-devel make net-tools nfs-utils smartmontools sysstat e2fsprogs e2fsprogs-libs fontconfig-devel expect unzip openssh-clients readline | grep "not installed"
1.6.关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl status firewalld.service
vim /etc/sysconfig/selinux
SELINUX=enforcing¸Ä³ÉSELINUX=disabled
1.7.配置VNC服务
在NODE1节点配置就可以
yum install -y tigervnc-server tigervnc-server-module
修改配置文件
cat /etc/sysconfig/vncservers
cat /lib/systemd/system/vncserver\@.service
cp /lib/systemd/system/vncserver\@.service /etc/systemd/system/vncserver\@:1.service
> /etc/systemd/system/vncserver\@:1.service
cat >> /etc/systemd/system/vncserver\@:1.service << EOF
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
User=root
ExecStartPre=-/usr/bin/vncserver -kill %i
ExecStart=/usr/bin/vncserver %i
PIDFile=/root/.vnc/%H%i.pid
ExecStop=-/usr/bin/vncserver -kill %i
[Install]
WantedBy=multi-user.target
EOF
#注:用 root 的话用把/home/root/.vnc/%H%i.pid 改为/root/.vnc/%H%i.pid
设置vnc登录密码
vncpasswd
启动vnc服务
systemctl daemon-reload
systemctl restart vncserver@:1.service
systemctl enable vncserver@:1.service
ss -lnt|grep 590
LISTEN 0 5 *:5901 *:*
LISTEN 0 5 :::5901 :::*
1.8.修改系统内核参数
cat >> /etc/sysctl.conf << EOF
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 = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
kernel.shmall = 2359296
kernel.shmmax = 9663676416
EOF
使设置生效
/sbin/sysctl -p
1.9.添加系统环境变量
cat >> /etc/profile <<EOF
if [ \$USER = "oracle" ] || [ \$USER = "grid" ]; then
if [ \$SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
EOF
10.系统资源限制配置
cat >> /etc/security/limits.conf <<EOF
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
grid hard stack 32768
grid soft nproc 2047
grid hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
oracle soft nproc 2047
oracle hard nproc 16384
oracle hard memlock 134217728
oracle soft memlock 134217728
EOF
1.11.添加组和用户
groupadd -g 14321 oinstall
groupadd -g 14322 dba
groupadd -g 14323 oper
groupadd -g 14324 backupdba
groupadd -g 14325 dgdba
groupadd -g 14326 kmdba
groupadd -g 14327 asmdba
groupadd -g 14328 asmoper
groupadd -g 14329 asmadmin
groupadd -g 14330 racdba
useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper,dba,racdba,oper grid
passwd grid
useradd -u 1101 -g oinstall -G asmdba,dba,backupdba,dgdba,kmdba,racdba,oper oracle
passwd oracle
1.12.创建目录、授权
mkdir -p /u01/app/grid
mkdir -p /u01/app/19.3.0/grid
chown -R grid:oinstall /u01
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01
13.添加grid用户变量
su - grid
[grid@node1 ~]$ vim .bash_profile
#alias ls="ll -at"
ORACLE_SID=+ASM1; export ORACLE_SID
JAVA_HOME=/usr/local/java;export JAVA_HOME
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
ORACLE_HOME=/u01/app/19.3.0/grid; export ORACLE_HOME
ORACLE_PATH=/u01/app/oracle/common/oracle/sql; export ORACLE_PATH
ORACLE_TERM=xterm;export ORACLE_TERM
NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS";export NLS_DATE_FORMAT
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
PATH=${PATH}:/u01/app/common/oracle/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export CLASSPATH
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/tmp
export TMPDIR=/tmp
#export NLS_LANG=american_america.ZHS16GBK
#alias sqlplus="rlwrap sqlplus"
umask 022
1.14.添加oracle用户变量
su - oracle
$ vim .bash_profile
#alias ls="ll -at"
ORACLE_SID=orcl1; export ORACLE_SID
ORACLE_UNQNAME=orcl; export ORACLE_UNQNAME
JAVA_HOME=/usr/local/java; export JAVA_HOME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/19.3.0/dbhome_1; export ORACLE_HOME
ORACLE_PATH=/u01/app/common/oracle/sql; export ORACLE_PATH
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
PATH=${PATH}:/u01/app/common/oracle/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export CLASSPATH
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/tmp
export TMPDIR=/tmp
#export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
umask 022
#alias sqlplus="rlwrap sqlplus"
#alias rman="rlwrap rman"
1.15.禁用NTP服务
使用root用户
service ntpd stop
chkconfig ntpd off
mv /etc/ntp.conf /etc/ntp.conf.bak
1.16.配置 RAC 节点以便可以使用 SSH 进行远程访问
验证已安装 SSH 软件
[root@node1 ~]# rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep ssh
openssh-askpass-4.3p2-41.el5 (x86_64)
openssh-clients-4.3p2-41.el5 (x86_64)
openssh-4.3p2-41.el5 (x86_64)
openssh-server-4.3p2-41.el5 (x86_64)
17.配置节点互信
./sshUserSetup.sh -user grid -hosts "node1 node2" -advanced -exverify -confirm -noPromptPassphrase
./sshUserSetup.sh -user oracle -hosts "node1 node2" -advanced -exverify -confirm -noPromptPassphrase
验证节点互信
su - grid
ssh node1 "date;hostname"
ssh node2 "date;hostname"
su - oracle
ssh node1 "date;hostname"
ssh node2 "date;hostname"
1.18.关闭透明大页和numa
sed -i 's/quiet/quiet transparent_hugepage=never numa=off/' /etc/default/grub
grub2-mkconfig -o /boot/grub2/grub.cfg
重启后检查是否生效
cat /sys/kernel/mm/transparent_hugepage/enabled
cat /proc/cmdline
1.19.关闭avahi-daemon服务
yum install -y avahi*
systemctl stop avahi-daemon.socket
systemctl stop avahi-daemon.service
pgrep -f avahi-daemon | awk '{print "kill -9 "$2}'
systemctl disable avahi-daemon.socket
systemctl disable avahi-daemon.service
1.20.配置 nozeroconf
cat <<EOF>>/etc/sysconfig/network
NOZEROCONF=yes
EOF
2.集群和数据库安装
2.1.安装 xdpyinfo 软件
yum install xdpyinfo -y
2.2.上传集群软件并解压,解压到grid的home目录
[root@node1 ~]$ cd /opt
[root@node1 ~]$ chown grid.oinstall sw/
[root@node1 ~]$ su - grid -c "unzip -q /opt/sw/LINUX.X64_19.3.0_193000_grid_home.zip -d /u01/app/19.3.0/grid"
2.3.集群安装前环境检查
使用root用户安装
cd /u01/app/19.3.0/grid/cv/rpm/
CVUQDISK_GRP=oinstall; export CVUQDISK_GRP
rpm -ivh cvuqdisk-1.0.10-1.rpm
将cvuqdisk拷贝到其他节点
scp cvuqdisk-1.0.10-1.rpm node2:/opt/sw
CVUQDISK_GRP=oinstall; export CVUQDISK_GRP
rpm -ivh cvuqdisk-1.0.10-1.rpm
2.4.安装前环境检查
su - grid
[grid@node1 ~]$ cd $ORACLE_HOME
[grid@node1 grid]$ ./runcluvfy.sh stage -post hwos -n node1,node2 -verbose
2.5.安装集群软件
调取图形界面
[root@node1 ~]# xhost +
access control disabled, clients can connect from any host
[root@node1 ~]# su - grid
[grid@node1 ~]$ export DISPLAY=192.168.1.21:1
[grid@node1 ~]$ xhost +
access control disabled, clients can connect from any host
[grid@node1 ~]$ cd /u01/app/19.3.0/grid
[grid@node1 grid]#./gridSetup.sh
2.6.创建磁盘组
asmca
2.7.上传和解压数据库软件
上传数据库软件并解压,解压到grid的home目录
[root@node1 ~]$ cd /opt
[root@node1 ~]$ chown oracle.oinstall sw/ -R
[root@node1 ~]$ su - oracle -c "unzip -q /opt/sw/LINUX.X64_19.3.0_193000_db_home.zip -d /u01/app/oracle/product/19.3.0/dbhome_1"
2.8.安装数据库软件
su - oracle
[oracle@node1 ~]$ export DISPLAY=192.168.1.21:1
[oracle@node1 ~]$ cd /u01/app/oracle/product/19.3.0/dbhome_1
[oracle@node1 dbhome_1]$ ./runInstaller
2.9.创建数据库
dbca
总结
以上是Oracle19c RAC集群linux平台上安装的详细步骤。以上部署是在节点1的配置步骤,节点2第1部分系统配置和第2部分存储配置配置步骤一样;第3部分集群和数据库的安装,只需要在节点1执行即可。
1.Oracle数据库 底层原理解析_解析oracle数据库内部实现(视频讲解)
详细讲解了Oracle数据库内部是如何实现的,以及Oracle数据库的设计思路;
以此举一反三,可以轻松掌握MySQL与PostgreSQL数据库的设计思想与不同之处。
https://edu.csdn.net/course/detail/35647
2.Oracle 19c RAC For Linux安装部署(视频讲解)
https://edu.csdn.net/course/detail/35792