0% found this document useful (0 votes)
19 views8 pages

Oracle Linux Setup Instructions

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)
19 views8 pages

Oracle Linux Setup Instructions

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

vi /etc/hosts

cat >> /etc/hosts << EOF

[Link] fgcwdb21
[Link] fgcwdb22

[Link] fgcwdb21priv
[Link] fgcwdb22priv

[Link] fgcwdb21vip
[Link] fgcwdb22vip

[Link] 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
[Link] /dev/sdb1
[Link] /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/[Link].d

mkdir bk

mv *.repo bk/

echo "[EL]" >> /etc/[Link].d/[Link]


echo "name =Linux 7.x DVD" >> /etc/[Link].d/[Link]
echo "baseurl=[Link] >> /etc/[Link].d/[Link]
echo "gpgcheck=0" >> /etc/[Link].d/[Link]
echo "enabled=1" >> /etc/[Link].d/[Link]

cat /etc/[Link].d/[Link]

# 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 [Link].6
yum -y install [Link].6
yum -y install [Link].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 [Link]

cat >> /etc/security/[Link] << 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/[Link]" file as described below. See MOS


Note [ID 1487773.1]
echo "* - nproc 16384" > /etc/security/limits.d/[Link]
cat >> /etc/[Link] << EOF
#ORACLE SETTING
[Link]-max-nr = 1048576
[Link]-max = 6815744
[Link] = 2684354560
[Link] = 655360
[Link] = 4096
[Link] = 250 32000 100 128
vm.nr_hugepages = 1200
net.ipv4.ip_local_port_range = 9000 65500
[Link].rp_filter = 2
[Link].rp_filter = 2
net.ipv4.ip_forward=1
[Link].rmem_default = 262144
[Link].rmem_max = 4194304
[Link].wmem_default = 262144
[Link].wmem_max = 1048586
kernel.panic_on_oops = 1
[Link]=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/[Link] << 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/[Link]

/etc/default/grub:

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


cat /etc/default/grub

然后执行:
grub2-mkconfig -o /etc/[Link]

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 [Link]


systemctl stop [Link]
systemctl disable [Link]

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/[Link]
修改行
hosts: files dns myhostname

hosts: files dns myhostname nis

sed -ie 's/files dns myhostname/files dns myhostname nis/g' /etc/[Link]


cat /etc/[Link]

for OL7:
systemctl stop [Link] [Link]
systemctl disable [Link] [Link]

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/[Link]
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

#./[Link] -user grid -hosts "fgcwdb21 fgcwdb22" -advanced -exverify -


confirm
#./[Link] -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/[Link]

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

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

You might also like