1. 程式人生 > >2018-1-3 第一節 安裝系統redhat (redhat6.9) for oracle

2018-1-3 第一節 安裝系統redhat (redhat6.9) for oracle

redhat6.9  系統推送程式碼 for oracle

第一步:分割槽

# CLASSROOM MACHINE(c) NEED A DISK OF: 90000M  
cat >>  /tmp/partitioning <<EOF  
clearpart --none  
part /boot  --size 300  #/boot 300M
part swap --size 4096  #swap 實體記憶體的1.5倍
part pv.RAC12crhel601 --size 45800  #視實際情況
volgroup RAC12crhel6 pv.RAC12crhel601  
logvol /  --vgname=RAC12crhel6 --size=45700 --name=root  #掛載點配置在根/
part pv.O11grhel502 --size 7000  #模擬物理硬碟,做ASM,四個做+DATA,一個做+FRA
part pv.O11grhel503 --size 7000  
part pv.O11grhel504 --size 7000  
part pv.O11grhel505 --size 7000  
part pv.O11grhel506 --size 10000  
EOF
第二步:系統配置

1、關閉防火牆:

檢視防火牆狀:

[[email protected] ~]# chkconfig --list iptables
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off
立即關閉,並非永久關閉
[[email protected] ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
永久關閉
[[email protected] ~]# chkconfig iptables off
2、配置網路:
[[email protected] ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0 
DEVICE=eth0  
BOOTPROTO=none  
ONBOOT=yes  
NETMASK=255.255.255.0  
IPADDR=XXX  
GATEWAY=192.168.0.254  
TYPE=Ethernet  
USERCTL=no  
IPV6INIT=no  
PEERDNS=yes 


3、掛載ISO檔案
給ISO檔案建立一個掛載點
[[email protected] /]# mkdir cd
[[email protected] /]#mount -o loop /stage/rhel-server-6.9-x86_64-dvd.iso  /cd
4、  配置yum源
配置本地檔案源:
vim /etc/yum.repos.d/base.repo
配置163源:
在cd /etc/yum.repos.d下新建一個163.repo檔案
[email protected] yum.repos.d]# vim /etc/yum.repos.d/163.repo
[[email protected] ~]# cd /etc/yum.repos.d/
[163]
name=163
baseurl=http://mirrors.163.com/centos/6.9/os/x86_64/
gpgcheck=0
enabled=1
這裡要注意的是,baseurl這一項,你要到http://mirrors.163.com/centos這裡,去找到你對應的redhat版本的目錄,然後點os、再點x86_64(一般都有),然後用你位址列上顯示的網址替換上面的baseurl就行了,儲存退出。
配置epel源
rpm -vih http://dl.fedoraproject.org/pub/epel/6/x86_64/Packages/e/epel-release-6-8.noarch.rpm  
5、補包:
#顯示所有已經安裝和可以安裝的程式包
[[email protected] yum.repos.d]# yum list | grep oracleasm
# Install the pub keys  
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-* 2>/dev/null  
 
yum -y groupinstall "Development tools"  
yum -y install libaio  
yum -y install libaio-devel  
    
yum -y install unixODBC  
yum -y install unixODBC-devel  

yum -y install oracleasm\*  
  
yum -y install openmotif\*  
yum -y install ksh\*  
yum -y install sysstat\*  
yum -y install compat\*  
yum -y install nfs-utils  
yum -y install "glibc-devel.i386"  
[[email protected] selinux]# yum -y install tigervnc-server.x86_64
[[email protected] selinux]# yum -y install tigervnc.x86_64
6、關閉:NetworkManager
chkconfig NetworkManager off  
7、關閉,SELINUX
sed -i.bak 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux
[[email protected] selinux]# vim /etc/selinux/config 
selinux狀態可以通過以下命令檢視:
sestatus
getenforce      <<-檢視selinux當前狀態

8、建oracle使用者/組
echo "oracle" | passwd --stdin root  
# oracle  
groupadd oinstall  
groupadd dba  
groupadd oper  
# grid  
groupadd asmadmin  
groupadd asmdba  
groupadd asmoper  
# oracle  
useradd -g oinstall -G dba,oper,asmadmin,asmdba,asmoper -d /home/oracle   oracle  
echo "oracle" | passwd --stdin oracle  
echo "export ORACLE_BASE=/u01/app/oracle" >> /home/oracle/.bash_profile  
echo '# export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1' >> /home/oracle/.bash_profile  
echo "# export ORACLE_SID=orcl"  >> /home/oracle/.bash_profile  
echo '# export TNS_ADMIN=/u01/app/oracle/product/11.2.0/grid/network/admin'  >> /home/oracle/.bash_profile  
echo "export NLS_LANG=american_america.AL32UTF8" >> /home/oracle/.bash_profile  
echo "export ORACLE_TERM=xterm" >> /home/oracle/.bash_profile  
echo "export EDITOR=vi" >> /home/oracle/.bash_profile  
echo '# export PATH=$ORACLE_HOME/bin:$PATH:/u01/app/oracle/product/11.2.0/grid/bin' >> /home/oracle/.bash_profile  
echo "export LANG=en_US" >> /home/oracle/.bash_profile  
  
mkdir -p /u01/app/oracle  
chown oracle:oinstall /u01/app  
chown oracle:oinstall /u01/app/oracle  
9、系統引數調整:
# Oracle2  
echo "fs.file-max = 6815744" >> /etc/sysctl.conf  
echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf  
echo "kernel.shmall = 2097152" >> /etc/sysctl.conf  
echo "kernel.shmmni = 4096" >> /etc/sysctl.conf  
echo "net.core.rmem_default=4194304" >> /etc/sysctl.conf  
echo "net.core.rmem_max=4194304" >> /etc/sysctl.conf  
echo "net.core.wmem_default=1048576" >> /etc/sysctl.conf  
echo "net.core.wmem_max=1048576" >> /etc/sysctl.conf  
echo "net.ipv4.ip_local_port_range = 9000 65500" >> /etc/sysctl.conf  
echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf
kernel.shmmax = 68719476736
這個引數為實體記憶體的一半,最好是一半到三分之二中間。
# Oracle3  
echo "session required /lib/security/pam_limits.so" >>/etc/pam.d/login  
# Oracle4  
echo "grid soft nproc 2047" >>/etc/security/limits.conf  
echo "grid hard nproc 16384" >>/etc/security/limits.conf  
echo "grid soft nofile 1024" >>/etc/security/limits.conf  
echo "grid hard nofile 65536" >>/etc/security/limits.conf  
echo "oracle soft nproc 2047" >>/etc/security/limits.conf  
echo "oracle hard nproc 16384" >>/etc/security/limits.conf  
echo "oracle soft nofile 1024" >>/etc/security/limits.conf  
echo "oracle hard nofile 65536" >>/etc/security/limits.conf  
wget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g_x8664/DATABASES/flashplayer-11.2.202.297-1.ram0.98.x86_64.rpm  
rpm -ivh /stage/flashplayer-11.2.202.297-1.ram0.98.x86_64.rpm  
cp /usr/lib/mozilla/plugins/libflashplayer.so  /usr/lib64/mozilla/plugins/  
# wget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g_x8664/DATABASES/pdksh-5.2.14-36.el5.x86_64.rpm  
# rpm -ivh /stage/pdksh-5.2.14-36.el5.x86_64.rpm --force --nodeps
wget -P /stage -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O12c_x8664/ASMLIB/oracleasmlib-2.0.4-1.el6.x86_64.rpm  
rpm -ivh /stage/oracleasmlib-2.0.4-1.el6.x86_64.rpm  
wget -P /stage -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O12c_x8664/ASMMOD/kmod-oracleasm-2.0.8-13.el6_8.x86_64.rpm  
rpm -ivh --force --nodeps /stage/kmod-oracleasm-2.0.8-13.el6_8.x86_64.rpm   
# UEK3 for ASMFD 
kmod-oracleasm 6.9要裝新版本的,kmod-oracleasmXXXXX6.9XXXXX
ASM盤組
chkconfig oracleasm on  
oracleasm configure -i<<EOF  
oracle  
asmadmin  
y  
y  
EOF  
  
oracleasm init  
  
vd1=/dev/\${disktype}5  
vd2=/dev/\${disktype}6  
vd3=/dev/\${disktype}7  
vd4=/dev/\${disktype}8  
vd5=/dev/\${disktype}3  
  
oracleasm createdisk ASMDISK01 \$vd1  
oracleasm createdisk ASMDISK02 \$vd2  
oracleasm createdisk ASMDISK03 \$vd3  
oracleasm createdisk ASMDISK04 \$vd4  
oracleasm createdisk ASMDISK05 \$vd5  
!  
安裝過程中使用到的軟體跟映象:
連結:https://pan.baidu.com/s/1nw9D2sD 密碼:4t02