oracle 10g asm_第一回

wisdomone1發表於2009-08-16
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部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-612425/,如需轉載,請註明出處,否則將追究法律責任。

相關文章