RAC中ORACLE_SID区分大小写(11.2.0.1)

做实验,登录一个节点, 发现切换到oracle用户,然后直接sqlplus,显示数据库未启动
-bash-4.1$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on 星期五 9月 13 14:39:24 2013

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

Connected to an idle instance.

SQL> 

但是,数据库确实是启动的
-bash-4.1$ crs_stat -t -v
名称           类型           R/RA   F/FT   目标      状态      主机        
----------------------------------------------------------------------
ora.DATADG.dg  ora....up.type 0/5    0/     ONLINE    ONLINE    ais1        
ora....ER.lsnr ora....er.type 0/5    0/     ONLINE    ONLINE    ais1        
ora....N1.lsnr ora....er.type 0/5    0/0    ONLINE    ONLINE    ais1        
ora.SYSDG.dg   ora....up.type 0/5    0/     ONLINE    ONLINE    ais1        
ora....SM1.asm application    0/5    0/0    ONLINE    ONLINE    ais1        
ora....S1.lsnr application    0/5    0/0    ONLINE    ONLINE    ais1        
ora.ais1.gsd   application    0/5    0/0    OFFLINE   OFFLINE               
ora.ais1.ons   application    0/3    0/0    ONLINE    ONLINE    ais1        
ora.ais1.vip   ora....t1.type 0/0    0/0    ONLINE    ONLINE    ais1        
ora....SM2.asm application    0/5    0/0    ONLINE    ONLINE    ais2        
ora....S2.lsnr application    0/5    0/0    ONLINE    ONLINE    ais2        
ora.ais2.gsd   application    0/5    0/0    OFFLINE   OFFLINE               
ora.ais2.ons   application    0/3    0/0    ONLINE    ONLINE    ais2        
ora.ais2.vip   ora....t1.type 0/0    0/0    ONLINE    ONLINE    ais2        
ora.asm        ora.asm.type   0/5    0/     ONLINE    ONLINE    ais1        
ora.eons       ora.eons.type  0/3    0/     ONLINE    ONLINE    ais1        
ora.gsd        ora.gsd.type   0/5    0/     OFFLINE   OFFLINE               
ora....network ora....rk.type 0/5    0/     ONLINE    ONLINE    ais1        
ora.oc4j       ora.oc4j.type  0/5    0/0    OFFLINE   OFFLINE               
ora.ons        ora.ons.type   0/3    0/     ONLINE    ONLINE    ais1        
ora.prod.db    ora....se.type 0/2    0/1    ONLINE    ONLINE    ais1        
ora.scan1.vip  ora....ip.type 0/0    0/0    ONLINE    ONLINE    ais1

原因为,oracle用户的.bash_profile中的ORACLE_ID为大写

-bash-4.1$ echo $ORACLE_SID
PROD1
-bash-4.1$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on 星期五 9月 13 14:38:33 2013

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

Connected to an idle instance.

SQL> exit
Disconnected

修改一下,正常连接
-bash-4.1$ export ORACLE_SID=prod1
-bash-4.1$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on 星期五 9月 13 14:39:52 2013

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> 

但是直接通过VIP加数据库名的方式连接不区分大小写

-bash-4.1$ sqlplus aisj/aisj@192.168.3.7/PROD 

SQL*Plus: Release 11.2.0.1.0 Production on 星期五 9月 13 14:41:32 2013

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options



-bash-4.1$ sqlplus aisj/aisj@192.168.3.7/PRod

SQL*Plus: Release 11.2.0.1.0 Production on 星期五 9月 13 14:41:39 2013

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL>
请使用浏览器的分享功能分享到微信等