ORACLE---Aix7.1 安装Oracle11.2.0.4版本数据库

===可参考support.oracle.com 官方安装文档
https://docs.oracle.com/cd/E11882_01/install.112/e24335/toc.htm


===AIX下smit命令和smitty命令的区别
1、在字符界面:smitty和 smit效果是一样的。
2、在图形化界面:
启动字符的 System Management 用smitty
启动图形的 System Management 用smit


===IBM AIX系统为rootvg实现镜像  https://jingyan.baidu.com/article/fc07f9891c516412ffe519fe.html
[root@infowms_test1/]# lsvg -l rootvg                              //确定rootvg pvs=1,且lp=pp可以看出,rootvg没有镜像
[root@infowms_test1/]# lspv                                           //查看AIX系统磁盘情况。
[root@infowms_test1/]# lsattr -El hdisk0                         //进一步确认hdisk0和hdisk1容量是否一致,出两块盘的容量相同,可以镜像
[root@infowms_test1/]# lsattr -El hdisk1                        //进一步确认hdisk0和hdisk1容量是否一致,出两块盘的容量相同,可以镜像
[root@infowms_test1/]# bootinfo -B hdisk1                    //返回值为1,则说明hdisk1可以引导系统,否则说明hdisk1 不适合做hdisk0的镜像
[root@infowms_test1/]# extendvg -f rootvg hdisk1          //将hdisk1 纳入到rootvg中
[root@infowms_test1/]# lspv                                            //查看AIX系统磁盘情况
[root@infowms_test1/]# chvg –Qn rootvg                       //命令执行完成后,QUORUM的值会变为1 (Disabled),rootvg只有两块磁盘,而且实现简单镜像,因此需要取消rootvg中的物理卷限额
[root@infowms_test1/]# mirrorvg -c 2 rootvg hdisk1            //对rootvg实现镜像

//在rootvg的两块盘上创建引导信息,然后修改引导设备顺序清单。
[root@infowms_test1/]# bootlist -m normal -o                       //显示引导设备顺序
[root@infowms_test1/]# bosboot –ad  /dev/hdisk1                 //建立引导记录
[root@infowms_test1/]# bootlist –m normal hdisk0 hdisk1    //更改引导顺序
[root@infowms_test1/]# bootlist -m normal –o                       //显示引导设备顺序


===AIX系统也支持RPM安装包:(例如我安装图形化工具VNC)
[root@infowms_test1/]# rpm -qa|grep vnc (自带的tigervnc1.3.10-1版本要卸载掉,否则在runInstaller各种打不开图形化界面)
tightvnc-server-1.3.10-1
[root@infowms_test1/tmp]# rpm -e tightvnc-server-1.3.10-1
[root@infowms_test1/tmp]# rpm -ivh vnc-3.3.3r2-6.aix5.1.ppc.rpm
[root@infowms_test1/tmp]# rpm -qa|grep vnc



(1---7所有配置完成,再一次性重启机器 shutdown -Fr,使得所有配置生效)
1、硬件环境检查:
[root@infowms_test1/]# df -g /tmp                                                   //一般满足1GB即可
[root@infowms_test1/]# /usr/sbin/lsattr -E -l sys0 -a realmem         // memory 生产环境一般需要8G以及以上
[root@infowms_test1/]# /usr/sbin/lsps -a                                          // swap 一般设置8--32Gb之间即可
[root@infowms_test1/]# /usr/sbin/lsps -s                                          // 查看 swap 使用率

Available RAM                       Swap Space Required
Between 1 GB and 2 GB       1.5 times the size of the RAM
Between 2 GB and 16 GB      Equal to the size of the RAM
More than 16 GB                   16 GB

[root@infowms_test1/]# /usr/bin/getconf HARDWARE_BITMODE   //查看服务器位数
[root@infowms_test1/]# bootinfo -K                                                  //查看服务器位数

[root@infowms_test1/]# prtconf |grep Processor                               //查看CPU型号
[root@infowms_test1/]# lsattr -El proc0                                             //查看某个CPU状态
[root@infowms_test1/]# oslevel -s                                                     //查看OS版本
[root@infowms_test1/]# instfix -i|grep ML                                           //查看OS版本


===检查大网IP网卡是否绑定多网卡,生产环境一般要求双网卡绑定
[root@infowms_test1/]# smit etherchannel ---> List All EtherChannels / Link Aggregations
EtherChannel / Link Aggregation: ent8
Status: Available
Attributes:
      adapter_names   ent0           EtherChannel Adapters
      alt_addr        0x000000000000 Alternate EtherChannel Address
      auto_recovery   yes            Enable automatic recovery after failover
      backup_adapter  ent4           Adapter used when whole channel fails
      hash_mode       default        Determines how outgoing adapter is chosen
      interval        long           Determines interval value for IEEE 802.3ad mode
      mode            standard       EtherChannel mode of operation
      netaddr         0              Address to ping
      noloss_failover yes            Enable lossless failover after ping failure
      num_retries     3              Times to retry ping before failing
      retry_time      1              Wait time (in seconds) between pings
      use_alt_addr    no             Enable Alternate EtherChannel Address
      use_jumbo_frame no             Enable Gigabit Ethernet Jumbo Frames


===配置search域名和dns服务器IP
[root@infowms_test1/]# vi /etc/resolv.conf
search  oracle.com.cn
nameserver      10.30.XX.XX
nameserver      10.40.XX.XX
  
===检查DNS解析顺序
[root@infowms_test1/]# more /etc/netsvc.conf
建议:hosts=local,bind,nis


===如果数据库使用域名的话,通知网络工程师在DNS配置域名绑定IP,如果是RAC,配置多个SCAN VIP
例如: testdb.learn.oracle.com.cn
[root@infowms_test1/]# nslookup testdb.learn


2、修改主机名(需要reboot生效)
[root@infowms_test1/]# hostname infowms_test1  【暂时生效,重启失效】

[root@infowms_test1/]# smit tcpip ---> futher configureation ---> hostname ---> set the hostname 【永久生效,需要重启】
[root@infowms_test1/]# smit ---> communication Application and Services ---> TCP/IP ---> futher configureation ---> hostname ---> set the hostname  【永久生效,需要重启】  或者这样

[root@infowms_test1/]#cat /etc/hosts
10.xx.xx.xx    infowms_test1

最后确认/etc/hosts中数据是一致的。


3、关闭防火墙
开防火墙
smit ---> communication Application and Services ---> TCP/IP ---> configure IP security(ipv4) ---> Start/stop ip security ----> start IP security
关闭防火墙
smit ---> communication Application and Services ---> TCP/IP ---> configure IP security(ipv4) ---> Start/stop ip security ----> stop IP security
配置防火墙规则
smit ---> communication Application and Services ---> TCP/IP ---> configure IP security(ipv4) ---> Advantanced IP Security Configuration


4、软件环境检查、安装Oracle依赖、以及操作系统补丁
The following operating system filesets are required for AIX 7.1:
bos.adt.base
bos.adt.lib
bos.adt.libm
bos.perf.libperfstat
bos.perf.perfstat
bos.perf.proctools
xlC.rte.11.1.0.2 or later
gpfs.base 3.3.0.11

===lslpp检查是否已安装所需系统依赖包文件集(filesets)
[root@infowms_test1/]# lslpp -l bos.adt.base bos.adt.lib bos.adt.libm bos.perf.perfstat bos.perf.libperfstat bos.perf.proctools xlC.rte gpfs.base

[root@infowms_test1/]# lslpp -l gpfs.base   ==如果未安装是这种状态
lslpp: 0504-132  Fileset gpfs.base not installed.

[root@infowms_test1/]# lslpp -l xlC.rte     ==如果已安装是这种状态
  Fileset                      Level  State      Description        
  ----------------------------------------------------------------------------
Path: /usr/lib/objrepos
  xlC.rte                   13.1.3.1  COMMITTED  IBM XL C++ Runtime for AIX
 
===安装所需的系统依赖包
[root@infowms_test1/]# smit install_latest
选择安装路径,如/dev/cd0
INPUT device / directory for software [/dev/cd0]
在安装的软件选项上按F4或者是Esc+4,打开软件列表,可以用“/”寻找你需要安装的文件集。如找到bos.adt,然后按F7或者Esc+7选中要安装的软件:
    > bos.adt                                                            ALL
      5.2.0.50  Base Application Development Debuggers
      5.2.0.40  Base Application Development Graphics Include Files
回车,确定安装选项
     PREVIEW only? (install operation will NOT occur)              no
     COMMIT software updates?                                      yes
     SAVE replaced files?                                          no
其中:
PREVIEW only表示预览安装,如果选yes可以先测试安装
COMMIT software updates表示立即提交,如果选为yes,则SAVE replaced files为no。
ACCEPT new license agreements一般选为yes,表示接受许可协议。


===安装AIX系统补丁
[root@infowms_test1/]# /usr/sbin/instfix -ik "IZ87216 IZ87564 IZ89165 IZ97035"
    All filesets for IZ87216 were found.
    All filesets for IZ87564 were found.
    All filesets for IZ89165 were found.
    All filesets for IZ97035 were found.


===检查哪个详细的系统补丁是否安装
[root@infowms_test1/]# /usr/sbin/instfix -a -ivk IZ87216


===安装系统补丁
[root@infowms_test1/]# smit update_by_fix
选择安装目录,如
INPUT device / directory for software [/dev/cd0]
打开安装列表,选择需要安装的patch,如
      IY35795 smitty causes an error of invalid length of strings in JA_JP
     > IY35810 Enhanced concurrent extendvg with 3 or more nodes may fail
       IY35817 pthread debug resource owner broken for 64-bit mode
确定安装选项,是否提交,是否保存过去的版本等等,确定后提交执行安装。


5、配置核心参数
===A、检查UDP和TCP端口范围:
[root@infowms_test1/]# /usr/sbin/no -a | fgrep ephemeral
       tcp_ephemeral_high = 65535
        tcp_ephemeral_low = 32768
       udp_ephemeral_high = 65535
        udp_ephemeral_low = 32768 
修改为9000-65500:
[root@infowms_test1/]# /usr/sbin/no -p -o tcp_ephemeral_low=9000 -o tcp_ephemeral_high=65500
[root@infowms_test1/]# /usr/sbin/no -p -o udp_ephemeral_low=9000 -o udp_ephemeral_high=65500

[root@infowms_test1/]# /usr/sbin/no -a | fgrep ephemeral   (再次查看)
       tcp_ephemeral_high = 65500
        tcp_ephemeral_low = 9000
       udp_ephemeral_high = 65500
        udp_ephemeral_low = 9000


===B、AIX 6.1 和 7.1检查系统异步IO、AIO可以提示提升I/O 吞吐量和性能。【The recommended value for aio_maxreqs is 64k (65536)】
查看系统异步IO
[root@infowms_test1/]# ioo -o aio_maxreqs
aio_maxreqs = 131072
设置系统异步IO大小
[root@infowms_test1/]# ioo -o aio_maxreqs=65536
Setting aio_maxreqs to 65536
检测当前使用数
[root@infowms_test1/etc]# ps -ek|grep -v grep|grep -v posix_aioserver|grep -c aioserver
0


===C、优化虚拟内存管理
[root@infowms_test1/]# vmo -p -o minperm%=3
[root@infowms_test1/]# vmo -p -o maxperm%=90
[root@infowms_test1/]# vmo -p -o maxclient%=90
[root@infowms_test1/]# vmo -p -o strict_maxclient=1
[root@infowms_test1/]# vmo -p -o strict_maxperm=0

vmo -p -o lru_file_repage=0  --AIX7.1不需要,AIX6.1的参数
报错:vmo: 1485-110 Invalid tunable name lru_file_repage

查看:
[root@infowms_test1/]# vmo -a  --查看所有
[root@infowms_test1/]# vmo -a |grep minperm%
[root@infowms_test1/]# vmo -a |grep maxperm%
[root@infowms_test1/]# vmo -a |grep maxclient%
[root@infowms_test1/]# vmo -a |grep strict_maxclient 
[root@infowms_test1/]# vmo -a |grep strict_maxperm


===D、调整操作系统ARG/ENV空间大小【Oracle recommends that you increase the space allocated for ARG/ENV list to 128】
[root@infowms_test1/]# lsattr -El sys0 -a ncargs            --查看
[root@infowms_test1/]# chdev -l sys0 -a ncargs=256     --修改


===E、配置用户最大进程数
[root@infowms_test1/]# /usr/sbin/lsattr -E -l sys0 -a maxuproc              --查看
[root@infowms_test1/]# smitty chgsys                                                    --查看
[root@infowms_test1/]# /usr/sbin/chdev -l sys0 -a maxuproc=16384     --修改


===F、配置SSH LoginGraceTime(Oracle recommends uncommenting the LoginGraceTime parameter in the OpenSSH configuration file /etc/ssh/sshd_config, and setting it to a value of 0 (unlimited).)
[root@infowms_test1/]# vi /etc/ssh/sshd_config
LoginGraceTime  0

重启SSH:
[root@infowms_test1/]# stopsrc -s sshd
[root@infowms_test1/]# startsrc -s sshd


6、配置网络优化参数
[root@infowms_test1/]# no -a | grep -E "ipqmaxlen|rfc1323|sb_max|tcp_recvspace|tcp_sendspace|udp_recvspace|udp_sendspace"    --检查
ipqmaxlen = 100
rfc1323 = 0
sb_max = 1048576
tcp_recvspace = 16384
tcp_sendspace = 16384
udp_recvspace = 42080
udp_sendspace = 9216

如需修改参数,需确认是否是compatibility模式:
[root@infowms_test1/]# lsattr -E -l sys0 -a pre520tune
pre520tune disable Pre-520 tuning compatibility mode True

disable模式修改参数:
[root@infowms_test1/]# /usr/sbin/no -r -o ipqmaxlen=512
[root@infowms_test1/]# /usr/sbin/no -p -o rfc1323=1
[root@infowms_test1/]# /usr/sbin/no -p -o sb_max=4194304
[root@infowms_test1/]# /usr/sbin/no -p -o tcp_recvspace=65536
[root@infowms_test1/]# /usr/sbin/no -p -o tcp_sendspace=65536
[root@infowms_test1/]# /usr/sbin/no -p -o udp_recvspace=655360
[root@infowms_test1/]# /usr/sbin/no -p -o udp_sendspace=65536

enable模式修改参数:
[root@infowms_test1/]# vi /etc/rc.net
if [ -f /usr/sbin/no ] ; then
    /usr/sbin/no -o udp_sendspace=65536
    /usr/sbin/no -o udp_recvspace=655360
    /usr/sbin/no -o tcp_sendspace=65536
    /usr/sbin/no -o tcp_recvspace=65536
    /usr/sbin/no -o rfc1323=1
    /usr/sbin/no -o sb_max=4194304
    /usr/sbin/no -o ipqmaxlen=512
fi

使用aix命令调整私有网卡rfc1323参数:
[root@infowms_test1/]# smitty chinet    选择公网网卡(eth8)和私网网卡(eth1,eth5),然后修改rfc1323=1

重启服务器(shutdown -Fr)

再次检查:
[root@infowms_test1/]# no -a | grep -E "ipqmaxlen|rfc1323|sb_max|tcp_recvspace|tcp_sendspace|udp_recvspace|udp_sendspace"
                ipqmaxlen = 512
                  rfc1323 = 1
                   sb_max = 4194304
            tcp_recvspace = 65536
            tcp_sendspace = 65536
            udp_recvspace = 655360
            udp_sendspace = 65536

查看如下文件,表示下次服务器重启如上参数一样生效:
[root@infowms_test1/]# more /etc/tunables/nextboot


7、修改用户限制
[root@infowms_test1/]# vi /etc/security/limits.conf   (如原来存在需删除,stack_hard 需要设置,否则修改不了stack 限制)
default:
        fsize = -1
        core = 2097151
        cpu = -1
        data = -1
        rss = -1
        stack_hard = -1
        stack = -1
        nofiles = -1

重启后检查:(需要重启服务器shutdown -Fr)
[root@infowms_test1/]# ulimit -a

修改(立即生效):(如上选项的第一个英文字母)
[root@infowms_test1/]# ulimit -f unlimited   (修改fsize)


8、创建orcale用户,将其加入dba组
[root@infowms_test1/]# mkgroup -'A' id='1000' adms='root' oinstall
[root@infowms_test1/]# mkgroup -'A' id='1001' adms='root' dba
[root@infowms_test1/]# mkuser id='1101' pgrp='oinstall' groups='dba' home='/home/oracle' oracle
[root@infowms_test1/]# passwd oracle


9、创建目录
[root@infowms_test1/]# mkdir -p /u01/app/oracle
[root@infowms_test1/]# mkdir -p /u01/app/oraInventory
[root@infowms_test1/]# mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1
[root@infowms_test1/]# chown -R oracle:oinstall /u01/app/oracle
[root@infowms_test1/]# chown -R oracle:oinstall /u01/app/oraInventory
[root@infowms_test1/]# chown -R oracle:oinstall /u01/app/oracle/product/11.2.0/dbhome_1
[root@infowms_test1/]# chmod -R 775 /u01


10、设置oracle用户环境变量
[oracle@infowms_test1/home/oracle]# vi .profile
[oracle@infowms_test1/home/oracle]# cat .profile
export ORACLE_SID=SCPRD
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
export NLS_LANG='AMERICAN_AMERICA.AL32UTF8'
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=PATH:$ORACLE_HOME/bin:/bin:/usr/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
umask 022

查看环境配置是否完成
. .profile
env | grep ORA


11、图形界面安装过程
1、解压文件
[root@infowms_test1/]# su - oracle
[oracle@infowms_test1/home/oracle]# cd /data
[oracle@infowms_test1/data]# unzip p13390677_112040_AIX64-5L_1of7.zip
[oracle@infowms_test1/data]# unzip p13390677_112040_AIX64-5L_2of7.zip

p6880880_112000_AIX64-5L.zip  (opatch工具包)
p27967757_112040_AIX64-5L.zip  (PSU 补丁包安装请看我写的其他文章)


2、安装(使用VNC登陆,远程至桌面系统)
[root@infowms_test1/]# rpm -qa|grep vnc (需要安装tigervnc,如果没有就安装tigervnc)
vnc-3.3.3r2-6

[root@infowms_test1/data/database]#./rootpre.sh
./rootpre.sh output will be logged in /tmp/rootpre.out_19-08-26.16:14:25

Checking if group services should be configured....
Nothing to configure.

[root@infowms_test1/]#  xhost +
[root@infowms_test1/]#  su - oracle
[oracle@infowms_test1/home/oracle]#  export DISPLAY=10.xx.xx.xx:1.0
若出现乱码,选择以下其他一个LANG环境变量即可
[oracle@infowms_test1/home/oracle]#  export
[oracle@infowms_test1/home/oracle]#  export
[oracle@infowms_test1/home/oracle]#  cd /data
[oracle@infowms_test1/data]# cd database
[oracle@infowms_test1/data/database]# ./runInstaller

图形化安装过程省略... 自行解决。(建议仅仅安装数据库软件,后面通过DBCA建库)


3、安装最后执行2个脚本(root下执行)
[root@infowms_test1/]# /u01/app/oraInventory/orainstRoot.sh
[root@infowms_test1/]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh


4、返回图形化安装界面,确认即可,安装结束。

5、DBCA建库(注意字符集的选择、AMM或ASMM内存管理、专有服务器模式、进程数设置)

6、NETCA创建监听(或者手动配置listener.ora和tnsnames.ora文件,请查看网络配置文章)

7、Opatch PSU 打补丁(请查看PSU补丁文章)



Focus On Technology,Thanks To My Family And Friends ! 

                        ---Elegent_Shu---

猜你喜欢

转载自blog.51cto.com/14509409/2433435
今日推荐