KEMBAR78
Oracle Linux7+ASM+Oracle RAC 19c | PDF | System Software | Software
0% found this document useful (0 votes)
4 views8 pages

Oracle Linux7+ASM+Oracle RAC 19c

Uploaded by

32liu3232
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views8 pages

Oracle Linux7+ASM+Oracle RAC 19c

Uploaded by

32liu3232
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 8

vi /etc/hosts

cat >> /etc/hosts << EOF

192.168.0.21 fgcwdb21
192.168.0.22 fgcwdb22

10.10.100.21 fgcwdb21priv
10.10.100.22 fgcwdb22priv

192.168.0.23 fgcwdb21vip
192.168.0.24 fgcwdb22vip

192.168.0.25 fgcwdbscan
EOF

cat /etc/hosts

cat >> ~/.bash_profile << EOF


export LANG=en_US.UTF8
EOF

cat ~/.bash_profile
source ~/.bash_profile

fdisk /dev/sdb
fdisk /dev/sdc
mkfs.xfs /dev/sdb1
mkfs.xfs /dev/sdc1
mkdir /oracle
mkdir /backup

cat >> /etc/fstab << EOF


/dev/sdb1 /oracle xfs defaults 0 0
/dev/sdc1 /backup xfs defaults 0 0
EOF

mount /oracle
mount /backup

/usr/sbin/groupadd -g 60001 oinstall


/usr/sbin/groupadd -g 60002 dba
/usr/sbin/groupadd -g 60003 oper
/usr/sbin/groupadd -g 60004 backupdba
/usr/sbin/groupadd -g 60005 dgdba
/usr/sbin/groupadd -g 60006 kmdba
/usr/sbin/groupadd -g 60007 asmdba
/usr/sbin/groupadd -g 60008 asmoper
/usr/sbin/groupadd -g 60009 asmadmin
/usr/sbin/useradd -u 61001 -g oinstall -G asmadmin,asmdba,dba,asmoper,oper grid
/usr/sbin/useradd -u 61002 -g oinstall -G
dba,backupdba,dgdba,kmdba,asmadmin,asmdba,oper oracle

echo "oracle" | passwd --stdin grid


echo "oracle" | passwd --stdin oracle

mkdir -p /oracle/app/grid
mkdir -p /oracle/app/19c/grid
chown -R grid:oinstall /oracle

mkdir -p /oracle/app/oraInventory
chown -R grid:oinstall /oracle/app/oraInventory

mkdir -p /oracle/app/oracle/product/19c/db_1
chown -R oracle:oinstall /oracle/app/oracle
chmod -R 775 /oracle

chown -R grid:oinstall /backup


chmod -R 775 /backup

mount /dev/cdrom /mnt

cd /etc/yum.repos.d

mkdir bk

mv *.repo bk/

echo "[EL]" >> /etc/yum.repos.d/itpux.repo


echo "name =Linux 7.x DVD" >> /etc/yum.repos.d/itpux.repo
echo "baseurl=file:///mnt" >> /etc/yum.repos.d/itpux.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/itpux.repo
echo "enabled=1" >> /etc/yum.repos.d/itpux.repo

cat /etc/yum.repos.d/itpux.repo

# From Public Yum or ULN


yum -y install autoconf
yum -y install automake
yum -y install binutils
yum -y install binutils-devel
yum -y install bison
yum -y install cpp
yum -y install dos2unix
yum -y install ftp
yum -y install gcc
yum -y install gcc-c++
yum -y install lrzsz
yum -y install python-devel
yum -y install compat-db*
yum -y install compat-gcc-34
yum -y install compat-gcc-34-c++
yum -y install compat-libcap1
yum -y install compat-libstdc++-33
yum -y install compat-libstdc++-33.i686
yum -y install glibc-*
yum -y install glibc-*.i686
yum -y install libXpm-*.i686
yum -y install libXp.so.6
yum -y install libXt.so.6
yum -y install libXtst.so.6
yum -y install libXext
yum -y install libXext.i686
yum -y install libXtst
yum -y install libXtst.i686
yum -y install libX11
yum -y install libX11.i686
yum -y install libXau
yum -y install libXau.i686
yum -y install libxcb
yum -y install libxcb.i686
yum -y install libXi
yum -y install libXi.i686
yum -y install libXtst
yum -y install libstdc++-docs
yum -y install libgcc_s.so.1
yum -y install libstdc++.i686
yum -y install libstdc++-devel
yum -y install libstdc++-devel.i686
yum -y install libaio
yum -y install libaio.i686
yum -y install libaio-devel
yum -y install libaio-devel.i686
yum -y install ksh
yum -y install libXp
yum -y install libaio-devel
yum -y install numactl
yum -y install numactl-devel
yum -y install make -y
yum -y install sysstat -y
yum -y install unixODBC
yum -y install unixODBC-devel
yum -y install elfutils-libelf-devel-0.97
yum -y install elfutils-libelf-devel
yum -y install redhat-lsb-core

systemctl set-default multi-user.target

cat >> /etc/security/limits.conf << EOF


#ORACLE SETTING
grid soft nproc 16384
grid hard nproc 16384
grid soft nofile 65536
grid hard nofile 65536
grid soft stack 32768
grid hard stack 32768
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft stack 32768
oracle hard stack 32768
#oracle hard memlock 2000000
#oracle soft memlock 2000000
EOF
ulimit -a

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


cat /etc/pam.d/login

#Amend the "/etc/security/limits.d/90-nproc.conf" file as described below. See MOS


Note [ID 1487773.1]
echo "* - nproc 16384" > /etc/security/limits.d/90-nproc.conf
cat >> /etc/sysctl.conf << EOF
#ORACLE SETTING
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmax = 2684354560
kernel.shmall = 655360
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
vm.nr_hugepages = 1200
net.ipv4.ip_local_port_range = 9000 65500
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
net.ipv4.ip_forward=1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
kernel.panic_on_oops = 1
vm.swappiness=5
vm.min_free_kbytes=204800
EOF
sysctl -p

cat /sys/kernel/mm/transparent_hugepage/defrag
[always] madvise never

cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never

cat >> /etc/rc.d/rc.local << EOF

if test -f /sys/kernel/mm/transparent_hugepage/enabled; then


echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
EOF
chmod +x /etc/rc.d/rc.local

/etc/default/grub:

sed -ie 's/rhgb quiet/rhgb quiet numa=off/g' /etc/default/grub


cat /etc/default/grub

然后执行:
grub2-mkconfig -o /etc/grub2.cfg

numastat

numactl --show

numactl --hardware

ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime


hwclock
echo "SELINUX=disabled" > /etc/selinux/config
echo "#SELINUXTYPE=targeted " >> /etc/selinux/config

cat /etc/selinux/config
setenforce 0

systemctl status firewalld.service


systemctl stop firewalld.service
systemctl disable firewalld.service

We've made a lot of changes, so it's worth doing a reboot of the VM at this point
to make sure all the changes have taken effect.
# shutdown -r now

vi /etc/fstab
none /dev/shm tmpfs defaults,size=6144m 0 0

mount -o remount /dev/shm

echo "NOZEROCONF=yes" >> /etc/sysconfig/network

vi /etc/nsswitch.conf
修改行
hosts: files dns myhostname

hosts: files dns myhostname nis

sed -ie 's/files dns myhostname/files dns myhostname nis/g' /etc/nsswitch.conf


cat /etc/nsswitch.conf

for OL7:
systemctl stop avahi-daemon.socket avahi-daemon.service
systemctl disable avahi-daemon.socket avahi-daemon.service

Either configure NTP, or make sure it is not configured so the Oracle Cluster Time
Synchronization Service (ctssd) can synchronize the times of the RAC nodes. If you
want to deconfigure NTP do the following, which is what I did for this
installation.

systemctl stop ntpd


systemctl disable ntpd
systemctl status ntpd

systemctl stop chronyd


systemctl disable chronyd
systemctl status chronyd

rm -rf /etc/chrony.conf
date -s 'Sat Dec 1 17:37:01 CST 2018'

su - grid
export LANG=en_US.UTF8
vi ~/.bash_profile

PS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1
umask 022
#alias sqlplus="rlwrap sqlplus"
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
ORACLE_SID=+ASM1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
ORACLE_BASE=/oracle/app/grid; export ORACLE_BASE
ORACLE_HOME=/oracle/app/19c/grid; export ORACLE_HOME
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
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

su - oracle
export LANG=en_US.UTF8
vi ~/.bash_profile

PS1="[`whoami`@`hostname`:"'$PWD]$'
#alias sqlplus="rlwrap sqlplus"
#alias rman="rlwrap rman"
export PS1
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_UNQNAME=fgcwdb
ORACLE_BASE=/oracle/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/19c/db_1; export ORACLE_HOME
ORACLE_SID=fgcwdb1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.UTF8;export NLS_LANG
PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
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
su - grid
export LANG=en_US.UTF8
vi ~/.bash_profile

PS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1
umask 022
export TMP=/tmp
export LANG=en_US.UTF8
export TMPDIR=$TMP
ORACLE_SID=+ASM2; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
ORACLE_BASE=/oracle/app/grid; export ORACLE_BASE
ORACLE_HOME=/oracle/app/19c/grid; export ORACLE_HOME
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
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

su - oracle
export LANG=en_US.UTF8
vi ~/.bash_profile

PS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1
export TMP=/tmp
export LANG=en_US.UTF8
export TMPDIR=$TMP
export ORACLE_UNQNAME=fgcwdb
ORACLE_BASE=/oracle/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/19c/db_1; export ORACLE_HOME
ORACLE_SID=fgcwdb2; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.UTF8;export NLS_LANG
PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
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

root:
vi ~/.bash_profile
/oracle/app/19c/grid/bin

cd /backup

#./fgsshUserSetup.sh -user grid -hosts "fgcwdb21 fgcwdb22" -advanced -exverify -


confirm
#./fgsshUserSetup.sh -user oracle -hosts "fgcwdb21 fgcwdb22" -advanced -exverify -
confirm

oracle

su - grid
ssh fgcwdb66 date
ssh fgcwdb67 date

exit
su - oracle
ssh fgcwdb66 date
ssh fgcwdb67 date
exit

--------------------
asm 设置

for i in {d..l};
do
echo "sd$i" "`/usr/lib/udev/scsi_id --whitelisted --replace-whitespace
--device=/dev/sd$i` ";
done

for i in {d..l};
do
echo "KERNEL==\"sd?\",SUBSYSTEM==\"block\", PROGRAM==\"/usr/lib/udev/scsi_id --
whitelisted --replace-whitespace
--device=/dev/\$name\",RESULT==\"`/usr/lib/udev/scsi_id --whitelisted --replace-
whitespace --device=/dev/sd$i`\", SYMLINK+=\"asm-disk$i\",OWNER=\"grid\",
GROUP=\"asmadmin\",MODE=\"0660\""
done

vi /etc/udev/rules.d/99-oracle-asmdevices.rules

/sbin/udevadm trigger --type=devices --action=change

ls -lsa /dev/asm*
ls -lsa /dev/sd*

You might also like