Oracle版本:Oracle 11g

1、确定自己的Linux版本:

[root@localhost ~]#uname -r

2.6.32-431.el6.x86_64

2.6.32-431.el6.x86_64,即Linux 6

2、安装Oracleasm Kernel:

[root@localhost ~]# yum install kmod-oracleasm

3、下载两个安装包:oracleasmlib和oracleasm-support

[root@localhost ~]#wget http://oss.oracle.com/projects/oracleasm-support/dist/files/RPMS/rhel6/amd64/2.1.8/oracleasm-support-2.1.8-1.el6.x86_64.rpm

[root@localhost ~]#wget http://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.4-1.el6.x86_64.rpm

4、安装这两个包:

[root@localhost ~]#rpm -ivh oracleasm*

5、配置:

[root@localhost ~]#su oracle

[root@localhost ~]#/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

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磁盘,可以这样配置:

[root@ca-test1 /]# /etc/init.d/oracleasm disable

Writing Oracle ASM library driver configuration [ OK ]

Unmounting ASMlib driver filesystem [ OK ]

Unloading module "oracleasm" [ OK ]

[root@ca-test1 /]# /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 ]

6、为ASM准备一块硬盘空间:

首先可以使用fdisk -l命令查看分区,

我这里为ASM准备了一块还没有分区的硬盘,

使用fdisk -l命令看到这块硬盘叫sdc,然后我们开始给这块硬盘分区:

[root@localhost ~]# fdisk /dev/sdc

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel with disk identifier 0x3c1761b2.

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)

WARNING:
DOS-compatible mode is deprecated. It's strongly recommended to

switch
off the mode (command 'c') and change display units to

sectors
(command 'u').

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)

因为ASM要求必须是主分区或逻辑分区所以只能选p:

Command (m for help): p

Partition
number (1-4): 2

First
cylinder (1-121601, default 1):

Using
default value 1

Last
cylinder, +cylinders or +size{K,M,G} (1-121601, default 121601):

Using
default value 121601

再次执行fdisk -l命令查看分区:

Disk
/dev/sdc: 1000.2 GB, 1000204886016 bytes

255
heads, 63 sectors/track, 121601 cylinders

Units
= cylinders of 16065 * 512 = 8225280 bytes

Sector
size (logical/physical): 512 bytes / 512 bytes

I/O
size (minimum/optimal): 512 bytes / 512 bytes

Disk
identifier: 0x881f3ea8

Device
Boot Start End Blocks Id System

/dev/sdc2
1 121601 976760001 83 Linux

7、将硬盘空间分配给ASM:

查看磁盘组:

[root@ca-test1 /]# /etc/init.d/oracleasm listdisks

VOL1

新建一个磁盘组VOL2并分配给ASM:

[root@ca-test1 /]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdc2

Creating Oracle ASM disk "VOL2" [ OK ]

最新文章

  1. Spring容器深入(li)
  2. VS2015解决非Unicode编码包含中文字段无法编译的问题
  3. Java 中文字符串编码之GBK转UTF-8
  4. 后端码农谈前端(CSS篇)第二课:CSS的5个来源
  5. 查找(顺序表&有序表)
  6. Qt的quit(),exit()以及close()事件捕获
  7. html中的特殊符号
  8. [Wordpress]Wordpress使用SMTP发送电邮
  9. Sublime_text3怎么发现PHP语法错误?
  10. 好记性不如烂笔头85-spring3学习(6)-BeanFactory 于bean生命周期
  11. flash检测网络是否通畅
  12. Linux 配置tomcat遇见的若干问题
  13. Java关于读取Excel文件~xlsx xls csv txt 格式文件~持续汇总~
  14. 在Linux搭建Git服务器
  15. vue中计算属性computed方法内传参
  16. 从Node到Go的心路之旅
  17. Go Web:Cookie
  18. pinpoint vs druid
  19. 捷信达会员管理系统SQL语句相关
  20. php数组按值的大小排序

热门文章

  1. Symbiont
  2. [Head First设计模式]策略模式
  3. 深入理解Java中的final关键字
  4. 以空白符结尾的 alias
  5. Bash 中的 _ 是不是环境变量
  6. Unity里的Mesh属性
  7. Like与Instr模糊查询性能
  8. util类中非静态方法中注入serivce,在controller层是使用util。
  9. 清北学堂模拟赛day7 石子合并加强版
  10. JavaScript闭包之“词法作用域”