ORACLE---Aix7.1 安裝Oracle11.2.0.4版本資料庫

記錄每一次錯誤發表於2020-05-07

===可參考support.oracle.com 官方安裝文件


===AIX下smit命令和smitty命令的區別
1、在字元介面:smitty和 smit效果是一樣的。
2、在圖形化介面:
啟動字元的 System Management 用smitty
啟動圖形的 System Management 用smit


===IBM AIX系統為rootvg實現映象  
[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---


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31547066/viewspace-2690435/,如需轉載,請註明出處,否則將追究法律責任。

相關文章