ITPub博客

首页 > 数据库 > Oracle > ORA-12162: TNS:net service name is incorrectly specified

ORA-12162: TNS:net service name is incorrectly specified

原创 Oracle 作者:intser 时间:2015-03-17 20:48:50 0 删除 编辑

点击(此处)折叠或打开

  1. [oracle@e1 ~]$ sqlplus / as sysdba

  2. SQL*Plus: Release 11.2.0.3.0 Production on Fri Oct 24 14:25:44 2014

  3. Copyright (c) 1982, 2011, Oracle. All rights reserved.

  4. ERROR:
  5. ORA-12162: TNS:net service name is incorrectly specified


  6. Enter user-name:
  7. ERROR:
  8. ORA-12162: TNS:net service name is incorrectly specified


  9. Enter user-name:
  10. ERROR:
  11. ORA-12162: TNS:net service name is incorrectly specified


  12. SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
  13. [oracle@e1 ~]$


这个错误是因为ORACLE_SID变量没有传进去造成的。
把ORACLE_SID变量赋值,登录数据库。

点击(此处)折叠或打开

  1. [oracle@e1 ~]$ echo $ORACLE_SID


    [oracle@e1 ~]$ 
    [
    oracle@e1 ~]$ export ORACLE_SID=P1
  2. [oracle@e1 ~]$ echo $ORACLE_SID
  3. P1
  4. [oracle@e1 ~]$ sqlplus / as sysdba

  5. SQL*Plus: Release 11.2.0.3.0 Production on Fri Oct 24 14:28:13 2014

  6. Copyright (c) 1982, 2011, Oracle. All rights reserved.

  7. Connected to an idle instance.

  8. SYS@P1>startup
  9. ORACLE instance started.

  10. Total System Global Area 920678400 bytes
  11. Fixed Size 1348720 bytes
  12. Variable Size 549456784 bytes
  13. Database Buffers 364904448 bytes
  14. Redo Buffers 4968448 bytes
  15. Database mounted.
  16. Database opened.
  17. SYS@P1>


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29505646/viewspace-1463405/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-02-25

  • 博文量
    11
  • 访问量
    87364