SUSE 11.1 安裝ORACLE 11.2.0.3 ASM非RAC雙機過程紀要

gaopengtttt發表於2014-01-10

SUSE 11.1 安裝ORACLE 11.2.0.3 ASM非RAC雙機過程紀要

增加使用者和組:
/usr/sbin/groupadd -g 501 oinstall
/usr/sbin/groupadd -g 502 dba
/usr/sbin/groupadd -g 503 oper
/usr/sbin/groupadd -g 504 asmadmin
/usr/sbin/groupadd -g 505 asmoper
/usr/sbin/groupadd -g 506 asmdba
useradd -u 502 -g oinstall -G dba,asmdba,oper oracle
useradd -u 501 -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid

建立目錄:
mkdir –p /home/app/
chown -R grid:oinstall /home/app/
chmod -R 775 /home/app/
mkdir -p /home/app/oraInventory
chown -R grid:oinstall /home/app/oraInventory
chmod -R 775 /home/app/oraInventory
mkdir -p /home/app/grid
mkdir -p /home/app/oracle
chown -R grid:oinstall /home/app/grid
chown -R oracle:oinstall /home/app/oracle
chmod -R 775 /home/app/oracle
chmod -R 775 /home/app/grid 

修改GRID環境變數
ORACLE_SID=+ASM; export ORACLE_SID
ORACLE_BASE=/home/app; export ORACLE_BASE
ORACLE_HOME=/home/app/grid; export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH; export PATH
export ORA_CRS_HOME=/home/app/grid   ---這一行SUSE下面必須加


需要安裝的包
 ksh-93t libaio-0.3.104 libaio-32bit-0.3.104 libaio-devel-0.3.104 libaio-devel-32bit-0.3.104 libstdc++33-3.3.3 libstdc++33-32bit-3.3.3 libstdc++43-4.3.3_20081022 libstdc++43-32bit-4.3.3_20081022 libstdc++43-devel-4.3.3_20081022 libstdc++43-devel-32bit-4.3.3_20081022 libgcc43-4.3.3_20081022 libstdc++-devel-4.3 make-3.81 sysstat-8.1.5


rpm -q binutils ksh  gcc gcc-c++ glibc-32bit glibc- glibc-devel-  glibc-devel-32bit  libaio- libaio-32bit- libelf- libgcc- libstdc++ libstdc++-devel make- sysstat- --qf '%{name}.%{arch}\n'|sort

新增裸裝置
/dev/raw
raw1:sdb
raw2:sdc
raw3:sdd
raw4:sde
raw5:sdf
raw6:sdg
raw7:sdh
raw8:sdi
raw9:sdj
raw10:sdk
raw11:sdl


rcraw start 繫結裝置。
然後chkconfig raw   on 開啟開機自動繫結。
設定裸裝置許可權
11.1和10.3 50-udev-default.rules檔案位置不一樣,如下:
/lib/udev/rules.d/50-udev-default.rules
改動
KERNEL=="rawctl",               NAME="raw/%k", GROUP="disk"
SUBSYSTEM=="raw", KERNEL=="raw[0-9]*", NAME="raw/%k", GROUP="dba", MODE="660", OWNER="grid"
修改限制
/etc/security/limits.conf
oracle  soft    nproc   2047
oracle  hard    nproc   16384
oracle  soft    nofile  1024
oracle  hard    nofile  65536
grid  soft    nproc   2047
grid  hard    nproc   16384
grid  soft    nofile  1024
grid  hard    nofile  65536

修改使用者限制
/etc/profile
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
              ulimit -u 16384
              ulimit -n 65536
        else
              ulimit -u 16384 -n 65536
        fi
        umask 022
fi

增加shm
/etc/fstab 加入一行
tmpfs                /dev/shm    tmpfs   defaults,size=11264m 0 0
mount -o remount /dev/shm
重新MOUNT一下


修改SYSCTL.CONF核心引數如下:
kernel.shmall = 4194304
kernel.shmmax = 17179869184
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576

需要加入
/etc/pam.d/login
session    required     pam_limits.so

規劃DG
/DATA1 4T
/DATA2 4T
/ARCH  3T

根據文件進行建立How To Setup ASM (11.2) On An Active/Passive Cluster (Non-RAC). (Doc ID 1296124.1)

安裝ORACLE軟體

ORACLE_SID=ismpdb; export ORACLE_SID
ORACLE_BASE=/home/app; export ORACLE_BASE
ORACLE_HOME=/home/app/oracle; export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH; export PATH
export ORA_CRS_HOME=/home/app/grid  ----這一行SUSE必須新增否者報錯

PRCR-1006 : 無法新增 ismpdb 的資源 ora.ismpdb.db
PRCR-1118 : 無法生成資源的資源許可權
PRKH-1013 : Oracle 主目錄 /opt/oracle/db/product/11.2.0/crs 不存在。


安裝過程中遇到錯誤
Installing 11gR2 Fails With [INS-30060] Check For Group Existence Failed (Doc ID 1268391.1)
原因是他們以前安裝過ORACLE軟體其/TMP下的CUV目錄許可權和使用者組不對

 

srvctl add database -d ismpdb -n ismpdb -o /home/app/oracle -p +DATA1/ISMPDB/spfileismpdb.ora -s OPEN -y AUTOMATIC -a DATA1,DATA2,ARCH -t IMMEDIATE
啟動資料庫srvctl start database -d ismpdb
報錯
PRCR-1079 : Failed to start resource ora.t11gr2.db
CRS-5010: Update of configuration file "/hostname/app/oracle/product/11.2.0/server_2/srvm/admin/oratab.bak.orcldevbal882" failed:
details at "(:CLSN00011:)" in "/orcldevbal882/app/grid/product/11.2.0.2/grid/log/orcldevbal882/agent/ohasd/oraagent_grid/oraagent_grid.log"
CRS-5010: Update of configuration file "/hostname/app/oracle/product/11.2.0/server_2/dbs/initt11gR2.ora" failed:
details at "(:CLSN00014:)" in "/orcldevbal882/app/grid/product/11.2.0.2/grid/log/orcldevbal882/agent/ohasd/oraagent_grid/oraagent_grid.log"
CRS-5017: The resource action "ora.t11gr2.db start" encountered the following error:
CRS-5010: Update of configuration file "/hostname/app/oracle/product/11.2.0/server_2/dbs/initt11gR2.ora" failed:
details at "(:CLSN00014:)" in "/orcldevbal882/app/grid/product/11.2.0.2/grid/log/orcldevbal882/agent/ohasd/oraagent_grid/oraagent_grid.log"
解決

其實就是許可權問題。

 

啟動LISTENER報錯
TNS-12555: TNS:permission denied
TNS-12560: TNS:protocol adapter error
  TNS-00525: Insufficient privilege for operation
   Linux Error: 1: Operation not permitted


 Listener Fails To Start With IPC Permission Errors (TNS-12546 TNS-12555 TNS-00516 TNS-00525) (Doc ID 434062.1)
 啟動LISTENER報了一個許可權不足的錯誤,這個由文章可以看出可能是由於不同的使用者啟動了LISTENER導致/TMP/.ORACLE裡面的執行檔案許可權不對。
 文件建議刪除,但是同時這個操作會導致RAC 的cluster 以及單例項ASM的環境崩潰,只能重啟伺服器
 所以建議如果出現這樣的問題一定要關閉資料庫,關閉CRS HAS後再刪除,然後重啟伺服器,不能冒昧的直接刪除。

 
配置浮動IP的時候注意BUG,如果新增一個IP

192.168.190.8是我手動加入的
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = tasm)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.190.8)(PORT = 1521))
    )
  )
報錯:
TNS-12542: TNS:address already in use
TNS-12560: TNS:protocol adapter error
TNS-00512: Address already in use
Linux Error: 98: Address already in use
需要修改tasm主機名為IP
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.190.4)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.190.8)(PORT = 1521))
    )
  )

參考:
Listener Fails to Start on Linux, Errors with TNS-12542, Linux Error: 98: Address already in use (Doc ID 301014.1)

安裝GRID AND DATABASE PSU
下載p17272731_112030_Linux-x86-64.zip,這個檔案包含了GID PSU和DATABASE PSU 我這個時候是11.2.0.3.8

按照要求下載最新的OPatch 6880880
解壓
然後使用命令
export JAVA_HOME=$ORACLE_HOME/jdk  -grid
/home/grid/OPatch/ocm/bin/emocmrsp  -grid
生成檔案ocm.rsp
驗證GRID和DATABASE 的HOME目錄可用

/home/grid/OPatch/opatch lsinventory -detail -oh /home/app/grid -grid
chmod 775 /home/app/oracle/cfgtoollogs  注意這個目錄需要賦權,不然不能執行 -root
/home/grid/OPatch/opatch lsinventory -detail -oh /home/app/oracle  -grid

使用root使用者解壓
 unzip p17272731_112030_.zip
停止所有ORCALE程式CRS DATABASE
 然後使用root使用者
 opatch auto -ocmrf
/home/grid/OPatch/opatch auto /soft/gidpsu  -ocmrf /home/grid/ocm.rsp\
我這裡報錯
Using configuration parameter file: /opt/app/11.2.0/grid/crs/install/crsconfig_params
Either does not exist or is not readable
Make sure the file exists and it has read and execute access
Clusterware home location does not exist
說明
opatch auto fails: Clusterware home location does not exist (Doc ID 1567205.1)
At the time of this writing, the bug is still being worked by Development.
The workaround is to apply the patch manually.
The manual instruction is part of patch readme, alternatively refer to the following for general instruction:
note 1494646.1 - Readme - Patch Installation and Deinstallation For 11.2.0.3.x GI PSU
只能手動進行升級安裝
參考
Readme - Patch Installation and Deinstallation For 11.2.0.3.x GI PSU (Doc ID 1494646.1)
第一步停止有所的ORACLE程式
第二步 root使用者
/home/app/grid/crs/install/roothas.pl -unlock 
第三步 grid使用者
 /OPatch/opatch napply -oh -local /
 /home/grid/OPatch/opatch napply -oh  /home/app/grid -local /soft/gidpsu/17076717
 報錯
 Copy Action: Source File "/soft/gidpsu/17076717/files/crs/demo/demoActionScript" does not exists or is not readable
'oracle.crs, 11.2.0.3.0': 無法將檔案從 'demoActionScript' 複製到 '/home/app/grid/crs/demo/demoActionScript'
注意一下許可權 chmod 777 -R 即可
第四步 grid使用者
/OPatch/opatch apply -oh -local /
 /home/grid/OPatch/opatch apply -oh  /home/app/grid -local /soft/gidpsu/16902043
第五步 oracle使用者
$ //custom/server//custom/scripts/prepatch.sh -dbhome
/soft/gidpsu/17076717/custom/server/17076717/custom/scripts/prepatch.sh -dbhome /home/app/oracle
第六步 oracle使用者
$ /OPatch/opatch napply -oh -local //custom/server/
/home/oracle/OPatch/opatch napply -oh  /home/app/oracle -local /soft/gidpsu/17076717/custom/server/17076717
這裡要注意一些許可權問題,以及以前升級的HISTROY檔案問題。
第七步 oracle使用者
$ /OPatch/opatch apply -oh -local /
/home/oracle/OPatch/opatch apply -oh  /home/app/oracle -local /soft/gidpsu/16902043
第八步 oracle使用者
//custom/server//custom/scripts/postpatch.sh -dbhome
/soft/gidpsu/17076717/custom/server/17076717/custom/scripts/postpatch.sh -dbhome /home/app/oracle
第九步驟 root使用者
/rdbms/install/rootadd_rdbms.sh
/home/app/grid/rdbms/install/rootadd_rdbms.sh
/crs/install/roothas.pl -patch
/home/app/grid/crs/install/roothas.pl -patch

NO09-ISMP-LXDB-01:/home/app/oracle/cfgtoollogs # /home/app/grid/crs/install/roothas.pl -patch
Using configuration parameter file: /home/app/grid/crs/install/crsconfig_params
CRS-4123: Oracle High Availability Services has been started.

第十步 將patch應用到資料庫
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql psu apply
SQL> QUIT


整個升級剛過程報錯基本都是許可權問題,因為有grid和oracle兩個使用者,注意一下報錯後檢視許可權修改即可,不過
這種升級過程比較複雜。

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

相關文章