删除ASM实例
今天傍晚想起用OEL5U3安装Oracle10g,本想着如何在linux上用裸设备实现Oracle安装,可是一时没想出什么好的办法(之前做过一次裸设备的,虽然勉强实现了,但是还需要建立到裸设备文件的连接文件,个人感觉太笨拙了,一定有更好的办法,至少应该可以像在HP-UX/AIX里面,直接使用/dev/rxxxxxx之类,才算比较方便。)后来想起来前几天用ASM搭建的RAC环境,是啊,何必不用ASM呢,这么富有前景的东西,应该好好整整,有了ASM,裸设备应该也快要退出历史舞台了。
之所以要删除ASM是由于我在安装时,没有规划好存储,(后悔了),可是后来再运行的时候,却百试不爽了,就至少先把之前第一次执行DBCA创建的ASM实例删除掉了。具体如下:
看下系统里面关于ASM的进程:
[oracle@ligle-db ~]$ ps -ef | grep asm
oracle 4138 1 0 03:45
? 00:00:00 asm_pmon_+ASM
oracle 4140 1 0 03:45 ?
00:00:00 asm_psp0_+ASM
oracle 4142 1 0 03:45 ? 00:00:00
asm_mman_+ASM
oracle 4144 1 0 03:45 ? 00:00:00
asm_dbw0_+ASM
oracle 4146 1 0 03:45 ? 00:00:00
asm_lgwr_+ASM
oracle 4148 1 0 03:45 ? 00:00:00
asm_ckpt_+ASM
oracle 4150 1 0 03:45 ? 00:00:00
asm_smon_+ASM
oracle 4152 1 0 03:45 ? 00:00:00
asm_rbal_+ASM
oracle 4154 1 0 03:45 ? 00:00:01
asm_gmon_+ASM
oracle 5309 4028 0 04:09 pts/0 00:00:00 grep
asm
设置ORACLE_SID为ASM实例名,且进入ASM实例
[oracle@ligle-db ~]$ export ORACLE_SID=+ASM
[oracle@ligle-db ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Nov 29 04:10:17 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
检查ASM实例上的磁盘组(DISKGROUP)
SQL> select name from v$asm_diskgroup;
NAME
------------------------------
LIGLE_ARCH1
SQL> drop diskgroup ligle_arch1 including contents; -->删除磁盘组
Diskgroup dropped.
SQL> shutdown -->关闭ASM实例
ASM
diskgroups dismounted
ASM instance shutdown
SQL> exit
Disconnected from Oracle Database 10g
Enterprise Edition Release 10.2.0.1.0 - Production
从CSS中删除ASM实例信息
[oracle@ligle-db ~]$ oradism -delete -asmsid +ASM
删除ASM相关的参数文件(pfile/spfile)
[oracle@ligle-db ~]$ cd $ORACLE_HOME/dbs
[oracle@ligle-db dbs]$ ls
ab_+ASM.dat hc_+ASM.dat
initdw.ora init.ora lk+ASM orapw+ASM spfile+ASM.ora
[oracle@ligle-db dbs]$ rm -rf *+ASM*
[oracle@ligle-db dbs]$ cd $ORACLE_BASE/admin
[oracle@ligle-db admin]$ ls
+ASM
[oracle@ligle-db admin]$ rm -rf *
删除/etc/oratab中关于ASM自动启动的信息
[oracle@ligle-db admin]$ vi /etc/oratab
#
# This file is used by ORACLE utilities. It is
created by root.sh
# and updated by the Database Configuration Assistant when
creating
# a database.
# A colon, ':', is used as the field terminator. A
new line terminates
# the entry. Lines beginning with a pound sign, '#', are
comments.
#
# Entries are of the form:
#
$ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are
the system identifier and home
# directory of the database respectively. The
third filed indicates
# to the dbstart utility that the database should ,
"Y", or should not,
# "N", be brought up at system boot time.
#
#
Multiple entries with the same $ORACLE_SID are not
allowed.
#
#
+ASM:/u01/app/oracle/product/10.2.0/db_1:N
至此,基本ASM就删除干净了,可以再重新来一遍了,哈哈!