您好,登錄后才能下訂單哦!
本篇內(nèi)容介紹了“虛擬軟件vmare內(nèi)怎么安裝linux系統(tǒng)下的ORACLE數(shù)據(jù)的RAC環(huán)境”的有關(guān)知識(shí),在實(shí)際案例的操作過(guò)程中,不少人都會(huì)遇到這樣的困境,接下來(lái)就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!
/opt //安裝包路徑 并且解壓grid壓縮包
1、安裝系統(tǒng)、配置雙網(wǎng)卡網(wǎng)絡(luò)、配置共享磁盤(pán)(以rac02為例)
1.1 IP地址規(guī)劃
192.168.47.151 rac01
192.168.47.152 rac02
10.11.12.51 rac01priv
10.11.12.52 rac02priv
192.168.47.153 rac01vip
192.168.47.154 rac02vip
192.168.47.155 racscanip
1.2 設(shè)置共享盤(pán)(兩個(gè)虛擬機(jī)配置都需要更改設(shè)置)
1.2.1 添加獨(dú)立 永久磁盤(pán)--共享盤(pán)路徑:H:\sharedisk\diskrac2\sharedisk*
1.2.2 更改獨(dú)立虛擬機(jī)配置(vmdk中添加、修改以下信息)
一:
scsi1.present = "TRUE"scsi1.virtualDev = "lsilogic"scsi1.sharedBus = "virtual"
scsi1:1.present = "TRUE"scsi1:1.mode = "independent-persistent"
scsi1:1.filename = "H:\sharedisk\diskrac2\sharediskOCR.vmdk"
scsi1:1.deviceType = "plainDisk"scsi1:2.present = "TRUE"
scsi1:2.mode = "independent-persistent"
scsi1:2.filename = "H:\sharedisk\diskrac2\sharediskrDate01.vmdk"
scsi1:2.deviceType = "plainDisk"
scsi1:3.present = "TRUE"
scsi1:3.mode = "independent-persistent"
scsi1:3.filename = "H:\sharedisk\diskrac2\sharediskrDate02.vmdk"
scsi1:3.deviceType = "plainDisk"
scsi1:4.present = "TRUE"
scsi1:4.mode = "independent-persistent"
scsi1:4.filename = "H:\sharedisk\diskrac2\sharediskrFlash.vmdk"
scsi1:4.deviceType = "plainDisk"
disk.locking = "false"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
diskLib.DataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize = "4096"
diskLib.maxUnsyncedWrites = "0"
disk.EnableUUID="TRUE"
二:
scsi1.present = "TRUE"
scsi1.virtualDev = "lsilogic"
scsi1.sharedBus = "virtual"
scsi1:0.present = "TRUE"
scsi1:0.fileName = "C:\sharedisk\RAC01\ocr1.vmdk"
scsi1:0.mode = "independent-persistent"
scsi1:0.deviceType = "plainDisk"
scsi1:1.present = "TRUE"
scsi1:1.fileName = "C:\sharedisk\RAC01\ocr2.vmdk"
scsi1:1.mode = "independent-persistent"
scsi1:1.deviceType = "plainDisk"
scsi1:2.present = "TRUE"
scsi1:2.fileName = "C:\sharedisk\RAC01\ocr3.vmdk"
scsi1:2.mode = "independent-persistent"
scsi1:2.deviceType = "plainDisk"
scsi1:3.present = "TRUE"
scsi1:3.fileName = "C:\sharedisk\RAC01\data.vmdk"
scsi1:3.mode = "independent-persistent"
scsi1:3.deviceType = "plainDisk"
scsi1:4.present = "TRUE"
scsi1:4.fileName = "C:\sharedisk\RAC01\fra.vmdk"
scsi1:4.mode = "independent-persistent"
scsi1:4.deviceType = "plainDisk"
floppy0.present = "FALSE"
disk.locking = "false"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
diskLib.DataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize = "4096"
diskLib.maxUnsyncedWrites = "0"
disk.EnableUUID="TRUE"
三:
scsi1.sharedBus = "virtual"
scsi1:0.deviceType = "plainDisk"
scsi1:1.deviceType = "plainDisk"
scsi1:2.deviceType = "plainDisk"
scsi1:3.deviceType = "plainDisk"
scsi1:4.deviceType = "plainDisk"
disk.locking = "false"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
diskLib.DataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize = "4096"
diskLib.maxUnsyncedWrites = "0"
disk.EnableUUID="TRUE"
2、配置OS
2.1 關(guān)閉防火墻、selinux
[root@rac02 ~]# chkconfig iptables off
[root@rac02 ~]# service iptables status
[root@rac02 ~]# service iptables stop
[root@rac02 ~]# vi /etc/selinux/config
SELINUX=disabled
2.2 修改host文件
[root@rac02 ~]# vi /etc/hosts
172.19.15.142 racd01
172.19.15.141 racd02
10.10.11.10 racd01priv
10.10.11.22 racd02priv
172.19.15.143 racd01vip
172.19.15.144 racd02vip
172.19.15.145 racdscanip
2.3 配置yum源
2.3.1 配置本地yum源
[root@rac02 ~]#yum clean all
[root@rac02 ~]#mkdir /mnt/cdrommount -t iso9660 /dev/cdrom /mnt/cdrom/
[root@rac02 ~]#vi /etc/yum.repos.d/local.repo
[local]
name=local
baseurl=file:///mnt/cdrom
gpgcheck=0enabled=1
2.3.2 配置163yum源
[root@rac02 ~]#vi /etc/yum.repos.d/163.repo
[163]
name=163
baseurl=http://mirrors.163.com/centos/7/os/x86_64/
gpgcheck=0enabled=1
#yum repolist
2.4 安裝rpm包
[root@rac02 ~]#vi yum.sh
yum install compat-lib*
yum install binutils-2*
yum install gcc*
yum install glibc-2*
yum install glibc-devel-2*
yum install ksh
yum install libgcc-4*
yum install libstdc++-4*
yum install libstdc++-d*
yum install libaio-0*
yum install libaio-d*
yum install sysstat-9*
yum install make-3*
yum install binutils-2*
yum install libc*
2.5 修改內(nèi)核配置文件
[root@rac02 ~]#vi /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1054472192
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
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 = 1048586
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.tcp_rmem = 4194304 4194304 4194304
[root@rac02 ~]##sysctl -p //立即生效。
2.6 修改用戶限制
[root@rac02 ~] #vi /etc/security/limits.conf
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
2.7配置Oracle軟件安裝組、用戶、環(huán)境變量、安裝目錄
2.7.1 #創(chuàng)建組
groupadd -g 1300 dbagroupadd -g 1301 opergroupadd -g 1000 oinstallgroupadd -g 1200 asmadmin
groupadd -g 1201 asmdbagroupadd -g 1202 asmoper
#用戶
useradd -m -u 1100 -g oinstall -G asmadmin,asmdba,asmoper -s /bin/bash grid
useradd -m -u 1101 -g oinstall -G dba,oper,asmdba -s /bin/bash oracle
2.7.2#配置目錄
mkdir -p /u01/app/11.2.0/grid
mkdir -p /u01/app/grid
mkdir -p /u01/app/oracle
chown grid:oinstall /u01/app/11.2.0/grid
chown grid:oinstall /u01/app/grid
chown oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/chown -R grid:oinstall /u01
2.7.3#用戶環(huán)境變量修改home下的 .bash_profile(Oracle_sid需要根據(jù)節(jié)點(diǎn)不同進(jìn)行修改)
ORACLE用戶
export TMP=/tmp
export TMPDIR=$TMPexport ORACLE_SID=orc1 # rac01
export ORACLE_SID=orc2 # rac02
export ORACLE_UNQNAME=orc
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
$ source .bash_profile //使配置文件生效
GRID用戶
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_SID=+ASM1 # rac01
export ORACLE_SID=+ASM2 # rac02
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
umask 022
$ source .bash_profile //使配置文件生效
2.8.配置grid及oracle用戶ssh互信
方法一:
#cd /software/grid/sshsetup
#./sshUserSetup.sh -user grid -hosts "rac01 rac02" -advanced -noPromptPassphrase
#./sshUserSetup.sh -user oracle -hosts "rac01 rac02" -advanced -noPromptPassphrase
方法二:
1)在節(jié)點(diǎn) 1 上:
[root@rac01 ~]$ su - grid
[grid@rac01 ~]$ cd /home/grid/
[grid@rac01 ~]$ mkdir~/.ssh
[grid@rac01 ~]$ chmod 700 ~/.ssh
[grid@rac01 ~]$ ssh-keygen -t rsa
[grid@rac01 ~]$ ssh-keygen -t dsa
2)在節(jié)點(diǎn)2上:
[root@rac02 ~]$ su - grid
[grid@rac02 ~]$ cd /home/grid/
[grid@rac02 ~]$ mkdir ~/.ssh
[grid@rac02 ~]$ chmod 700 ~/.ssh
[grid@rac01 ~]$ ssh-keygen -t rsa
[grid@rac01 ~]$ ssh-keygen -t dsa
3) 僅在一個(gè)節(jié)點(diǎn)操作,以rac01為例:
[grid@rac01 ~]$ touch ~/.ssh/authorized_keys
[grid@rac01 ~]$ cd ~/.ssh
[grid@rac01.ssh]$ ssh racd01 cat ~/.ssh/id_rsa.pub >> authorized_keys
[grid@rac01.ssh]$ ssh racd02 cat ~/.ssh/id_rsa.pub >> authorized_keys
[grid@rac01.ssh]$ ssh racd01 cat ~/.ssh/id_dsa.pub >> authorized_keys
[grid@rac01.ssh]$ ssh racd02 cat ~/.ssh/id_dsa.pub >> authorized_keys
[grid@rac01.ssh]$pwd
[grid@rac01.ssh]$scp authorized_keys racd02:`pwd`
4)每個(gè)節(jié)點(diǎn)均操作
[grid@rac01 ~]$ chmod 600 ~/.ssh/authorized_keys
[grid@rac01 ~]$ chmod 600 ~/.ssh/authorized_keys
5)在要運(yùn)行oui的接單以grid用戶運(yùn)行,以racd01為例:
[grid@rac01.ssh]$exec /usr/bin/ssh-agent $SHELL
[grid@rac01.ssh]$ssh-add
6)檢查互信
$ ssh rac01 date
$ ssh rac02 date
$ ssh rac01priv date
$ ssh rac02priv date
2.9 配置裸設(shè)備[root@rac01 ~]#fdisk /dev/sdb
n p 1 +2G
n p 2 w
[root@rac01 ~]# vi /etc/udev/rules.d/60-raw.rules
ACTION=="add", KERNEL=="/dev/sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="17", RUN+="/bin/raw /dev/raw/raw1 %M %m"
ACTION=="add", KERNEL=="/dev/sdc1", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="33", RUN+="/bin/raw /dev/raw/raw2 %M %m"
ACTION=="add", KERNEL=="/dev/sdd1", RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="49", RUN+="/bin/raw /dev/raw/raw3 %M %m"
ACTION=="add", KERNEL=="/dev/sde1", RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="65", RUN+="/bin/raw /dev/raw/raw4 %M %m"
ACTION=="add", KERNEL=="/dev/sdf1", RUN+="/bin/raw /dev/raw/raw5 %N"
ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="81", RUN+="/bin/raw /dev/raw/raw5 %M %m"
ACTION=="add",KERNEL=="raw*",OWNER="grid",GROUP="asmadmin",MODE="660"
[root@rac01 ~]#start_udev //無(wú)法正確安裝時(shí),使用下列兩個(gè)語(yǔ)句
// #raw /dev/raw/raw1 /dev/sdb1
// #raw /dev/raw/raw2 /dev/sdb2
[root@rac01 ~]#raw -qa =等價(jià)于= ls -lrt /dev/raw
[root@rac01 ~]#ll /dev/raw
[root@rac01 ~]#partprobe
3、安裝grid
[root@rac01 /]#xhost +
[root@rac01 /]# su - grid
[grid@rac01 ~]$ export
[grid@rac01 ~]$ cd /software/grid/
[grid@rac01 grid]$ ./runInstaller
運(yùn)行roo.sh報(bào)錯(cuò),可使用如下命令
[root@rac02 ~]# /u01/app/11.2.0/grid/crs/install/rootcrs.pl -deconfig -force
查看安裝日志
[root@rac01 /]# cat /u01/app/oraInventory/logs/installActions2019-03-27_04-25-47PM.log
檢查crs狀態(tài)
[grid@rac01 ~]$ crsctl check crs
檢查Clusterware資源
[grid@rac01 ~]$ crs_stat -t -v
[grid@rac01 ~]$ crsctl stat res -t
檢查集群節(jié)點(diǎn)
[grid@rac01 ~]$ olsnodes -n
檢查兩個(gè)節(jié)點(diǎn)上的Oracle TNS監(jiān)聽(tīng)器進(jìn)程
[grid@rac01 ~]$ ps -ef|grep lsnr|grep -v 'grep'|grep -v 'ocfs'|awk '{print$9}'
確認(rèn)當(dāng)前正在運(yùn)行已安裝的Oracle ASM:
[grid@rac01 ~]$ srvctl status asm -a ./runcluvfy.sh stage -post hwos -n rac01,rac02 -verbose
安裝asm [grid@rac01 ~]$ asmca
4、安裝oracle
[root@rac01 ~]#xhost +
[root@rac01 ~]# su - oracle
[oracle@rac01 ~]$ cd /software/database
[oracle@rac01 database]$ ./runInstaller
5、檢查安裝后的配置
檢查集群運(yùn)行狀態(tài)
[grid@rac01 ~]$srvctl status database -d orc
檢查本地節(jié)點(diǎn)crs狀態(tài)
[grid@rac01 ~]$ crsctl check crs
檢查集群crs狀態(tài)
[grid@rac01 ~]$ crsctl check cluster
檢查集群節(jié)點(diǎn)
[grid@rac01 ~]$ olsnodes -n -i -s -t
檢查集群間的表決磁盤(pán)信息
[grid@rac01 ~]$ crsctl query css votedisk
檢查集群scan ip
[grid@rac01 ~]$ srvctl config scan
檢查scan 監(jiān)聽(tīng)
[grid@rac01 ~]$ srvctl config scan_listener
6、啟、停集群數(shù)據(jù)庫(kù)進(jìn)入grid用戶
整個(gè)集群的數(shù)據(jù)庫(kù)啟停
[grid@rac01 ~]$ srvctl stop database -d orcl
[grid@rac01 ~]$ srvctl start database -d orcl
進(jìn)入root用戶 只關(guān)閉了當(dāng)前結(jié)點(diǎn)
[root@rac01 bin]# pwd/u01/app/11.2.0/grid/bin
[root@rac01 bin]# ./crsctl stop crs
7、em
[oracle@rac1 ~]$ emctl status dbconsole
[oracle@rac1 ~]$ emctl start dbconsole
[oracle@rac1 ~]$ emctl stop dbconsole
“虛擬軟件vmare內(nèi)怎么安裝linux系統(tǒng)下的ORACLE數(shù)據(jù)的RAC環(huán)境”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí)可以關(guān)注億速云網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!
免責(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)容。