第一次在AIX上安装Oracle,还是做RAC,偏偏操作系统还是比较新的AIX6.1还有HACMP 5.4真是痛苦呀,经历了N长的时间,寻求了不少帮助,终于成型了,呵呵……
[@more@]AIX6.1+HAcmp5.4+ORACLE10G RAC 安装参考手册一、系统软硬件组成及安装环境规划
硬件环境:IBM P6 570两台
HP磁盘阵列2TB
交换机;
软件环境:AIX6.1+HAcmp5.4
Oracle Database 10g for AIX5L(64-BIT)
二、系统规划
三、安装准备
1、调整AIX文件系统
使用smit fs 两台机器调整成相同调整后的文件系统情况如下:
$ hostname
node1
$ df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 20.00 19.84 1% 10156 1% /
/dev/hd2 10.00 8.19 19% 40056 3% /usr
/dev/hd9var 10.00 9.88 2% 988 1% /var
/dev/hd3 4.00 3.75 7% 368 1% /tmp
/dev/hd1 25.00 8.48 67% 36487 2% /home
/dev/hd11admin 0.25 0.25 1% 5 1% /admin
/proc - - - - - /proc
/dev/hd10opt 30.00 29.87 1% 4645 1% /opt
# hostname
node2
# df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 20.00 19.85 1% 10211 1% /
/dev/hd2 10.00 7.88 22% 42813 3% /usr
项目
说明
备注
操作系统
AIX6.1
AIX6.1
主机名
node1
node2
内存
16GB
16GB
本地磁盘
146GB *2
146GB*2
存储(HP)
2TB
2TB
双光纤通道
专用IP
124.17.100.102
124.17.100.103
虚拟IP
192.168.1.1
192.168.1.2
公共IP
124.17.100.104
124.17.100.105
Oracle RAC SID
keyan1
keyan2
数据库名称
keyan
SERVERICE_NAME
keyandb
/dev/hd9var 10.00 9.87 2% 921 1% /var
/dev/hd3 4.00 3.56 11% 1246 1% /tmp
/dev/fwdump 1.00 1.00 1% 4 1% /var/adm/ras/platform
/dev/hd1 25.00 10.23 60% 32743 2% /home
/dev/hd11admin 0.25 0.25 1% 5 1% /admin
/proc - - - - - /proc
/dev/hd10opt 30.00 29.81 1% 5566 1% /opt
2、检查系统内存(两个节点相同)
# lsattr -E -l sys0 -a realmem
realmem 15466496 Amount of usable physical memory in Kbytes False
3、检查CPU(两个节点相同)
# lsdev -C | grep proc
proc0 Available 00-00 Processor
proc2 Available 00-02 Processor
proc4 Available 00-04 Processor
proc6 Available 00-06 Processor
4、配置HACMP集群
$ hostname
node1
$ ifconfig -a
en8:flags=1e080863,c0
inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255
en9:flags=5e080863,c0
inet 124.17.100.102 netmask 0xffffff00 broadcast 124.17.100.255
inet 124.17.100.104 netmask 0xffffff00 broadcast 124.17.100.255
tcp_sendspace 131072 tcp_recvspace 65536 rfc1323 0
lo0: flags=e08084b
inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
inet6 ::1/0
tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1
$ netstat -in
Name Mtu Network Address ZoneID Ipkts Ierrs Opkts Oerrs Coll
en8 1500 link#2 0.21.5e.2.65.91 803100 0 620942 0 0
en8 1500 192.168.1 192.168.1.1 803100 0 620942 0 0
en9 1500 link#3 0.14.5e.74.bc.b0 272543 0 185511 4 0
en9 1500 124.17.100 124.17.100.102 272543 0 185511 4 0
en9 1500 124.17.100 124.17.100.104 272543 0 185511 4 0
lo0 16896 link#1 868306 0 868485 0 0
lo0 16896 127 127.0.0.1 868306 0 868485 0 0
lo0 16896 ::1 1 868306 0 868485 0 0
$
# hostname
node2
# ifconfig -a
en8:flags=1e080863,c0
inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255
en9:flags=5e080863,c0
inet 124.17.100.103 netmask 0xffffff00 broadcast 124.17.100.255
inet 124.17.100.105 netmask 0xffffff00 broadcast 124.17.100.255
tcp_sendspace 131072 tcp_recvspace 65536 rfc1323 0
lo0: flags=e08084b
inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
inet6 ::1/0
tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1
# netstat -in
Name Mtu Network Address ZoneID Ipkts Ierrs Opkts Oerrs Coll
en8 1500 link#2 0.21.5e.2.40.31 714111 0 679573 0 0
en8 1500 192.168.1 192.168.1.2 714111 0 679573 0 0
en9 1500 link#3 0.14.5e.74.fc.e4 259675 0 187897 4 0
en9 1500 124.17.100 124.17.100.103 259675 0 187897 4 0
en9 1500 124.17.100 124.17.100.105 259675 0 187897 4 0
lo0 16896 link#1 865854 0 866047 0 0
lo0 16896 127 127.0.0.1 865854 0 866047 0 0
lo0 16896 ::1 1 865854 0 866047 0 0
#
(1)、创建cluster
smit hacmp
回车,完成创建cluster。
(2)、添加节点
# smitty hacmp
Initialization and Standard Configuration
Add Nodes to an HACMP Cluster
Configure Nodes to an HACMP Cluster (standard)
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
* Cluster Name [ibm_cls]
New Nodes (via selected communication paths) [node1 node2] +
Currently Configured Node(s)
(3)、添加资源组
# smitty hacmp
Initialization and Standard Configuration
Configure HACMP Resource Groups
Add a Resource Group
Add a Resource Group
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
* Resource Group Name [racdbrg]
* Participating Nodes (Default Node Priority) [node1 node2] +
Startup Policy Online On All Available Nodes +
Fallover Policy Bring Offline (On Error Node Only) +
Fallback Policy Never Fallback
(4)、配置串口通信
# smitty hacmp
Extended Configuration
Extended Topology Configuration
Configure HACMP Communication Interfaces/Devices
Add Communication Interfaces/Devices
Select a category
Move cursor to desired item and press Enter.
> Add Discovered Communication Interface and Devices
Add Pre-defined Communication Interfaces and Devices
Select a category
Move cursor to desired item and press Enter.
Discovery last performed: (Dec 08 20:10)
Communication Interfaces
> Communication Devices
Select Point-to-Point Pair of Discovered Communication Devices to Add
Move cursor to desired item and press F7. Use arrow keys to scroll.
ONE OR MORE items can be selected.
Press Enter AFTER making all selections.
Node Device Device Path Pvid
node1 hdisk2 /dev/hdisk2 0002ee503cc
node2 hdisk2 /dev/hdisk2 0002ee503cc
> node1 tty0 /dev/tty0
> node2 tty0 /dev/tty0
5、修改/etc/hosts文件(两节点分别完成),添加以下内容:
192.168.2.1 node1_boot2
192.168.2.2 node2_boot2
192.168.1.1 node1_boot1
192.168.1.2 node2_boot1
124.17.100.102 node1 node1_pre
124.17.100.103 node2 node2_pre
124.17.100.104 node1_vip
124.17.100.105 node2_vip
6、修改/etc/rc.net,添加如下的内容(双节点)
#for oracle rac
if [ -f /usr/sbin/no ] ; then
/usr/sbin/no -o extendednetstats=0 >>/dev/null 2>&1
/usr/sbin/no -p -o udp_sendspace=65536
/usr/sbin/no -p -o udp_recvspace=262144
/usr/sbin/no -p -o tcp_sendspace=262144
/usr/sbin/no -p -o tcp_recvspace=262144
/usr/sbin/no -p -o rfc1323=1
/usr/sbin/no -p -o sb_max=1310720
/usr/sbin/no -r -o ipqmaxlen=512
fi
#for oracle rac end
7、在双节点上分别建立Oracle用户,dba、oinstall、hagsuser组,并保持组ID和用户ID相同。
使用smitty group和smitty user添加组和用户添加后的情况如下:
# hostname
node1
# id oracle
uid=301(oracle) gid=220(oinstall) groups=221(dba),222(hagsuser)
# hostname
node2
# id oracle
uid=301(oracle) gid=220(oinstall) groups=221(dba),222(hagsuser)
8、配置磁盘阵列,创建共享卷
# smitty mkvg
Add a Big Volume Group
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
VOLUME GROUP name [datavg] +
Physical partition SIZE in megabytes 128
* PHYSICAL VOLUME names [hdisk4,hdisk5] +
Force the creation of a volume group yes +
Activate volume group AUTOMATICALLY no +
at system restart?
Volume Group MAJOR NUMBER [60]
Create VG Concurrent Capable? enhanced concurrent +
激活卷组
# varyonvg -c datavg
建立LV
mklv -y'rac_crs' -w'n' -s'n' -r'n' datavg 2
mklv -y'rac_voting' -w'n' -s'n' -r'n' datavg 2
mklv -y'rac_data01' -w'n' -s'n' -r'n' datavg 128
修改权限
#chown oracle:dba /dev/rrac_*
在另外一个节点上导入并行卷组#importvg -y data_vg hdisk4
为根分区做镜像
1)、将rootvg扩展到hdisk1上(默认是hdisk0)
chdev -l hdisk1 -a pv=yes
extendvg rootvg hdisk1
2)、镜像
mirrorvg -S -c 2 rootvg hdisk1
3)、重新生成boot image
bosboot -ad /dev/hdisk0
bosboot -ad /dev/hdisk1
4)、更新bootlist
bootlist -m normal hdisk0 hdisk1 cd0
查看更改结果
bootlist -o -m normal
5)、重启系统
shutdown -Fr
9、确保每个节点上的hacmp集群已经正常启动,如果没有启动使用smitty clsstart启动集群
10、设置环境变量(两个节点分别配置)
节点1
su – oracle
vi .profile添加以下内容:
export ORACLE_HOME=/home/oracle/product/10.2.0/db
export ORACLE_BASE=/home/oracle
export ORACLE_SID=keyan1
unset USERNAME
umask 022
export PATH=$HOME/bin:$ORACLE_HOME/bin:$PATH
节点2
su – oracle
vi .profile添加以下内容:
export ORACLE_HOME=/home/oracle/product/10.2.0/db
export ORACLE_BASE=/home/oracle
export ORACLE_SID=keyan2
unset USERNAME
umask 022
export PATH=$HOME/bin:$ORACLE_HOME/bin:$PATH
四、安装Oracle CRS
先打补丁p6718715_10203_AIX64-5L.zip,然后以root用户执行补丁6718715里面的rootpre.sh文件;
再用oracle用户执行CRS安装程序
./runInstaller
界面如下:
点击Next
点击Next
选择CRS安装的目录/home/oracle/product/10.2.0/crs,点击Next
oracle进行系统参数检查无问题,点击Next
添加Cluster中两个节点及相关的公网、私网、VIP网络名称,点击Next
选择ocr文件的位置为/dev/rac_crs,点击Next
选择voting disk的位置为/dev/rac_crs,点击Next
执行安装至完成。
完成后安装提示用root用户分别在每个节点执行root.sh.
CRS配置完成。
五、安装oracle数据库软件
先以root用户执行安装盘中rootpre目录中的rootpre.sh脚本;
然后用oracle用户执行数据库安装软件
./runInstaller
界面如下:
点击Next
选择Enterprise Edition,,点击Next
选择数据库安装目录为/home/oracle/product/10.2.0/db,点击Next
点击“Select All”选择所有节点,点击Next
Oracle软件进行系统参数检查,检查通过后点击Next
选择Install Database Software only ,点击Next
点击Next完成安装。安装完成后按照提示分别在每个节点用root用户执行root.sh脚本。
至此数据库软件安装完成
六、netca进行网络配置
用oracle用户执行netca命令,如图所示:
选择Cluster Configuration,点击Next
点击“Select all nodes”选择所有节点,点击“Next”
选择Listener configuration,点击Next
选择Add,点击Next
配置监听器的名称,点击Next
选择TCP协议支持,点击Next
使用1521端口作为监听端口,点击Next
不进行其他配置,点击Next
完成监听器配置
七、配置ASM
使用dbca新建ASM存储卷,用oracle用户执行dbca命令,如图所示:
选择Oracle Real Application Clusters database,点击Next
选择Configure Austomatic Storage Management,点击Next
点击“select all”选择所有节点,点击“next”
给出ASM SYS的密码为keyan,选择使用Pfile作为ASM的参数文件,点击Next
点击OK
ASM 实例开始启动
出现ASM磁盘组的界面,点击Create New
出现选择磁盘新建磁盘组界面,点击Change Disk Discovery Path按钮
输入Discovery Path为/dev/rrac_data*,点击OK
选择/dev/rrac_data01磁盘,选择Redundancy为Extenal,给出Disk Group Name为DATAVG,点击OK
完成新建ASM工作
八、DBCA建立数据库
使用oracle用户,执行dbca,出现如下界面:
选择Oracle Real Application Clusters database,点击Next
选择Create Database,点击Next
点击“select all”选择所有节点,点击“next”
选择General purpose,点击Next
输入Global Database Name和SID prefix为keyan,点击Next
去掉Configure the Database with Enterprose Manager,点击Next
输入SYS和SYSTEM的密码,点击Next
储存选择Automatic Storage Management (ASM) ,点击Next
选择第四步建立的DATAVG作为存储,点击Next
点击Next
点击Next
点击Next
出现Service配置界面,点击Add添加Service
Enter Service name 处填写keyandb,点击OK
TAF Policy 选择Basic,keyan1和keyan2都使用Perferred,点击Next
内存配置使用系统内存的65%,点击Sizing Tab页
更改Processes 为1024,选择Character Sets Tab页
选择Choose from the list of character sets中的ZHS16GBK,
Defatult Language为Simplified Chinese,Default Date Format为China,点击Next
点击Next
点击Finish建立数据库。
九、升级Oracle10g RAC(10.2.0.10升级到10.2.0.4.0)
1、下载Oracle10.2.0.4.0 for AIX 64-bit升级包 p6810189_10204_AIX5L.zip并解压
2、关闭数据库:分别在每个节点执行
sqlplus /nolog
conn sys/sys密码 as sysdba
shutdown
3、停止所有RAC上所有服务
1)、chmod -R +w /home/oracle/product/10.2.0/crs/inventory/Templates/*
2)、isqlplusctl stop
3)、emctl stop dbconsole
4)、lsnrctl stop
5)、srvctl stop service –d keyan
6)、srvctl stop instance –d keyan –I keyan1
srvctl stop instance –d keyan –I keyan2
7)、srvctl stop asm –n node1
srvctl stop asm –n node2
8)、srvctl stop nodeapps –n node1
srvctl stop nodeapps –n node2
9)、以root用户执行(每个节点分别执行)
/home/oracle/product/10.2.0/crs/bin/crsctl stop crs
ps –ef|grep ons 将找到的进程使用kill -9 pid杀死
/home/oracle/product/10.2.0/crs/install/root102.sh
10)、对系统进行冷备份
11)、安装升级补丁
安装结束后需要分别在每个节点用root用户执行root.sh
12)、SQL> STARTUP UPGRADE
SQL> SPOOL upgrade_info.log
SQL> @?/rdbms/admin/utlu102i.sql
SQL> SPOOL OFF
完成后检查upgrade_info.log
13) 、SQL> STARTUP NOMOUNT
SQL> ALTER SYSTEM SET CLUSTER_DATABASE=FALSE SCOPE=spfile;
SQL> SHUTDOWN
14)、SQL> STARTUP UPGRADE
SQL> SPOOL patch.log
SQL> @?/rdbms/admin/catupgrd.sql
SQL> SPOOL OFF
15)、重新启动数据库
SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP
16)、SQL> @?/rdbms/admin/utlrp.sql
17)、SQL> ALTER SYSTEM SET CLUSTER_DATABASE=TRUE SCOPE=spfile;
18)、重新启动数据库;启动所有的数据库服务。
十、验证RAC 集群和数据库配置
所有实例和服务的状态
$ srvctl status database -d keyan
Instance keyan1 is running on node node1
Instance keyan2 is running on node node2
单个实例的状态
$ srvctl status instance -d keyan -i keyan1
Instance keyan1 is running on node node1
$ srvctl status instance -d keyan -i keyan2
Instance keyan2 is running on node node2
在数据库全局命名服务的状态
$ srvctl status service -d keyan
Service keyandb is running on instance(s) keyan2, keyan1
特定节点上节点应用程序的状态
$ srvctl status nodeapps -n node1
VIP is running on node: node1
GSD is running on node: node1
Listener is running on node: node1
ONS daemon is running on node: node1
$ srvctl status nodeapps -n node2
VIP is running on node: node2
GSD is running on node: node2
Listener is running on node: node2
ONS daemon is running on node: node2
ASM 实例的状态
$ srvctl status asm -n node1
ASM instance +ASM1 is running on node node1.
$ srvctl status asm -n node2
ASM instance +ASM2 is running on node node2.
列出配置的所有数据库
$ srvctl config database
Keyan
显示RAC 数据库的配置
$ srvctl config database -d keyan
node1 keyan1 /home/oracle/product/10.2.0/db
node2 keyan2 /home/oracle/product/10.2.0/db
显示指定集群数据库
$ srvctl config service -d keyan
keyandb PREF: keyan2 keyan1 AVAIL:
显示节点应用程序的配置-(VIP、GSD、ONS、监听器)
$ srvctl config nodeapps -n node1 -a -g -s -l
VIP exists.: /node1_vip/124.17.100.104/255.255.255.0/en9
GSD exists.
ONS daemon exists.
Listener exists.
$ srvctl config nodeapps -n node2 -a -g -s -l
VIP exists.: /node2_vip/124.17.100.105/255.255.255.0/en9
GSD exists.
ONS daemon exists.
Listener exists.
显示ASM 实例的配置
$ srvctl config asm -n node1
+ASM1 /home/oracle/product/10.2.0/db
$ srvctl config asm -n node2
+ASM2 /home/oracle/product/10.2.0/db
集群中所有正在运行的实例
SQL>SELECT inst_id, instance_number inst_no, instance_name inst_name , parallel , status
, database_status db_status, active_state state, host_name host
FROM gv$instance
ORDER BY inst_id;
INST_ID INST_NO INST_NAME PAR STATUS DB_STATUS STATE HOST
---------- ---------- ---------------- --- ------------ ----------------- --------- ----------------------------------------------------------------
1 1 keyan1 YES OPEN ACTIVE NORMAL node1
2 2 keyan2 YES OPEN ACTIVE NORMAL node2
位于磁盘组中的所有数据文件
SQL> select name from v$datafile
union
select member from v$logfile
union
select name from v$controlfile
union
select name from v$tempfile;
NAME
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+DATAVG/keyan/controlfile/current.260.682350775
+DATAVG/keyan/datafile/sysaux.257.682350719
+DATAVG/keyan/datafile/system.256.682350719
+DATAVG/keyan/datafile/undotbs1.258.682350719
+DATAVG/keyan/datafile/undotbs2.264.682350799
+DATAVG/keyan/datafile/users.259.682350719
+DATAVG/keyan/onlinelog/group_1.261.682350777
+DATAVG/keyan/onlinelog/group_2.262.682350777
+DATAVG/keyan/onlinelog/group_3.265.682350821
+DATAVG/keyan/onlinelog/group_4.266.682350821
+DATAVG/keyan/tempfile/temp.263.682350779
11 rows selected.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/570433/viewspace-1021965/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/570433/viewspace-1021965/