ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle 10g asm_第一回

oracle 10g asm_第一回

原创 Linux操作系统 作者:wisdomone1 时间:2009-08-16 03:07:14 0 删除 编辑
Redundancy Level Minimum Number of Disks Data Files Recovery Files Both File Types
External 1 1.15 GB 2.3 GB 3.45 GB
Normal 2 2.3 GB 4.6 GB 6.9 GB
High 3 3.45 GB 6.9 GB 10.35 GB


lsls
external --说白了就是本来disk就是利用阵列的技术,人家本身就是冗余的
normal  --你可以理解为mirror,这是一般普通的配置
high   --你要有钱就用它,最少3 disk


利用loop device虚拟asm存储设备,搭建oracle相关环境

[root@rhel4 asmdisk]# pwd
/asmdisk
[root@rhel4 asmdisk]# dd if=/dev/zero f=asm_disk1 bs=1024k count=400
400+0 records in
400+0 records out
[root@rhel4 asmdisk]# dd if=/dev/zero f=asm_disk2 bs=1024k count=400
400+0 records in
400+0 records out
[root@rhel4 asmdisk]# dd if=/dev/zero f=asm_disk3 bs=1024k count=400

[root@rhel4 asmdisk]# losetup /dev/loop1 /asmdisk/asm_disk1
[root@rhel4 asmdisk]# losetup /dev/loop2 /asmdisk/asm_disk2
[root@rhel4 asmdisk]# losetup /dev/loop3 /asmdisk/asm_disk3
[root@rhel4 asmdisk]# raw /dev/raw/raw1 /dev/loop1
/dev/raw/raw1:  bound to major 7, minor 1
[root@rhel4 asmdisk]# raw /dev/raw/raw2 /dev/loop2
/dev/raw/raw2:  bound to major 7, minor 2
[root@rhel4 asmdisk]# raw /dev/raw/raw3 /dev/loop3
/dev/raw/raw3:  bound to major 7, minor 3
[root@rhel4 asmdisk]# chmod 600 /dev/raw/raw*
[root@rhel4 asmdisk]# chown oracle:oinstall /dev/raw/raw*

[root@rhel4 asmdisk]# more  /etc/sysconfig/rawdevices  
# This file and interface are deprecated.
# Applications needing raw device access should open regular
# block devices with O_DIRECT.
# raw device bindings
# format: 
#         
# example: /dev/raw/raw1 /dev/sda1
#          /dev/raw/raw2 8 5
/dev/raw/raw1 /dev/loop1
/dev/raw/raw2 /dev/loop2

[root@rhel4 asmdisk]# more  /etc/rc.local  
#!/bin/sh
#
# This script. will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style. init stuff.

touch /var/lock/subsys/local
/bin/chown oracle:oinstall /dev/raw/raw[1-3]
/bin/chmod 660 /dev/raw/raw[1-3]


为asm磁盘组添加磁盘

先作上上述操作,命令作及写入文件(rawdevices and rc.local)
SQL> select group_number,name,offline_disks from v$asm_diskgroup;

GROUP_NUMBER NAME                           OFFLINE_DISKS
------------ ------------------------------ -------------
           1 DATA                                       0

SQL> alter diskgroup DATA add disk '/dev/raw/raw4';

Diskgroup altered.

为asm磁盘组删除磁盘

SQL> select path,disk_number,name from v$asm_disk;
PATH                 DISK_NUMBER NAME
-------------------- ----------- ------------------------------
/dev/raw/raw4                  3 DATA_0003
/dev/raw/raw3                  2 DATA_0002
/dev/raw/raw2                  1 DATA_0001
/dev/raw/raw1                  0 DATA_0000

SQL> alter diskgroup DATA drop disk DATA_0003; --要注意删除时,一定要用上视图查询到的name,不然报错,什么找不到磁盘的磁盘之类的

Diskgroup altered.

























来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-612425/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
提供针对oracle初学者及进阶的数据库培训,欢迎大家咨询: 微信: wisdomone 微信公众号: lovedb 工作经历: 中国普天 北京科蓝 北京云和恩墨 北京神州新桥

注册时间:2008-04-04

  • 博文量
    2189
  • 访问量
    12690167