ASM中磁碟組許可權問題

dingzihan發表於2014-02-20
昨天,在向ASM磁碟組backup中新增磁碟的時候,一直新增不了。報錯如下:(從日誌裡將報錯資訊摘出來)
cd /oracle/app/grid/diag/asm/+asm/+ASM1/trace
SQL> alter diskgroup BACKUP add disk '/dev/mapper/backup1p1' 
ORA-15032: not all alterations performed
ORA-15031: disk specification '/dev/mapper/backup1p1' matches no disks
ORA-15025: could not open disk "/dev/mapper/backup1p1"
ORA-15056: additional error message
Linux-x86_64 Error: 13: Permission denied
Additional information: 42
Additional information: -448706944
ERROR: alter diskgroup BACKUP add disk '/dev/mapper/backup1p1'

將昨天的操作步驟簡單回顧下:
1、停叢集
cd /oracle/app/11.2/grid/bin
./crsctl stop cluster -all  --需要root許可權執行
./crs_stat -t
2、fdisk /dev/mapper/backup1
 /sbin/partprobe /dev/mapper/backup1   (另一臺也需要做)
在叢集所以伺服器上執行以下命令來載入已更新的塊裝置分割槽表/sbin/partprobe /dev/mapper/backup1(兩臺伺服器都需要做)
總結:使用partprobe可以不用重啟系統即可配合fdisk工具建立新的分割槽。
在/dev/mapper/下生產一個新的目錄backup1p1

3、授權
chown -R oracle:oinstall /dev/mapper/backup*  (另一臺也需要做)

4、啟叢集
cd /oracle/app/11.2/grid/bin
./crsctl start cluster -all  --需要root許可權執行
./crs_stat -t

5、新增磁碟組
su - grid
sqlplus / as sysasm
alter diskgroup data add disk '/dev/mapper/backup1p1';

SQL> alter diskgroup BACKUP add disk '/dev/mapper/backup1p1';
alter diskgroup backup add disk '/dev/mapper/backup1p1'
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15031: disk specification '/dev/mapper/backup1p1' matches no disks
ORA-15025: could not open disk "/dev/mapper/backup1p1"
ORA-15056: additional error message
Linux-x86_64 Error: 13: Permission denied
Additional information: 42
Additional information: -953398608

後來在朋友的幫助下,修改了/dev/mapper/backup的屬主,新增磁碟成功。
chown -R grid:asmadmini  /dev/mapper/backup*
alter diskgroup data add disk '/dev/mapper/backup1';   ----注意這裡:新增的磁碟是backup1 ,而不是bachup1p1。
新增磁碟成功。


上午繼續在網上查詢大量資料,瞭解管理多路徑下ASM磁碟許可權問題,發現資料比較少,我決定把自己的操作過程記錄下來。

[grid@RAC-2 mapper]$ ls -l backup*
lrwxrwxrwx 1 oracle oinstall 8 Jan 23 17:04 backup -> ../dm-38
lrwxrwxrwx 1 oracle oinstall 8 Jan 23 17:04 backup1 -> ../dm-42
lrwxrwxrwx 1 oracle oinstall 8 Feb 18 14:33 backup1p1 -> ../dm-55
lrwxrwxrwx 1 oracle oinstall 8 Jan 23 17:04 backup2 -> ../dm-39
lrwxrwxrwx 1 oracle oinstall 8 Feb 18 14:34 backup2p1 -> ../dm-56
lrwxrwxrwx 1 oracle oinstall 8 Jan 23 17:04 backup3 -> ../dm-27
lrwxrwxrwx 1 oracle oinstall 8 Feb 18 14:34 backup3p1 -> ../dm-57
lrwxrwxrwx 1 oracle oinstall 8 Jan 23 17:04 backup4 -> ../dm-35
lrwxrwxrwx 1 oracle oinstall 8 Feb 18 14:34 backup4p1 -> ../dm-58
lrwxrwxrwx 1 oracle oinstall 8 Jan 23 17:04 backup5 -> ../dm-32
lrwxrwxrwx 1 oracle oinstall 8 Jan 23 17:04 backup6 -> ../dm-31
lrwxrwxrwx 1 oracle oinstall 8 Jan 23 17:04 backupp1 -> ../dm-48
backup1p1 對應的dm-55
backup2p1 對應的dm-56
backup3p1 對應的dm-57
backup4p1 對應的dm-58  都屬於root使用者所有,難怪昨天磁碟怎麼也加不了。疑惑在這兒?
在不同的屬主下,下面兩種方式新增的磁碟,對資料庫有影響嗎?效果一樣嗎?
chown -R oracle:oinstall /dev/mapper/backup*
alter diskgroup data add disk '/dev/mapper/backup1p1';
chown -R grid:asmadmini  /dev/mapper/backup*
alter diskgroup data add disk '/dev/mapper/backup1'; 
規範:在11g R2的ASM系統中(grid 和oracle使用者),建議設定磁碟為:grid:asmadmin,  許可權設定為660。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22969361/viewspace-1084351/,如需轉載,請註明出處,否則將追究法律責任。

相關文章