歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> ASM更換磁盤名稱

ASM更換磁盤名稱

日期:2017/2/28 15:42:53   编辑:Linux教程

今天他們要測試IBM的那個SVC存儲同步的東西,然後需要把服務器上的盤都踢出去後再加進來,不過這樣的話磁盤名稱就會變了。因此需要把ASM中的磁盤名稱都換了,其實過程也很簡單:

1、修改asm實例的asm磁盤默認查找路徑參數asm_diskstring,使用如下命令:

alter system set asm_diskstring='/dev/rhdisk*';

2、關閉整個Cluster,等待他們踢盤加盤後再修改如下屬性,我的是RAC環境所以一下操作要在所有節點上執行

修改磁盤用戶及屬組:

[rac11g2@root]# chown grid:asmadmin /dev/rhdisk[2-4]

修改磁盤屬性為660:

[rac11g2@root]# chmod 660 /dev/rhdisk[2-4]

修改磁盤共享屬性:

[rac11g2@root]# lsattr -El hdisk2|grep reserve_policy
reserve_policy no_reserve Reserve Policy True

[rac11g2@root]# chdev -l hdisk2 -a reserve_policy=no_reserve
[rac11g2@root]# chdev -l hdisk3 -a reserve_policy=no_reserve
[rac11g2@root]# chdev -l hdisk4 -a reserve_policy=no_reserve

3、現在就可以啟動Cluster了

[rac11g1@root]# crsctl start cluster -all


注:我曾經因為忘了修改磁盤屬性為660,結果導致Database起不來,在Alert日志中出現了ORA-00600的錯誤,嚇我一跳,不過從日志中比較容易看出來是權限的問題,調整磁盤屬性後再重啟就可以了:

Sweep [inc][393409]: completed
Sweep [inc2][393409]: completed
NOTE: Loaded library: System
ORA-15025: could not open disk "/dev/rhdisk4"
ORA-27041: unable to open file
IBM AIX RISC System/6000 Error: 13: Permission denied
Additional information: 11
SUCCESS: diskgroup DATA was mounted
Errors in file /soft/Oracle/diag/rdbms/nint/nint1/trace/nint1_ckpt_19136654.trc (incident=409793):
ORA-00600: internal error code, arguments: [kfioTranslateIO03], [], [], [], [], [], [], [], [], [], [], []
Incident details in: /soft/oracle/diag/rdbms/nint/nint1/incident/incdir_409793/nint1_ckpt_19136654_i409793.trc
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
NOTE: dependency between database nint and diskgroup resource ora.DATA.dg is established
ERROR: unrecoverable error ORA-600 raised in ASM I/O path; terminating process 19136654
Dumping diagnostic data in directory=[cdmp_20120302172201], requested by (instance=1, osid=19136654 (CKPT)), summary=[incident=409793].
Fri Mar 02 17:22:01 2012
PMON (ospid: 14156014): terminating the instance due to error 469
System state dump requested by (instance=1, osid=14156014 (PMON)), summary=[abnormal instance termination].
System State dumped to trace file /soft/oracle/diag/rdbms/nint/nint1/trace/nint1_diag_21168306.trc
Fri Mar 02 17:22:02 2012
ORA-1092 : opitsk aborting process
Fri Mar 02 17:22:02 2012
License high water mark = 1
Instance terminated by PMON, pid = 14156014
USER (ospid: 15335672): terminating the instance
Instance terminated by USER, pid = 15335672

【摘錄】

First, you can try to check the OS drive ownership , permission and reserve_policy attribute on all nodes. Then restart the ASM instance.
1)Make sure that the hdisk# is owned by the OS user who installed the ASM Oracle Home ... and that the disk is mounted correctly (with the correct owner)
2)Make sure that the permissions are set correctly at the disk level ... 660 is normal ... but if there are problems use 777 as a test
ls -l /dev/rhdisk3 output:
For 10gR2/11gR1 like: crw-rw---- oracle:oinstall /dev/rhdisk3
For 11gR2 like: crw-rw---- grid:asmadmin /dev/rhdisk3


How to change the drive ownership and permission ?
For 10gR2/11gR1:
# chown -R oracle:oinstall /dev/rhdisk[3-10]
# chmod -R 660 /dev/rhdisk[3-10]
For 11gR2:
# chown -R grid:asmadmin /dev/rhdisk[3-10]
# chmod -R 660 /dev/rhdisk[3-10]


3)Make sure that the reserve_policy attribute of the needed hdisk# is no_reserve or no on all nodes.
chdev -l hdisk# -a reserve_policy=no_reserve






If it also fail by the first step, you may try to set the Oracle ASM parameter ASM_DISKSTRING to /dev/* or /dev/rhdisk*. The Step is:
1)Backup the ASM instance pfile(Parameter File) or spfile (Server Parameter File).
Most in the $ORACLE_HOME/dbs. pfile name like is init+ASM1.ora, you can use cp command to backup it .and vi the content.
You to create spfile to pfile for backup,if use spfile.
2)set ASM_DISKSTRING parameter
use pfile ENV:
Add or Edit "ASM_DISKSTRING" line to *.ASM_DISKSTRING='/dev/rhdisk*' in pfile. Startup the ASM instance using the pfile.

use spfile ENV:
$ ORACLE_SID=+ASM1;export ORACLE_SID

$ sqlplus "/ as sysdba"
or
$ sqlplus "/ as sysasm"

SQL> startup
SQL> alter system set asm_diskstring='/dev/rhdisk*';
SQL> select group_number,disk_number,path from v$asm_disk;
--You can get some disk info and the most disk's group_number is not 0.




If ASM_DISKSTRING is NOT SET ... then the following default is used


Default ASM_DISKSTRING per OS


Operating System Default Search String
=======================================
Solaris (32/64 bit) /dev/rdsk/*
Windows NT/XP \\.\orcldisk*
Linux (32/64 bit) /dev/raw/*


LINUX (ASMLIB) ORCL:*
LINUX (ASMLIB) /dev/oracleasm/disks/* ( as a workaround )


HPUX /dev/rdsk/*
HP-UX(Tru 64) /dev/rdisk/*
AIX /dev/*

Copyright © Linux教程網 All Rights Reserved