加载中…
正文 字体大小:

一个单节点的rac

(2011-11-01 20:51:20)
标签:

oracle

rac

grid

redhat

x86_64

vmware

workstation

杂谈

花了300块钱买了8G内存,本想用vmware创建两个虚拟机,来装个rac,但是因为两个虚拟机的共享盘没

有搞定,没有成功。同事说需要Vmware server版。无奈只好先在一个节点上装了grid。记下来,免得忘

记了。
一、 环境
Vmware workstation 8 创建了两个虚拟机,安装了64bit的redhat 5.6。
 一个单节点的rac

二、 安装ASMLIB
根据oracle文档,LINUX上安装asm,需要安装oracleasm-support-version.arch.rpm
oracleasm-kernel-version.arch.rpm
oracleasmlib-version.arch.rpm,下载地址如下:
http://www.oracle.com/technology/tech/linux/asmlib/index.html
[root@lin01 tmp]# rpm -Uvh oracleasm-support-2.1.7-1.el5.x86_64.rpm
warning: oracleasm-support-2.1.7-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID

1e5e0159
Preparing...                ########################################### [100%]
   1:oracleasm-support      ########################################### [100%]
 [root@lin01 tmp]# rpm -Uvh oracleasm-2.6.18-238.el5-2.0.5-1.el5.x86_64.rpm
warning: oracleasm-2.6.18-238.el5-2.0.5-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY,

key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:oracleasm-2.6.18-238.el########################################### [100%]
 [root@lin01 tmp]# rpm -Uvh oracleasmlib-2.0.4-1.el5.x86_64.rpm
warning: oracleasmlib-2.0.4-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID

1e5e0159
Preparing...                ########################################### [100%]
   1:oracleasmlib           ########################################### [100%]
[root@lin01 tmp]#
然后执行oracleasm configure -i
[root@lin01 tmp]# oracleasm configure -i
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: grid
Default group to own the driver interface []: oinstall
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
[root@lin01 tmp]#

[root@lin01 tmp]# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Mounting ASMlib driver filesystem: /dev/oracleasm
操作一下需要做成磁盘组的磁盘:此处是/dev/sdc1
Oracleasm createdisk DISK1 /dev/sdc1
三、 配置NTP
将/etc/sysconfig/ntpd内容改成如下这样。
# Drop root to id 'ntp:ntp' by default.
OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"

# Set to 'yes' to sync hw clock after successful ntpdate
SYNC_HWCLOCK=no

# Additional options for ntpdate
NTPDATE_OPTIONS=""
然后chkconfig –level 235 ntpd on
Service ntpd start  开启ntp。
四、 创建用户和组。
省略步骤。
[root@lin01 logs]# id oracle
uid=1101(oracle) gid=1000(oinstall) groups=1000(oinstall),1200(dba),1204(asmdba)
[root@lin01 logs]# id grid
uid=1100(grid) gid=1000(oinstall) groups=1000(oinstall),1202(asmadmin),1203(asmoper),1204

(asmdba)
[root@lin01 logs]#
五、 修改几个文件
将 /etc/security/limits.conf添加如下内容:
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
向文件/etc/pam.d/login添加如下一行
session    required     pam_limits.so
向文件/etc/profile file 最后添加如下内容:
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
六、 内核参数修改
修改文件/etc/sysctl.conf 将如下项修改或添加:
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

执行sysctl –p
七、 安装所需的rpm包
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
elfutils-libelf-devel-static-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-common-2.5
glibc-devel-2.5
glibc-headers-2.5
kernel-headers-2.6.18
ksh-20060214
libaio-0.3.106
libaio-devel-0.3.106
libgcc-4.1.2
libgomp-4.1.2
libstdc++-4.1.2
libstdc++-devel-4.1.2
make-3.81
sysstat-7.0.2
unixODBC-2.2.11
unixODBC-devel-2.2.11
系统中没有就去安装盘中去找。
八、 Hosts文件
127.0.0.1               localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6

192.168.37.129   LIN01
192.168.37.130   LIN02

172.16.1.1    LIN01-adm
172.16.1.2    LIN02-adm

192.168.37.131   LIN

10.1.1.1     LIN01-priv1
10.1.1.2     LIN02-priv1

192.168.37.141  LIN01-vip
192.168.37.142  LIN02-vip
192.168.37.143  LIN-scan

[root@lin01 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:44:FE:AD 
          inet addr:192.168.37.129  Bcast:192.168.37.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2255 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2010 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:185272 (180.9 KiB)  TX bytes:359490 (351.0 KiB)

eth1      Link encap:Ethernet  HWaddr 00:0C:29:44:FE:B7 
          inet addr:172.16.1.1  Bcast:172.16.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:425 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3025 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:77490 (75.6 KiB)  TX bytes:226851 (221.5 KiB)

eth2      Link encap:Ethernet  HWaddr 00:0C:29:44:FE:C1 
          inet addr:10.1.1.1  Bcast:10.1.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4127 errors:0 dropped:0 overruns:0 frame:0
          TX packets:220 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:354793 (346.4 KiB)  TX bytes:37454 (36.5 KiB)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:19137 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19137 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:10755766 (10.2 MiB)  TX bytes:10755766 (10.2 MiB)

九、 开始安装
 一个单节点的rac

一个单节点的rac

一个单节点的rac

一个单节点的rac

一个单节点的rac

一个单节点的rac

一个单节点的rac

一个单节点的rac

一个单节点的rac

一个单节点的rac

一个单节点的rac

一个单节点的rac

一个单节点的rac

一个单节点的rac

一个单节点的rac

一个单节点的rac
 
不要点确定,去用root执行root.sh
[root@lin01 grid]# ./root.sh
Running Oracle 11g root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/11.2/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.
2011-11-01 19:32:59: Parsing the host name
2011-11-01 19:32:59: Checking for super user privileges
2011-11-01 19:32:59: User has super user privileges
Using configuration parameter file: /u01/11.2/grid/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
  root wallet
  root wallet cert
  root cert export
  peer wallet
  profile reader wallet
  pa wallet
  peer wallet keys
  pa wallet keys
  peer cert request
  pa cert request
  peer cert
  pa cert
  peer root cert TP
  profile reader root cert TP
  pa root cert TP
  peer pa cert TP
  pa peer cert TP
  profile reader pa cert TP
  profile reader peer cert TP
  peer user cert
  pa user cert
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting
CRS-2672: Attempting to start 'ora.gipcd' on 'lin01'
CRS-2672: Attempting to start 'ora.mdnsd' on 'lin01'
CRS-2676: Start of 'ora.gipcd' on 'lin01' succeeded
CRS-2676: Start of 'ora.mdnsd' on 'lin01' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'lin01'
CRS-2676: Start of 'ora.gpnpd' on 'lin01' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'lin01'
CRS-2676: Start of 'ora.cssdmonitor' on 'lin01' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'lin01'
CRS-2672: Attempting to start 'ora.diskmon' on 'lin01'
CRS-2676: Start of 'ora.diskmon' on 'lin01' succeeded
CRS-2676: Start of 'ora.cssd' on 'lin01' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'lin01'
CRS-2676: Start of 'ora.ctssd' on 'lin01' succeeded

ASM created and started successfully.

DiskGroup OCR_TST created successfully.

clscfg: -install mode specified
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-2672: Attempting to start 'ora.crsd' on 'lin01'
CRS-2676: Start of 'ora.crsd' on 'lin01' succeeded
CRS-4256: Updating the profile
Successful addition of voting disk 115ddde948684f0abf20d1c0d333b39d.
Successfully replaced voting disk group with +OCR_TST.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   115ddde948684f0abf20d1c0d333b39d (ORCL:DISK1) [OCR_TST]
Located 1 voting disk(s).
CRS-2673: Attempting to stop 'ora.crsd' on 'lin01'
CRS-2677: Stop of 'ora.crsd' on 'lin01' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'lin01'
CRS-2677: Stop of 'ora.asm' on 'lin01' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'lin01'
CRS-2677: Stop of 'ora.ctssd' on 'lin01' succeeded
CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'lin01'
CRS-2677: Stop of 'ora.cssdmonitor' on 'lin01' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'lin01'
CRS-2677: Stop of 'ora.cssd' on 'lin01' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'lin01'
CRS-2677: Stop of 'ora.gpnpd' on 'lin01' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'lin01'
CRS-2677: Stop of 'ora.gipcd' on 'lin01' succeeded
CRS-2673: Attempting to stop 'ora.mdnsd' on 'lin01'
CRS-2677: Stop of 'ora.mdnsd' on 'lin01' succeeded
CRS-2672: Attempting to start 'ora.mdnsd' on 'lin01'
CRS-2676: Start of 'ora.mdnsd' on 'lin01' succeeded
CRS-2672: Attempting to start 'ora.gipcd' on 'lin01'
CRS-2676: Start of 'ora.gipcd' on 'lin01' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'lin01'
CRS-2676: Start of 'ora.gpnpd' on 'lin01' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'lin01'
CRS-2676: Start of 'ora.cssdmonitor' on 'lin01' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'lin01'
CRS-2672: Attempting to start 'ora.diskmon' on 'lin01'
CRS-2676: Start of 'ora.diskmon' on 'lin01' succeeded
CRS-2676: Start of 'ora.cssd' on 'lin01' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'lin01'
CRS-2676: Start of 'ora.ctssd' on 'lin01' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'lin01'
CRS-2676: Start of 'ora.asm' on 'lin01' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'lin01'
CRS-2676: Start of 'ora.crsd' on 'lin01' succeeded
CRS-2672: Attempting to start 'ora.evmd' on 'lin01'
CRS-2676: Start of 'ora.evmd' on 'lin01' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'lin01'
CRS-2676: Start of 'ora.asm' on 'lin01' succeeded
CRS-2672: Attempting to start 'ora.OCR_TST.dg' on 'lin01'
CRS-2676: Start of 'ora.OCR_TST.dg' on 'lin01' succeeded
CRS-2672: Attempting to start 'ora.registry.acfs' on 'lin01'
CRS-2676: Start of 'ora.registry.acfs' on 'lin01' succeeded

lin01     2011/11/01 19:38:33     /u01/11.2/grid/cdata/lin01/backup_20111101_193833.olr
Configure Oracle Grid Infrastructure for a Cluster ... succeeded
Updating inventory properties for clusterware
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 3999 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/oraInventory
'UpdateNodeList' was successful.
[root@lin01 grid]#
现在回到安装画面,点确定,完成安装。
 一个单节点的rac

忽略这个错误。
验证一下安装成果:
[grid@lin01 ~]$ asmcmd
ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB 

Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN         512   4096  1048576     20473    20120                       

 20120                         OCR_TST/
ASMCMD> exit
[grid@lin01 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS      
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       lin01                                       
ora.OCR_TST.dg
               ONLINE  ONLINE       lin01                                       
ora.asm
               ONLINE  ONLINE       lin01                    Started            
ora.eons
               ONLINE  ONLINE       lin01                                       
ora.gsd
               OFFLINE OFFLINE      lin01                                       
ora.net1.network
               ONLINE  ONLINE       lin01                                       
ora.ons
               ONLINE  ONLINE       lin01                                       
ora.registry.acfs
               ONLINE  ONLINE       lin01                                       
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
            ONLINE  ONLINE       lin01                                       
ora.lin01.vip
            ONLINE  ONLINE       lin01                                       
ora.oc4j
            OFFLINE OFFLINE                                                  
ora.scan1.vip
            ONLINE  ONLINE       lin01                                       
[grid@lin01 ~]$

查看网卡状况,可以看到vip和scan ip已经在eth0上了。
[root@lin01 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:44:FE:AD 
          inet addr:192.168.37.129  Bcast:192.168.37.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2255 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2010 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:185272 (180.9 KiB)  TX bytes:359490 (351.0 KiB)

eth0:1    Link encap:Ethernet  HWaddr 00:0C:29:44:FE:AD 
          inet addr:192.168.37.141  Bcast:192.168.37.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

eth0:2    Link encap:Ethernet  HWaddr 00:0C:29:44:FE:AD 
          inet addr:192.168.37.143  Bcast:192.168.37.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

eth1      Link encap:Ethernet  HWaddr 00:0C:29:44:FE:B7 
          inet addr:172.16.1.1  Bcast:172.16.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:425 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3025 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:77490 (75.6 KiB)  TX bytes:226851 (221.5 KiB)

eth2      Link encap:Ethernet  HWaddr 00:0C:29:44:FE:C1 
          inet addr:10.1.1.1  Bcast:10.1.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4127 errors:0 dropped:0 overruns:0 frame:0
          TX packets:220 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:354793 (346.4 KiB)  TX bytes:37454 (36.5 KiB)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:19137 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19137 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:10755766 (10.2 MiB)  TX bytes:10755766 (10.2 MiB)
待续...

阅读 评论 收藏 转载 喜欢 打印举报
已投稿到:
  • 评论加载中,请稍候...
发评论

       

    验证码: 请点击后输入验证码 收听验证码

    发评论

    以上网友发言只代表其个人观点,不代表新浪网的观点或立场。

      

    新浪BLOG意见反馈留言板 不良信息反馈 电话:4006900000 提示音后按1键(按当地市话标准计费) 欢迎批评指正

    新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 会员注册 | 产品答疑

    新浪公司 版权所有