11g單機使用asm

安佰勝發表於2012-01-04
 
11g單機使用asm
 
=========================
 
和10g不同,11g中如果要單機使用asm需要安裝grid frastructure元件
安裝軟體就在grid包中,安裝時選擇第二個選項就能進入這個元件的安裝
具體安裝步驟如下:
10g單機使用asm的方法可以參考
http://space.itpub.net/13177610/viewspace-713292
 
-------------------------------
 
--安裝依賴的rpm包
--rpms
 
oracleasm-support-2.1.7-1.el5.i386.rpm
oracleasmlib-2.0.4-1.el5.i386.rpm
oracleasm-2.6.18-194.el5xen-2.0.5-1.el5.i686.rpm
 
--asm對應的磁碟
--sdb,大小5g
--對sdb只進行fdisk,不建立檔案系統

fdisk -l
fdisk /dev/sdb
--config asmdisks
oracleasm configure
oracleasm createdisk DATA /dev/sdb1
oracleasm scandisks
oracleasm listdisks
-----------------
--create groups and users
groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 asmadmin
groupadd -g 505 asmoper
groupadd -g 506 asmdba
useradd -g oinstall -G dba,asmdba,oper oracle
useradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid
 
mkdir -p /oracle/app/oracle/product/11.2.0/dbhome
mkdir -p /oracle/app/grid/product/11.2.0/grid
chown -R oracle:oinstall /oracle/app/
chown -R grid:oinstall /oracle/app/grid
chmod -R 775 /oracle/
passwd grid
passwd oracle
# vi /etc/security/limits.conf
#ORACLE SETTING
grid                 soft    nproc   2047
grid                 hard    nproc   16384
grid                 soft    nofile  1024
grid                 hard    nofile  65536
oracle               soft    nproc   2047
oracle               hard    nproc   16384
oracle               soft    nofile  1024
oracle               hard    nofile  65536
# vi /etc/pam.d/login
#ORACLE SETTING
session    required     pam_limits.so
# vi /etc/sysctl.conf
#ORACLE SETTING
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586

gird時間同步所需要的設定
Network Time Protocol Setting
/sbin/service ntpd stop
chkconfig ntpd off
rm /etc/ntp.conf

-----------------
--envs
#grid
ORACLE_SID=+ASM; export ORACLE_SID
ORACLE_BASE=/oracle/app/grid; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/grid; export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LANG=C; export LANG
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
              ulimit -p 16384
              ulimit -n 65536
        else
              ulimit -u 16384 -n 65536
        fi
        umask 022
fi
 
#oracle
ORACLE_BASE=/oracle/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome; export ORACLE_HOME
ORACLE_SID=DB11; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
LANG=C; export LANG
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
              ulimit -p 16384
              ulimit -n 65536
        else
              ulimit -u 16384 -n 65536
        fi
        umask 022
fi

---------------------
--install grid infrstruncture
--安裝沒什麼可說的
--不過安裝完軟體執行root.sh指令碼報錯,如下
--這個報錯會導致叢集不能正確配置
--最終導致安裝失敗
--在網上查了下,是個bug
--處理方法是執行root.sh指令碼後到/var/tmp/.oracle中等著
--當出現檔案npohasd後執行如下命令
--dd if=/var/tmp/.oracle/npohasd f=/dev/null bs=1024 count=1
--之後就不會報錯
--錯誤如下
[root@localhost grid]# sh root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /oracle/app/grid/product/11.2.0/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying coraenv to /usr/local/bin ...

Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
2012-01-04 11:57:57: Checking for super user privileges
2012-01-04 11:57:57: User has super user privileges
2012-01-04 11:57:57: Parsing the host name
Using configuration parameter file: /oracle/app/grid/product/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
CRS-4664: Node localhost successfully pinned.
Adding daemon to inittab
CRS-4124: Oracle High Availability Services startup failed.
CRS-4000: Command Start failed, or completed with errors.
ohasd failed to start: Inappropriate ioctl for device
ohasd failed to start: Inappropriate ioctl for device at /oracle/app/grid/product/11.2.0/grid/crs/install/roothas.pl line 296.
 
--其他沒什麼好說的
--圖形介面點而已
--之後安裝資料庫軟體、建立資料庫
--參考了下面的內容
--比較詳細
 

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

相關文章