1、准备oracleasm包

[root@localhost oracle]# uname -r
2.6.18-164.el5

[oracle@localhost ~]$ ls -l
total 264
-rw-r--r-- 1 oracle oinstall 136910 Jun 23 00:16 oracleasm-2.6.18-164.el5-2.0.5-1.el5.x86_64.rpm
-rw-r--r-- 1 oracle oinstall 14176 Jun 23 00:16 oracleasmlib-2.0.4-1.el5.x86_64.rpm
-rw-r--r-- 1 oracle oinstall 90225 Jun 23 00:16 oracleasm-support-2.1.8-1.el5.x86_64.rpm

2、用root用户安装oracleasm包

在下载的时候,需要注意与linux操作系统的内核版本一致,否则可能会出现错误

[root@localhost oracle]# rpm -ivh oracleasm*
warning: oracleasm-2.6.18-164.el5-2.0.5-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [ 33%]
2:oracleasm-2.6.18-164.el########################################### [ 67%]
3:oracleasmlib ########################################### [100%]

3、配置驱动

[root@localhost oracle]# /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 []: 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
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]

4、 检查配置是否成功

确认ASMlib驱动被加载

[root@localhost oracle]# lsmod |grep asm
oracleasm 84136 1

确认系统内存在oracleasm文件系统

[root@localhost oracle]# cat /proc/filesystems |grep oracleasm
nodev oracleasmfs

确认oracleasm文件系统被挂载

[root@localhost oracle]# df -ha |grep oracleasm
oracleasmfs 0 0 0 - /dev/oracleasm

5、fdisk创建磁盘

[root@localhost ~]# fdisk -l

Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System
/dev/sda1 * 1 6 48163+ 83 Linux
/dev/sda2 7 515 4088542+ 83 Linux
/dev/sda3 516 772 2064352+ 82 Linux swap / Solaris
/dev/sda4 773 1044 2184840 5 Extended
/dev/sda5 773 1044 2184808+ 83 Linux Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdb doesn't contain a valid partition table Disk /dev/sdc: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdc doesn't contain a valid partition table

发现存在几个未使用的,/dev/sdb,/dev/sdc

[root@localhost ~]# fdisk /dev/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): n --添加一块磁盘
Command action
e extended
p primary partition (1-4)
p --主磁盘
Partition number (1-4): 1 --第一分区
First cylinder (1-261, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-261, default 261):
Using default value 261 Command (m for help): w --写入
The partition table has been altered! Calling ioctl() to re-read partition table.
Syncing disks.

查看创建好的磁盘:

[root@localhost ~]# fdisk -l

Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System
/dev/sda1 * 1 6 48163+ 83 Linux
/dev/sda2 7 515 4088542+ 83 Linux
/dev/sda3 516 772 2064352+ 82 Linux swap / Solaris
/dev/sda4 773 1044 2184840 5 Extended
/dev/sda5 773 1044 2184808+ 83 Linux Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System
/dev/sdb1 1 261 2096451 83 Linux Disk /dev/sdc: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System
/dev/sdc1 1 261 2096451 83 Linux

6、创建ASM磁盘

[root@localhost ~]# /etc/init.d/oracleasm createdisk KEL1 /dev/sdb1
Marking disk "KEL1" as an ASM disk: [ OK ]
[root@localhost ~]# /etc/init.d/oracleasm createdisk KEL2 /dev/sdc1
Marking disk "KEL2" as an ASM disk: [ OK ]

查看创建好的磁盘:

[root@localhost disks]# pwd
/dev/oracleasm/disks --创建好的磁盘在此目录中
[root@localhost disks]# ls -l
total 0
brw-rw---- 1 oracle oinstall 8, 17 Jun 23 00:32 KEL1
brw-rw---- 1 oracle oinstall 8, 33 Jun 23 00:32 KEL2

检查创建成功:

[root@localhost ~]# /etc/init.d/oracleasm listdisks
KEL1
KEL2

在RAC环境中需要在另外一节点执行:

[root@localhost ~]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@localhost ~]# /etc/init.d/oracleasm listdisks
KEL1
KEL2

从而在所有的节点都可以看见创建的ASM磁盘。

7、 启动CSS进程

在启动的时候,务必已经安装了oracle数据库,否则的话是不存在localconfig这个命令的

[root@kel ~]# /home/oracle/product/10.2.0/db_1/bin/localconfig add
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Configuration for local CSS has been initialized Adding to inittab
Startup will be queued to init within 90 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
kel
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)

8、配置ASM实例

[oracle@kel asm]$ vi initasm.ora 

INSTANCE_TYPE = ASM
ASM_POWER_LIMIT = 3
ASM_DISKSTRING = 'ORCL:KEL1','ORCL,KEL2'
DB_UNIQUE_NAME = '+ASM'

9、启动ASM

[oracle@kel asm]$ export ORACLE_SID=+ASM --默认的ASM实例名称
[oracle@kel asm]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jun 23 01:38:46 2014 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to an idle instance. SQL> startup pfile='/home/oracle/asm/initasm.ora';
ASM instance started Total System Global Area 125829120 bytes
Fixed Size 2019000 bytes
Variable Size 98644296 bytes
ASM Cache 25165824 bytes
ORA-15110: no diskgroups mounted

错误表示,暂时没有磁盘组创建,从而也不会自动的挂在磁盘

10、创建spfile

SQL> create spfile from pfile;

File created.

使用spfile的好处是,以后创建了磁盘组之后,会自动的修改参数asm_diskgroups,从而在每次启动的时候可以自动的挂载磁盘组。

11、创建磁盘组

SQL> create diskgroup KEL external redundancy  disk 'ORCL:KEL1','ORCL:KEL2';

12、手工注册ASM

SQL> alter system register;

System altered.

13、创建表空间

在创建表空间的时候,数据库必须打开,然后在数据库的sqlplus中创建表空间即可

SQL> create tablespace kel datafile '+ASM/kel.dbf' size 50M;

Tablespace created.

附加:

删除CSS配置:

[root@kel ~]# /home/oracle/product/10.2.0/db_1/bin/localconfig delete
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
Shutdown has begun. The daemons should exit soon.

oracleasm方式创建ASM的更多相关文章

  1. 99-oracle-asmdevices.rules(udev方式创建asm磁盘)

    一.创建asm磁盘的几种方式 创建asm方式很多主要有以下几种 1.Faking方式 2.裸设备方式 3.udev方式(它下面有两种方式) 3.1 uuid方式. 3.2 raw方式(裸设备方式) 4 ...

  2. 用asmlib方式创建oracle集群ASM磁盘(oracleasm)

    创建asm磁盘的几种方式 创建asm方式很多主要有以下几种 1.Faking方式 2.裸设备方式 3.udev方式(它下面有两种方式) 3.1 uuid方式 3.2 raw方式(裸设备方式) 4.as ...

  3. 实验:利用ASMLib创建ASM磁盘

    环境:RHEL 6.5 + Oracle 11.2.0.4 RAC(2 nodes) 目的:在实验环境使用ASMLib配置共享ASM磁盘,虽然我们已经不建议使用ASMLib进行绑盘,但是无奈有客户是这 ...

  4. 转://如何创建ASM磁盘

    1  前言 无论是安装单机版的asm还是rac都离不开ASM磁盘组的创建,创建ASM磁盘组的关键是创建好需要的asm磁盘,发现很多网友安装grid软件和grid实例,都在磁盘的创建这里有很大的问题,本 ...

  5. 创建ASM实例及ASM数据库

    --======================== -- 创建ASM实例及ASM数据库 --======================== 一.ASM相关概念 1.什么是ASM(Auto Stor ...

  6. 创建ASM实例及ASM数据库(转载)

    --======================== -- 创建ASM实例及ASM数据库 --======================== 一.ASM相关概念 1.什么是ASM(Auto Stor ...

  7. 转:Oracle下创建ASM磁盘总结

    Oracle下创建ASM磁盘总结 文章转载:https://blog.csdn.net/okhymok/article/details/78791841?utm_source=blogxgwz1 2. ...

  8. 基于CentOS与VmwareStation10搭建Oracle11G RAC 64集群环境:4.安装Oracle RAC FAQ-4.5.安装Grid,创建ASM磁盘组空间不足

    因之前分区时,分区的Last cylinder的值选了“1”,导致创建磁盘组空间不足.解决办法是先删除分区,重新创建分区并删除ASM磁盘,然后重建ASM磁盘 1. 先删除分区,重新创建分区: 1)查询 ...

  9. 11g使用非duplicate方式创建物理standby要注意的问题总结

    在上篇博文中,使用了duplicate方式来创建物理standby http://blog.csdn.net/aaron8219/article/details/38434579 今天来说说在11g中 ...

随机推荐

  1. 安装eclipse for JavaEE 后的一些设置

    以下的设置是相对于一个workspace而设置的,如果更换了workspace则要重新设置. 1. 设置Text Editors: 2. 设置Content Assist 的快捷键(比较方便) 3. ...

  2. CentOS7安装Hadoop2.7完整流程

    总体思路,准备主从服务器,配置主服务器可以无密码SSH登录从服务器,解压安装JDK,解压安装Hadoop,配置hdfs.mapreduce等主从关系. 1.环境,3台CentOS7,64位,Hadoo ...

  3. 用Eclipse编写运行Java程序

    1.选择一个空的文件夹,作为workspace工作空间,用来存放你以后用eclipse写的Java程序.(一个workspace可以放很多很多project项目) 2.新建java项目:File-&g ...

  4. JVM最多可创建多少线程

    JVM可支持的最大线程数 JVM最大线程数 (2012-07-04 23:20:15) 转载▼ 标签: jvm 最大线程数 it 分类: java分布式总结 摘自:http://sesame.itey ...

  5. SVN与Eclipse整合

    SVN与Eclipse整合 下载SVN插件(http://subclipse.tigris.org) 我们使用版本eclipse_svn_site-1.6.5.zip 解压到一个文件夹中 进入ecli ...

  6. mongodb管理工具rockmongo

    mongodb的图像管理工具非常之多,我用的是rockmongo. RockMongo 是一个PHP5写的MongoDB管理工具. 主要特征: 使用宽松的New BSD License协议 速度快,安 ...

  7. 高斯消元 分析 && 模板 (转载)

    转载自:http://hi.baidu.com/czyuan_acm/item/dce4e6f8a8c45f13d7ff8cda czyuan 先上模板: /* 用于求整数解得方程组. */ #inc ...

  8. 函数lock_rec_get_first

    /*********************************************************************//** Gets the first explicit l ...

  9. uva10820Send a Table

    筛法. 首先使cnt[i]=sqr(n/i),这样cnt[i]就表示gcd(x,y)大于等于i的数对的个数,然后倒序枚举减去gcd大于i的个数就可以得到ans[i].最终得到ans[1]. 这个算法单 ...

  10. UVa 1400 (线段树) "Ray, Pass me the dishes!"

    求一个区间的最大连续子序列,基本想法就是分治,这段子序列可能在区间的左半边,也可能在区间的右半边,也有可能是横跨区间中点,这样就是左子区间的最大后缀加上右子区间的最大前缀之和. 线段树维护三个信息:区 ...