【安装】AIX安装单实例11gR2 GRID+DB
1.1 BLOG文档结构图
1.2 前言部分
1.2.1 导读和注意事项
各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~:
① 基于aix安装11gR2的grid和db软件(重点)
② 静默安装
Tips:
① 若文章代码格式有错乱,推荐使用QQ、搜狗或360浏览器,也可以下载pdf格式的文档来查看,pdf文档下载地址:http://yunpan.cn/cdEQedhCs2kFz (提取码:ed9b)
② 本篇BLOG中命令的输出部分需要特别关注的地方我都用灰色背景和粉红色字体来表示,比如下边的例子中,thread 1的最大归档日志号为33,thread 2的最大归档日志号为43是需要特别关注的地方;而命令一般使用黄色背景和红色字体标注;对代码或代码输出部分的注释一般采用蓝色字体表示。
List of Archived Logs in backup set 11
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ------------------- ---------- ---------
1 32 1621589 2015-05-29 11:09:52 1625242 2015-05-29 11:15:48
1 33 1625242 2015-05-29 11:15:48 1625293 2015-05-29 11:15:58
2 42 1613951 2015-05-29 10:41:18 1625245 2015-05-29 11:15:49
2 43 1625245 2015-05-29 11:15:49 1625253 2015-05-29 11:15:53
[ZFXXDB1:root]:/>lsvg -o
T_XDESK_APP1_vg
rootvg
[ZFXXDB1:root]:/>
00:27:22 SQL> alter tablespace idxtbs read write;
====》2097152*512/1024/1024/1024=1G
本文如有错误或不完善的地方请大家多多指正,ITPUB留言或QQ皆可,您的批评指正是我写作的最大动力。
1.2.2 相关参考文章链接
如何创建ASM磁盘 http://blog.itpub.net/26736162/viewspace-1401193/
Oracle?ASM+11gR2安装 http://blog.itpub.net/26736162/viewspace-1205206/
【DBCA -SILENT】静默安装之rac数据库安装 http://blog.itpub.net/26736162/viewspace-1586352/
ASM数据文件和FILESYSTEM文件转移方法集锦 http://blog.itpub.net/26736162/viewspace-1400516/
1.2.3 本文简介
本文亮点是全篇基于命令行来安装。
---------------------------------------------------------------------------------------------------------------------
第二章 AIX安装单实例11gR2 GRID+DB
2.1 安装环境收集
项目 |
primary db |
db 类型 |
单实例 |
db version |
11.2.0.3.0 |
db 存储 |
ASM |
主机IP地址/hosts配置 |
22.188.187.158 ZFFR4CB1101 |
OS版本及kernel版本 |
AIX 64位 7.1.0.0 |
2.2 系统硬件检测
内存的基本要求
至少1GB的物理内存
Oracle官方推荐内存2GB或者更多
这里我们如果是实验环境满足基本条件即可。实际生产环境要充分的评估业务使用情况和系统的架构来制定内存的分配和预留。
在AIX系统命令行中输入
# getconf REAL_MEMORY
11927552
我们内存是12G,非常充裕,这个和实际生产系统使用的内存也差不多
l 下表列出内存与交换空间大小的对应关系
可用内存RAM |
交换空间需求 |
1GB到2GB之间 |
内存大小的1.5倍 |
2GB到16GB之间 |
等于内存的大小 |
超过16GB |
以16GB为准 |
查看要安装的AIX6.1系统的交换空间的尺寸,通过以下命令
# lsps -a
Page Space Physical Volume Volume Group Size %Used Active Auto Type Chksum
hd6 hdisk0 rootvg 11264MB 1 yes yes lv 0
输出的结果是我们物理内存12个G,这里系统还占用一小部分,如果不是的话,
chps –s number hd6 增加交换空间,例如 chps –s 28 hd6 28*pp size算出number数即可。
1.2 磁盘空间要求
l 至少1GB的/TMP 目录空间
我们继续满足条件,这个空间其实可以给大了,我们还要利用它存放oracle 11g安装包,这里我们给20个G.继续下一个环节
1.3 运行级别要求
l 确保系统运行在2级别模式
# cat /etc/.init.state
2.检查软件需求
2.1 操作系统要求
l AIX 5L V5.3 TL 09 SP1 ("5300-09-01"), 64 bit kernel
l AIX 6.1 TL 02 SP 1 ("6100-02-01), 64-bit kernel
l AIX 7.1 TL 0 SP 1 ("7100-00-01"), 64-bit kernel
我们满足上面罗列出的基本条件即可,或者更高的修订版本,但是不能比上面所列出的低。我们安装的是AIX 6.1的系统,确认操作系统版本,命令如下
# oslevel –s
6100-07-00-0000
满足安装条件,我们继续下一步
2.2 安装oracle 11G 所需要的操作系统环境包
我们要确保以下的操作系统环境包已安装
bos.adt.base
bos.adt.lib
bos.adt.libm
bos.perf.libperfstat 6.1.2.1 or later
bos.perf.perfstat
bos.perf.proctools
xlC.aix61.rte.10.1.0.0 or later
xlC.rte.10.1.0.0 or later
gpfs.base 3.2.1.8 or later
命令行查询是否安装
# lslpp -l bos.adt.base bos.adt.lib bos.adt.libm bos.perf.perfstat bos.perf.libperfstat bos.perf.proctools
一般情况只要将AIX升级到最新的TL,这一步应该没有问题
查看物理内存大小
#/usr/sbin/lsattr -E -l sys0 -a realmem
realmem 2031616 Amount of usable physical memory in Kbytes False
查看swap space,交换空间通常情况下是物理内存的2倍,通常采用如下公式计算交换空间的大小512M + (物理内存大小(单位M) - 256M) * 1.25
#lsps -a
Page Space Physical Volume Volume Group Size %Used Active Auto Type
hd6 hdisk0 rootvg 512MB 1 yes yes lv
查看系统结构,AIX下安装ORACLE需要是64位的系统
# getconf HARDWARE_BITMODE
64
或者
# bootinfo -K
64
检查OS版本,11GR2需要5300-09以上的版本
# oslevel -s
5300-10-00-0000
检查如下包是否已经安装,没有的话需要smit install进行安装
lslpp -l bos.adt.base
lslpp -l bos.adt.lib
lslpp -l bos.adt.libm
lslpp -l bos.perf.perfstat
lslpp -l bos.perf.libperfstat
lslpp -l bos.perf.proctools
lslpp -l rsct.basic.rte (这个包官方文档没有提及,不安装的情况下检查通不过)
[ZFFR4CB2101:root]/]> getconf REAL_MEMORY
4194304
[ZFFR4CB2101:root]/]> /usr/sbin/lsattr -E -l sys0 -a realmem
realmem 4194304 Amount of usable physical memory in Kbytes False
[ZFFR4CB2101:root]/]> lsps -a
Page Space Physical Volume Volume Group Size %Used Active Auto Type Chksum
hd6 hdisk0 rootvg 8192MB 0 yes yes lv 0
[ZFFR4CB2101:root]/]> getconf HARDWARE_BITMODE
64
[ZFFR4CB2101:root]/]> bootinfo -K
64
[ZFFR4CB2101:root]/]>
[ZFFR4CB2101:root]/]> df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 4.25 4.00 6% 12709 2% /
/dev/hd2 10.00 4.57 55% 118820 11% /usr
/dev/hd9var 4.50 4.24 6% 1178 1% /var
/dev/hd3 4.25 4.23 1% 172 1% /tmp
/dev/hd1 1.00 1.00 1% 77 1% /home
/dev/hd11admin 0.25 0.25 1% 7 1% /admin
/proc - - - - - /proc
/dev/hd10opt 4.50 4.37 3% 2567 1% /opt
/dev/livedump 1.00 1.00 1% 6 1% /var/adm/ras/livedump
/dev/Plv_install 1.00 1.00 1% 4 1% /install
/dev/Plv_mtool 1.00 1.00 1% 4 1% /mtool
/dev/Plv_audit 2.00 1.99 1% 5 1% /audit
/dev/Plv_ftplog 1.00 1.00 1% 5 1% /ftplog
/dev/Tlv_bocnet 50.00 49.99 1% 4 1% /bocnet
/dev/Tlv_WebSphere 10.00 5.71 43% 45590 4% /WebSphere
/dev/TLV_TEST_DATA 100.00 99.98 1% 7 1% /lhr
/dev/tlv_softtmp 30.00 20.30 33% 5639 1% /softtmp
ZTDNETAP3:/nfs 1240.00 14.39 99% 513017 14% /nfs
/dev/tlv_u01 50.00 32.90 35% 51714 1% /u01
[ZFFR4CB2101:root]/]> cat /etc/.init.state
2
[ZFFR4CB2101:root]/]> oslevel -s
7100-03-03-1415
[ZFFR4CB2101:root]/]> lslpp -l bos.adt.base bos.adt.lib bos.adt.libm bos.perf.perfstat bos.perf.libperfstat bos.perf.proctools
Fileset Level State Description
----------------------------------------------------------------------------
Path: /usr/lib/objrepos
bos.adt.base 7.1.3.15 COMMITTED Base Application Development
Toolkit
bos.adt.lib 7.1.2.15 COMMITTED Base Application Development
Libraries
bos.adt.libm 7.1.3.0 COMMITTED Base Application Development
Math Library
bos.perf.libperfstat 7.1.3.15 COMMITTED Performance Statistics Library
Interface
bos.perf.perfstat 7.1.3.15 COMMITTED Performance Statistics
Interface
Path: /etc/objrepos
bos.adt.base 7.1.3.15 COMMITTED Base Application Development
Toolkit
bos.perf.libperfstat 7.1.3.15 COMMITTED Performance Statistics Library
Interface
bos.perf.perfstat 7.1.3.15 COMMITTED Performance Statistics
Interface
lslpp: 0504-132 Fileset bos.perf.proctools not installed.
2.3 创建文件系统
/usr/lpp/EMC/Symmetrix/bin/inq.aix64_51 -showvol -sid
lspv
mkvg -S -y t_u01_vg -s 128 hdisk22
mklv -t jfs2 -y tlv_u01 -x 1024 t_u01_vg 400
crfs -v jfs2 -d tlv_u01 -m /u01 -A yes
mount /u01
mklv -t jfs2 -y tlv_softtmp -x 1024 t_u01_vg 240
crfs -v jfs2 -d tlv_softtmp -m /softtmp -A yes
mount /softtmp
[ZFFR4CB2101:root]/]> /usr/lpp/EMC/Symmetrix/bin/inq.aix64_51 -showvol -sid
Inquiry utility, Version V7.3-1214 (Rev 0.1) (SIL Version V7.3.0.1 (Edit Level 1214)
Copyright (C) by EMC Corporation, all rights reserved.
For help type inq -h.
.........................
------------------------------------------------------------------------------------------------
DEVICE :VEND :PROD :REV :SER NUM :Volume :CAP(kb) :SYMM ID
------------------------------------------------------------------------------------------------
/dev/rhdisk0 :AIX :VDASD :0001 :hdisk5 : 00000: 134246400 :N/A
/dev/rhdisk1 :EMC :SYMMETRIX :5876 :640250a000 : 0250A: 2880 :000492600664
/dev/rhdisk2 :EMC :SYMMETRIX :5876 :640250b000 : 0250B: 2880 :000492600664
/dev/rhdisk3 :EMC :SYMMETRIX :5876 :640250c000 : 0250C: 2880 :000492600664
/dev/rhdisk4 :EMC :SYMMETRIX :5876 :640250d000 : 0250D: 2880 :000492600664
/dev/rhdisk5 :EMC :SYMMETRIX :5876 :64026f6000 : 026F6: 134246400 :000492600664
/dev/rhdisk6 :EMC :SYMMETRIX :5876 :64026fe000 : 026FE: 134246400 :000492600664
/dev/rhdisk7 :EMC :SYMMETRIX :5876 :6402706000 : 02706: 134246400 :000492600664
/dev/rhdisk8 :EMC :SYMMETRIX :5876 :640270e000 : 0270E: 134246400 :000492600664
/dev/rhdisk9 :EMC :SYMMETRIX :5876 :6402716000 : 02716: 134246400 :000492600664
/dev/rhdisk10 :EMC :SYMMETRIX :5876 :640271e000 : 0271E: 134246400 :000492600664
/dev/rhdisk11 :EMC :SYMMETRIX :5876 :6402726000 : 02726: 134246400 :000492600664
/dev/rhdisk12 :EMC :SYMMETRIX :5876 :640272e000 : 0272E: 134246400 :000492600664
/dev/rhdisk13 :EMC :SYMMETRIX :5876 :6402736000 : 02736: 134246400 :000492600664
/dev/rhdisk14 :EMC :SYMMETRIX :5876 :640273e000 : 0273E: 134246400 :000492600664
/dev/rhdisk15 :EMC :SYMMETRIX :5876 :6402746000 : 02746: 134246400 :000492600664
/dev/rhdisk16 :EMC :SYMMETRIX :5876 :640274e000 : 0274E: 134246400 :000492600664
/dev/rhdisk17 :EMC :SYMMETRIX :5876 :6402756000 : 02756: 134246400 :000492600664
/dev/rhdisk18 :EMC :SYMMETRIX :5876 :640275e000 : 0275E: 134246400 :000492600664
/dev/rhdisk19 :EMC :SYMMETRIX :5876 :6402766000 : 02766: 134246400 :000492600664
/dev/rhdisk20 :EMC :SYMMETRIX :5876 :640276e000 : 0276E: 134246400 :000492600664
/dev/rhdisk21 :EMC :SYMMETRIX :5876 :6402776000 : 02776: 134246400 :000492600664
/dev/rhdisk22 :EMC :SYMMETRIX :5876 :640277e000 : 0277E: 134246400 :000492600664
/dev/rhdisk23 :EMC :SYMMETRIX :5876 :6402786000 : 02786: 134246400 :000492600664
/dev/rhdisk24 :EMC :SYMMETRIX :5876 :640278e000 : 0278E: 134246400 :000492600664
[ZFFR4CB2101:root]/]> lspv
hdisk0 00c49fc434da2434 rootvg active
hdisk1 00c49fc461fc76b2 None
hdisk2 00c49fc461fc76f5 None
hdisk3 00c49fc461fc7739 None
hdisk4 00c49fc461fc777a None
hdisk5 00c49fc461fc77bd None
hdisk6 00c49fc461fc77fe None
hdisk7 00c49fc461fc783f None
hdisk8 00c49fc461fc7880 None
hdisk9 00c49fc461fc78c5 None
hdisk10 00c49fc461fc7908 None
hdisk11 00c49fc461fc7958 None
hdisk12 00c49fc461fc79a0 None
hdisk13 00c49fc461fc79ea None
hdisk14 00c49fc461fc7a2f None
hdisk15 00c49fc461fc7a71 None
hdisk16 00c49fc461fc7ab1 None
hdisk17 00c49fb4e3a8fc12 None
hdisk18 00c49fc461fc7b3b T_NET_APP_vg active
hdisk19 00c49fc461fc7b7d None
hdisk20 00c49fc461fc7bbe None
hdisk21 00c49fc461fc7bff None
hdisk22 00c49fc461fc7c40 None
hdisk23 00c49fc461fc7c88 T_TEST_LHR_VG active
hdisk24 00c49fc461fc7cca T_TEST_LHR_VG active
[ZFFR4CB2101:root]/]> df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 4.25 4.00 6% 12643 2% /
/dev/hd2 10.00 4.58 55% 118785 10% /usr
/dev/hd9var 4.50 4.08 10% 1175 1% /var
/dev/hd3 4.25 3.75 12% 1717 1% /tmp
/dev/hd1 1.00 1.00 1% 17 1% /home
/dev/hd11admin 0.25 0.25 1% 7 1% /admin
/proc - - - - - /proc
/dev/hd10opt 4.50 4.37 3% 2559 1% /opt
/dev/livedump 1.00 1.00 1% 6 1% /var/adm/ras/livedump
/dev/Plv_install 1.00 1.00 1% 4 1% /install
/dev/Plv_mtool 1.00 1.00 1% 4 1% /mtool
/dev/Plv_audit 2.00 1.99 1% 5 1% /audit
/dev/Plv_ftplog 1.00 1.00 1% 5 1% /ftplog
/dev/Tlv_bocnet 50.00 49.99 1% 4 1% /bocnet
/dev/Tlv_WebSphere 10.00 5.71 43% 45590 4% /WebSphere
/dev/TLV_TEST_DATA 100.00 99.98 1% 7 1% /lhr
ZTDNETAP3:/nfs 1240.00 14.39 99% 512924 14% /nfs
ZTINIMSERVER:/sharebkup 5500.00 1258.99 78% 2495764 1% /sharebkup
[ZFFR4CB2101:root]/]> mklv -t jfs2 -y tlv_u01 -x 1024 t_u01_vg 400
tlv_u01
[ZFFR4CB2101:root]/]> crfs -v jfs2 -d tlv_u01 -m /u01 -A yes
File system created successfully.
52426996 kilobytes total disk space.
New File System size is 104857600
[ZFFR4CB2101:root]/]> mount /u01
[ZFFR4CB2101:root]/]> df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 4.25 4.00 6% 12648 2% /
/dev/hd2 10.00 4.58 55% 118785 10% /usr
/dev/hd9var 4.50 4.08 10% 1176 1% /var
/dev/hd3 4.25 3.75 12% 1717 1% /tmp
/dev/hd1 1.00 1.00 1% 17 1% /home
/dev/hd11admin 0.25 0.25 1% 7 1% /admin
/proc - - - - - /proc
/dev/hd10opt 4.50 4.37 3% 2559 1% /opt
/dev/livedump 1.00 1.00 1% 6 1% /var/adm/ras/livedump
/dev/Plv_install 1.00 1.00 1% 4 1% /install
/dev/Plv_mtool 1.00 1.00 1% 4 1% /mtool
/dev/Plv_audit 2.00 1.99 1% 5 1% /audit
/dev/Plv_ftplog 1.00 1.00 1% 5 1% /ftplog
/dev/Tlv_bocnet 50.00 49.99 1% 4 1% /bocnet
/dev/Tlv_WebSphere 10.00 5.71 43% 45590 4% /WebSphere
/dev/TLV_TEST_DATA 100.00 99.98 1% 7 1% /lhr
ZTDNETAP3:/nfs 1240.00 14.39 99% 512924 14% /nfs
ZTINIMSERVER:/sharebkup 5500.00 1258.99 78% 2495764 1% /sharebkup
/dev/tlv_u01 50.00 49.99 1% 4 1% /u01
[ZFFR4CB2101:root]/]>
[ZFFR4CB2101:root]/]> mklv -t jfs2 -y tlv_softtmp -x 1024 t_u01_vg 240
tlv_softtmp
[ZFFR4CB2101:root]/]> crfs -v jfs2 -d tlv_softtmp -m /softtmp -A yes
File system created successfully.
31456116 kilobytes total disk space.
New File System size is 62914560
[ZFFR4CB2101:root]/]> mount /softtmp
[ZFFR4CB2101:root]/]> df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 4.25 4.00 6% 12650 2% /
/dev/hd2 10.00 4.58 55% 118785 10% /usr
/dev/hd9var 4.50 4.08 10% 1177 1% /var
/dev/hd3 4.25 3.75 12% 1717 1% /tmp
/dev/hd1 1.00 1.00 1% 17 1% /home
/dev/hd11admin 0.25 0.25 1% 7 1% /admin
/proc - - - - - /proc
/dev/hd10opt 4.50 4.37 3% 2559 1% /opt
/dev/livedump 1.00 1.00 1% 6 1% /var/adm/ras/livedump
/dev/Plv_install 1.00 1.00 1% 4 1% /install
/dev/Plv_mtool 1.00 1.00 1% 4 1% /mtool
/dev/Plv_audit 2.00 1.99 1% 5 1% /audit
/dev/Plv_ftplog 1.00 1.00 1% 5 1% /ftplog
/dev/Tlv_bocnet 50.00 49.99 1% 4 1% /bocnet
/dev/Tlv_WebSphere 10.00 5.71 43% 45590 4% /WebSphere
/dev/TLV_TEST_DATA 100.00 99.98 1% 7 1% /lhr
ZTDNETAP3:/nfs 1240.00 14.39 99% 512924 14% /nfs
ZTINIMSERVER:/sharebkup 5500.00 1258.99 78% 2495764 1% /sharebkup
/dev/tlv_u01 50.00 49.99 1% 4 1% /u01
/dev/tlv_softtmp 30.00 30.00 1% 4 1% /softtmp
[ZFFR4CB2101:root]/]>
2.4 建立安装目录
mkdir -p /u01/app/11.2.0/grid
chmod -R 755 /u01/app/11.2.0/grid
mkdir -p /u01/app/grid
chmod -R 755 /u01/app/grid
mkdir -p /u01/app/oracle
chmod -R 755 /u01/app/oracle
[ZFFR4CB2101:root]/]> mkdir -p /u01/app/11.2.0/grid
[ZFFR4CB2101:root]/]> chmod -R 755 /u01/app/11.2.0/grid
[ZFFR4CB2101:root]/]> mkdir -p /u01/app/grid
[ZFFR4CB2101:root]/]> chmod -R 755 /u01/app/grid
[ZFFR4CB2101:root]/]> mkdir -p /u01/app/oracle
[ZFFR4CB2101:root]/]> chmod -R 755 /u01/app/oracle
[ZFFR4CB2101:root]/]>
[ZFFR4CB2101:root]/]> cd /u01/app
[ZFFR4CB2101:root]/u01/app]> l
total 0
drwxr-xr-x 3 root system 256 Mar 08 16:11 11.2.0
drwxr-xr-x 2 root system 256 Mar 08 16:11 grid
drwxr-xr-x 2 root system 256 Mar 08 16:11 oracle
[ZFFR4CB2101:root]/u01/app]>
2.5 建立用户和用户组
mkgroup -A id=1024 dba
mkgroup -A id=1025 asmadmin
mkgroup -A id=1026 asmdba
mkgroup -A id=1027 asmoper
mkgroup -A id=1028 oinstall
mkuser -a id=1025 pgrp=oinstall groups=dba,asmadmin,asmdba,asmoper,oinstall home=/home/grid fsize=-1 cpu=-1 data=-1 core=-1 rss=-1 stack=-1 stack_hard=-1 capabilities=CAP_NUMA_ATTACH,CAP_BYPASS_RAC_VMM,CAP_PROPAGATE grid
echo "grid:grid" |chpasswd
pwdadm -c grid
mkuser -a id=1024 pgrp=dba groups=dba,asmadmin,asmdba,asmoper,oinstall home=/home/oracle fsize=-1 cpu=-1 data=-1 core=-1 rss=-1 stack=-1 stack_hard=-1 capabilities=CAP_NUMA_ATTACH,CAP_BYPASS_RAC_VMM,CAP_PROPAGATE oracle
echo "oracle:oracle" |chpasswd
pwdadm -c oracle
chown -R grid:dba /u01/app/11.2.0
chown grid:dba /u01/app
chown grid:dba /u01/app/grid
chown -R oracle:dba /u01/app/oracle
chown oracle:dba /u01
/usr/sbin/lsuser -a capabilities grid
/usr/sbin/lsuser -a capabilities oracle
[ZFFR4CB2101:root]/u01/app]> mkgroup -A id=1024 dba
[ZFFR4CB2101:root]/u01/app]> mkuser -a id=1025 pgrp=dba groups=dba home=/home/grid fsize=-1 cpu=-1 data=-1 core=-1 rss=-1 stack=-1 stack_hard=-1 capabilities=CAP_NUMA_ATTACH,CAP_BYPASS_RAC_VMM,CAP_PROPAGATE grid
[ZFFR4CB2101:root]/u01/app]> passwd grid
Changing password for "grid"
grid's New password:
Enter the new password again:
[ZFFR4CB2101:root]/u01/app]>
[ZFFR4CB2101:root]/u01/app]> mkuser -a id=1024 pgrp=dba groups=dba home=/home/oracle fsize=-1 cpu=-1 data=-1 core=-1 rss=-1 stack=-1 stack_hard=-1 capabilities=CAP_NUMA_ATTACH,CAP_BYPASS_RAC_VMM,CAP_PROPAGATE oracle
[ZFFR4CB2101:root]/u01/app]> passwd oracle
Changing password for "oracle"
oracle's New password:
Enter the new password again:
[ZFFR4CB2101:root]/u01/app]> chown -R grid:dba /u01/app/11.2.0
[ZFFR4CB2101:root]/u01/app]> chown grid:dba /u01/app
[ZFFR4CB2101:root]/u01/app]> chown grid:dba /u01/app/grid
[ZFFR4CB2101:root]/u01/app]> chown -R oracle:dba /u01/app/oracle
[ZFFR4CB2101:root]/u01/app]> chown oracle:dba /u01
[ZFFR4CB2101:root]/u01/app]> /usr/sbin/lsuser -a capabilities grid
grid capabilities=CAP_NUMA_ATTACH,CAP_BYPASS_RAC_VMM,CAP_PROPAGATE
[ZFFR4CB2101:root]/u01/app]> /usr/sbin/lsuser -a capabilities oracle
oracle capabilities=CAP_NUMA_ATTACH,CAP_BYPASS_RAC_VMM,CAP_PROPAGATE
[ZFFR4CB2101:root]/u01/app]>
2.6 配置 grid 和 oracle的 .profile
su - grid
vi .profile
umask 022
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid
export ORACLE_SID=+ASM
export ORACLE_TERM=vt100
export ORACLE_OWNER=grid
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/u01/app/oracle/product/11.2.0/dbhome_1/lib32
export LIBPATH=$LIBPATH:/u01/app/oracle/product/11.2.0/dbhome_1/lib
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export PATH=$PATH:/bin:/usr/ccs/bin:/usr/bin/X11:$ORACLE_HOME/bin
export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
set -o vi
export EDITOR=vi
alias l='ls -l'
export PS1='[$LOGNAME@'`hostname`:'$PWD'']$ '
export AIXTHREAD_SCOPE=S
export ORACLE_TERM=vt100
export TMP=/tmp
export TMPDIR=/tmp
export LANG=en_US
export PS1='[$LOGNAME@'`hostname`:'$PWD'']$ '
export DISPLAY=22.188.216.97:0.0
su - oracle
vi .profile
umask 022
export ORACLE_SID=ora11g
export ORACLE_BASE=/u01/app/oracle
export GRID_HOME=/u01/app/11.2.0/grid
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$GRID_HOME/bin:$PATH:$ORACLE_HOME/OPatch
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/rdbms/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
export ORACLE_OWNER=oracle
set -o vi
export EDITOR=vi
alias l='ls -l'
export AIXTHREAD_SCOPE=S
export ORACLE_TERM=vt100
export TMP=/tmp
export TMPDIR=/tmp
export LANG=en_US
export PS1='[$LOGNAME@'`hostname`:'$PWD'']$ '
export DISPLAY=22.188.216.97:0.0
. ~/.profile 生效当前的环境变量
2.7 准备ASM磁盘
ASM磁盘权限
chown grid.dba /dev/rhdiskN -> (ocr,votedisk)
chown oracle.dba /dev/rhdiskM -> (datafile)
chmod 660 /dev/rhdiskN、M
chown grid.dba /dev/rhdisk20
chown oracle.dba /dev/rhdisk21
chmod 660 /dev/rhdisk20
chmod 660 /dev/rhdisk21
[ZFFR4CB2101:root]/]> lspv
hdisk0 00c49fc434da2434 rootvg active
hdisk1 00c49fc461fc76b2 None
hdisk2 00c49fc461fc76f5 None
hdisk3 00c49fc461fc7739 None
hdisk4 00c49fc461fc777a None
hdisk5 00c49fc461fc77bd None
hdisk6 00c49fc461fc77fe None
hdisk7 00c49fc461fc783f None
hdisk8 00c49fc461fc7880 None
hdisk9 00c49fc461fc78c5 None
hdisk10 00c49fc461fc7908 None
hdisk11 00c49fc461fc7958 None
hdisk12 00c49fc461fc79a0 None
hdisk13 00c49fc461fc79ea None
hdisk14 00c49fc461fc7a2f None
hdisk15 00c49fc461fc7a71 None
hdisk16 00c49fc461fc7ab1 None
hdisk17 00c49fb4e3a8fc12 None
hdisk18 00c49fc461fc7b3b T_NET_APP_vg active
hdisk19 00c49fc461fc7b7d None
hdisk20 00c49fc461fc7bbe None
hdisk21 00c49fc461fc7bff None
hdisk22 00c49fc461fc7c40 t_u01_vg active
hdisk23 00c49fc461fc7c88 T_TEST_LHR_VG active
hdisk24 00c49fc461fc7cca T_TEST_LHR_VG active
[ZFFR4CB2101:root]/]> chown grid.dba /dev/rhdisk20
[ZFFR4CB2101:root]/]> chown oracle.dba /dev/rhdisk21
[ZFFR4CB2101:root]/]> chmod 660 /dev/rhdisk20
[ZFFR4CB2101:root]/]> chmod 660 /dev/rhdisk21
[ZFFR4CB2101:root]/]>
2.8 调整相应的系统参数
2.8.1 /etc/security/limits
vi /etc/security/limits
root:
fsize = -1
stack = -1
fsize_hard = -1
nofiles = 65536
core = -1
data = -1
cpu_hard = -1
data_hard = -1
stack_hard = -1
rss = -1
rss_hard = -1
nofiles_hard = 65536
cpu = -1
oracle:
fsize = -1
stack = -1
fsize_hard = -1
nofiles = 65536
core = -1
data = -1
cpu_hard = -1
data_hard = -1
stack_hard = -1
rss = -1
rss_hard = -1
nofiles_hard = 65536
cpu = -1
grid:
fsize = -1
stack = -1
fsize_hard = -1
nofiles = 65536
core = -1
data = -1
cpu_hard = -1
data_hard = -1
stack_hard = -1
rss = -1
rss_hard = -1
nofiles_hard = 65536
cpu = -1
2.8.2 调整用户最大进程数调整maxuproc(系统最大进程数)
调整maxuproc(系统最大进程数)
smitty chgsys
或是
#chdev -l sys0 -a maxuproc=16384
sys0 changed
[ZFFR4CB2101:root]/]> lsattr -E -l sys0 -a maxuproc
maxuproc 16384 Maximum number of PROCESSES allowed per user True
[ZFFR4CB2101:root]/]> chdev -l sys0 -a maxuproc=16384
sys0 changed
[ZFFR4CB2101:root]/]> lsattr -E -l sys0 -a maxuproc
maxuproc 16384 Maximum number of PROCESSES allowed per user True
[ZFFR4CB2101:root]/]>
2.8.3 其它参数
[ZFFR4CB2101:root]/]> ioo -a | grep aio_maxreqs
aio_maxreqs = 131072
posix_aio_maxreqs = 131072
[ZFFR4CB2101:root]/]>
# ioo –o aio_maxreqs
aio_maxreqs = 65536
这里有需要声明的是在AIX 5L需要运行rootpre.sh脚本才能开启aio功能,在AIX 6L中默认已开启。在AIX 5和6中都是65536(6k)的值去做最大的异步io。
调整ncargs(系统块大小)
#chdev -l sys0 -a ncargs=128
sys0 changed
调整异步io
#smitty aio
修改完后需要重启动,可以使用如下命令查看aio server的进程数
$pstat -a|grep aios
修改完毕后,需重起系统生效.
优化虚拟内存管理
vmo -p -o minperm%=3
vmo -p -o maxperm%=90
vmo -p -o maxclient%=90
vmo -p -o lru_file_repage=0
vmo -p -o strict_maxclient=1
vmo -p -o strict_maxperm=0
调整网络参数
no -r -o ipqmaxlen=512
no -p -o rfc1323=1
no -p -o sb_max=131072 //2*65536
no -p -o tcp_recvspace=65536
no -p -o tcp_sendspace=65536
no -p -o udp_recvspace=655360
no -p -o udp_sendspace=65536
2.8.4 shell脚本
_chlimit(){
[ -f /etc/security/limits.org ] || { cp -p /etc/security/limits /etc/security/limits.org; }
cat /etc/security/limits.org |egrep -vp "root|oracle|grid" > /etc/security/limits
echo "root:
core = -1
cpu = -1
data = -1
fsize = -1
nofiles = -1
rss = -1
stack = -1
core_hard = -1
cpu_hard = -1
data_hard = -1
fsize_hard = -1
nofiles_hard = -1
rss_hard = -1
stack_hard = -1
oracle:
core = -1
cpu = -1
data = -1
fsize = -1
nofiles = -1
rss = -1
stack = -1
cpu_hard = -1
core_hard = -1
data_hard = -1
fsize_hard = -1
nofiles_hard = -1
rss_hard = -1
stack_hard = -1
grid:
core = -1
cpu = -1
data = -1
fsize = -1
nofiles = -1
rss = -1
stack = -1
core_hard = -1
cpu_hard = -1
data_hard = -1
fsize_hard = -1
nofiles_hard = -1
rss_hard = -1
stack_hard = -1" >> /etc/security/limits
}
_chospara(){
vmo -p -o minperm%=3
echo "yes"|vmo -p -o maxperm%=90
echo "yes" |vmo -p -o maxclient%=90
echo "yes"|vmo -p -o lru_file_repage=0
echo "yes"|vmo -p -o strict_maxclient=1
echo "yes" |vmo -p -o strict_maxperm=0
echo "yes\nno" |vmo -r -o page_steal_method=1;
ioo -a|egrep -w "aio_maxreqs|aio_maxservers|aio_minservers"
/usr/sbin/chdev -l sys0 -a maxuproc=16384 -a ncargs=256 -a minpout=4096 -a maxpout=8193 -a fullcore=true
echo "check sys0 16384 256"
lsattr -El sys0 |egrep "maxuproc|ncargs|pout|fullcore" |awk '{print $1,$2}'
/usr/sbin/no -p -o sb_max=41943040
/usr/sbin/no -p -o udp_sendspace=2097152
/usr/sbin/no -p -o udp_recvspace=20971520
/usr/sbin/no -p -o tcp_sendspace=1048576
/usr/sbin/no -p -o tcp_recvspace=1048576
/usr/sbin/no -p -o rfc1323=1
/usr/sbin/no -r -o ipqmaxlen=512
/usr/sbin/no -p -o clean_partial_conns=1
cp -p /etc/environment /etc/environment.`date '+%Y%m%d'`
cat /etc/environment.`date '+%Y%m%d'` |awk '/^TZ=/{print "TZ=BEIST-8"} !/^TZ=/{print}' >/etc/environment
_chlimit
}
_chlimit
_chospara
第三章 grid安装
3.1 准备安装源
上传文件到softtmp目录:
[ZFFR4CB2101:root]/softtmp]> l
total 9644872
drwxr-xr-x 2 root system 256 Mar 08 16:10 lost+found
-rw-r----- 1 root system 1766307597 Mar 02 04:05 p10404530_112030_AIX64-5L_1of7.zip
-rw-r----- 1 root system 1135393912 Mar 02 04:03 p10404530_112030_AIX64-5L_2of7.zip
-rw-r----- 1 root system 2036455635 Mar 02 04:06 p10404530_112030_AIX64-5L_3of7.zip
[ZFFR4CB2101:root]/softtmp]> unzip p10404530_112030_AIX64-5L_3of7.zip
Archive: p10404530_112030_AIX64-5L_3of7.zip
creating: grid/
creating: grid/stage/
inflating: grid/stage/shiphomeproperties.xml
creating: grid/stage/Components/
creating: grid/stage/Components/oracle.crs/
creating: grid/stage/Components/oracle.crs/11.2.0.3.0/
creating: grid/stage/Components/oracle.crs/11.2.0.3.0/1/
creating: grid/stage/Components/oracle.crs/11.2.0.3.0/1/DataFiles/
inflating: grid/stage/Components/oracle.crs/11.2.0.3.0/1/DataFiles/filegroup5.jar
inflating: grid/stage/Components/oracle.crs/11.2.0.3.0/1/DataFiles/filegroup4.jar
inflating: grid/stage/Components/oracle.crs/11.2.0.3.0/1/DataFiles/filegroup3.jar
inflating: grid/stage/Components/oracle.crs/11.2.0.3.0/1/DataFiles/filegroup2.jar
inflating: grid/stage/Components/oracle.crs/11.2.0.3.0/1/DataFiles/filegroup1.jar
creating: grid/stage/Components/oracle.has.crs/
《《《《。。。。。。。。篇幅原因,有省略。。。。。。。。》》》》
inflating: grid/doc/server.11203/E18951-02.mobi
inflating: grid/welcome.html
creating: grid/sshsetup/
inflating: grid/sshsetup/sshUserSetup.sh
inflating: grid/readme.html
[ZFFR4CB2101:root]/softtmp]>
[ZFFR4CB2101:root]/softtmp]> l
total 9644880
drwxr-xr-x 9 root system 4096 Oct 28 2011 grid
drwxr-xr-x 2 root system 256 Mar 08 16:10 lost+found
-rw-r----- 1 root system 1766307597 Mar 02 04:05 p10404530_112030_AIX64-5L_1of7.zip
-rw-r----- 1 root system 1135393912 Mar 02 04:03 p10404530_112030_AIX64-5L_2of7.zip
-rw-r----- 1 root system 2036455635 Mar 02 04:06 p10404530_112030_AIX64-5L_3of7.zip
[ZFFR4CB2101:root]/softtmp]> cd grid
[ZFFR4CB2101:root]/softtmp/grid]> l
total 168
drwxr-xr-x 9 root system 4096 Oct 10 2011 doc
drwxr-xr-x 4 root system 4096 Oct 21 2011 install
-rwxr-xr-x 1 root system 28122 Oct 28 2011 readme.html
drwxrwxr-x 2 root system 256 Oct 21 2011 response
drwxrwxr-x 3 root system 256 Oct 21 2011 rootpre
-rwxr-xr-x 1 root system 13369 Sep 22 2010 rootpre.sh
drwxrwxr-x 2 root system 256 Oct 21 2011 rpm
-rwxr-xr-x 1 root system 10006 Oct 21 2011 runInstaller
-rwxrwxr-x 1 root system 4878 May 14 2011 runcluvfy.sh
drwxrwxr-x 2 root system 256 Oct 21 2011 sshsetup
drwxr-xr-x 14 root system 4096 Oct 21 2011 stage
-rw-r--r-- 1 root system 4561 Oct 10 2011 welcome.html
3.2 配置连通性+执行runcluvfy.sh脚本预检测
该步骤主要是为了可以执行/softtmp/grid/runcluvfy.sh stage -pre crsinst -n ZFFR4CB2101 -verbose -fixup,若不检测或者采用图形安装的话可以不用执行。
su - grid
mkdir -p ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa ->回车->回车->回车
ssh-keygen -t dsa ->回车->回车->回车
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
ssh `hostname` date
[grid@ZFFR4CB2101:/home/grid]$ /softtmp/grid/runcluvfy.sh stage -pre crsinst -n ZFFR4CB2101 -verbose -fixup
Performing pre-checks for cluster services setup
Checking node reachability...
Check: Node reachability from node "ZFFR4CB2101"
Destination Node Reachable?
------------------------------------ ------------------------
ZFFR4CB2101 yes
Result: Node reachability check passed from node "ZFFR4CB2101"
Checking user equivalence...
Check: User equivalence for user "grid"
Node Name Status
------------------------------------ ------------------------
ZFFR4CB2101 passed
Result: User equivalence check passed for user "grid"
Checking node connectivity...
Checking hosts config file...
Node Name Status
------------------------------------ ------------------------
ZFFR4CB2101 passed
Verification of the hosts config file successful
Interface information for node "ZFFR4CB2101"
Name IP Address Subnet Gateway Def. Gateway HW Address MTU
------ --------------- --------------- --------------- --------------- ----------------- ------
en0 22.188.187.158 22.188.187.0 22.188.187.158 22.188.187.1 C6:03:AE:03:97:83 1500
Check: Node connectivity of subnet "22.188.187.0"
Result: Node connectivity passed for subnet "22.188.187.0" with node(s) ZFFR4CB2101
Check: TCP connectivity of subnet "22.188.187.0"
Result: TCP connectivity check passed for subnet "22.188.187.0"
Interfaces found on subnet "22.188.187.0" that are likely candidates for VIP are:
ZFFR4CB2101 en0:22.188.187.158
WARNING:
Could not find a suitable set of interfaces for the private interconnect
Result: Node connectivity check passed
Checking multicast communication...
Checking subnet "22.188.187.0" for multicast communication with multicast group "230.0.1.0"...
Check of subnet "22.188.187.0" for multicast communication with multicast group "230.0.1.0" passed.
Check of multicast communication passed.
Check: Total memory
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
ZFFR4CB2101 4GB (4194304.0KB) 2GB (2097152.0KB) passed
Result: Total memory check passed
Check: Available memory
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
ZFFR4CB2101 2.7969GB (2932716.0KB) 50MB (51200.0KB) passed
Result: Available memory check passed
Check: Swap space
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
ZFFR4CB2101 8GB (8388608.0KB) 4GB (4194304.0KB) passed
Result: Swap space check passed
Check: Free disk space for "ZFFR4CB2101:/tmp"
Path Node Name Mount point Available Required Status
---------------- ------------ ------------ ------------ ------------ ------------
/tmp ZFFR4CB2101 /tmp 1.7661GB 1GB passed
Result: Free disk space check passed for "ZFFR4CB2101:/tmp"
Check: User existence for "grid"
Node Name Status Comment
------------ ------------------------ ------------------------
ZFFR4CB2101 passed exists(1025)
Checking for multiple users with UID value 1025
Result: Check for multiple users with UID value 1025 passed
Result: User existence check passed for "grid"
Check: Group existence for "oinstall"
Node Name Status Comment
------------ ------------------------ ------------------------
ZFFR4CB2101 passed exists
Result: Group existence check passed for "oinstall"
Check: Group existence for "dba"
Node Name Status Comment
------------ ------------------------ ------------------------
ZFFR4CB2101 passed exists
Result: Group existence check passed for "dba"
Check: Membership of user "grid" in group "oinstall" [as Primary]
Node Name User Exists Group Exists User in Group Primary Status
---------------- ------------ ------------ ------------ ------------ ------------
ZFFR4CB2101 yes yes yes no failed
Result: Membership check for user "grid" in group "oinstall" [as Primary] failed
Check: Membership of user "grid" in group "dba"
Node Name User Exists Group Exists User in Group Status
---------------- ------------ ------------ ------------ ----------------
ZFFR4CB2101 yes yes yes passed
Result: Membership check for user "grid" in group "dba" passed