---
title: "删除Linux非rac环境下的ASM实例"
author: "libin123"
date: "2010-04-25T01:48:58Z"
tags: []
categories: ["数据库"]
slug: "linux-rac-asm"
draft: false
lastmod: "2010-04-25T01:48:58Z"
id: 652365
url: "https://dbua.iteye.com/blog/652365"
---

**环境说明：**

操作系统：CentOS 5 x86  
数据库：Oracle 10.2.0.1 非RAC环境  
ASM实例名：+ASM

参考：metalink node:311350.1

**1、检查ASM实例进程**

ora\_test@oracle\[/home/oracle]&gt; ps -ef|grep asm|grep -v grep  
oracle 4263 1 0 Jan20 ? 00:00:02 asm\_pmon\_+ASM  
oracle 4265 1 0 Jan20 ? 00:00:00 asm\_psp0\_+ASM  
oracle 4267 1 0 Jan20 ? 00:00:00 asm\_mman\_+ASM  
oracle 4269 1 0 Jan20 ? 00:00:00 asm\_dbw0\_+ASM  
oracle 4271 1 0 Jan20 ? 00:00:00 asm\_lgwr\_+ASM  
oracle 4273 1 0 Jan20 ? 00:00:00 asm\_ckpt\_+ASM  
oracle 4275 1 0 Jan20 ? 00:00:00 asm\_smon\_+ASM  
oracle 4277 1 0 Jan20 ? 00:00:00 asm\_rbal\_+ASM  
oracle 4279 1 0 Jan20 ? 00:00:06 asm\_gmon\_+ASM

**2、设置ASM实例名**

ora\_test@oracle\[/home/oracle]&gt; export ORACLE\_SID=+ASM

**3、检查是否有实例在使用ASM**

ora\_test@oracle\[/home/oracle]&gt; sqlplus / as sysdba

SQL\*Plus: Release 10.2.0.1.0 - Production on Thu Jan 21 08:44:03 2010

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:  
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production  
With the Partitioning, OLAP and Data Mining options

idle&gt; select instance\_name from v$asm\_client;

no rows selected

如果有实例在使用ASM，需要首先停止这些相关的实例，并备份相关的datafile、controlfile等

**4、检查ASM实例上的diskgroup**

idle&gt; select name from v$asm\_diskgroup;

NAME  
\------------------------------  
DATA

**5、删除检查到ASM实例上的diskgroup**

idle&gt; drop diskgroup data including contents;

Diskgroup dropped.

**6、关闭ASM实例**

idle&gt; shutdown  
ORA-15100: invalid or missing diskgroup name

ASM instance shutdown  
idle&gt; exit  
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production  
With the Partitioning, OLAP and Data Mining options

**7、从css中删除ASM实例信息**

ora\_test@oracle\[/home/oracle]&gt; oradism -delete -asmsid +ASM

**8、删除ASM实例相关的spfile、pfile等文件**

ora\_test@oracle\[/home/oracle]&gt; cd $ORACLE\_HOME/dbs  
ora\_test@oracle\[/oracle/app/10.1/dbs]&gt; rm -f \*+ASM*  
ora\_test@oracle\[/oracle/app/10.1/dbs]&gt; cd $ORACLE\_BASE/admin  
ora\_test@oracle\[/oracle/admin]&gt; rm -rf +ASM

**9、删除/etc/oratab文件中的ASM实例相关行**

删除/etc/oratab文件中的如下行

其实删除oracle 实例同样要查出该文件的内容

+ASM:/oracle/app/10.1:Y

**10、用root用户删除cssd服务**

ora\_test@root\[/oracle/app/10.1/bin]&gt; ./localconfig delete  
Stopping CSSD.  
Shutting down CSS daemon.  
Shutdown request successfully issued.  
Shutdown has begun. The daemons should exit soon.

**11、清除ASM使用的设备的文件头信息**

ora\_test@oracle\[/home/oracle]&gt; cd /dev/raw/  
ora\_test@oracle\[/dev/raw]&gt; ls -l *  
crw------- 1 oracle oinstall 162, 1 Jan 21 08:45 raw1  
crw------- 1 oracle oinstall 162, 2 Jan 21 08:45 raw2  
crw------- 1 oracle oinstall 162, 3 Jan 21 08:45 raw3  
ora\_test@oracle\[/dev/raw]&gt; dd if=/dev/zero of=/dev/raw/raw1 bs=1024 count=10  
10+0 records in  
10+0 records out  
10240 bytes (10 kB) copied, 0.00396028 seconds, 2.6 MB/s  
ora\_test@oracle\[/dev/raw]&gt; dd if=/dev/zero of=/dev/raw/raw2 bs=1024 count=10  
10+0 records in  
10+0 records out  
10240 bytes (10 kB) copied, 0.00485093 seconds, 2.1 MB/s  
ora\_test@oracle\[/dev/raw]&gt; dd if=/dev/zero of=/dev/raw/raw3 bs=1024 count=10  
10+0 records in  
10+0 records out  
10240 bytes (10 kB) copied, 0.00532261 seconds, 1.9 MB/s

--end--