用户环境:
OS:IBM AIX 6.1
Database:Oracle Database 11gR2(11.2.0.3)
1.根据oracle官方建议修改OS相关参数
2.创建组和用户
mkgroup -A id=501 oinstall
mkgroup -A id=502 dba
mkgroup -A id=503 oper
mkgroup -A id=504 asmadmin
mkgroup -A id=505 asmoper
mkgroup -A id=506 asmdba
mkuser pgrp=oinstall groups=asmadmin,asmdba,asmoper,dba grid
mkuser pgrp=oinstall groups=dba,oper,asmdba oracle
配置.profile
# GRID Environment
export ORACLE_BASE=/oravl01/app/oracle
export ORACLE_HOME=/oravl01/app/11.2.0/grid
export PATH=$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:$GRID_HOME/bin:/usr/java5/jre/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/precomp/lib:$LD_LIBRARY_PATH
export LIBPATH=$ORACLE_HOME/lib
export AIXTHREAD_SCOPE=S
export ORACLE_TERM=vt100
export NLS_LANG=AMERICAN_AMERICA.zhs16gbk
# Oracle Environment
export ORACLE_UNQNAME=bidb
export ORACLE_BASE=/oravl01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/11.2.0/db_1
export GRID_HOME=/oravl01/app/11.2.0/grid
export ORACLE_SID=bidb
export PATH=$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:$GRID_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/precomp/lib:$LD_LIBRARY_PATH
export LIBPATH=$ORACLE_HOME/lib
export AIXTHREAD_SCOPE=S
export ORACLE_TERM=vt100
export NLS_LANG=AMERICAN_AMERICA.zhs16gbk
3.修改磁盘属性
chown grid:asmadmin rhdiskn
chmod 660 rhdiskn
4.Grid Infrastructure安装
安装过程中创建ASM DG
5.ORACLE数据库软件安装
6.DBCA建库
至此,节点一的数据库安装完成(此时就是一台单实例数据库)
节点一上,grid用户停止所有资源
jxhdb:grid:/home/grid> crsctl stop has
root用户执行:
tar cfv ora.tar /oravl01
(grid、oracle软件都安装在/oravl01)
tar完成后,ftp到节点二
接下来的操作都在第二个节点上
重复上面的节点一上的1、2、3步
然后再将节点一的tar解开(root用户执行)
cd /
tar xvf ora.tar
解开后,继续root用户执行:
# /oravl01/app/oraInventory/orainstRoot.sh
Changing permissions of /oravl01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /oravl01/app/oraInventory to oinstall.
The execution of the script. is complete.
# /oravl01/app/11.2.0/grid/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /oravl01/app/11.2.0/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Creating /usr/local/bin directory...
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
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 script.
Now product-specific root actions will be performed.
Using configuration parameter file: /oravl01/app/11.2.0/grid/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'system'..
Operation successful.
CRS-4664: Node jxhdb2 successfully pinned.
Adding Clusterware entries to inittab
jxhdb2 2012/02/08 13:41:21 /oravl01/app/11.2.0/grid/cdata/jxhdb2/backup_20120208_134121.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
如上配置还有另一个方法:
CSS & OHAS services as root user:
# $/crs/install/roothas.pl -deconfig -force
# $/crs/install/roothas.pl
# /oravl01/app/oracle/11.2.0/db_1/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /oravl01/app/oracle/11.2.0/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
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 script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
将cssd设置为自动启动:
jxhdb2:grid:/oravl01/app/oracle>crsctl modify resource "ora.cssd" -attr "AUTO_START=1"
由于ora.diskmon在11.2.0.3状态为offline是正常的,可不用管它
ID 1346881.1
As Grid Infrastructure daemon diskmon.bin is used for Exadata fencing, started from 11.2.0.3, resource ora.diskmon will be offline in non-Exadata environment. This is expected behaviour change.
用grid在图形界面下reconfig监听
jxhdb2:grid:/oravl01/app/oracle>srvctl add LISTENER
jxhdb2:grid:/oravl01/app/oracle>srvctl add asm
jxhdb2:grid:/oravl01/app/oracle>crsctl modify resource "ora.asm" -attr "AUTO_START=1"
jxhdb2:grid:/oravl01/app/oracle>crsctl start resource ora.cssd (不手动启动一次cssd,后面通过crsctl start has是不能启动的,我做过几次都这样,请大家注意)
CRS-2672: Attempting to start 'ora.cssd' on 'jxhdb2'
CRS-2672: Attempting to start 'ora.diskmon' on 'jxhdb2'
CRS-2676: Start of 'ora.diskmon' on 'jxhdb2' succeeded
CRS-2676: Start of 'ora.cssd' on 'jxhdb2' succeeded
jxhdb2:grid:/>crsctl stop has
jxhdb2:grid:/>crsctl start has
jxhdb2:grid:/>crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.DGDATA1.dg ora....up.type 0/5 0/ ONLINE ONLINE jxhdb2
ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE jxhdb2
ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE jxhdb2
ora.cssd ora.cssd.type 0/5 0/5 ONLINE ONLINE jxhdb2
ora.diskmon ora....on.type 0/10 0/5 OFFLINE OFFLINE
ora.evmd ora.evm.type 0/10 0/5 ONLINE ONLINE jxhdb2
ora.ons ora.ons.type 0/3 0/ OFFLINE OFFLINE
如果DG offline应手动mount
jxhdb2:grid:/oravl01/app/11.2.0/>sqlplus / as sysasm
SQL> alter diskgroup DGDATA1 mount;
最后把数据库加入:
jxhdb2:oracle:/>srvctl add database -d bidb -o /oravl01/app/oracle/11.2.0/db_1
jxhdb2:grid:/>crsctl stop has
jxhdb2:grid:/>crsctl start has
jxhdb2:oracle:/home/oracle>crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.DGDATA1.dg ora....up.type 0/5 0/ ONLINE ONLINE jxhdb2
ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE jxhdb2
ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE jxhdb2
ora.bidb.db ora....se.type 0/2 0/1 ONLINE ONLINE jxhdb2
ora.cssd ora.cssd.type 0/5 0/5 ONLINE ONLINE jxhdb2
ora.diskmon ora....on.type 0/10 0/5 OFFLINE OFFLINE
ora.evmd ora.evm.type 0/10 0/5 ONLINE ONLINE jxhdb2
ora.ons ora.ons.type 0/3 0/ OFFLINE OFFLINE
ASM HA配置完成。