您好,登錄后才能下訂單哦!
########12c rac 多出一個(gè)grid的base目錄和需要準(zhǔn)備一個(gè)40G的盤做GIMR磁盤,其他大致相同.
########從滿腦子問(wèn)號(hào)rac是什么開始搞,做之前先百度了解rac是什么,基本架構(gòu)是怎么樣的,大概就是下圖這樣子,詳細(xì)點(diǎn)的自行百度~
########準(zhǔn)備好oracle安裝包,Oracle官網(wǎng)下載,包不要錢.
########p13390677_112040_Linux-x86-64_1of7/p13390677_112040_Linux-x86-64_2of7/p13390677_112040_Linux-x86-64_3of7
1.VMware環(huán)境:兩臺(tái)安裝linux的虛擬機(jī),本次我使用的red hat 6.8,每臺(tái)兩個(gè)網(wǎng)卡public/private。
搞幾個(gè)共享磁盤出來(lái)
cmd切換到VMware安裝目錄下,執(zhí)行創(chuàng)建共享磁盤.
vmware-vdiskmanager.exe -c -s 1G -a lsilogic -t 2 C:\share_disk\ocr01.vmdk
vmware-vdiskmanager.exe -c -s 1G -a lsilogic -t 2 C:\share_disk\ocr02.vmdk
vmware-vdiskmanager.exe -c -s 1G -a lsilogic -t 2 C:\share_disk\ocr03.vmdk
vmware-vdiskmanager.exe -c -s 5G -a lsilogic -t 2 C:\share_disk\data.vmdk
vmware-vdiskmanager.exe -c -s 5G -a lsilogic -t 2 C:\share_disk\backup.vmdk
改虛擬機(jī)的.vmx文件,文件末尾添加剛才創(chuàng)建的虛擬磁盤.
scsi1.present = "TRUE"
scsi1.virtualDev = "lsilogic"
scsi1.sharedBus = "virtual"
scsi1:1.present = "TRUE"
scsi1:1.mode = "independent-persistent"
scsi1:1.filename = "C:\share_disk\ocr01.vmdk"
scsi1:1.deviceType = "disk"
scsi1:2.present = "TRUE"
scsi1:2.mode = "independent-persistent"
scsi1:2.filename = "C:\share_disk\ocr02.vmdk"
scsi1:2.deviceType = "disk"
scsi1:3.present = "TRUE"
scsi1:3.mode = "independent-persistent"
scsi1:3.filename = "C:\share_disk\ocr03.vmdk"
scsi1:3.deviceType = "disk"
scsi1:4.present = "TRUE"
scsi1:4.mode = "independent-persistent"
scsi1:4.filename = "C:\share_disk\backup.vmdk"
scsi1:4.deviceType = "disk"
scsi1:5.present = "TRUE"
scsi1:5.mode = "independent-persistent"
scsi1:5.filename = "C:\share_disk\data.vmdk"
scsi1:5.deviceType = "disk"
disk.locking = "false"
disk.EnableUUID = "true"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
diskLib.DataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize = "4096"
diskLib.maxUnsyncedWrites = "0"
2.開機(jī)檢查兩臺(tái)主機(jī)都可以看到剛添加的共享盤,檢查swap空間。
內(nèi)存 | Swap |
1 - 2 GB | 內(nèi)存的1.5倍 |
2-16GB | 和內(nèi)存相等 |
>16GB | 16 GB |
3.操作系統(tǒng)配置
3.1關(guān)閉selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
3.2關(guān)閉iptables
rhel6
service iptables stop
chkconfig ip6tables off
chkconfig iptables off
rhel7
systemctl stop firewalld.service
systemctl disable firewalld.service
firewall-cmd --state
3.3改IP地址,改hosts文件
cat >> /etc/hosts <<EOF
2.2.2.10 rac1
2.2.2.11 rac1-vip
2.2.2.20 rac2
2.2.2.21 rac2-vip
2.2.2.15 rac-scan
192.168.88.200 rac1-priv
192.168.88.201 rac2-priv
EOF
禁用ntp,oracle rac中會(huì)使用ctss來(lái)同步集群時(shí)間.
mv /etc/ntp.conf /etc/ntp.conf.bak
3.4內(nèi)核參數(shù)
cat >> /etc/sysctl.conf <<EOF
kernel.shmmni = 4096
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
sysctl -p
3.5Limits
cat >> /etc/security/limits.conf <<EOF
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF
12C:
grid soft stack 10240
oracle soft stack 10240
3.6 pam
echo session required pam_limits.so >> /etc/pam.d/login
3.7 profile
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
3.8 新建用戶及更改環(huán)境變量.
/usr/sbin/groupadd -g 501 oinstall
/usr/sbin/groupadd -g 502 dba
/usr/sbin/groupadd -g 504 asmadmin
/usr/sbin/groupadd -g 506 asmdba
/usr/sbin/groupadd -g 507 asmoper
/usr/sbin/useradd -u 501 -g oinstall -G asmadmin,asmdba,asmoper grid
/usr/sbin/useradd -u 502 -g oinstall -G dba,asmdba oracle
##passwd oracle
echo "oracle:oracle" | chpasswd
##passwd grid
echo "grid:grid" | chpasswd
##Oracle Inventory目錄
mkdir -p /u01/app/oraInventory
chown -R grid:oinstall /u01/app/oraInventory
chmod -R 775 /u01/app/oraInventory
##Grid Home目錄
mkdir -p /u01/11.2.0/grid
chown -R grid:oinstall /u01/12.2.0/grid
chmod -R 775 /u01/11.2.0/grid
##Oracle Base目錄
mkdir -p /u01/app/oracle
mkdir -p /u01/app/oracle/cfgtoollogs
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle
##Oracle Home目錄
mkdir -p /u01/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /u01/app/oracle/product/
chmod -R 775 /u01/app/oracle/product/
12C:grid $ORACLE_BASE
mkdir /u01/grid
chown -R grid:oinstall /u01/grid
chmod -R 775 /u01/grid
##oracle用戶.bash_profile添加
vi /home/oracle/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
export ORACLE_SID=jicheng1 ##rac2為jicheng2
export NLS_LANG=american_america.zhs16gbk
export PATH=.:$PATH:$ORACLE_HOME/bin:/ u01/11.2.0/grid/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
##grid用戶.bash_profile添加
vi /home/grid/.bash_profile
export ORACLE_BASE=/u01/app/oracle
#12C export ORACLE_BASE=/u01/grid
export ORACLE_HOME=/u01/11.2.0/grid
export ORACLE_SID=+ASM1 ##rac2為ASM2
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
3.9 操作系統(tǒng)配置結(jié)束,reboot兩臺(tái)機(jī)器(改配置文件關(guān)selinux重啟生效)
4.ASM盤,可以使用ASMlib和udev方式來(lái)綁定,本次使用udev來(lái)綁定ASM磁盤
取共享磁盤ssid,創(chuàng)建文件/etc/udev/rules.d/99-oracle.rules并寫入,往rac2節(jié)點(diǎn)拷貝一份,同樣啟動(dòng)start_udev
rhel6
for i in sdb sdc sdd sde sdf; do UUID=`/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$i` ; echo 'KERNEL=="sd*", BUS=="scsi", PROGRAM=="scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="'$UUID'", NAME="asm-'$i'", OWNER="grid", GROUP="asmadmin", MODE="0660"'; done >> /etc/udev/rules.d/99-oracle.rules ; cat /etc/udev/rules.d/99-oracle.rules
start_udev
ll /dev/asm*
scp /etc/udev/rules.d/99-oracle.rules 2.2.2.20:/etc/udev/rules.d/99-oracle.rules
rac2 :
start_udev
ll /dev/asm*
rhel7
for i in b c d e f
do
UUID=`/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`
echo 'KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="'$UUID'", SYMLINK+="asm-disk'$i'",OWNER="grid", GROUP="asmadmin",MODE="0660"'
done >> /etc/udev/rules.d/99-oracle.rules
/sbin/udevadm trigger --type=devices --action=change
udevadm control --reload-rules
5.上傳文件,安裝依賴包,圖形界面安裝grid,oracle數(shù)據(jù)庫(kù)軟件,DBCA建庫(kù)。
5.1安裝依賴包,配好yum裝吧
yum install -y binutils compat-libstdc++-33 glibc ksh libaio libgcc libstdc++ make compat-libcap1 gcc gcc-c++ glibc-devel libaio-devel libstdc++-devel sysstat elfutils-libelf-devel
5.2圖形界面grid用戶運(yùn)行 ./runInstaller
installation type 選高級(jí).
添加rac2,配置雙節(jié)點(diǎn)grid用戶互信
注意選擇路徑,把剛才三個(gè)ocr磁盤選上
最后安裝檢查會(huì)報(bào)asm磁盤警告,檢查兩個(gè)節(jié)點(diǎn)都可以訪問(wèn)asm磁盤后直接忽略下一步.
dd if=/dev/zero f=/dev/asm-sda bs=1024 count=1
5.3安裝完成運(yùn)行root腳本,先在第一個(gè)節(jié)點(diǎn)上執(zhí)行,然后其他節(jié)點(diǎn)順序執(zhí)行,不能同時(shí)執(zhí)行
/u01/app/oraInventory/orainstRoot.sh
/u01/11.2.0/grid/root.sh
5.4驗(yàn)證集群
[root@rac1]# /oracle/11.2.0/grid/bin/crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.DATA.dg ora....up.type ONLINE ONLINE rac1
ora....N1.lsnr ora....er.type ONLINE ONLINE rac1
ora.asm ora.asm.type ONLINE ONLINE rac1
ora.cvu ora.cvu.type ONLINE ONLINE rac1
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....network ora....rk.type ONLINE ONLINE rac1
ora.oc4j ora.oc4j.type ONLINE ONLINE rac1
ora.ons ora.ons.type ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip ora....t1.type ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip ora....t1.type ONLINE ONLINE rac2
ora....ry.acfs ora....fs.type ONLINE ONLINE rac1
ora.scan1.vip ora....ip.type ONLINE ONLINE rac1
5.5圖形界面oracle用戶運(yùn)行 ./runInstaller
只安裝數(shù)據(jù)庫(kù)軟件
添加rac2,設(shè)置oracle用戶互信
5.6一路下一步到安裝完成,同樣執(zhí)行root腳本
5.7DBCA建庫(kù),圖形界面Oracle用戶執(zhí)行dbca
選rac數(shù)據(jù)庫(kù)
自定義,定制
選中兩個(gè)節(jié)點(diǎn)
使用ASM盤存儲(chǔ)數(shù)據(jù)
后面配置就看需求了,測(cè)試環(huán)境可以都試一試.
結(jié)束。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。