script of check repair ASM DISKGROUP
用於check repair DISKGROUP用
[@more@]#!/bin/sh
export ORACLE_BASE=/oracle/app
export ORA_ASM_HOME=${ORACLE_BASE}/11gR1/db
export ORACLE_SID=+ASM24
function repair_dg(){
sqlstr="alter diskgroup $2 check DISK "
x=`expr $1 * 8`
i=`expr $x - 8`
if [ $1 -eq 9 ];then
j=70
else
j=`expr $x - 1`
fi
while ((i<=j))
do
if [ $i -eq $j ];then
flag=`printf '%04d' $i`
sqlstr1=$sqlstr" DATA_"$flag
((i=i+1))
continue
fi
flag=`printf '%04d' $i`
sqlstr=$sqlstr" $2_"$flag","
((i=i+1))
done
echo $sqlstr1" repair;" >/tmp/repair_dg_$1.sql
$ORA_ASM_HOME/bin/sqlplus -S "/ as sysdba" <
SELECT SYS_CONTEXT ('userenv', 'sid') from dual;
;
select 'end: '||to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;
exit
EOD
}
repair_dg 1 DATA &
repair_dg 2 DATA &
repair_dg 3 DATA &
repair_dg 4 DATA &
repair_dg 5 DATA &
repair_dg 6 DATA &
repair_dg 7 DATA &
repair_dg 8 DATA &
repair_dg 9 DATA &
解釋一下:
1,data這個diskgroup下有71個disk (DATA_0000--DATA_0070)
2,要求用9個併發同時執行check repair操作,
alter diskgroup check disk repair會做哪些事,在asm guide/sql reference中有說明
3,指令碼設定成前面8個指令碼每個檢查8個disk,最後一個檢查7個,共計8*8+7=71個
4,注意必須連asm instance才能執行
5,被check的dg必須mount
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/94384/viewspace-1028911/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [Oracle Script] check userOracle
- [Oracle Script] check latchOracle
- check ftp success scriptFTP
- DBMS_REPAIR SCRIPT [ID 556733.1]AI
- [Oracle Script] check active sessionOracleSession
- [Oracle Script] check lock infoOracle
- [Oracle Script] check Literal SQLOracleSQL
- Asm diskgroup 的修復ASM
- Mysql optimize、Analyze、check、repair維護操作MySqlAI
- [Oracle Script] check tablespace usage infoOracle
- [Oracle Script] check temp tablespace usageOracle
- [Oracle Script] check object count by userOracleObject
- [Oracle Script] check File I/OOracle
- 給ASM例項增加diskgroupASM
- ASM DISK HEADER CORRUPTION & REPAIRASMHeaderAI
- ASM管理 - 如何重新命名diskgroupASM
- Using FTP Transferring Non-ASM Datafiles to ASM diskgroupFTPASM
- oracle asm diskgroup add datafile error problemOracleASMError
- 學習ASM技術(三)--diskgroup管理ASM
- 學習ASM技術(二)--diskgroup管理ASM
- 新建或修改ASM diskgroup 的問題ASM
- [Oracle Script] ASM Disks Performance metricOracleASMORM
- How to move ASM database files from one diskgroup to anotherASMDatabase
- votedisk在ASM diskgroup上的存放規律ASM
- 檢查asm磁碟組狀態的檢視v$asm_diskgroupASM
- [Oracle] Device Checks for ASM - This is a pre-check........OracledevASM
- Oracle OCP 1Z0 053 Q33(ALTER DISKGROUP ** CHECK)Oracle
- Linux 磁碟對應 ASM diskgroup 中的磁碟LinuxASM
- 在ASM Diskgroup間移動資料檔案ASM
- 向ASM diskgroup中新增磁碟的例行檢查ASM
- ASM Diskgroup Can Not Be Shown When Creating Database With DBCAASMDatabase
- solaris 10_oracle asm_diskgroup_failgroup_相關OracleASMAI
- [Oracle Script] ASM Disk Groups UsedOracleASM
- Some adminitration script for RAC % ASMASM
- ASM diskgroup dismount with "Waited 15 secs for write IO to PST"ASMAI
- How to free space from an ASM diskgroup? (Doc ID 1553744.1)ASM
- How to restore ASM based OCR after complete loss of the CRS diskgroupRESTASM
- Using SQL Script Get Information about ASMSQLORMASM