亚洲熟妇中文字幕欧美,国产 日韩 欧美 视频 制服,日韩av天堂一区二区,国产精品亚洲av三区

  1. <big id="nbhen"><acronym id="nbhen"></acronym></big>

        <source id="nbhen"><track id="nbhen"></track></source>

      1. <b id="nbhen"><acronym id="nbhen"></acronym></b>

        湖北企業(yè)新聞網(wǎng),歡迎您!

        幫助中心 廣告聯(lián)系

        網(wǎng)站關(guān)鍵詞: 湖北企業(yè)新聞網(wǎng)

        oracle 11G RAC 搭建部署!

        來源:時(shí)間:2020-11-20 10:45:10 閱讀:-

        相信在大家運(yùn)維的過程中,甲方爸爸的要求那是多種多樣的,掌握些經(jīng)常用到的技術(shù)還是必要的,本篇教學(xué)是本人在一系列痛苦的煎熬后寫出了這篇較為詳細(xì)的ORACLE 11G RAC文檔,根據(jù)本篇教程本人也是部署了很多的生產(chǎn)環(huán)境。閑話少敘,接下來就是正文了。。。。。

        本篇涉及到的oracle grid 等軟件包在百度云上,鏈接直接就是下面這個(gè)。

        鏈接:https://pan.baidu.com/s/1uty4loIDZlKdi5rRIbIolA

        提取碼:n5hw

        如果大家在部署的過程中出現(xiàn)問題,可以私信我,不及時(shí)回復(fù)請(qǐng)見諒,畢竟每天還要上班,為甲方爸爸效力。哈哈哈哈

        一,硬件環(huán)境

        1,1,中標(biāo)麒麟操作系統(tǒng)、兩臺(tái)虛擬主機(jī)。

        1,2,IP地址規(guī)劃:管理ip(ip) 2個(gè) 用戶管理集群使用的ip

        私有ip (privip) 2個(gè) 用于雙節(jié)點(diǎn)間通訊

        業(yè)務(wù)ip(vip) 2個(gè) 業(yè)務(wù)ip,通過訪問scanip后訪問vip

        訪問ip(scanip)1個(gè) 對(duì)外表現(xiàn)為業(yè)務(wù)ip

        1.3,硬盤規(guī)劃: 一個(gè)仲裁磁盤 OCR_VOTE(可選則三個(gè))

        數(shù)據(jù)磁盤 DATA (tyyw搭建時(shí)劃分了兩個(gè)data在asmca界面組成一個(gè)data組)

        閃回磁盤 FRA (700G以下就可以)

        1.4 環(huán)境配置

        物理主機(jī)需要進(jìn)行bond綁定 最好為4塊網(wǎng)卡分別兩塊網(wǎng)卡一組,兩塊光纖卡需要做冗余bond如下圖。

        oracle 11G  RAC 搭建部署

        1.5,如物理主機(jī)劃分存儲(chǔ)lun,則需要安裝多路徑軟件(存儲(chǔ)廠商提供)。

        注:多路徑軟件會(huì)發(fā)生fdisk多識(shí)別磁盤現(xiàn)象,注意注意

        二,軟件環(huán)境

        oracle 11G  RAC 搭建部署

        三,配置hosts 文件

        3.1 rac1 注hosts文件不要有大寫出現(xiàn),后期不能識(shí)別

        oracle 11G  RAC 搭建部署

        3.2 rac2

        #eth0

        192.168.8.51 rac1.wln.com rac1

        192.168.8.52 rac2.wln.com rac2

        #viptual

        192.168.8.53 rac1-vip.wln.com rac1-vip

        192.168.8.54 rac2-vip.wln.com rac2-vip

        #eth1 priv

        18.1.30.51 rac1-priv.wln.com rac1-priv

        18.1.30.52 rac2-priv.wln.com rac2-priv

        #scan

        192.168.8.55 rac-scan.wln.com rac-scan

        建議節(jié)點(diǎn)一做完hosts文件后直接scp節(jié)點(diǎn)二防止出錯(cuò)

        注意:/etc/hosts 文件兩節(jié)點(diǎn)一定要一致 寫全7個(gè)ip (2個(gè)節(jié)點(diǎn)ip(eth0 public)2個(gè)vip,2個(gè)priv(eth1),scan)寫上域名,寫上主機(jī)名(主機(jī)名一定要小寫)配置完/etc/hosts不需用重啟網(wǎng)卡

        四,檢查依賴包

        4.1配置yum源,批量安裝軟件包

        yum -y install binutils-* compat-libstdc++-* compat-libstdc++-* elfutils-libelf-* elfutils-libelf-devel-* gcc-* gcc-c++-* glibc-* glibc-* glibc-common-* glibc-devel-* glibc-devel-* glibc-headers-* ksh-* libaio-* libaio-* libaio-devel-* libaio-devel-* libgcc-* libgcc-* libstdc++-* libstdc++-* libstdc++-devel* make-* sysstat-* unixODBC-* compat-libcap1

        以上操作均在所有節(jié)點(diǎn)執(zhí)行。

        五,安裝工作

        以下配置均在所有節(jié)點(diǎn)執(zhí)行

        5.1 修改主機(jī)名稱

        [root@rac1 ~]# vi /etc/sysconfig/network

        NETWORKING=yes

        HOSTNAME=rac1

        5.2 配置用戶,組,目錄和權(quán)限

        groupadd oinstall

        groupadd dba

        groupadd oper

        groupadd asmadmin

        groupadd asmdba

        groupadd asmoper

        useradd -g oinstall -G dba,asmdba,asmadmin,asmoper grid

        useradd -g oinstall -G dba,oper,asmdba oracle

        echo -n qwer1234|passwd --stdin grid

        echo -n qwer1234|passwd --stdin oracle

        mkdir -p /u01/app/11.2.0/grid

        mkdir -p /u01/app/grid

        mkdir -p /u01/app/oracle

        chown -R grid:oinstall /u01

        chown grid:oinstall /u01/app/11.2.0/grid

        chown grid:oinstall /u01/app/grid

        chown -R oracle:oinstall /u01/app/oracle

        chmod -R 775 /u01/

        注意:兩個(gè)節(jié)點(diǎn)創(chuàng)建的用戶,組,目錄,權(quán)限,一定要一致,做完之后檢查,不能有誤,否者會(huì)引起后續(xù)創(chuàng)建數(shù)據(jù)庫找磁盤組識(shí)別不出來

        5.3 修改系統(tǒng)內(nèi)核參數(shù)

        1 sed -i 's/kernel.shmmax/#kernel.shmmax/g' /etc/sysctl.conf

        2. sed -i 's/kernel.shmall/#kernel.shmall/g' /etc/sysctl.conf

        3.vim /etc/sysctl.conf

        fs.aio-max-nr = 1048576

        fs.file-max = 6815744

        kernel.shmall = 2097152

        kernel.shmmax = 1073741824

        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

        4.sysctl –p

        注意:修改內(nèi)核參數(shù)直接配置文件末尾加入就可以不需要修改原來內(nèi)核文件

        5.4 配置/etc/security/limits.conf

        oracle soft nproc 2047

        oracle hard nproc 16384

        oracle soft nofile 1024

        oracle hard nofile 65536

        oracle soft stack 10240

        grid soft nproc 2047

        grid hard nproc 16384

        grid soft nofile 1024

        grid hard nofile 65536

        grid soft stack 10240

        5.5 配置/etc/profile

        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

        ####

        六,配置用戶環(huán)境變量

        6.1配置節(jié)點(diǎn)1用戶

        A grid用戶

        vim /home/grid/.bash_profile

        export TMP=/tmp

        export TMPDIR=$TMP

        export ORACLE_HOSTNAME=rac1.wln.com

        export ORACLE_SID=+ASM1

        export ORACLE_BASE=/u01/app/grid

        export ORACLE_HOME=/u01/app/11.2.0/grid

        export NLS_DATE_FORMAT="yy-mm-dd HH24:MI:SS"

        export PATH=$ORACLE_HOME/bin:$PATH

        export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

        B oracle 用戶

        vim /home/oracle/.bash_profile

        export TMP=/tmp

        export TMPDIR=$TMP

        export ORACLE_HOSTNAME=rac1.wln.com

        export ORACLE_BASE=/u01/app/oracle

        export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1

        export ORACLE_UNQNAME=prod

        export ORACLE_SID=prod1

        export ORACLE_TERM=xterm

        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

        export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"

        export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

        6.2 配置節(jié)點(diǎn)2用戶

        A grid用戶

        Vim /home/grid/.bash_profile

        export TMP=/tmp

        export TMPDIR=$TMP

        export ORACLE_HOSTNAME=rac2.wln.com

        export ORACLE_SID=+ASM2

        export ORACLE_BASE=/u01/app/grid

        export ORACLE_HOME=/u01/app/11.2.0/grid

        export NLS_DATE_FORMAT="yy-mm-dd HH24:MI:SS"

        export PATH=$ORACLE_HOME/bin:$PATH

        export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

        B oracle用戶

        Vim /home/oracle/.bash_profile

        export TMP=/tmp

        export TMPDIR=$TMP

        export ORACLE_HOSTNAME=rac2.wln.com

        export ORACLE_BASE=/u01/app/oracle

        export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1

        export ORACLE_UNQNAME=prod

        export ORACLE_SID=prod2

        export ORACLE_TERM=xterm

        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 export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"

        export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

        七. 配置用戶等效性

        7.1 grid 用戶等效性

        以下均已grid用戶執(zhí)行

        注意:等效性配置與后面grid集群安裝有直接關(guān)系

        按照順序進(jìn)行操作,否則會(huì)提示沒有文件或目錄的錯(cuò)誤

        oracle 11G  RAC 搭建部署

        以grid戶執(zhí)行操作

        rac1

        ssh-keygen -t rsa

        ssh-keygen -t dsa

        rac2

        ssh-keygen -t rsa

        ssh-keygen -t dsa

        #以上用默認(rèn)配置,一路回車即可

        rac1

        cat ~/.ssh/*.pub >> ~/.ssh/authorized_keys

        ssh grid@rac2 cat ~/.ssh/*.pub >> ~/.ssh/authorized_keys

        rac2

        cat ~/.ssh/*.pub >> ~/.ssh/authorized_keys

        ssh grid@rac1 cat ~/.ssh/*.pub >> ~/.ssh/authorized_keys

        #建立等效性

        rac1,rac2 雙節(jié)點(diǎn)執(zhí)行

        ssh rac1 date

        ssh rac1-priv date

        ssh rac2 date

        ssh rac2-priv date

        雙節(jié)點(diǎn)出現(xiàn)下圖表示成功

        oracle 11G  RAC 搭建部署

        oracle 11G  RAC 搭建部署

        7.2 oracle 用戶等效性

        一下oracle用戶執(zhí)行操作

        rac1

        ssh-keygen -t rsa

        ssh-keygen -t dsa

        rac2

        ssh-keygen -t rsa

        ssh-keygen -t dsa

        #以上用默認(rèn)配置,一路回車即可

        rac1

        cat ~/.ssh/*.pub >> ~/.ssh/authorized_keys

        ssh oracle@rac2 cat ~/.ssh/*.pub >> ~/.ssh/authorized_keys

        rac2

        cat ~/.ssh/*.pub >> ~/.ssh/authorized_keys

        ssh oracle@rac1 cat ~/.ssh/*.pub >> ~/.ssh/authorized_keys

        #建立等效性

        rac1,rac2 雙節(jié)點(diǎn)執(zhí)行

        ssh rac1 date

        ssh rac1-priv date

        ssh rac2 date

        ssh rac2-priv date

        八,配置ntp服務(wù)

        8.1 節(jié)點(diǎn)1

        主數(shù)據(jù)庫服務(wù)器配置: 如該內(nèi)網(wǎng)有時(shí)間同步服務(wù)器則使用內(nèi)網(wǎng)時(shí)間同步服務(wù)

        編輯/etc/ntp.conf

        server 127.127.1.0

        fudge 127.127.1.0 stratum 8

        啟動(dòng)ntpserver service ntpd start

        添加到系統(tǒng)自啟動(dòng) chkconfig --level 12345 ntpd on

        8.2 節(jié)點(diǎn)2

        編輯/etc/ntp.conf

        server 內(nèi)網(wǎng)時(shí)間同步服務(wù)器ip iburst


        雙節(jié)點(diǎn)查看時(shí)間同步效果

        ntpq -p

        oracle 11G  RAC 搭建部署


        九.安裝并配置 ASM 驅(qū)動(dòng)或裸設(shè)備

        9.1 檢查內(nèi)核

        [root@rac1 ~]# uname -r

        2.6.18-164.el5

        Oracle ASMlib 下載地址:


        下載以下 rpm 包(注意 rpm 包版本和 Linux 內(nèi)核版本一致):

        9.2 安裝 oracleasm 包(雙節(jié)點(diǎn)執(zhí)行)

        安裝以下安裝包 按照順序執(zhí)行安裝否則會(huì)導(dǎo)致安裝失敗

        注意:如果沒有與內(nèi)核版本相同的安裝包,則采用裸設(shè)備安裝方式→

        oracle 11G  RAC 搭建部署

        1,rpm-ivh oracleasm-support-2.1.7-1.el5.x86_64.rpm

        2, rpm -ivh kmod-oracleasm-2.0.6.rh1-3.el6_5.x86_64.rpm

        3, rpm -ivh oracleasmlib-2.0.4-1.el5.x86_64.rpm

        4,rpm -ivh oracleasm-2.6.18-164.el5-2.0.5-1.el5.x86_64.rpm --force --nodeps


        9.2.1初始化 asmlib(在所有節(jié)點(diǎn)執(zhí)行)

        節(jié)點(diǎn) 2 省略

        A [root@rac1 ~]# oracleasm configure -i

        Configuring the Oracle ASM library driver.

        This will configure the on-boot properties of the Oracle ASM library driver.

        The following questions will determine whether the driver is loaded on boot and what permissions it will have.

        The current values will be shown in brackets ('[]'). Hitting without typing an answer will keep that current value. Ctrl-C will abort.

        Default user to own the driver interface []: grid

        Default group to own the driver interface []: oinstall

        Start Oracle ASM library driver on boot (y/n) [n]: y

        Scan for Oracle ASM disks on boot (y/n) [y]: y

        Writing Oracle ASM library driver configuration: done

        B [root@rac1 ~]# oracleasm init

        Creating /dev/oracleasm mount point: /dev/oracleasm

        Loading module "oracleasm": oracleasm

        Mounting ASMlib driver filesystem: /dev/oracleasm

        9.2.2 磁盤分區(qū)(節(jié)點(diǎn) 1 執(zhí)行)

        [root@rac1 ~]# fdisk /dev/sdb 分區(qū)不需要格式化

        Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

        Building a new DOS disklabel. Changes will remain in memory only,

        until you decide to write them. After that, of course, the previous

        content won't be recoverable.

        Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

        Command (m for help): n

        Command action

        e extended

        p primary partition (1-4)

        p

        Partition number (1-4): 1

        First cylinder (1-261, default 1):

        Using default value 1

        Last cylinder or +size or +sizeM or +sizeK (1-261, default 261):

        Using default value 261

        Command (m for help):

        Command (m for help): w

        The partition table has been altered!

        sdb、sdc、sdd執(zhí)行相同操作

        9.2.3 創(chuàng)建 asm 磁盤,在節(jié)點(diǎn) 1 執(zhí)行

        A. [root@rac1 ~]# oracleasm createdisk OCR_VOTE /dev/sdb1

        Writing disk header: done

        Instantiating disk: done

        [root@rac1 ~]# oracleasm createdisk DATA /dev/sdc1

        Writing disk header: done

        Instantiating disk: done

        [root@rac1 ~]# oracleasm createdisk FRA /dev/sdd1

        Writing disk header: done

        Instantiating disk: done

        B. [root@rac1 ~]# oracleasm scandisks

        Reloading disk partitions: done

        Cleaning any stale ASM disks...

        Scanning system for ASM disks...

        [root@rac1 ~]# oracleasm listdisks

        DATA

        FRA

        OCR_VOTE

        9.2.4節(jié)點(diǎn) 2 掃描識(shí)別 ASM 磁盤

        [root@rac2 ~]# oracleasm scandisks

        Reloading disk partitions: done

        Cleaning any stale ASM disks...

        Scanning system for ASM disks...

        Instantiating disk "OCR_VOTE"

        Instantiating disk "DATA"

        Instantiating disk "FRA"

        [root@rac2 ~]# oracleasm listdisks

        DATA

        FRA

        OCR_VOTE

        9.3 制作裸設(shè)備

        如果沒有asm安裝包 可以采用裸設(shè)備的安裝方式 下面采用裸設(shè)備的方式進(jìn)行操作

        [root@rac1 ~]# fdisk /dev/sdb 分區(qū)不需要格式化

        Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

        Building a new DOS disklabel. Changes will remain in memory only,

        until you decide to write them. After that, of course, the previous

        content won't be recoverable.

        Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

        Command (m for help): n

        Command action

        e extended

        p primary partition (1-4)

        p

        Partition number (1-4): 1

        First cylinder (1-261, default 1):

        Using default value 1

        Last cylinder or +size or +sizeM or +sizeK (1-261, default 261):

        Using default value 261

        Command (m for help):

        Command (m for help): w

        The partition table has been altered!

        開始用裸設(shè)備命令制作裸設(shè)備 虛擬機(jī)環(huán)境下兩個(gè)節(jié)點(diǎn)都需要操作

        9.3.1 制作裸設(shè)備

        [root@rac1 ~]# raw /dev/raw/raw1 /dev/sdb1

        /dev/raw/raw1: bound to major 8, minor 17

        [root@rac1 ~]# raw /dev/raw/raw2 /dev/sdc1

        /dev/raw/raw2: bound to major 8, minor 33

        [root@rac1 ~]# raw /dev/raw/raw3 /dev/sdd1

        /dev/raw/raw3: bound to major 8, minor 49

        [root@rac1 oracle]# raw -qa

        /dev/raw/raw1: bound to major 8, minor 17

        /dev/raw/raw2: bound to major 8, minor 33

        /dev/raw/raw3: bound to major 8, minor 49

        9.3.2 自動(dòng)掛載文件

        [root@rac1 oracle]# vim /etc/rc.local

        添加如下內(nèi)容:

        raw /dev/raw/raw1 /dev/sdb1

        raw /dev/raw/raw2 /dev/sdc1

        raw /dev/raw/raw3 /dev/sdd1

        9.3.3 將裸設(shè)備文件和分區(qū)設(shè)備文件進(jìn)行綁定

        [root@rac1 oracle]# vim /etc/udev/rules.d/60-raw.rules

        編輯文件添加如下內(nèi)容:

        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=="raw[1-3]",OWNER=="grid",GROUP=="asmadmin",MODE=="660"

        9.3.4重新啟動(dòng)服務(wù)器

        reboot

        start_udev 啟動(dòng)裸設(shè)備

        十. 安裝 cvuqdisk 軟件包 (雙節(jié)點(diǎn)執(zhí)行操作)

        cvuqdisk軟件包用于發(fā)現(xiàn)共享存儲(chǔ),在grid 安裝軟件的rpm目錄中,在所有節(jié)點(diǎn)執(zhí)行;

        [root@rac1 grid]# cd /wln/grid/rpm

        [root@rac1 grid]# export CVUQDISK_GRP=oinstall

        [root@rac1 rpm]# rpm -ivh cvuqdisk-1.0.7-1.rpm

        Preparing... #################################### [100%]

        1:cvuqdisk #################################### [100%


        注:如集群安裝失敗,卸載集群時(shí)該軟件也會(huì)被刪除需要重新安裝。


        十一.安裝前檢查

        [grid@rac1 grid]$ pwd

        /wln/grid

        [grid@rac1 grid]$ ./runcluvfy.sh stage -post hwos -n rac1,rac2 -verbose

        十二. 安裝 Grid Infrastructure

        [grid@rac1 grid]$ pwd

        /wln/grid

        [grid@rac1 grid]$ ./runInstaller

        12.1 安裝 grid

        選擇跳過更新

        oracle 11G  RAC 搭建部署

        為集群安裝

        oracle 11G  RAC 搭建部署

        高級(jí)安裝

        oracle 11G  RAC 搭建部署

        默認(rèn)

        oracle 11G  RAC 搭建部署

        Configure GNS 對(duì)鉤去掉,SCAN Name 選擇和/etc/hosts 中一致的名字

        oracle 11G  RAC 搭建部署

        添加節(jié)點(diǎn)2

        oracle 11G  RAC 搭建部署

        默認(rèn)

        oracle 11G  RAC 搭建部署

        選擇ASM存儲(chǔ)

        oracle 11G  RAC 搭建部署

        創(chuàng)建磁盤組 選擇仲裁磁盤

        oracle 11G  RAC 搭建部署

        配置 ASM System 口令(此處用 oracle 會(huì)報(bào)密碼不符合推薦標(biāo)準(zhǔn)的錯(cuò)誤)

        oracle 11G  RAC 搭建部署

        不使用智能平臺(tái)管理接口

        oracle 11G  RAC 搭建部署

        默認(rèn)

        oracle 11G  RAC 搭建部署

        使用默認(rèn)的安裝位置

        oracle 11G  RAC 搭建部署

        選擇清單目錄

        oracle 11G  RAC 搭建部署

        檢驗(yàn),問題忽略即可

        oracle 11G  RAC 搭建部署

        安裝即可

        oracle 11G  RAC 搭建部署

        執(zhí)行root腳本

        oracle 11G  RAC 搭建部署

        以 root 用戶按順序執(zhí)行

        1.[root@rac1 ~]# /u01/app/oraInventory/orainstRoot.sh

        2.[root@rac2 ~]# /u01/app/oraInventory/orainstRoot.sh

        3.[root@rac1 ~]# /u01/app/11.2.0/grid/root.sh 時(shí)間較長,耐心等待

        4.[root@rac2 ~]# /u01/app/11.2.0/grid/root.sh

        運(yùn)行完腳本后,點(diǎn)擊 ok 完成安裝.如果不能 rac-scan,那么會(huì)報(bào)錯(cuò)

        12.2 確認(rèn)集群軟件安裝成功

        在grid用戶下 使用 crs_stat -t 與 crs_stat -t -v

        [grid@rac1 ~] crs_stat -t

        oracle 11G  RAC 搭建部署

        [grid@rac1 ~]crs_stat -t -v

        oracle 11G  RAC 搭建部署


        十三.創(chuàng)建 ASM 磁盤組

        本次任務(wù)將創(chuàng)建 2 個(gè) asm 磁盤組,分別為:DATA,FRA。其中 DATA 將存放數(shù)據(jù)庫 文件;FRA 存放閃回文件. 可以選擇多個(gè)磁盤進(jìn)行劃分組

        如:有連個(gè)ams磁盤DATA,DATA1 可以選擇在創(chuàng)建磁盤組時(shí)選擇兩個(gè)

        在 grid 用戶下,執(zhí)行 asmca,啟動(dòng) asm 磁盤組創(chuàng)建向?qū)?/p>

        oracle 11G  RAC 搭建部署

        點(diǎn)擊 create 按鈕,在彈出的創(chuàng)建界面中填寫磁盤組名稱,選擇 external(none),并 勾選成員,選擇完畢后點(diǎn)擊 ok;

        oracle 11G  RAC 搭建部署

        創(chuàng)建 FRA 磁盤組和 DATA 操作相同

        oracle 11G  RAC 搭建部署

        確認(rèn) stat 為 2 of 2 時(shí),退出 asmca

        oracle 11G  RAC 搭建部署

        十四.安裝 oracle11gr2 database 軟件

        以 oracle 用戶登錄到節(jié)點(diǎn)一,切換到軟件安裝目錄,執(zhí)行安裝

        [oracle@rac1 database]$ ./runInstaller

        在彈出的安裝界面中,點(diǎn)擊 next

        oracle 11G  RAC 搭建部署

        跳過軟件更新

        oracle 11G  RAC 搭建部署

        選擇"install software only",點(diǎn)擊 next

        oracle 11G  RAC 搭建部署

        選擇雙節(jié)點(diǎn)

        oracle 11G  RAC 搭建部署

        加入中文

        oracle 11G  RAC 搭建部署

        選擇企業(yè)版,點(diǎn)擊 next

        oracle 11G  RAC 搭建部署

        使用默認(rèn)的目錄,點(diǎn)擊 nex

        oracle 11G  RAC 搭建部署

        默認(rèn)

        oracle 11G  RAC 搭建部署

        進(jìn)入安裝過程自動(dòng)進(jìn)行安裝檢查 忽略安裝即可

        oracle 11G  RAC 搭建部署

        執(zhí)行腳本以 root 用戶,在兩個(gè)節(jié)點(diǎn)上執(zhí)行腳本 執(zhí)行順序: 1.rac1 2.rac

        oracle 11G  RAC 搭建部署

        點(diǎn)擊完成安裝即可

        oracle 11G  RAC 搭建部署

        十五.創(chuàng)建數(shù)據(jù)庫

        在節(jié)點(diǎn) 1 上用 oracle 用戶執(zhí)行 dbca 命令, 選擇 rac 數(shù)據(jù)庫點(diǎn)擊 next

        點(diǎn)擊創(chuàng)建數(shù)據(jù)庫

        oracle 11G  RAC 搭建部署

        選擇一般用途或事務(wù)處理,點(diǎn)擊 next

        oracle 11G  RAC 搭建部署

        填寫數(shù)據(jù)庫名稱(使用環(huán)境變量中 ORACLE_UNQNAME),選擇兩個(gè)節(jié)點(diǎn),點(diǎn)擊 next

        oracle 11G  RAC 搭建部署

        默認(rèn),點(diǎn)擊 next

        oracle 11G  RAC 搭建部署

        為所有用戶設(shè)置統(tǒng)一密碼:oracle,點(diǎn)擊 next

        oracle 11G  RAC 搭建部署

        選擇 ASM 存儲(chǔ)方式,并選擇相應(yīng)的磁盤組,

        點(diǎn)擊 next 彈出 ASM 用戶密碼窗口,輸入在安裝 grid 時(shí)設(shè)置的密碼:oracle

        oracle 11G  RAC 搭建部署

        選擇閃回磁盤組,取消勾選歸檔,next

        oracle 11G  RAC 搭建部署

        選擇 Sample Schemas(用于學(xué)習(xí))

        oracle 11G  RAC 搭建部署

        選擇自動(dòng)內(nèi)存管理,內(nèi)存段 40%

        oracle 11G  RAC 搭建部署

        點(diǎn)擊字符集選項(xiàng),選擇 ZHS16GBK 類型

        oracle 11G  RAC 搭建部署

        顯示概覽,默認(rèn)不變,點(diǎn)擊 next

        oracle 11G  RAC 搭建部署

        點(diǎn)擊 確定

        oracle 11G  RAC 搭建部署

        oracle 11G  RAC 搭建部署

        十六.集群管理

        ###########實(shí)際操作是發(fā)現(xiàn)root命令下沒有crsctl命令#############

        16.1 RAC 的啟動(dòng)與關(guān)閉

        oracle rac 默認(rèn)會(huì)開機(jī)自啟動(dòng),如需維護(hù)時(shí)可使用以下命令:

        關(guān)閉:

        crsctl stop cluster 停止本節(jié)點(diǎn)集群服務(wù)

        crsctl stop cluster –all 停止所有節(jié)點(diǎn)服務(wù)

        開啟

        crsctl start cluster 開啟本節(jié)點(diǎn)集群服務(wù)

        crsctl start cluster –all 開啟所有節(jié)點(diǎn)服務(wù)

        注:以上命令需以 root 用戶執(zhí)行

        ############################################################

        16.2 RAC 檢查運(yùn)行狀況

        以 grid 用戶運(yùn)行

        [grid@rac1 ~]$ crsctl check cluster

        CRS-4537: Cluster Ready Services is online

        CRS-4529: Cluster Synchronization Services is online

        CRS-4533: Event Manager is online

        16.3 Database 檢查例狀態(tài)

        [oracle@rac1 ~]$ srvctl status database -d prod

        Instance rac1 is running on node rac1

        Instance rac2 is running on node rac2

        16.4 檢查節(jié)點(diǎn)應(yīng)用狀態(tài)及配置

        [oracle@rac1 ~]$ srvctl status nodeapps

        VIP rac1-vip is enabled

        VIP rac1-vip is running on node: rac1

        VIP rac2-vip is enabled

        VIP rac2-vip is running on node: rac2

        Network is enabled

        Network is running on node: rac1

        Network is running on node: rac2

        GSD is disabled

        GSD is not running on node: rac1

        GSD is not running on node: rac2

        ONS is enabled

        ONS daemon is running on node: rac1

        ONS daemon is running on node: rac2

        eONS is enabled

        eONS daemon is running on node: rac1

        eONS daemon is running on node: rac2

        [oracle@rac1 ~]$ srvctl config nodeapps -a -g -s -l

        -l option has been deprecated and will be ignored.

        VIP exists.:rac1

        VIP exists.: /rac1-vip/182.168.8.53/255.255.255.0/eth0

        VIP exists.:rac2

        VIP exists.: /rac2-vip/182.168.8.54/255.255.255.0/eth0 GSD exists.

        ONS daemon exists. Local port 6100, remote port 6200

        Name: LISTENER

        Network: 1, Owner: grid

        Home:

        /u01/app/11.2.0/grid on node(s) rac2,rac1 End points: TCP:1521

        16.5 查看數(shù)據(jù)庫配置

        [oracle@rac1 ~]$ srvctl config database -d prod -a

        Database unique name: prod

        Database name: prod

        Oracle home: /u01/app/oracle/product/11.2.0/db_1

        Oracle user: oracle

        Spfile: +DATA/prod/spfileprod.ora

        Domain:

        Start options: open

        Stop options: immediate

        Database role: PRIMARY

        Management policy: AUTOMATIC

        Server pools: prod

        Database instances: prod1,prod2

        Disk Groups: DATA,FRA

        Services:

        Database is enabled

        Database is administrator managed

        16.6 檢查 ASM 狀態(tài)及配置

        [oracle@rac1 ~]$ srvctl status asm

        ASM is running on rac1,rac2

        [oracle@rac1 ~]$ srvctl config asm -a

        ASM home: /u01/app/11.2.0/grid

        ASM listener: LISTENER

        ASM is enabled.

        16.7 檢查 TNS 的狀態(tài)及配置

        [oracle@rac1 ~]$ srvctl status listener

        Listener LISTENER is enabled

        Listener LISTENER is running on node(s): rac1,rac2

        [oracle@rac1 ~]$ srvctl config listener -a

        Name: LISTENER

        Network: 1, Owner: grid

        Home:

        /u01/app/11.2.0/grid on node(s) rac2,rac1

        End points: TCP:1521

        16.8 檢查 SCAN 的狀態(tài)及配置

        [oracle@rac1 ~]$ srvctl status scan

        SCAN VIP scan1 is enabled

        SCAN VIP scan1 is running on node rac1

        [oracle@rac1 ~]$ srvctl config scan

        SCAN name: rac-scan, Network: 1/182.168.8.0/255.255.255.0/eth0

        SCAN VIP name: scan1, IP: /rac-scan.xl.com/182.168.8.55

        16.9 檢查 VIP 的狀態(tài)及配置

        [oracle@rac1 ~]$ srvctl status vip -n rac1

        VIP rac1-vip is enabled

        VIP rac1-vip is running on node: rac1

        [oracle@rac1 ~]$ srvctl status vip -n rac2

        VIP rac2-vip is enabled

        VIP rac2-vip is running on node: rac2

        [oracle@rac1 ~]$ srvctl config vip -n rac1

        VIP exists.:rac1

        VIP exists.: /rac1-vip/182.168.8.53/255.255.255.0/eth0

        [oracle@rac1 ~]$ srvctl config vip -n rac2

        VIP exists.:rac2

        VIP exists.: /rac2-vip/182.168.8.54/255.255.255.0/eth0

        推薦閱讀:通化熱線