本帖最后由 wildwave 于 2014-06-28 15:58:19 编辑

解决方案 »

  1.   

    ORA-12162: TNS:net service name is incorrectly specified
    Cause: The connect descriptor corresponding to the net service name in TNSNAMES.ORA or in the directory server (Oracle Internet Directory) is incorrectly specified.
    Action: If using local naming make sure there are no syntax errors in the corresponding connect descriptor in the TNSNAMES.ORA file. If using directory naming check the information provided through the administration used for directory naming.
    检查tnsname.ora文件中的网络服务名的配置
      

  2.   

    我的tnsname.ora文件:
    ORCL =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
        )
        (CONNECT_DATA =
          (SERVICE_NAME = orcl)
        )
      )
      

  3.   

    http://blog.csdn.net/wallwind/article/details/6775783看看oracle_sid有没有设置。另外,HOST = 127.0.0.1修改为电脑的ip试试。
      

  4.   

    和oracle_sid没有关系,不是同一种场景pl/sql dev连接时指定的database是orcl么?
    如果是的话,看看本机上是否装了不止一个数据库软件,比如同时装了多个Oracle服务端、多个Oracle客户端,或者同时装了服务端和客户端,如果是这种情况,在环境变量中将Oracle_home指定到你说的tnsnames.ora文件所在的那个目录下(实际上是tnsnames.ora所在的目录的上上级),或者将你的tnsnames.ora文件在这几个目录中分别拷贝粘贴一份
      

  5.   

    su - oracle
    vi ~/.bash_profile
    你试下在oracle用户下为.bash_profile添加下面的字段
    ORACLE_SID=orcl
    export ORACLE_SID