1.查看当前磁盘

[root@std u01]# fdisk -l

Disk /dev/sda: 42.9 GB,  bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes Device Boot Start End Blocks Id System
/dev/sda1 * + Linux
/dev/sda2 Linux swap / Solaris Disk /dev/sdb: MB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes Device Boot Start End Blocks Id System Disk /dev/sdc: MB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes Device Boot Start End Blocks Id System Disk /dev/sdd: MB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes Device Boot Start End Blocks Id System Disk /dev/sde: MB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes Device Boot Start End Blocks Id System

从上面的输出可以看出我们有四快盘且都没有分区:
/dev/sdb
/dev/sdc
/dev/sdd
/dev/sde

2.对磁盘进行分区

[root@std u01]# fdisk /dev/sdb

Command (m for help): n
Command action
e extended
p primary partition (-)
p
Partition number (-):
First cylinder (-, default ):
Using default value
Last cylinder or +size or +sizeM or +sizeK (-, default ):
Using default value Command (m for help): w
The partition table has been altered! Calling ioctl() to re-read partition table.
Syncing disks.

对其他磁盘执行同样的分区操作!

[root@std u01]# ll /dev/sd*
brw-r----- root disk , Jan : /dev/sda
brw-r----- root disk , Jan : /dev/sda1
brw-r----- root disk , Jan : /dev/sda2
brw-r----- root disk , Jan : /dev/sdb
brw-r----- root disk , Jan : /dev/sdb1
brw-r----- root disk , Jan : /dev/sdc
brw-r----- root disk , Jan : /dev/sdc1
brw-r----- root disk , Jan : /dev/sdd
brw-r----- root disk , Jan : /dev/sdd1
brw-r----- root disk , Jan : /dev/sde
brw-r----- root disk , Jan : /dev/sde1

3.绑定裸设备

[root@std u01]# vi /etc/sysconfig/rawdevices
[root@std u01]# cat /etc/sysconfig/rawdevices
# raw device bindings
# format: <rawdev> <major> <minor>
# <rawdev> <blockdev>
# example: /dev/raw/raw1 /dev/sda1
# /dev/raw/raw2
/dev/raw/raw1 /dev/sdb1
/dev/raw/raw2 /dev/sdc1
/dev/raw/raw3 /dev/sdd1
/dev/raw/raw4 /dev/sde1
[root@std u01]# service rawdevices restart
Assigning devices:
/dev/raw/raw1 --> /dev/sdb1
/dev/raw/raw1: bound to major , minor
/dev/raw/raw2 --> /dev/sdc1
/dev/raw/raw2: bound to major , minor
/dev/raw/raw3 --> /dev/sdd1
/dev/raw/raw3: bound to major , minor
/dev/raw/raw4 --> /dev/sde1
/dev/raw/raw4: bound to major , minor
done
[root@std u01]# raw -qa
/dev/raw/raw1: bound to major , minor
/dev/raw/raw2: bound to major , minor
/dev/raw/raw3: bound to major , minor
/dev/raw/raw4: bound to major , minor

3.更改裸设备的权限

[root@std u01]# cd /dev/raw
[root@std raw]# ll
total
crw------- root root , Jan : raw1
crw------- root root , Jan : raw2
crw------- root root , Jan : raw3
crw------- root root , Jan : raw4
[root@std raw]# chown oracle:dba raw*
[root@std raw]# ll
total
crw------- oracle dba , Jan : raw1
crw------- oracle dba , Jan : raw2
crw------- oracle dba , Jan : raw3
crw------- oracle dba , Jan : raw4

为方便我们把"chown oracle:dba raw*"写入/etc/rc.local

[root@std raw]# cat /etc/rc.local |grep chown
chown oracle:dba /dev/raw/raw[-]
[root@std raw]#

4.安装配置ASM驱动

[root@std u01]# uname -ra
Linux std 2.6.-.el5 # SMP Tue Mar :: EDT i686 i686 i386 GNU/Linux
[root@std u01]# ll oracleasm*
-rw-r--r-- root root Jul oracleasm-2.6.-.el5-2.0.-.el5.i686.rpm
-rw-r--r-- root root Jul oracleasm-2.6.-.el5debug-2.0.-.el5.i686.rpm
-rw-r--r-- root root Jul oracleasm-2.6.-.el5-debuginfo-2.0.-.el5.i686.rpm
-rw-r--r-- root root Jul oracleasm-2.6.-.el5PAE-2.0.-.el5.i686.rpm
-rw-r--r-- root root Jul oracleasm-2.6.-.el5xen-2.0.-.el5.i686.rpm
-rw-r--r-- root root Jul oracleasmlib-2.0.-.el5.i386.rpm
-rw-r--r-- root root Jul oracleasm-support-2.1.-.el5.i386.rpm [root@std u01]# rpm -ivh oracleasm* --这些包之前我们以安装过
warning: oracleasm-2.6.-.el5-2.0.-.el5.i686.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [%]
package oracleasm-support-2.1.-.el5.i386 is already installed
package oracleasm-2.6.-.el5xen-2.0.-.el5.i686 is already installed
package oracleasm-2.6.-.el5-2.0.-.el5.i686 is already installed
package oracleasm-2.6.-.el5debug-2.0.-.el5.i686 is already installed
package oracleasm-2.6.-.el5-debuginfo-2.0.-.el5.i686 is already installed
package oracleasm-2.6.-.el5PAE-2.0.-.el5.i686 is already installed
package oracleasmlib-2.0.-.el5.i386 is already installed

配置验证ASM驱动:

[root@std u01]# /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) [y]:
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ] [root@std u01]# lsmod |grep asm
oracleasm

5.初始化ASM参数

[root@std u01]# su - oracle
[oracle@std ~]$ cd $ORACLE_HOME/dbs
[oracle@std dbs]$ mkdir -p $ORACLE_BASE/admin/+ASM/{b,c,u}dump
[oracle@std dbs]$ touch init+ASM.ora
[oracle@std dbs]$ vi init+ASM.ora
[oracle@std dbs]$ cat init+ASM.ora
*.asm_diskstring='/dev/raw/raw*'
*.instance_type='asm'
*.large_pool_size=24M
*.remote_login_passwordfile='SHARED'
*.background_dump_dest='/u02/app/admin/+ASM/bdump'
*.core_dump_dest='/u02/app/admin/+ASM/cdump'
*.user_dump_dest='/u02/app/admin/+ASM/bdump'
[oracle@std dbs]$

6.为ASM实例创建密码文件

[oracle@std dbs]$ orapwd file=orapw+ASM password=oracle1
[oracle@std dbs]$

7.以root身份启动CSS进程

[oracle@std ~]# /u02/app/product/10.2./db_1/bin/localconfig add
/etc/oracle does not exist. Creating it now.
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 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within seconds.
CSS is active on these nodes.
localhost
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)

验证CSS进程是否启动;

[oracle@std dbs]$ crsctl check css
CSS appears healthy
[oracle@std dbs]$ crsctl check crs
CSS appears healthy
Cannot communicate with CRS
Cannot communicate with EVM

8.启动ASM实例

[oracle@std dbs]$ export ORACLE_SID=+ASM
[oracle@std dbs]$ sqlplus '/as sysdba' SQL*Plus: Release 10.2.0.4. - Production on Fri Jan :: Copyright (c) , , Oracle. All Rights Reserved. Connected to an idle instance. SQL> startup
ASM instance started Total System Global Area bytes
Fixed Size bytes
Variable Size bytes
ASM Cache bytes
ORA-: no diskgroups mounted

可以看到我们的ASM实例已经正常启动,最后报出ORA-15110错误说明没有挂载任何磁盘组,
因为此时我们还没有创建任何磁盘组,所以忽略这个错误。

9.创建spfile

使用spfile以后,在节下来的我们创建磁盘组时,ASM_DISKGROUPS这个参数会被自动更新。
而如果使用pfile,这个参数值不会自动更新。

SQL> create spfile from pfile;

File created.

SQL> shutdown abort
ASM instance shutdown
SQL> startup
ASM instance started Total System Global Area bytes
Fixed Size bytes
Variable Size bytes
ASM Cache bytes
ORA-: no diskgroups mounted SQL> show parameter spfile NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string /u02/app/product/10.2./db_1/d
bs/spfile+ASM.ora

10.查看磁盘及创建磁盘组

--查看磁盘asm_diskstring参数指定的磁盘

SQL> select path from v$asm_disk;

PATH
--------------------------------------------------------------------------------
/dev/raw/raw4
/dev/raw/raw3
/dev/raw/raw2
/dev/raw/raw1

--创建磁盘组

CREATE DISKGROUP diskgroup_name
[ { HIGH | NORMAL | EXTERNAL } REDUNDANCY ]
[ FAILGROUP failgroup_name ]
DISK [ NAME disk_name ] [ SIZE size_clause ] [ FORCE | NOFORCE ] ...;

注意:冗余度有三个选择:HIGH(高度冗余&gt;三路)、NORMAL(标准冗余--双路)和EXTERNAL(外部存储冗余)

SQL> create diskgroup DATA external redundancy
disk '/dev/raw/raw1','/dev/raw/raw2'; Diskgroup created. SQL> create diskgroup FLA external redundancy
disk '/dev/raw/raw3','/dev/raw/raw4'; Diskgroup created. SQL> select GROUP_NUMBER,NAME,TOTAL_MB,FREE_MB from v$asm_diskgroup; GROUP_NUMBER NAME TOTAL_MB FREE_MB
------------ ------------------------------ ---------- ----------
DATA
FLA

11.把ASM实例注册到监听中

创建好ASM实例后,一般会系统会把ASM实例自动注册到监听中,如果没有自动注册,可以手动注册。

[oracle@std bdump]$ export ORACLE_SID=+ASM
[oracle@std bdump]$ sqlplus '/as sysdba' SQL*Plus: Release 10.2.0.4. - Production on Fri Jan :: Copyright (c) , , Oracle. All Rights Reserved. Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4. - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> alter system register; System altered.
[oracle@std ~]$ lsnrctl status

LSNRCTL for Linux: Version 10.2.0.4. - Production on -JAN- ::

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.4. - Production
Start Date -JAN- ::
Uptime days hr. min. sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u02/app/product/10.2./db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=std)(PORT=)))
Services Summary...
Service "+ASM" has instance(s).
Instance "+ASM", status BLOCKED, has handler(s) for this service...
Service "+ASM_XPT" has instance(s).
Instance "+ASM", status BLOCKED, has handler(s) for this service...
The command completed successfully

12.远程访问ASM实例

要想从远程访问ASM实例,TNS配置需加上UR属性

asm=
(DESCRIPTION=
(ADDRESS= (PROTOCOL=tcp)(HOST=192.168.1.172)(PORT=))
(CONNECT_DATA=
(SERVICE_NAME=+ASM)
(UR=A)))
C:\Users\Administrator>sqlplus sys/oracle1@asm as sysdba

SQL*Plus: Release 10.2.0.1. - Production on 星期五 1月  :: 

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

连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.4. - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> select group_number,name from v$asm_diskgroup; GROUP_NUMBER NAME
------------ ------------------------------------------------------------
DATA
FLA

使用裸设备配置Oracle ASM实例一例的更多相关文章

  1. (转)设置了RemoveIPC=yes 的RHEL7.2 会crash掉Oracle asm 实例和Oracle database实例

    设置了RemoveIPC=yes 的RHEL7.2  会crash掉Oracle asm 实例和Oracle database实例,该问题也会在使用Shared Memory Segment (SHM ...

  2. 转://Window下安装Oracle ASM单实例数据库

    之前做的Oracle ASM实验都是基于Linux或者Unix操作系统的,最近想试试如何在Windows环境下使用Oracle ASM.本文介绍如何在windows下创建裸设备,并创建ASM磁盘组以及 ...

  3. [置顶] Oracle 11g R2 ASM:了解 Oracle ASM 基本概念

    About Oracle ASM Instances About Oracle ASM Disk Groups About Mirroring and Failure Groups About Ora ...

  4. oracle数据库启动报错,不能启动ASM实例

    数据库rac启动时报错,日志例如以下,后来使用 Sat Jun  7 06:02:11 2014 GATHER_STATS_JOB encountered errors.  Check the tra ...

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

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

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

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

  7. oracle asm 概念

    automated storage management ,即自动存储管理,简称asm .. 在oracle 10g 这个版本之前,管理一个大型数据库成千上万的数据文件对数据库管理员来说是一个既无技术 ...

  8. oracle11g rac asm 实例内存修改

    ASM实例内存修改 memory_max_target(它为静态参数,修改完成后需要重启实例) memory_target(它为动态参数,不需要重启实例) SQL> select name,is ...

  9. [置顶] Oracle GoldenGate 系列:使用 Oracle ASM API DBLOGREADER 时遇 ora-01031 错误

    今天在自己新搭建的 Oracle ACFS 文件系统上测试 GoldenGate ,启动 extract 进程报如下错误: 2013-08-27 14:58:39  ERROR   OGG-00446 ...

随机推荐

  1. host_network_interfaces_slow_mode_thresholds

    CDH报集群异常: host_network_interfaces_slow_mode_thresholds 警告置为从不-- 主要是我没有查到发生这种情况的原因是什么--

  2. hdu2476 String painter(区间dp)

    题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=2476 Problem Description There are two strings ...

  3. dubbo服务治理框架设计

    dubbo.JSF作为使用最广泛的服务端框治理架,其设计和实现思想值得进行学习研究. 整个服务管理框架核心的原理基于反射以及socket调用实现,服务管理框架包含服务的注册管理 服务的索引管理以及服务 ...

  4. 移动端网页 -- 安卓与IOS兼容

    1.在a链接长按时,ios系统会识别并复制a链接中的href值,而安卓不会,只会选择复制文字 关于长按复制其他区域内容:pc端可以实现,在移动端目前还没有找到解决方案,很多都是基于flash的 2.i ...

  5. 【转】Docker网络详解及pipework源码解读与实践

    好文必转 原文地址: http://www.infoq.com/cn/articles/docker-network-and-pipework-open-source-explanation-prac ...

  6. 图论 SRM 674 Div1 VampireTree 250

    Problem Statement      You are a genealogist specializing in family trees of vampires. Vampire famil ...

  7. Cache的使用

    公共方法Add 将指定项添加到 Cache 对象,该对象具有依赖项.过期和优先级策略以及一个委托(可用于在从 Cache 移除插入项时通知应用程序). Equals(从 Object 继承) 已重载. ...

  8. Unity Standard Assets 简介之 Utility

    决定写这个系列起因于刚才的偶然所见,我发现当前版本的Unity有一个 Utility 标准资源包,里面有一个 FPSCounter 脚本提供了显示游戏运行帧率的基本功能,而我几周前刚刚写过一个同样功能 ...

  9. SIFT特征提取分析

    SIFT特征提取分析 sift 关键点,关键点检测 读'D. G. Lowe. Distinctive Image Features from Scale-Invariant Keypoints[J] ...

  10. BZOJ3161 : 孤舟蓑笠翁

    显然求出每个点到所有关键点的最短路和次短路即可,答案就是每个关键点的次短路. 设$f[i][j][0]$表示左手在$i$,右手在$j$的解,$f[i][j][1]$表示左手在$i$,右手在$j$,且左 ...