Identify If A Disk/Part Is Still Used By ASM,Used by ASM Or Used by ASM_603210.1
How To Identify If A Disk/Partition Is Still Used By ASM, Has Been Used by ASM Or Has Not Been Used by ASM (Unix/Linux)? (Doc ID 603210.1)
In this Document
Applies to:Oracle Server - Enterprise Edition - Version 10.1.0.2 to 11.1.0.7 [Release 10.1 to 11.1]Information in this document applies to any platform. GoalThe present C program will help us to identify if a Disk/Partition is still used by ASM, has been used by ASM or has not been used by ASM on Unix or Linux platforms. Fix1) First of all, we need to compile the next C code:
#include
#include #define BLOCK_SIZE 4096 int main(int argc, char *argv[]) { char buf[BLOCK_SIZE]; char *fname; int fd; int count; if (argc != 2) { fprintf(stderr, "Exactly one argument required\n"); return (-1); } fname = argv[1]; fd = open(fname, O_RDONLY); if (fd { perror(fname); return (-1); } count = read(fd, buf, sizeof(buf)); if (count { perror(fname); return (-1); } if (count { return (1); } if ( buf[32] == 'O' && buf[33] == 'R' && buf[34] == 'C' && buf[35] == 'L' && buf[36] == 'D' && buf[37] == 'I' && buf[38] == 'S' && buf[39] == 'K') { if (buf[71] != 4) { printf("This disk %s still used by ASM\n",argv[1]); return (0); } else printf("This disk %s has been used by ASM\n",argv[1]); return (0); } printf("This disk %s has not been used by ASM\n",argv[1]); return (1); }
2) Save the above code in an ASCII file, then using a C Compiler compile it as follow:
$> -ls
-rw-r--r-- 1 oracle oinstall 2014 Jun 16 15:57 checkasmdisk.c $> cc checkasmdisk.c -o checkasmdisk $> -ls -rwxr-xr-x 1 oracle oinstall 5670 Jun 16 15:57 checkasmdisk -rw-r--r-- 1 oracle oinstall 2014 Jun 16 15:57 checkasmdisk.c
3) Check the desired disk(s), we can obtain 4 states: 3.1) Disk has not been used by ASM:
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> !dd if=/dev/zero of=/dev/sda14 bs=8192 count=12800 12800+0 records in 12800+0 records out SQL> !checkasmdisk /dev/sda14 This disk /dev/sda14 has not been used by ASM
3.2) Disk is still used by ASM :
SQL> create diskgroup DATADG external redundancy disk '/dev/sda14';
Diskgroup created. SQL> !checkasmdisk /dev/sda14 This disk /dev/sda14 still used by ASM
3.3) Disk has been used by ASM:
SQL> drop diskgroup DATADG;
Diskgroup dropped. SQL> !checkasmdisk /dev/sda14 This disk /dev/sda14 has been used by ASM
3.4) Disk cannot be accessed:
# ls -l /dev/sda14
brw-rw---- 1 oracle dba 8, 14 Jun 11 19:12 /dev/sda14 # chown root:disk /dev/sda14 # ls -l /dev/sda14 brw-rw---- 1 root disk 8, 14 Jun 11 19:12 /dev/sda14 SQL> !checkasmdisk /dev/sda14 /dev/sda14: Permission denied brw-rw---- 1 oracle dba 8, 14 Jun 11 19:12 /dev/sda14
|
|
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17252115/viewspace-1402364/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle ASM Disk Used Space DirectoryOracleASM
- [Oracle Script] ASM Disk Groups UsedOracleASM
- ASM Spfile Is Not Used when ASM Instance StartsASM
- ASM tools used by Support : KFOD, KFED, AMDU (Doc ID 1485597.1)ASM
- Script form where usedORM
- Signals used by the JVMJVM
- How Views Are Used (176)View
- Oracle Least Recently Used ChainsOracleASTAI
- Standard Functions Used in SAP Retail with ArticlesFunctionAI
- Accessing Frequently Used Dictionary ObjectsObject
- 教育授權certificate used to sign the license
- pod》error:The dependency `` is not used in any concrete targetError
- install redis and used in golang on ubuntu 14.04RedisGolangUbuntu
- zabbix修改Template OS Linux模版Used memoryLinux
- drop asm disk、撤銷drop asm diskASM
- Android @Field parameters can only be used with form encodingAndroidORMEncoding
- name server cannot be used, reason: Temporary failure in name resolutionServerAI
- Used+Available不等於1K-blocksAIBloC
- Default Data Type Mappings Used by Oracle SQL DeveloperAPPOracleSQLDeveloper
- Asm disk managerASM
- 解決 TypeError: Type aliases cannot be used with isinstance(). 辦法Error
- Can Tapes Be Used For RMAN Convert Database (Doc ID 563816.1)Database
- 【BBED】使用bbed解決 the amount of space used is not equal to block sizeBloC
- "alter system kill session" can crash the instance if IO slaves usedSession
- object dict cannot be used in await expression報錯解釋ObjectAIExpress
- 手工建立ASM Disk Groups、為 ASM Disk Groups 新增 diskASM
- what storage is used in a LOBSEGMENT and should it be shrunk / reorg-1453350.1
- ORA-02429: cannot drop index used for enforcement of unique/primary keyIndex
- SM$TS_USED,SM$TS_FREE,SM$TS_AVAILAI
- LOCAL INDEX和HINT的使用【DO BE USED LOCAL INDEX IN HINT】薦Index
- ASM: Device is already labeled for ASM diskASMdev
- Oracle ASM Disk DirectoryOracleASM
- Oracle ASM Disk PartnerOracleASM
- ASM Disk Group TemplateASM
- 什麼是 ABAP 程式語言的 Used Memory 和 Allocated Memory
- CocoaPods報錯:The dependency `AFNetworking ` is not used in any concrete target
- OGEM centrifugal pump and vacuum degasser used in solids control processSolid
- Mount Options for Oracle files when used with NFS on NAS devices_359515.1OracleNFSdev