ITPub博客

首页 > Linux操作系统 > Linux操作系统 > install 11G ASM on RedHat step by step

install 11G ASM on RedHat step by step

原创 Linux操作系统 作者:viadeazhu 时间:2010-03-10 21:40:22 0 删除 编辑

此文step by step配置一个单机11G ASM instance on RedHat 虚拟机。

首先假设你已经加上了4个500MB的硬盘,并且安装完毕RedHat操作系统和11GR2的oracle binary。

1.根据机器型号、操作系统版本和内核号,选择合适的ASMLIB下载:

http://otn.oracle.com/software/tech/linux/asmlib/

root@HaoRedHat: /export/home/oracle/asmlib > uname -r
2.6.18-8.el5

所以下载如下:

oracleasm-2.6.18-8.el5-2.0.4-1.el5.i686.rpm

oracleasm-support-2.1.3-1.el5.i386.rpm

oracleasmlib-2.0.4-1.el5.i386.rpm

然后安装packages:

root@HaoRedHat: /export/home/oracle/asmlib > rpm -Uvh *.rpm
warning: oracleasmlib-2.0.4-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:oracleasm-support      ########################################### [ 33%]
   2:oracleasm-2.6.18-8.el5 ########################################### [ 67%]
   3:oracleasmlib           ########################################### [100%]

2.配置ASMlib内核模块

root@HaoRedHat: /export/home/oracle/asmlib > /etc/init.d/oracleasm configure
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 without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: oracle
Default group to own the driver interface []: dba
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
Initializing the Oracle ASMLib driver: [  OK  ]
Scanning the system for Oracle ASMLib disks: [  OK  ]

此时模块已经启动:
root@HaoRedHat: /export/home/oracle/asmlib > lsmod | grep oracleasm
oracleasm              44436  1

3.对新加磁盘分区

首先在/dev目录下找到我所添加的4块新硬盘设备:

root@HaoRedHat: /dev > ls -altr sd*
brw-r----- 1 root disk 8,  0 Mar 11 05:11 sda
brw-r----- 1 root disk 8, 32 Mar 11 05:11 sdc
brw-r----- 1 root disk 8, 16 Mar 11 05:11 sdb
brw-r----- 1 root disk 8, 48 Mar 11 05:11 sdd

依次对此4硬盘分区,这里以一个为例:

root@HaoRedHat: /dev > fdisk /dev/sda
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4):
1
First cylinder (1-63, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-63, default 63):
Using default value 63

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

最后我们会看到:

root@HaoRedHat: /dev > ls -altr sd*1
brw-r----- 1 root disk 8,  1 Mar 11 06:12 sda1
brw-r----- 1 root disk 8, 17 Mar 11 06:19 sdb1
brw-r----- 1 root disk 8, 33 Mar 11 06:20 sdc1
brw-r----- 1 root disk 8, 49 Mar 11 06:20 sdd1

4.Create ASM Disks

root@HaoRedHat: /dev > /etc/init.d/oracleasm createdisk VOL1 /dev/sda1
Marking disk "VOL1" as an ASM disk: [  OK  ]
root@HaoRedHat: /dev > /etc/init.d/oracleasm createdisk VOL2 /dev/sdb1
Marking disk "VOL2" as an ASM disk: [  OK  ]
root@HaoRedHat: /dev > /etc/init.d/oracleasm createdisk VOL3 /dev/sdc1
Marking disk "VOL3" as an ASM disk: [  OK  ]
root@HaoRedHat: /dev > /etc/init.d/oracleasm createdisk VOL4 /dev/sdd1
Marking disk "VOL4" as an ASM disk: [  OK  ]

root@HaoRedHat: /dev > /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4

5.启动 +ASM instance

首先设置环境变量:

oracle@HaoRedHat: ~ > env|grep ORA
ORA_NLS10=/disk2/oracle/products/11r2/nls/data
ORACLE_SID=+ASM
ORACLE_BASE=/disk2/oracle/products
ORACLE_HOME=/disk2/oracle/products/11r2

初始化文件:

这里我们使用的是ASMlib,所以asm_diskstring应该这样写。

oracle@HaoRedHat: ~/products/11r2/dbs > cat init+ASM.ora
background_dump_dest='/export/home/oracle/asminstance/bdump'
user_dump_dest='/export/home/oracle/asminstance/udump'
core_dump_dest='/export/home/oracle/asminstance/cdump'
instance_type=asm
large_pool_size=12M
#asm_diskstring='/dev/rdsk/c3t19d*s4'
asm_diskstring='ORCL:VOL*'
remote_login_passwordfile='SHARED'

password file:

oracle@HaoRedHat: ~/products/11r2/dbs > orapwd file=orapw+ASM password=oracle

启动ASM instance:

oracle@HaoRedHat: ~ > env|grep ORA
ORA_NLS10=/disk2/oracle/products/11r2/nls/data
ORACLE_SID=+ASM
ORACLE_BASE=/disk2/oracle/products
ORACLE_HOME=/disk2/oracle/products/11r2
oracle@HaoRedHat: ~ > sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Thu Mar 11 17:52:11 2010

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORA-01078: failure in processing system parameters
ORA-29701: unable to connect to Cluster Synchronization Service

 

 

 

 

 

 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/15415488/viewspace-629180/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-08-22

  • 博文量
    79
  • 访问量
    392350