Oracle ASM磁盘-安装配置
2014-01-03 15:51
671 查看
总结一下ASM的磁盘创建过程
此次实验是基于CentOS 4.6系统的实验,
1.首先,我需要在Oracle的网站上download的一些ASM的lib包
http://www.oracle.com/technology/tech/linux/asmlib/install.html
因为自己实验的环境是基于Linux的,而且是RHEL AS 4所以会根据当前的kernel和OS的版本下载三个包
分别是:
oracleasm-2.6.9-67.EL-2.0.3-1.i686.rpm
oracleasmlib-2.0.2-1.i386.rpm
oracleasm-support-2.0.3-1.i386.rpm
2.之后可以通过RPM的软件对他们分别进行安装
[root@orahost01 ASM]# rpm -Uvh oracleasm-support-2.0.3-1.i386.rpm
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [100%]
[root@orahost01 ASM]# rpm -Uvh oracleasm-2.6.9-67.EL-2.0.3-1.i686.rpm
Preparing... ########################################### [100%]
1:oracleasm-2.6.9-67.EL ########################################### [100%]
[root@orahost01 ASM]# rpm -Uvn oracleasmlib-2.0.2-1.i386.rpm
-Uvn: unknown option
[root@orahost01 ASM]# rpm -Uvh oracleasmlib-2.0.2-1.i386.rpm
Preparing... ########################################### [100%]
1:oracleasmlib ########################################### [100%]
并且创建相应的Oracle用户和组
[root@orahost01 ASM]# groupadd oinstall
[root@orahost01 ASM]# groupadd dba
[root@orahost01 ASM]# mkdir -p /opt/oracle/product
[root@orahost01 ASM]# mkdir -p /home/oracle
[root@orahost01 ASM]# useradd -g oinstall -G dba -d /home/oracle oracle
[root@orahost01 ASM]# passwd oracle
Changing password for user oracle.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@orahost01 ASM]# id oracle
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
[root@orahost01 ASM]# chown -R oracle:oinstall /opt/oracle
[root@orahost01 ASM]# cd /home
[root@orahost01 home]# chown -R oracle:oinstall oracle
3.配置ASM的库文件
[root@orahost01 home]#/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 <ENTER> 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]: y
Writing Oracle ASM library driver configuration: [ OK ]
Creating /dev/oracleasm mount point: [ OK ]
Loading module "oracleasm": [ OK ]
Mounting ASMlib driver filesystem: [ OK ]
Scanning system for ASM disks: [ OK ]
以上操作会加载和ASM相关的一些.o的驱动.并且mount上asm的文件系统
4.如何disable和enable ASM
[root@orahost01 home]#/etc/init.d/oracleasm disable
Writing Oracle ASM library driver configuration: [ OK ]
Unmounting ASMlib driver filesystem: [ OK ]
Unloading module "oracleasm": [ OK ]
[root@orahost01 home]#/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 ]
5.创建ASM磁盘
首先先将一些磁盘(4块)插入我们的Server
之后
[root@orahost01 home]# /etc/init.d/oracleasm createdisk myVol1 /dev/sdb
Marking disk "/dev/sdb" as an ASM disk: asmtool: Device "/dev/sdb" is not a partition
[FAILED]
这里出现错误的原因是由于我们还没有对/dev/sdb这个设备文件所加载的磁盘进行分区,而且sdb也不是一个partition
因此我们先对sdb磁盘进行分区
[root@orahost01 dev]#fdisk sdb
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): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-130, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130, default 130):
Using default value 130
Command (m for help):w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
这个时候系统中会出现一个sdb1这个设备文件
之后我们继续对sdc,sdd,sde以上面同样的方法来进行分区。
------------------------------------------------------
重新创建ASM磁盘
[root@orahost01 dev]# /etc/init.d/oracleasm createdisk myVol1 /dev/sdb1
Marking disk "/dev/sdb1" as an ASM disk: [ OK ]
[root@orahost01 dev]# /etc/init.d/oracleasm listdisks
MYVOL1
[root@orahost01 dev]# /etc/init.d/oracleasm createdisk myVol2 /dev/sdc1
Marking disk "/dev/sdc1" as an ASM disk: [ OK ]
[root@orahost01 dev]# /etc/init.d/oracleasm createdisk myVol3 /dev/sde1
Marking disk "/dev/sde1" as an ASM disk: [ OK ]
[root@orahost01 dev]# /etc/init.d/oracleasm createdisk myVol4 /dev/sdd1
Marking disk "/dev/sdd1" as an ASM disk: [ OK ]
[root@orahost01 dev]#/etc/init.d/oracleasm listdisks
MYVOL1
MYVOL2
MYVOL3
MYVOL4
需要注意的是如果是在RAC环境中呢,如果在一个节点添加了ASM磁盘,在其他节点上要用过scandisks命令来获得这种变化。
如:
[root@orahost01 dev]#/etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [ OK ]
就此ASM环境的物理基础就已经搭建成功.
其他OS类似于此,很简单,只要按照这个思路走就可以了:)
文章转载自网管之家:http://www.bitscn.com/pdb/oracle/200811/154448.html
此次实验是基于CentOS 4.6系统的实验,
1.首先,我需要在Oracle的网站上download的一些ASM的lib包
http://www.oracle.com/technology/tech/linux/asmlib/install.html
因为自己实验的环境是基于Linux的,而且是RHEL AS 4所以会根据当前的kernel和OS的版本下载三个包
分别是:
oracleasm-2.6.9-67.EL-2.0.3-1.i686.rpm
oracleasmlib-2.0.2-1.i386.rpm
oracleasm-support-2.0.3-1.i386.rpm
2.之后可以通过RPM的软件对他们分别进行安装
[root@orahost01 ASM]# rpm -Uvh oracleasm-support-2.0.3-1.i386.rpm
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [100%]
[root@orahost01 ASM]# rpm -Uvh oracleasm-2.6.9-67.EL-2.0.3-1.i686.rpm
Preparing... ########################################### [100%]
1:oracleasm-2.6.9-67.EL ########################################### [100%]
[root@orahost01 ASM]# rpm -Uvn oracleasmlib-2.0.2-1.i386.rpm
-Uvn: unknown option
[root@orahost01 ASM]# rpm -Uvh oracleasmlib-2.0.2-1.i386.rpm
Preparing... ########################################### [100%]
1:oracleasmlib ########################################### [100%]
并且创建相应的Oracle用户和组
[root@orahost01 ASM]# groupadd oinstall
[root@orahost01 ASM]# groupadd dba
[root@orahost01 ASM]# mkdir -p /opt/oracle/product
[root@orahost01 ASM]# mkdir -p /home/oracle
[root@orahost01 ASM]# useradd -g oinstall -G dba -d /home/oracle oracle
[root@orahost01 ASM]# passwd oracle
Changing password for user oracle.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@orahost01 ASM]# id oracle
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
[root@orahost01 ASM]# chown -R oracle:oinstall /opt/oracle
[root@orahost01 ASM]# cd /home
[root@orahost01 home]# chown -R oracle:oinstall oracle
3.配置ASM的库文件
[root@orahost01 home]#/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 <ENTER> 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]: y
Writing Oracle ASM library driver configuration: [ OK ]
Creating /dev/oracleasm mount point: [ OK ]
Loading module "oracleasm": [ OK ]
Mounting ASMlib driver filesystem: [ OK ]
Scanning system for ASM disks: [ OK ]
以上操作会加载和ASM相关的一些.o的驱动.并且mount上asm的文件系统
4.如何disable和enable ASM
[root@orahost01 home]#/etc/init.d/oracleasm disable
Writing Oracle ASM library driver configuration: [ OK ]
Unmounting ASMlib driver filesystem: [ OK ]
Unloading module "oracleasm": [ OK ]
[root@orahost01 home]#/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 ]
5.创建ASM磁盘
首先先将一些磁盘(4块)插入我们的Server
之后
[root@orahost01 home]# /etc/init.d/oracleasm createdisk myVol1 /dev/sdb
Marking disk "/dev/sdb" as an ASM disk: asmtool: Device "/dev/sdb" is not a partition
[FAILED]
这里出现错误的原因是由于我们还没有对/dev/sdb这个设备文件所加载的磁盘进行分区,而且sdb也不是一个partition
因此我们先对sdb磁盘进行分区
[root@orahost01 dev]#fdisk sdb
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): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-130, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130, default 130):
Using default value 130
Command (m for help):w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
这个时候系统中会出现一个sdb1这个设备文件
之后我们继续对sdc,sdd,sde以上面同样的方法来进行分区。
------------------------------------------------------
重新创建ASM磁盘
[root@orahost01 dev]# /etc/init.d/oracleasm createdisk myVol1 /dev/sdb1
Marking disk "/dev/sdb1" as an ASM disk: [ OK ]
[root@orahost01 dev]# /etc/init.d/oracleasm listdisks
MYVOL1
[root@orahost01 dev]# /etc/init.d/oracleasm createdisk myVol2 /dev/sdc1
Marking disk "/dev/sdc1" as an ASM disk: [ OK ]
[root@orahost01 dev]# /etc/init.d/oracleasm createdisk myVol3 /dev/sde1
Marking disk "/dev/sde1" as an ASM disk: [ OK ]
[root@orahost01 dev]# /etc/init.d/oracleasm createdisk myVol4 /dev/sdd1
Marking disk "/dev/sdd1" as an ASM disk: [ OK ]
[root@orahost01 dev]#/etc/init.d/oracleasm listdisks
MYVOL1
MYVOL2
MYVOL3
MYVOL4
需要注意的是如果是在RAC环境中呢,如果在一个节点添加了ASM磁盘,在其他节点上要用过scandisks命令来获得这种变化。
如:
[root@orahost01 dev]#/etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [ OK ]
就此ASM环境的物理基础就已经搭建成功.
其他OS类似于此,很简单,只要按照这个思路走就可以了:)
文章转载自网管之家:http://www.bitscn.com/pdb/oracle/200811/154448.html
相关文章推荐
- 安装GI过程中DD清理磁盘头信息后没有重新oracleasm createdisk 导致重启服务器后找不到ASM磁盘
- RHEL5下 安装Oracle 并配置ASM(自己的笔记)
- 基于CentOS与VmwareStation10搭建Oracle11G RAC 64集群环境:4.安装Oracle RAC FAQ-4.2.Oracleasm Createdisk ASM磁盘失败:Instantiating disk: failed
- 在LINUX上配置oracle ASMLib的多路径磁盘
- Oracleasm下载地址、安装顺序及配置命令
- 在Oracle Linux 4.7上安装配置Oracle 10g ASM数据库
- Linx下安装oracle grid 11.2是不能自动发现ASM磁盘
- oracleasm 安装时需要查看系统内核信息及配置如下
- oracle ASM安装过程中UDEV实现磁盘绑定
- Centos 6.5 X86_64 安装oracle 11g rac,采用ASMlib创建asm磁盘
- Centos 6.5 X86_64 安装oracle 11g rac,采用ASMlib创建asm磁盘
- rhel5.8 安装oracle 10gr2 rac dbca asm 创建磁盘组报错 ORA-15063
- oracle 11g asm磁盘阵列安装时,磁盘路径不显示
- 在LINUX上配置oracle ASMLib的多路径磁盘
- ASMlib操作系统包安装与配置asm disk磁盘
- oracle 11g 单节点安装 ASM,找不到ASM磁盘组
- Linux平台上配置Oracle ASMLib和磁盘多路径
- ASMlib操作系统包安装与配置asm disk磁盘
- OCM_第十六天课程:Section7 —》GI 及 ASM 安装配置 _安装 GRID 软件/创建和管理 ASM 磁盘组/创建和管理 ASM 实例
- Oracle 11g 安装配置方法图文教程