今天发现asmcmd的时候是连接了空实例
[grid@RAC01 ~]$ asmcmd
Connected to an idle instance.
ASMCMD> ls
ASMCMD-8102: no connection to ASM; command requires ASM to run
ASMCMD> exit
想当然的进到asm实例中进行启动
[grid@RAC01 ~]$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.3.0 Production on Wed Sep 23 22:38:57 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORA-00304: requested INSTANCE_NUMBER is busy
SQL> exit
通过查看发现crs_stat发现asm正常
[grid@RAC01 ~]$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
———————————————————————-
ora.ARCH.dg ora….up.type 0/5 0/ ONLINE ONLINE rac01
ora….VOTE.dg ora….up.type 0/5 0/ ONLINE ONLINE rac01
ora.DATA.dg ora….up.type 0/5 0/ ONLINE ONLINE rac01
ora….ER.lsnr ora….er.type 0/5 0/ ONLINE ONLINE rac01
ora….N1.lsnr ora….er.type 0/5 0/0 ONLINE ONLINE rac02
ora.REDO.dg ora….up.type 0/5 0/ ONLINE ONLINE rac01
ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE rac01
ora.cvu ora.cvu.type 0/5 0/0 ONLINE ONLINE rac02
ora.gsd ora.gsd.type 0/5 0/ OFFLINE OFFLINE
ora….network ora….rk.type 0/5 0/ ONLINE ONLINE rac01
ora.oc4j ora.oc4j.type 0/1 0/2 ONLINE ONLINE rac02
ora.ons ora.ons.type 0/3 0/ ONLINE ONLINE rac01
ora….SM1.asm application 0/5 0/0 ONLINE ONLINE rac01
ora….01.lsnr application 0/5 0/0 ONLINE ONLINE rac01
ora.rac01.gsd application 0/5 0/0 OFFLINE OFFLINE
ora.rac01.ons application 0/3 0/0 ONLINE ONLINE rac01
ora.rac01.vip ora….t1.type 0/0 0/0 ONLINE ONLINE rac01
ora….SM2.asm application 0/5 0/0 ONLINE ONLINE rac02
ora….02.lsnr application 0/5 0/0 ONLINE ONLINE rac02
ora.rac02.gsd application 0/5 0/0 OFFLINE OFFLINE
ora.rac02.ons application 0/3 0/0 ONLINE ONLINE rac02
ora.rac02.vip ora….t1.type 0/0 0/0 ONLINE ONLINE rac02
ora.scan1.vip ora….ip.type 0/0 0/0 ONLINE ONLINE rac02
查看ASM进程
[grid@RAC01 ~]$ ps -ef|grep asm
grid 3063 1 0 20:30 ? 00:00:01 asm_pmon_+ASM1
grid 3065 1 0 20:30 ? 00:00:01 asm_psp0_+ASM1
grid 3067 1 1 20:30 ? 00:01:45 asm_vktm_+ASM1
grid 3071 1 0 20:30 ? 00:00:00 asm_gen0_+ASM1
grid 3073 1 0 20:30 ? 00:00:04 asm_diag_+ASM1
grid 3075 1 0 20:30 ? 00:00:01 asm_ping_+ASM1
grid 3077 1 0 20:30 ? 00:00:17 asm_dia0_+ASM1
grid 3079 1 0 20:30 ? 00:00:12 asm_lmon_+ASM1
grid 3081 1 0 20:30 ? 00:00:11 asm_lmd0_+ASM1
grid 3083 1 0 20:30 ? 00:00:14 asm_lms0_+ASM1
grid 3087 1 0 20:30 ? 00:00:00 asm_lmhb_+ASM1
grid 3089 1 0 20:30 ? 00:00:00 asm_mman_+ASM1
grid 3091 1 0 20:30 ? 00:00:00 asm_dbw0_+ASM1
grid 3093 1 0 20:30 ? 00:00:00 asm_lgwr_+ASM1
grid 3095 1 0 20:30 ? 00:00:00 asm_ckpt_+ASM1
grid 3097 1 0 20:30 ? 00:00:00 asm_smon_+ASM1
grid 3099 1 0 20:30 ? 00:00:04 asm_rbal_+ASM1
grid 3101 1 0 20:30 ? 00:00:00 asm_gmon_+ASM1
grid 3103 1 0 20:30 ? 00:00:00 asm_mmon_+ASM1
grid 3105 1 0 20:30 ? 00:00:00 asm_mmnl_+ASM1
grid 3107 1 0 20:30 ? 00:00:00 asm_lck0_+ASM1
grid 3131 1 0 20:30 ? 00:00:00 asm_asmb_+ASM1
grid 3133 1 0 20:30 ? 00:00:00 oracle+ASM1_asmb_+asm1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 5240 4815 2 22:16 pts/0 00:00:37 /u01/app/oracle/product/11.2.0/dbhome_1/jdk/jre/bin/java -Doracle.installer.not_bootstrap=true -DORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 -DSET_LAF= -Dsun.java2d.font.DisableAlgorithmicStyles=true -Dice.pilots.html4.ignoreNonGenericFonts=true -DDISPLAY=:0.0 -DJDBC_PROTOCOL=thin -mx128m -classpath /u01/app/oracle/product/11.2.0/dbhome_1/assistants/dbca/jlib/dbca.jar:/u01/app/oracle/product/11.2.0/dbhome_1/assistants/jlib/assistantsCommon.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/ewt3.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/ewtcompat-3_3_15.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/share.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/help4.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/jewt4.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/oracle_ice5.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/kodiak.jar:/u01/app/oracle/product/11.2.0/dbhome_1/lib/xmlparserv2.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/orai18n.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/ldapjclnt11.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/netcfg.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/ojmisc.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/oraclepki103.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/opm.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jdbc/lib/ojdbc5.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/srvm.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/srvmhas.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/srvmasm.jar:/u01/app/oracle/product/11.2.0/dbhome_1/classes:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/oemlt.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/emca.jar:/u01/app/oracle/product/11.2.0/dbhome_1/sysman/jlib/emCORE.jar:/u01/app/oracle/product/11.2.0/dbhome_1/oc4j/j2ee/home/oc4j.jar:/u01/app/oracle/product/11.2.0/dbhome_1/oc4j/j2ee/home/db_oc4j_deploy.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/emConfigInstall.jar:/u01/app/oracle/product/11.2.0/dbhome_1/oui/jlib/OraInstaller.jar:/u01/app/oracle/product/11.2.0/dbhome_1/oui/jlib/OraPrereq.jar:/u01/app/oracle/product/11.2.0/dbhome_1/inventory/prereqs/oui/OraPrereqChecks.jar:/u01/app/oracle/product/11.2.0/dbhome_1/oui/jlib/OraPrereqChecks.jar:/u01/app/oracle/product/11.2.0/dbhome_1/oui/jlib/OraCheckPoint.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/cvu.jar:/u01/app/oracle/product/11.2.0/dbhome_1/dv/jlib/dvca.jar:/u01/app/oracle/product/11.2.0/dbhome_1/jlib/gns.jar oracle.sysman.assistants.dbca.Dbca
grid 6140 6096 0 22:38 pts/2 00:00:00 grep asm
然后想到是不是环境变量配置错了
[grid@RAC01 ~]$ echo $ORACLE_SID
+ASM2
配置方法是将~/.bash_profile文件中的$ORACLE_SID=+ASM2改为$ORACLE_SID=+ASM1,然后通过source ~/.bash_profile即可(不一定是ASM1,具体的要看实际的实例名字)
发现ORACLE_SID对应的实例名是错的,故而将环境变量修改正确后,一切正常
[grid@RAC01 ~]$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.3.0 Production on Wed Sep 23 22:42:34 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> select status from v$instance;
STATUS
————
STARTED
网上说可以通过
alter system set INSTANCE_NUMBER=1 scope=spfile sid=’rac1′;
alter system set INSTANCE_NUMBER=2 scope=spfile sid=’rac2′;
进行修改即可