Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2406990
  • 博文数量: 384
  • 博客积分: 10193
  • 博客等级: 上将
  • 技术积分: 3785
  • 用 户 组: 普通用户
  • 注册时间: 2005-06-09 18:02
文章分类

全部博文(384)

文章存档

2011年(10)

2010年(29)

2009年(39)

2008年(36)

2007年(43)

2006年(198)

2005年(29)

分类: Oracle

2006-07-21 18:03:02

在Linux下的Oracle 10g (R1或者R2) 如果使用asm来存储数据, 可以安装asmlib来简化磁盘管理, asmlib有3个软件包组成

oracleasm-support-version.arch.rpm
oracleasm-kernel-version.arch.rpm
oracleasmlib-version.arch.rpm

其中oracleasm-kernel-version.arch.rpm包含了一个内核模块, 这个模块与系统当前使用的内核密切相关. 如果安装光盘相关目录下的oracleasm-kernel版本和当前系统使用的内核版本不一致, 可以从下载想对应的版本.

对于rhel AS3U5, 内核版本为kernel-2.4.21-32.EL, 下载的软件包分别为





对于rhel AS4U2, 内核版本为kernel-2.6.9-22.EL, 下载的软件包分别为





安装过程分别如下:

[root@rhel3u5 root]# rpm -Uvh oracleasm-2.4.21-32.EL-1.0.4-1.i686.rpm oracleasm-support-2.0.2-1.i386.rpm oracleasmlib-2.0.2-1.i386.rpm
Preparing...                ########################################### [100%]
   1:oracleasm-support      ########################################### [ 33%]
   2:oracleasm-2.4.21-32.EL ########################################### [ 67%]
   3:oracleasmlib           ########################################### [100%]
[root@rhel3u5 root]#

[root@rhel4u2 ~]# rpm -Uvh oracleasm-2.6.9-22.EL-2.0.2-1.i686.rpm oracleasm-support-2.0.2-1.i386.rpm oracleasmlib-2.0.2-1.i386.rpm
Preparing...                ########################################### [100%]
   1:oracleasm-support      ########################################### [ 33%]
   2:oracleasm-2.6.9-22.EL  ########################################### [ 67%]
   3:oracleasmlib           ########################################### [100%]
[root@rhel4u2 ~]#

rhel AS3U5下asmlib配置过程如下:

启动oracle asmlib

[root@rhel3u5 root]# /etc/init.d/oracleasm start
Creating /dev/oracleasm mount point:                       [  OK  ]

起用asmlib

[root@rhel3u5 root]# /etc/init.d/oracleasm enable
Writing Oracle ASM library driver configuration:           [  OK  ]
Loading module "oracleasm":                                [  OK  ]
Mounting ASMlib driver filesystem:                         [  OK  ]
Scanning system for ASM disks:                             [  OK  ]

配置asmlib

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) [y]:
Fix permissions of Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration:           [  OK  ]
Scanning system for ASM disks:                             [  OK  ]

增加磁盘

[root@rhel3u5 root]# /etc/init.d/oracleasm createdisk DISK1 /dev/sdb1
Marking disk "/dev/sdb1" as an ASM disk: [root@rhel3u5 root]#
[root@rhel3u5 root]# /etc/init.d/oracleasm createdisk DISK2 /dev/sdc1
Marking disk "/dev/sdc1" as an ASM disk: [root@rhel3u5 root]#

asmlib只可以配置磁盘分区. 不可以配置整个磁盘

[root@rhel4u2 ~]# /etc/init.d/oracleasm createdisk DISK3 /dev/sdd
Marking disk "/dev/sdd" as an ASM disk: asmtool: Device "/dev/sdd" is not a partition
                                                           [FAILED]

显示当前磁盘

[root@rhel3u5 root]# /etc/init.d/oracleasm listdisks
DISK1
DISK2

建立asm实例时, 需要指定磁盘搜索路径为'ORCL:*', 才可以找到磁盘.

asm实例建成后, 可查询磁盘组中磁盘的情况:

SQL> col label for a7
SQL> col path for a10
SQL> /

GROUP_NUMBER DISK_NUMBER NAME                           LABEL   PATH
------------ ----------- ------------------------------ ------- ----------
           1           0 DISK1                          DISK1   ORCL:DISK1
           1           1 DISK2                          DISK2   ORCL:DISK2

使用asmlib的好处是不受raw数量的限制(在linux2.4中, raw设备不能超过256个, linux2.6中,最多不能超过4096个).










阅读(3709) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~