注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

Memory extender

Beautiful Day..

 
 
 

日志

 
 

异样的ORA-12154: TNS:could not resolve the connect identifier specified  

2010-07-30 08:13:52|  分类: Oracle Database |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
       经常会遇到ora-12154,通常是因为连接字符串的内容信息有误造成。
       异样的ORA-12154: TNS:could not resolve the connect identifier specified - G - Memory extender
      
       
       --------------------------------------------------------分割线------------------------------------------------------------- 

       下面这个却是服务器端无法连接DB 

其它机器可以正常连DB,但在服务器本身上面却无法连,报ora-12154

原因是之前曾经将sqlnet.ora里面的NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT) mark掉,改回来就OK了。

[oracle@localhost ~]$ sqlplus /@LORCL as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jul 29 14:18:00 2010

 

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

 

ERROR:

ORA-12154: TNS:could not resolve the connect identifier specified

 

[oracle@localhost ~]$ pwd

/home/oracle

[oracle@localhost ~]$ cat .bash_profile

# .bash_profile

 

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

        . ~/.bashrc

fi

 

# User specific environment and startup programs

 

PATH=$PATH:$HOME/bin

ORACLE_BASE=/home/oracle/oracle

export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1

export ORACLE_HOME

PATH=$PATH:$ORACLE_HOME/bin

export PATH

ORACLE_SID=lorcl

export ORACLE_SID

[oracle@localhost ~]$ vi .bash_profile

 

--将ORACLE_SID改成了大写LORCL,还是不行

 

[oracle@localhost ~]$ sqlplus

 

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jul 29 14:19:51 2010

 

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

 

Enter user-name: /@LORCL as sysdba

ERROR:

ORA-12154: TNS:could not resolve the connect identifier specified

 

 

[oracle@localhost ~]$ cd oracle/product/10.2.0/db_1/network/admin

[oracle@localhost admin]$ ls

listener1007218PM3600.bak   sqlnet10072911AM0251.bak

listener10072910AM5813.bak  sqlnet10072911AM0305.bak

listener10072911AM0251.bak  sqlnet10072911AM0407.bak

listener10072911AM0305.bak  sqlnet.ora

listener10072911AM0407.bak  tnsnames1007218PM3601.bak

listener.ora                tnsnames10072910AM5813.bak

samples                     tnsnames10072911AM0251.bak

shrept.lst                  tnsnames10072911AM0305.bak

sqlnet1007218PM3600.bak     tnsnames10072911AM0407.bak

sqlnet1007218PM4452.bak     tnsnames.ora

sqlnet10072910AM5813.bak

[oracle@localhost admin]$ cat tnsnames.ora

# tnsnames.ora Network Configuration File: /home/oracle/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.

 

LORCL =

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))

    )

    (CONNECT_DATA =

      (SERVICE_NAME = LORCL)

    )

  )

 

EXTPROC_CONNECTION_DATA =

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))

    )

    (CONNECT_DATA =

      (SID = PLSExtProc)

      (PRESENTATION = RO)

    )

  )

[oracle@localhost admin]$ cat sqlnet.ora

# sqlnet.ora Network Configuration File: /home/oracle/oracle/product/10.2.0/db_1/network/admin/sqlnet.ora

# Generated by Oracle configuration tools.

 

#NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

NAMES.DIRECTORY_PATH= (NONE)

 

[oracle@localhost admin]$ vi sqlnet

将之前某个时间mark掉的NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

改回去。

[oracle@localhost admin]$ sqlplus

 

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jul 29 14:22:36 2010

 

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

 

Enter user-name: /@LORCL AS SYSDBA

ERROR:

ORA-01031: insufficient privileges

 

 

Enter user-name: sys/hgd@LORCL as sysdba

 

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

 

SQL>

 


  评论这张
 
阅读(5323)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018