ORA-12162

2.故障原因

诡异的故障背后的原因竟然是那样的基础:ORACLE_SID没有指定!
确认系统当前的ORACLE_HOME和ORACLE_SID环境变量

[sql] view plain copy

  1. [oracle@asdlabdb01 ~]$ echo $ORACLE_HOME  
  2. /oracle/app/oracle/product/10.2.0/db_1  
  3. [oracle@asdlabdb01 ~]$ echo $ORACLE_SID  
  4.   
  5. [oracle@asdlabdb01 ~]$  


可见,此时只设置了ORACLE_HOME环境变量,但ORACLE_SID此时为空,这就是该问题的真实原因。

3.故障处理

给出ORACLE_SID,重新尝试登录。

[sql] view plain copy

 
  1. [oracle@asdlabdb01 ~]$ export ORACLE_SID=ora10g  
  2. [oracle@asdlabdb01 ~]$ echo $ORACLE_SID  
  3. ora10g  
  4. [oracle@asdlabdb01 ~]$ sqlplus / as sysdba  
  5.   
  6. SQL*Plus: Release 10.2.0.3.0 - Production on Sat Aug 27 23:27:34 2010  
  7.   
  8. Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.  
  9.   
  10. Connected to:  
  11. Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production  
  12. With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options  
  13.   
  14. sys@ora10g>  


OK,此时问题处理完毕。

原文地址:https://www.cnblogs.com/feiyun8616/p/7422716.html