1、安裝前node
虛擬機軟件:VMware-12.5linux
操做系統:Centos6.8c++
Oracle軟件:Oracle 11g R2sql
本篇全部安裝介質和文檔皆能夠在文末關注微信公衆號後回覆:oraclerac得到shell
2.配置虛擬機數據庫
這裏,咱們須要在 VMware 的虛擬主機上建立兩臺虛擬機,其中每臺vim
機器至少須要配置雙網卡,一塊網卡做爲 Public,另外一塊做爲 Private,建議 IP 地址均選擇bash
手動配置,而不是 DHCP 動態分配,且要求指定的 IP 在網絡裏是惟一的。主機名也分別要求指定爲惟一,避免衝突。主機名、IP 地址在前期規劃要慎重,一經指定,最好不要輕易改變,避免一些沒必要要的麻煩。這裏列出兩臺機器前期規劃的主機名、IP 地址信息:服務器
其中,每臺機器至少須要配置 3 個 IP 地址,在安裝操做系統的過程當中,咱們須要配置微信
公網 IP 和私有 IP 便可,虛擬 IP 在安裝集羣件時分配。Public IP、Virtual IP、SCAN IP 必
須配置在同一網段。SCAN IP 是 Oracle 11g 新推出的,在配置 11g RAC 時須要指定。咱們
的 SCAN IP 經過配置 DNS 服務器來實現,在下文中將給出配置步驟。
3.建立虛擬機知足下列條件:
(1)雙網卡
(2)2G內存
(3)2核CPU
(4)iSCSI格式20G硬盤
正常裝就行swap分區記得留大一點
node1主機名爲oracle92
node2主機名爲oralce93
配置檢查
此文檔不配置DNS
配置 11gR2 RAC 須要安裝 Oracle Grid Infrastructure 軟件、Oracle 數據庫軟件,其中 Grid軟件等同於 Oracle 10g 的 Clusterware 集羣件。Oracle 建議以不一樣的用戶分別安裝 Grid Infrastructure 軟件、Oracle 數據庫軟件,咱們這裏以 grid 用戶安裝 Grid Infrastructure,oracle用戶安裝 Oracle 數據庫軟件。而且 grid、oracle 用戶須要屬於不一樣的用戶組。在配置 RAC時,還要求這兩個用戶在 RAC 的不一樣節點上 uid、gid 要一致。用戶、組的對應信息見下表:
執行一下腳本完成成用戶、組的建立
1 #!/bin/bash 2 #Purpose:Create 6 groups named 'oinstall','dba','asmadmin','asmdba','asmoper','oper', plus 2 users named 'oracle','grid'. 3 #Also setting the Environment 4 #variable for oracle user. 5 #variable for grid user. 6 #Usage:Log on as the superuser('root'),and then execute the command:#./1preusers.sh 7 #Author:Asher Huang 8 echo "Now create 6 groups named 'oinstall','dba','asmadmin','asmdba','asmoper','oper'" 9 echo "Plus 2 users named 'oracle','grid',Also setting the Environment" 10 groupadd -g 1000 oinstall 11 groupadd -g 1200 asmadmin 12 groupadd -g 1201 asmdba 13 groupadd -g 1202 asmoper 14 useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper,dba -d /home/grid -s /bin/bash -c "grid Infrastructure Owner" grid 15 echo "grid" | passwd --stdin grid 16 echo 'export PS1="`/bin/hostname -s`-> "'>> /home/grid/.bash_profile 17 echo "export TMP=/tmp">> /home/grid/.bash_profile 18 echo 'export TMPDIR=$TMP'>>/home/grid/.bash_profile 19 echo "export ORACLE_SID=+ASM1">> /home/grid/.bash_profile 20 echo "export ORACLE_BASE=/u01/app/grid">> /home/grid/.bash_profile 21 echo "export ORACLE_HOME=/u01/app/11.2.0/grid">> /home/grid/.bash_profile 22 echo "export ORACLE_TERM=xterm">> /home/grid/.bash_profile 23 echo "export NLS_DATE_FORMAT='yyyy/mm/dd hh24:mi:ss'" >> /home/grid/.bash_profile 24 echo 'export TNS_ADMIN=$ORACLE_HOME/network/admin' >> /home/grid/.bash_profile 25 echo 'export PATH=/usr/sbin:$PATH'>> /home/grid/.bash_profile 26 echo 'export PATH=$ORACLE_HOME/bin:$PATH'>> /home/grid/.bash_profile 27 echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib'>> 28 /home/grid/.bash_profile 29 echo 'export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib'>> /home/grid/.bash_profile 30 echo "export EDITOR=vi" >> /home/grid/.bash_profile 31 echo "export LANG=en_US" >> /home/grid/.bash_profile 32 echo "export NLS_LANG=american_america.AL32UTF8" >> /home/grid/.bash_profile 33 echo "umask 022">> /home/grid/.bash_profile 34 groupadd -g 1300 dba 35 groupadd -g 1301 oper 36 useradd -u 1101 -g oinstall -G dba,oper,asmdba -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle 37 echo "oracle" | passwd --stdin oracle 38 echo 'export PS1="`/bin/hostname -s`-> "'>> /home/oracle/.bash_profile 39 echo "export TMP=/tmp">> /home/oracle/.bash_profile 40 echo 'export TMPDIR=$TMP'>>/home/oracle/.bash_profile 41 echo "export ORACLE_HOSTNAME=oracle92.localdomain">> /home/oracle/.bash_profile 42 echo "export ORACLE_SID=devdb1">> /home/oracle/.bash_profile 43 echo "export ORACLE_BASE=/u01/app/oracle">> /home/oracle/.bash_profile 44 echo 'export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1'>> /home/oracle/.bash_profile 45 echo "export ORACLE_UNQNAME=devdb">> /home/oracle/.bash_profile 46 echo 'export TNS_ADMIN=$ORACLE_HOME/network/admin' >> /home/oracle/.bash_profile 47 echo "export ORACLE_TERM=xterm">> /home/oracle/.bash_profile 48 echo 'export PATH=/usr/sbin:$PATH'>> /home/oracle/.bash_profile 49 echo 'export PATH=$ORACLE_HOME/bin:$PATH'>> /home/oracle/.bash_profile 50 echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib'>> /home/oracle/.bash_profile 51 echo 'export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib'>> /home/oracle/.bash_profile 52 echo "export EDITOR=vi" >> /home/oracle/.bash_profile 53 echo "export LANG=en_US" >> /home/oracle/.bash_profile 54 echo "export NLS_LANG=american_america.AL32UTF8" >> /home/oracle/.bash_profile 55 echo "export NLS_DATE_FORMAT='yyyy/mm/dd hh24:mi:ss'" >> /home/oracle/.bash_profile 56 echo "umask 022">> /home/oracle/.bash_profile 57 echo "The Groups and users has been created" 58 echo "The Environment for grid,oracle also has been set successfully"
在節點oracle93 上執行該腳本時,須要將grid 用戶環境變量ORACLE_SID 修改成+ASM2,
oracle 用戶環境變量ORACLE_SID 修改成devdb2,
ORACLE_HOSTNAME 環境變量修改成oracle93.localdomain
[root@oracle92 shell]# id grid
uid=1100(grid) gid=1000(oinstall)
groups=1000(oinstall),1200(asmadmin),1201(asmdba),1202(asmoper)
[root@oracle92 shell]# id oracle
uid=1101(oracle) gid=1000(oinstall)
groups=1000(oinstall),1201(asmdba),1300(dba),1301(oper)
7.建路徑、改權限:
關於 grid、oracle 用戶的環境變量配置信息,見下述表格
執行下面腳原本完成相關路徑、權限的配置。
#!/bin/bash #Purpose:Create the necessary directory for oracle,grid users and change the authention to oracle,grid users. #Usage:Log on as the superuser('root'),and then execute the command:#./2predir.sh #Author:Asher Huang echo "Now create the necessary directory for oracle,grid users and change the authention to oracle,grid users..." mkdir -p /u01/app/grid mkdir -p /u01/app/11.2.0/grid mkdir -p /u01/app/oracle chown -R oracle:oinstall /u01 chown -R grid:oinstall /u01/app/grid chown -R grid:oinstall /u01/app/11.2.0 chmod -R 775 /u01 echo "The necessary directory for oracle,grid users and change the authention to oracle,grid users has been finished"
8.修改/etc/security/limits.conf,配置 oracle 、 grid 用戶的
shell 限制:
執行下面腳本完成。
#!/bin/bash #Purpose:Change the /etc/security/limits.conf. #Usage:Log on as the superuser('root'),and then execute the command:#./3prelimits.sh #Author:Asher Huang echo "Now modify the /etc/security/limits.conf,but backup it named /etc/security/limits.conf.bak before" cp /etc/security/limits.conf /etc/security/limits.conf.bak 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 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 "Modifing the /etc/security/limits.conf has been succeed."
9.修改/etc/pam.d/login配置文件
#!/bin/bash #Purpose:Modify the /etc/pam.d/login. #Usage:Log on as the superuser('root'),and then execute the command:#./4prelimits.sh #Author:Asher Huang echo "Now modify the /etc/pam.d/login,but with a backup named /etc/pam.d/login.bak" cp /etc/pam.d/login /etc/pam.d/login.bak echo "session required /lib/security/pam_limits.so" >>/etc/pam.d/login echo "session required pam_limits.so" >>/etc/pam.d/login echo "Modifing the /etc/pam.d/login has been succeed."
10.修改/etc/profile 文件
執行腳本完成
#!/bin/bash #Purpose:Modify the /etc/profile. #Usage:Log on as the superuser('root'),and then execute the command:#./5preprofile.sh #Author:Asher Huang echo "Now modify the /etc/profile,but with a backup named /etc/profile.bak" cp /etc/profile /etc/profile.bak echo 'if [ $USER = "oracle" ]||[ $USER = "grid" ]; then' >> /etc/profile echo 'if [ $SHELL = "/bin/ksh" ]; then' >> /etc/profile echo 'ulimit -p 16384' >> /etc/profile echo 'ulimit -n 65536' >> /etc/profile echo 'else' >> /etc/profile echo 'ulimit -u 16384 -n 65536' >> /etc/profile echo 'fi' >> /etc/profile echo 'fi' >> /etc/profile echo "Modifing the /etc/profile has been succeed."
11.修改內核配置文件
執行腳本
#!/bin/bash #Purpose:Modify the /etc/sysctl.conf. #Usage:Log on as the superuser('root'),and then execute the command:#./6presysctl.sh #Author:Asher Huang echo "Now modify the /etc/sysctl.conf,but with a backup named /etc/sysctl.bak" cp /etc/sysctl.conf /etc/sysctl.conf.bak echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf echo "fs.file-max = 6815744" >> /etc/sysctl.conf echo "kernel.shmall = 2097152" >> /etc/sysctl.conf echo "kernel.shmmax = 2089633792" >> /etc/sysctl.conf echo "kernel.shmmni = 4096" >> /etc/sysctl.conf echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf echo "net.ipv4.ip_local_port_range = 9000 65500" >> /etc/sysctl.conf echo "net.core.rmem_default = 262144" >> /etc/sysctl.conf echo "net.core.rmem_max = 4194304" >> /etc/sysctl.conf echo "net.core.wmem_default = 262144" >> /etc/sysctl.conf echo "net.core.wmem_max = 1048586" >> /etc/sysctl.conf echo "net.ipv4.tcp_wmem = 262144 262144 262144" >> /etc/sysctl.conf echo "net.ipv4.tcp_rmem = 4194304 4194304 4194304" >> /etc/sysctl.conf echo "Modifing the /etc/sysctl.conf has been succeed." echo "Now make the changes take effect....." sysctl -p
12.中止 ntp 服務, 11gR2 新增的檢查項
# service ntpd status
ntpd is stopped
# chkconfig ntpd off
# cat /etc/ntp
ntp/ ntp.conf
# cp /etc/ntp.conf /etc/ntp.conf.bak
# rm -rf /etc/ntp.conf
13.節點 2 準備工做:
咱們已經在節點1 完成基本準備配置工做,在 節點2 上重複上述 配置hosts文件到 中止ntp準備工做,以完成節點 2 的準備工做。
14.配置oracle,grid用戶SSH對等性
雖然在安裝軟件的過程當中,oracle 會自動配置 SSH 對等性,建議在安裝軟件以前手工配置。
配置 oracle 用戶對等性:
節點1:
執行命令:
ssh-keygen -t rsa
ssh-keygen -t dsa
節點2
重複上述操做
返回節點1:
cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys
cat ~/.ssh/id_dsa.pub >>~/.ssh/authorized_keys
ssh oracle93 cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys
ssh oracle93 cat ~/.ssh/id_dsa.pub >>~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys oracle93:~/.ssh/authorized_keys
驗證 oracle SSH 對等性:
在 oracle92,oracle93 兩個節點上分別執行下述命令,第一次執行時須要口令驗證:
ssh oracle92 date
ssh oracle93 date
ssh oracle92-priv date
ssh oracle93-priv date
ssh oracle92.localdomain date
ssh oracle93.localdomain date
ssh oracle92-priv.localdomain date
ssh oracle93-priv.localdomain date
15.重複上述步驟,以grid 用戶配置對等性。
16.配置共享磁盤:
在任意節點上先建立共享磁盤,而後在另外的節點上選擇添加已有磁盤。這裏選擇先在
節點2 節點機器上建立共享磁盤,而後在 節點1 上添加。共建立 4 塊硬盤,其中 2 塊硬盤,未來用於配置 GRIDDG 磁盤組,專門存放 OCR 和 Voting Disk;1 塊磁盤,用於配置 DATA 磁盤組,存放數據庫;1 塊磁盤,用於配置 FLASH 磁盤組,用於閃回區;
虛擬機關機,而後操做
按照此方法添加再添加3塊
修改磁盤編號
節點一添加節點2建立的磁盤
選擇節點建立的xxx.vmdk文件
四塊都按順序添加並修改設備編號
加入4塊磁盤
設備編號爲:1:0,1:1
2:0,2:1
修改兩臺虛擬機對應文件VMX文件,
在宿主機vim下面兩文件
加入:
disk.locking="false" diskLib.dataCacheMaxSize = "0" diskLib.dataCacheMaxReadAheadSize = "0" diskLib.DataCacheMinReadAheadSize = "0" diskLib.dataCachePageSize = "4096" diskLib.maxUnsyncedWrites = "0" scsi1.shareBus="virtual" sched.scsi1:0.shares = "normal" sched.scsi1:0.throughputCap = "none" sched.scsi1:1.shares = "normal" sched.scsi1:1.throughputCap = "none" sched.scsi2:0.shares = "normal" sched.scsi2:0.throughputCap = "none" sched.scsi2:1.shares = "normal" sched.scsi2:1.throughputCap = "none" scsi1:0.mode = "independent-persistent" scsi1:0.deviceType = "scsi-hardDisk" scsi1:1.mode = "independent-persistent" scsi1:1.deviceType = "scsi-hardDisk" scsi2:0.mode = "independent-persistent" scsi2:0.deviceType = "scsi-hardDisk" scsi2:1.mode = "independent-persistent" scsi2:1.deviceType = "scsi-hardDisk"
17.啓動虛擬機
節點1
# fdisk -l
節點2
硬盤格式化(只用在一個節點作就能夠)
# fdisk /dev/sdb
fdisk /dev/sdb 表示要對/dev/sdb 磁盤進行格式化,其中,輸入的命令分別表示: n 表示新建 1 個分區; p 表示分區類型選擇爲 primary partition 主分區; 1 表示分區編號從 1 開始; 起始、終止柱面選擇默認值,即 1 和 500; w 表示將新建的分區信息寫入硬盤分區表。 ③ 重複上述步驟②,以 root 用戶在 node1 上分別格式化其他 3 塊磁盤: ④ 格式化完畢以後,在 node1,node2 節點上分別看到下述信息
把剩下的3塊盤安裝一樣的方式格式化
節點2執行,同步磁盤
18.修改/etc/udev/rules.d/60-raw.rules文件
添加以下幾行
ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N" ACTION=="add", KERNEL=="sdc1", RUN+="/bin/raw /dev/raw/raw2 %N" ACTION=="add", KERNEL=="sdd1", RUN+="/bin/raw /dev/raw/raw3 %N" ACTION=="add", KERNEL=="sde1", RUN+="/bin/raw /dev/raw/raw4 %N" KERNEL=="raw1", OWNER="grid", GROUP="asmadmin", MODE="660" KERNEL=="raw2", OWNER="grid", GROUP="asmadmin", MODE="660" KERNEL=="raw3", OWNER="grid", GROUP="asmadmin", MODE="660" KERNEL=="raw4", OWNER="grid", GROUP="asmadmin", MODE="660"
節點2重複
啓動udev服務(雙節點執行)
Root用戶執行:
# start_udev
驗證裸設備是否創建成功
ls –l /dev/raw
裸設備的用戶爲grid,組爲asmadmin。則裸設備創建成功
1、安裝介質
本篇全部安裝介質和文檔皆能夠在文末關注微信公衆號後回覆:oraclerac得到
oracle.p13390677_112040_Linux-x86-64_1of7.zip
oracle.p13390677_112040_Linux-x86-64_2of7.zip
oracle.p13390677_112040_Linux-x86-64_3of7.zip
其中:
****1of7.zip 和****2of7.zip是 Oracle 軟件的安裝介質。
****3of7.zip 是 GRID 軟件的安裝介質
1.分別上傳到/home/oralce/
和/home/grid/
而後解壓
# unzip 包名
2.先安裝一些依賴(雙節點):
yum install -y ld-linux.so.2 binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel make numactl sysstat libXp unixODBC unixODBC-devel
上傳pdksh-5.2.14-8.i386.rpm 包到節點
# rpm -ivh pdksh-5.2.14-8.i386.rpm
安裝
3.安裝前預檢查配置信息
在安裝 GRID 以前,建議先利用 CVU(Cluster Verification Utility)檢查 CRS 的安裝前環
境。使用 CVU 檢查 CRS 的安裝前環境:
# pwd /home/grid/grid # su - grid
./runcluvfy.sh stage -pre crsinst -n oracle92,oracle93 -fixup -verbose
提示以root用戶執行這個腳本,那咱們就執行一下(雙節點)
由於咱們沒有配DNS全部這一步會提示檢查失敗,不過不要緊,其它的檢查都經過就ok了
直到此步驟,咱們的安裝環境已經徹底準備 OK!!!
三.安裝 Grid Infrastructure
今後步驟開始,咱們正式安裝 Grid 軟件:
① 以 grid 用戶登陸圖形界面,執行/home/grid/grid/runInstaller,進入 OUI 的圖形安裝界面:
② 進入 OUI 安裝界面後,選擇第 3 項,跳過軟件更新,Next:
③ 選擇集羣的 Grid Infrastructure,Next:
④ 選擇 advanced Installation,Next:
⑤ 語言選擇默認,English,Next:
⑥ 去 掉 Configure GNS 選 項 , 按 照 之 前 2.1 節 中 的 表 格 輸 入 Cluster
Name:scan-cluster,SCAN Name:scan-cluster.localdomain。Next:
⑦ 單擊 Add,添加第 2 個節點,Next:
⑧ 確認網絡接口,Next(內外網必定不能在一個網段):
⑨ 選擇 ASM,做爲存儲,Next:
⑩ 輸入 ASM 磁盤組名,這裏命名爲 GRIDDG,冗餘策略選擇 External 外部,AU 大小
選擇默認 1M,ASM 磁盤選擇 raw1,raw2。Next:
⑪ 選擇給 ASM 的 SYS、ASMSNMP 用戶配置爲相同的口令,並輸入口令,Next:
⑫ 選擇不使用 IPMI,Next:
⑬ 給 ASM 指定不一樣的組,Next:
⑭ 選擇 GRID 軟件的安裝路徑,其中 ORACLE_BASE,ORACLE_HOME 均選擇之經配置好的,可參照 2.5 節中的配置信息。這裏須要注意 GRID 軟件的 ORACLE_HOME 不
能是 ORACLE_BASE 的子目錄。
⑮ 選擇默認的 Inventory,Next:
檢查
⑯ 檢查出現告警,提示在全部節點上缺失 cvuqdisk-1.0.9-1 軟件包。
能夠選擇忽略,直接進入下一步安裝。也能夠從 grid 安裝文件的 rpm 目錄下獲取該 RPM
包,而後進行安裝。
雙節點執行
在全部節點上安裝完 cvuqdisk-1.0.9-1 軟件後,從新執行預檢查,再也不有警告信息。
⑰ 進入安裝 GRID 安裝以前的概要信息,Install 進行安裝:
DNS報的錯能夠選擇忽略
⑱ 根據提示以 root 用戶分別在兩個節點上執行腳本:
報錯了。。。。。
緣由:說是找不到 libcap.so.1 這個包
解決辦法
執行
# ln -s /lib64/libcap.so.2.16 /lib64/libcap.so.1
而後再執行
./root.sh
須要等
若是報這個錯
執行命令
# cd /software/app/11.2.0/grid/crs/install/ # ./roothas.pl -deconfig -force -verbose
節點1執行成功後節點2執行
⑲ 執行完上述腳本以後,單擊 OK,等待安裝完成,Next,進入下一步。
⑳ 最後,單擊 close,完成 GRID 軟件在雙節點上的安裝。
若是你看到OCVU錯誤的話,沒有關係,這個錯誤是由Oracle自身的BUG形成的,它並不會影響咱們以後RAC的使用,所以點擊「OK」,忽略掉它就能夠啦。
至此,GRID 集羣件安裝成功!!!
4、安裝 Oracle e 軟件
今後步驟開始,咱們正式安裝 oracle 軟件:
① 以 oracle 用戶登陸圖形界面,執行/home/oracle/database/runInstaller,進入 OUI 的圖形
安裝界面:
② 進入 OUI 安裝界面後,選擇第 3 項,跳過軟件更新,Next:
③ 選擇第 2 項,只安裝 oracle 軟件,Nex
④ 選擇第 2 項,安裝 oracle RAC,選擇全部節點,Next:
⑤ 語言選擇默認,English,Next:
⑥ 選擇第 1 項,安裝企業版軟件,Next:
⑦ 選擇 oracle 軟件的安裝路徑,其中 ORACLE_BASE,ORACLE_HOME 均選擇以前已
經配置好的,可參照 2.5 節中的配置信息。Next:
⑧ 選擇 oracle 用戶組,Next:
⑨ 執行安裝前的預檢查,Next:
執行Oracle軟件安裝前的預檢查,這裏出現了一個警告,其緣由在於,若是使用DNS服務的話,RAC能夠設置多個Scan IP,而咱們用的是/etc/hosts文件,那麼RAC環境下就只容許設置一個Scan IP了,這並不影響咱們以後的使用,因此這裏點擊ignore all將該警告忽略掉便可。
⑩ 安裝概要信息,Install:
⑪ 根據提示以 root 用戶分別在兩個節點上執行腳本,Next:
執行/u01/app/oracle/product/11.2.0/db_1/root.sh 腳本
⑫ 最後,單擊 close,完成 oracle 軟件在雙節點上的安裝。
至此,咱們在 RAC 雙節點上完成 oracle 軟件的安裝!!!
五 建立 ASM ASM ASM ASM 磁盤組
以 grid 用戶建立 ASM 磁盤組,建立的 ASM 磁盤組爲下一步建立數據庫提供存儲。
① grid 用戶登陸圖形界面,執行 asmca 命令來建立磁盤組:
② 進入 ASMCA 配置界面後,單擊 Create,建立新的磁盤組:
③ 輸入磁盤組名 DATA,冗餘策略選擇 External,磁盤選擇 raw3,單擊 OK:
④ DATA 磁盤組建立完成,單擊 OK:
⑤ 繼續建立磁盤組,磁盤組名 FLASH,冗餘策略選擇 External,磁盤選擇 raw4
⑥ 最後,完成 DATA、FLASH 磁盤組的建立,Exit 推出 ASMCA 圖形配置界面:
至此,利用 ASMCA 建立好 DATA、FLASH 磁盤組。且,能夠看到連同以前建立的
GRIDDG 3 個磁盤組均已經被 RAC 雙節點 MOUNT。
六 建立 RAC 數據庫
接下來,使用 DBCA 來建立 RAC 數據庫。
① 以 oracle 用戶登陸圖形界面,執行 dbca,進入 DBCA 的圖形界面,選擇第 1 項,創
建 RAC 數據庫:
② 選擇建立數據庫選項,Next:
③ 選擇建立通用數據庫,Next:
④ 配置類型選擇 Admin-Managed,輸入數據庫名 devdb,選擇雙節點,Next:
⑤ 選擇默認,配置 OEM、啓用數據庫自動維護任務,Next:
⑥ 選擇數據庫用戶使用同一口令,Next:
⑦ 數據庫存儲選擇 ASM,使用 OMF,數據區選擇以前建立的 DATA 磁盤組,Next:
輸入建立的密碼
⑧ 指定數據庫閃回區,選擇以前建立好的 FLASH 磁盤組,Next:
⑨ 選擇建立數據庫自帶 Sample Schema,Next:
⑩ 選擇數據庫字符集,AL32UTF8,Next:
⑪ 選擇默認數據庫存儲信息,直接 Next:
⑫ 單擊,Finish,開始建立數據庫,Next:
建立數據庫可能持續時間稍長:
作到這一步趕忙多截兩個圖吧
⑬ 完成建立數據庫。
至此,咱們完成建立 RAC 數據庫!!!
七 Oracle RAC檢驗
以前安裝任何軟件都是放在node1節點上面的,爲了驗證RAC下「單節點安裝,全節點可用」的真實性,咱們使用oracle用戶登陸oracle93節點,並以sysdba用戶登入數據庫。
# su - oracle
$ sqlplus / as sysdba
可見,咱們在node2上成功登入了數據庫!
二、在node2上以sysdba身份建立表空間、用戶。
SQL> create tablespace racdata datafile '+DATA' size 100m autoextend on next 10m maxsize unlimited nologging extent management local uniform size 1024k segment space management auto;
SQL> create user ucase identified by 123456 default tablespace racdata temporary tablespace TEMP profile DEFAULT;
SQL> grant connect to ucase;
Grant succeeded.
SQL> grant resource to ucase;
Grant succeeded.
SQL> grant dba to ucase;
Grant succeeded.
SQL> grant alter tablespace to ucase;
Grant succeeded.
SQL> grant select any dictionary to ucase;
Grant succeeded.
SQL> grant unlimited tablespace to ucase;
Grant succeeded.
至此,咱們在node2節點上成功建立了一個表空間,並建立了一個新的用戶。
三、接着,咱們退出數據庫,並以oracle身份登錄oracle92節點,且以剛剛在oracle93節點上建立的用戶嘗試登陸數據庫。
# su - oracle
$ sqlplus
SQL*Plus: Release 11.2.0.4.0 Production on Wed Sep 19 15:16:28 2018
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Enter user-name: ucase
Enter password: 123456
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL>
SQL> show user;
USER is "UCASE"
可見,使用在node2節點上建立的用戶,成功地登錄了node1節點上的數據庫。
這個文檔是我一週半的心血。
我的公衆號:度一聊,不按期推送乾貨,及有用資源。