Oracle Study之-AIX6.1构建Oracle 10gR2 RAC(3)
一、配置共享存储
[oracle@aix203 ~]$lsdev -c disk
hdisk0 Available 1S-08-00-8,0 Other SCSI Disk Drive
hdisk1 Available 1D-08-02 Other FC SCSI Disk Drive
[root@aix204 /]#lsdev -c disk
hdisk0 Available 1S-08-00-8,0 16 Bit LVD SCSI Disk Drive
hdisk1 Available 1D-08-02 Other FC SCSI Disk Drive
在aix203上创建卷组(并发卷组)
[root@aix203 /]#lspv
hdisk0 000681aa6c0502a7 rootvg active
hdisk1 0008570c15134e9d rac10_vg
激活卷组,并查看卷组信息:
[root@aix203 /]#varyonvg rac10_vg
[root@aix203 /]#lsvg rac10_vg
VOLUME GROUP: rac10_vg VG IDENTIFIER: 000681aa00004c00000001537b5134d2 VG STATE: active PP SIZE: 128 megabyte(s) VG PERMISSION: read/write TOTAL PPs: 160 (20480 megabytes) MAX LVs: 256 FREE PPs: 160 (20480 megabytes) LVs: 0 USED PPs: 0 (0 megabytes) OPEN LVs: 0 QUORUM: 2 (Enabled) TOTAL PVs: 1 VG DESCRIPTORS: 2 STALE PVs: 0 STALE PPs: 0 ACTIVE PVs: 1 AUTO ON: no Concurrent: Enhanced-Capable Auto-Concurrent: Disabled VG Mode: Non-Concurrent MAX PPs per VG: 32512 MAX PPs per PV: 1016 MAX PVs: 32 LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no HOT SPARE: no BB POLICY: relocatable PV RESTRICTION: none INFINITE RETRY: no DISK BLOCK SIZE: 512
创建逻辑卷:
[root@aix203 /]#cat mklv.sh
mklv -y 'rac_ocr' -t 'raw' rac10_vg 1 mklv -y 'rac_vote' -t 'raw' rac10_vg 1 mklv -y 'system' -t 'raw' rac10_vg 10 mklv -y 'sysaux' -t 'raw' rac10_vg 5 mklv -y 'users' -t 'raw' rac10_vg 5 mklv -y 'undotbs1' -t 'raw' rac10_vg 5 mklv -y 'undotbs2' -t 'raw' rac10_vg 5 mklv -y 'temp' -t 'raw' rac10_vg 5 mklv -y 'control1_1' -t 'raw' rac10_vg 1 mklv -y 'control2_2' -t 'raw' rac10_vg 1 mklv -y 'control3_3' -t 'raw' rac10_vg 1 mklv -y 'spfile' -t 'raw' rac10_vg 1 mklv -y 'redo1_1' -t 'raw' rac10_vg 1 mklv -y 'redo1_2' -t 'raw' rac10_vg 1 mklv -y 'redo2_1' -t 'raw' rac10_vg 1 mklv -y 'redo2_2' -t 'raw' rac10_vg 1 mklv -y 'example' -t 'raw' rac10_vg 5 mklv -y 'index' -t 'raw' rac10_vg 5
查看逻辑卷信息:
[root@aix203 /]#lsvg -l rac10_vg
rac10_vg: LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT rac_ocr raw 1 1 1 closed/syncd N/A rac_vote raw 1 1 1 closed/syncd N/A system raw 10 10 1 closed/syncd N/A sysaux raw 5 5 1 closed/syncd N/A users raw 5 5 1 closed/syncd N/A undotbs1 raw 5 5 1 closed/syncd N/A undotbs2 raw 5 5 1 closed/syncd N/A temp raw 5 5 1 closed/syncd N/A control1_1 raw 1 1 1 closed/syncd N/A control2_2 raw 1 1 1 closed/syncd N/A control3_3 raw 1 1 1 closed/syncd N/A spfile raw 1 1 1 closed/syncd N/A redo1_1 raw 1 1 1 closed/syncd N/A redo1_2 raw 1 1 1 closed/syncd N/A redo2_1 raw 1 1 1 closed/syncd N/A redo2_2 raw 1 1 1 closed/syncd N/A example raw 5 5 1 closed/syncd N/A index raw 5 5 1 closed/syncd N/A
在另一个node导入卷组信息:
[root@aix204 /]#varyonvg rac10_vg
[root@aix204 /]#lsvg -l rac10_vg
rac10_vg: LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT rac_ocr raw 1 1 1 closed/syncd N/A rac_vote raw 1 1 1 closed/syncd N/A system raw 10 10 1 closed/syncd N/A sysaux raw 5 5 1 closed/syncd N/A users raw 5 5 1 closed/syncd N/A undotbs1 raw 5 5 1 closed/syncd N/A undotbs2 raw 5 5 1 closed/syncd N/A temp raw 5 5 1 closed/syncd N/A control1_1 raw 1 1 1 closed/syncd N/A control2_2 raw 1 1 1 closed/syncd N/A control3_3 raw 1 1 1 closed/syncd N/A spfile raw 1 1 1 closed/syncd N/A redo1_1 raw 1 1 1 closed/syncd N/A redo1_2 raw 1 1 1 closed/syncd N/A redo2_1 raw 1 1 1 closed/syncd N/A redo2_2 raw 1 1 1 closed/syncd N/A example raw 5 5 1 closed/syncd N/A index raw 5 5 1 closed/syncd N/A
二、安装配置HACMP
HACMP软件版本6.1
需要预先安装以下软件(AIX系统盘1#):
1) 安装hacmp
MISSING REQUISITES: The following filesets are required by one or more of the selected filesets listed above. They are not currently installed and could not be found on the installation media. bos.adt.syscalls 5.3.7.0 # Base Level Fileset bos.data 5.1.0.0 # Base Level Fileset bos.data 5.3.0.0 # Base Level Fileset bos.net.nfs.server 5.3.7.0 # Base Level Fileset [root@aix203 soft1]#lslpp -l |grep bos.adt.sys bos.adt.syscalls 6.1.9.0 COMMITTED System Calls Application [root@aix203 soft1]#lslpp -l |grep bos.data bos.data 6.1.6.15 COMMITTED Base Operating System Data [root@aix203 soft1]#lslpp -l |grep bos.net.nfs bos.net.nfs.adt 6.1.9.0 COMMITTED Network File System bos.net.nfs.cachefs 6.1.9.0 COMMITTED CacheFS File System bos.net.nfs.client 6.1.9.0 COMMITTED Network File System Client bos.net.nfs.server 6.1.8.0 COMMITTED Network File System Server bos.net.nfs.cachefs 6.1.9.0 COMMITTED CacheFS File System bos.net.nfs.client 6.1.9.0 COMMITTED Network File System Client
通过smit安装hacmp软件:
[root@aix203 soft1]#lslpp -l |grep cluster
bos.cluster.rte 6.1.9.0 COMMITTED Cluster Aware AIX cluster.adt.es.client.include cluster.adt.es.client.samples.clinfo cluster.adt.es.client.samples.clstat cluster.adt.es.client.samples.libcl cluster.adt.es.java.demo.monitor cluster.doc.en_US.assist.db2.html cluster.doc.en_US.assist.db2.pdf cluster.doc.en_US.assist.oracle.html cluster.doc.en_US.assist.oracle.pdf cluster.doc.en_US.assist.websphere.html cluster.doc.en_US.assist.websphere.pdf cluster.doc.en_US.es.html 6.1.0.0 COMMITTED HAES Web-based HTML cluster.doc.en_US.es.pdf 6.1.0.0 COMMITTED HAES PDF Documentation - U.S. cluster.es.assist.common 6.1.0.0 COMMITTED HACMP Smart Assist Common cluster.es.assist.db2 6.1.0.0 COMMITTED HACMP Smart Assist for DB2 cluster.es.assist.oracle 6.1.0.0 COMMITTED HACMP Smart Assist for Oracle cluster.es.assist.sap 6.1.0.0 COMMITTED HACMP Smart Assist for SAP cluster.es.assist.websphere cluster.es.cfs.rte 6.1.0.0 COMMITTED ES Cluster File System Support cluster.es.client.clcomd 6.1.0.0 COMMITTED ES Cluster Communication cluster.es.client.lib 6.1.0.0 COMMITTED ES Client Libraries cluster.es.client.rte 6.1.0.0 COMMITTED ES Client Runtime cluster.es.client.utils 6.1.0.0 COMMITTED ES Client Utilities cluster.es.client.wsm 6.1.0.0 COMMITTED Web based Smit cluster.es.cspoc.cmds 6.1.0.0 COMMITTED ES CSPOC Commands cluster.es.cspoc.dsh 6.1.0.0 COMMITTED ES CSPOC dsh cluster.es.cspoc.rte 6.1.0.0 COMMITTED ES CSPOC Runtime Commands cluster.es.nfs.rte 6.1.0.0 COMMITTED ES NFS Support cluster.es.plugins.dhcp 6.1.0.0 COMMITTED ES Plugins - dhcp cluster.es.plugins.dns 6.1.0.0 COMMITTED ES Plugins - Name Server cluster.es.plugins.printserver cluster.es.server.cfgast 6.1.0.0 COMMITTED ES Two-Node Configuration cluster.es.server.diag 6.1.0.0 COMMITTED ES Server Diags cluster.es.server.events 6.1.0.0 COMMITTED ES Server Events cluster.es.server.rte 6.1.0.0 COMMITTED ES Base Server Runtime cluster.es.server.testtool cluster.es.server.utils 6.1.0.0 COMMITTED ES Server Utilities cluster.es.worksheets 6.1.0.0 COMMITTED Online Planning Worksheets cluster.license 6.1.0.0 COMMITTED HACMP Electronic License mcr.rte 6.1.9.0 COMMITTED Metacluster Checkpoint and bos.cluster.rte 6.1.9.0 COMMITTED Cluster Aware AIX cluster.es.assist.db2 6.1.0.0 COMMITTED HACMP Smart Assist for DB2 cluster.es.assist.oracle 6.1.0.0 COMMITTED HACMP Smart Assist for Oracle cluster.es.assist.sap 6.1.0.0 COMMITTED HACMP Smart Assist for SAP cluster.es.assist.websphere cluster.es.client.clcomd 6.1.0.0 COMMITTED ES Cluster Communication cluster.es.client.lib 6.1.0.0 COMMITTED ES Client Libraries cluster.es.client.rte 6.1.0.0 COMMITTED ES Client Runtime cluster.es.client.wsm 6.1.0.0 COMMITTED Web based Smit cluster.es.cspoc.rte 6.1.0.0 COMMITTED ES CSPOC Runtime Commands cluster.es.nfs.rte 6.1.0.0 COMMITTED ES NFS Support cluster.es.server.diag 6.1.0.0 COMMITTED ES Server Diags cluster.es.server.events 6.1.0.0 COMMITTED ES Server Events cluster.es.server.rte 6.1.0.0 COMMITTED ES Base Server Runtime cluster.es.server.utils 6.1.0.0 COMMITTED ES Server Utilities mcr.rte 6.1.9.0 COMMITTED Metacluster Checkpoint and cluster.man.en_US.assist.data cluster.man.en_US.es.data 6.1.0.0 COMMITTED ES Man Pages - U.S. English
2)配置hacmp
1、配置cluster添加node
配置Cluster网络:
配置网络通讯接口:
修改网络属性:
在node上启动服务:
[root@aix203 /]# /usr/bin/startsrc -s clcomdES
[root@aix204 /]# /usr/bin/startsrc -s clcomdES
在两个node上配置网络参数,用于同步:
[root@aix203 /]#cat /usr/es/sbin/cluster/etc/rhosts
192.168.8.203
192.168.8.204
192.168.8.251
192.168.8.252
10.10.10.203
10.10.10.204
[root@aix203 /]#cat /usr/sbin/cluster/netmon.cf
192.168.8.203
192.168.8.204
192.168.8.251
192.168.8.252
10.10.10.203
10.10.10.204
配置hacmp同步:
配置hacmp资源组:
添加并发卷组到资源组:
再次同步hacmp配置!
启动hacmp服务:
查看hacmp服务:
[root@aix203 soft1]#lssrc -a |grep cl
clcomd caa 5046426 active
clcomdES clcomdES 5767410 active
clstrmgrES cluster 3801194 active
gsclvmd 6488150 active
clconfd caa inoperative
nimsh nimclient inoperative
三、查看卷组并发状态
[root@aix203 soft1]#lspv
hdisk0 000681aa6c0502a7 rootvg active
hdisk1 0008570c15134e9d rac10_vg concurrent
[root@aix203 soft1]#lsvg -l rac10_vg
rac10_vg: LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT rac_ocr raw 1 1 1 closed/syncd N/A rac_vote raw 1 1 1 closed/syncd N/A system raw 10 10 1 closed/syncd N/A sysaux raw 5 5 1 closed/syncd N/A users raw 5 5 1 closed/syncd N/A undotbs1 raw 5 5 1 closed/syncd N/A undotbs2 raw 5 5 1 closed/syncd N/A temp raw 5 5 1 closed/syncd N/A control1_1 raw 1 1 1 closed/syncd N/A control2_2 raw 1 1 1 closed/syncd N/A control3_3 raw 1 1 1 closed/syncd N/A spfile raw 1 1 1 closed/syncd N/A redo1_1 raw 1 1 1 closed/syncd N/A redo1_2 raw 1 1 1 closed/syncd N/A redo2_1 raw 1 1 1 closed/syncd N/A redo2_2 raw 1 1 1 closed/syncd N/A example raw 5 5 1 closed/syncd N/A index raw 5 5 1 closed/syncd N/A
[root@aix204 /]#lspv
hdisk0 0003504af4d8495b rootvg active
hdisk1 0008570c15134e9d rac10_vg concurrent
------- 卷组处于并发状态后,hacmp配置成功 !
修改逻辑卷属性:
[root@aix204 /]#cat chlv.sh
chown oracle:dba /dev/rac_ocr chown oracle:dba /dev/rac_vote chown oracle:dba /dev/system chown oracle:dba /dev/sysaux chown oracle:dba /dev/users chown oracle:dba /dev/undotbs1 chown oracle:dba /dev/undotbs2 chown oracle:dba /dev/temp chown oracle:dba /dev/control1_1 chown oracle:dba /dev/control2_2 chown oracle:dba /dev/control3_3 chown oracle:dba /dev/spfile chown oracle:dba /dev/redo1_1 chown oracle:dba /dev/redo1_2 chown oracle:dba /dev/redo2_1 chown oracle:dba /dev/redo2_2 chown oracle:dba /dev/example chown oracle:dba /dev/index chown oracle:dba /dev/rrac_ocr chown oracle:dba /dev/rrac_vote chown oracle:dba /dev/rsystem chown oracle:dba /dev/rsysaux chown oracle:dba /dev/rusers chown oracle:dba /dev/rundotbs1 chown oracle:dba /dev/rundotbs2 chown oracle:dba /dev/rtemp chown oracle:dba /dev/rcontrol1_1 chown oracle:dba /dev/rcontrol2_2 chown oracle:dba /dev/rcontrol3_3 chown oracle:dba /dev/rspfile chown oracle:dba /dev/rredo1_1 chown oracle:dba /dev/rredo1_2 chown oracle:dba /dev/rredo2_1 chown oracle:dba /dev/rredo2_2 chown oracle:dba /dev/rexample chown oracle:dba /dev/rindex chmod 660 /dev/rac_ocr chmod 660 /dev/rac_vote chmod 660 /dev/system chmod 660 /dev/sysaux chmod 660 /dev/users chmod 660 /dev/undotbs1 chmod 660 /dev/undotbs2 chmod 660 /dev/temp chmod 660 /dev/control1_1 chmod 660 /dev/control2_2 chmod 660 /dev/control3_3 chmod 660 /dev/spfile chmod 660 /dev/redo1_1 chmod 660 /dev/redo1_2 chmod 660 /dev/redo2_1 chmod 660 /dev/redo2_2 chmod 660 /dev/example chmod 660 /dev/index chmod 660 /dev/rrac_ocr chmod 660 /dev/rrac_vote chmod 660 /dev/rsystem chmod 660 /dev/rsysaux chmod 660 /dev/rusers chmod 660 /dev/rundotbs1 chmod 660 /dev/rundotbs2 chmod 660 /dev/rtemp chmod 660 /dev/rcontrol1_1 chmod 660 /dev/rcontrol2_2 chmod 660 /dev/rcontrol3_3 chmod 660 /dev/rspfile chmod 660 /dev/rredo1_1 chmod 660 /dev/rredo1_2 chmod 660 /dev/rredo2_1 chmod 660 /dev/rredo2_2 chmod 660 /dev/rexample chmod 660 /dev/rindex
[root@aix204 /]#sh chlv.sh
[root@aix204 /]#ls -l /dev |grep ocr
brw-rw---- 1 oracle dba 88, 1 Mar 15 16:01 rac_ocr
crw-rw---- 1 oracle dba 88, 1 Mar 15 16:08 rrac_ocr
[root@aix204 /]#ls -l /dev |grep vote
brw-rw---- 1 oracle dba 88, 2 Mar 15 16:01 rac_vote
crw-rw---- 1 oracle dba 88, 2 Mar 15 16:08 rrac_vote
[root@aix204 /]#