连接数据库报错ORA-12514


连接时报错:  

      [oracle@yangtk2 ~]$ lsnrctl status
  LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 01-SEP-2008 17:36:03
  Copyright (c) 1991, 2007, Oracle. All rights reserved.
  Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
  STATUS of the LISTENER
  ------------------------
  Alias LISTENER
  Version TNSLSNR for Linux: Version 11.1.0.6.0 - Production
  Start Date 01-SEP-2008 17:01:31
  Uptime 0 days 0 hr. 34 min. 32 sec
  Trace Level off
  Security ON: Local OS Authentication
  SNMP OFF
  Listener Parameter File /data/oracle/product/11.1/network/admin/listener.ora
  Listener Log File /data/oracle/diag/tnslsnr/yangtk2/listener/alert/log.xml
  Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.25.1.104)(PORT=1521)))
  The listener supports no services
  The command completed successfully


  检查listener.ora和tnsnames.ora都未发现异常:  

       [oracle@yangtk2 admin]$ more listener.ora
  # listener.ora Network Configuration File: /data/oracle/product/11.1/network/admin/listener.ora
  # Generated by Oracle configuration tools.
  LISTENER =
  (DESCRIPTION_LIST =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.25.1.104)(PORT = 1521))
  )
  )
  [oracle@yangtk2 admin]$ more tnsnames.ora
  # tnsnames.ora Network Configuration File: /data/oracle/product/11.1/network/admin/tnsnames.ora
  # Generated by Oracle configuration tools.
  ORA11G_S =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.25.1.104)(PORT = 1521))
  (CONNECT_DATA =
  (SERVER = DEDICATED)
  (SERVICE_NAME = ora11g_s.ytk-thinkpad)
  )
  )
  ORA11G_P =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.25.1.102)(PORT = 1521))
  (CONNECT_DATA =
  (SERVER = DEDICATED)
  (SERVICE_NAME = ora11g_p.ytk-thinkpad)
  )
  )

而且以前这个配置没有任何问题,就是这次启动虚机后才出现的问题。         

  查询了metalink,虽然上面记载了很多ORA-12514错误,但是没有发现什么有帮助的线索。

  由于这个错误以前并没有出现,所以怀疑是最近修改了什么东西导致了这个问题。而启动之后做了唯一的修改就是修改了主机的IP地址。

  通过ifconfig修改了主机IP地址,莫非是修改错误导致了问题,不过现在通过IP地址可以正常的登陆主机,而且tnsping也没有任何的问题:  

      [oracle@yangtk2 admin]$ tnsping ora11g_s
  TNS Ping Utility for Linux: Version 11.1.0.6.0 - Production on 01-SEP-2008 17:54:31
  Copyright (c) 1997, 2007, Oracle. All rights reserved.
  Used parameter files:
  /data/oracle/product/11.1/network/admin/sqlnet.ora
  Used TNSNAMES adapter to resolve the alias
  Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.25.1.104)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ora11g_s.ytk-thinkpad)))
  OK (0 msec)
  最后检查listner的日志:
  [oracle@yangtk2 admin]$ tail -20 /data/oracle/diag/tnslsnr/yangtk2/listener/alert/log.xml     
   
  type='UNKNOWN' level='16' host_id='yangtk2.ytk-thinkpad'
  host_addr='172.25.4.70'>
  01-SEP-2008 17:54:31 * ping * 0  
   
  type='UNKNOWN' level='16' host_id='yangtk2.ytk-thinkpad'
  host_addr='172.25.4.70'>
  WARNING: Subscription for node down event still pending
         
  type='UNKNOWN' level='16' host_id='yangtk2.ytk-thinkpad'
  host_addr='172.25.4.70'>
  01-SEP-2008 17:58:24 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=yangtk2.ytk-thinkpad)(USER=oracle))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=185599488)) * status * 0


  发现日志中的IP地址并没有改变,看来是修改IP的时候遗漏了什么位置。

  检查HOSTS文件,发现里面的配置忘了进行修改:  

      [oracle@yangtk2 admin]$ more /etc/hosts
  # Do not remove the following line, or various programs
  # that require network functionality will fail.
  172.25.4.70 yangtk2.ytk-thinkpad
  127.0.0.1 localhost.localdomain localhost


  将hosts文件中的ip也修改为当前的IP后,问题解决
[oracle@yangtk2 ~]$ lsnrctl stop
  LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 01-SEP-2008 18:01:00
  Copyright (c) 1991, 2007, Oracle. All rights reserved.
  Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
  The command completed successfully
  [oracle@yangtk2 ~]$ lsnrctl start
  LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 01-SEP-2008 18:01:10
  Copyright (c) 1991, 2007, Oracle. All rights reserved.
  Starting /data/oracle/product/11.1/bin/tnslsnr: please wait...
  TNSLSNR for Linux: Version 11.1.0.6.0 - Production
  System parameter file is /data/oracle/product/11.1/network/admin/listener.ora
  Log messages written to /data/oracle/diag/tnslsnr/yangtk2/listener/alert/log.xml
  Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.25.1.104)(PORT=1521)))
  Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
  STATUS of the LISTENER
  ------------------------
  Alias LISTENER
  Version TNSLSNR for Linux: Version 11.1.0.6.0 - Production
  Start Date 01-SEP-2008 18:01:10
  Uptime 0 days 0 hr. 0 min. 0 sec
  Trace Level off
  Security ON: Local OS Authentication
  SNMP OFF
  Listener Parameter File /data/oracle/product/11.1/network/admin/listener.ora
  Listener Log File /data/oracle/diag/tnslsnr/yangtk2/listener/alert/log.xml
  Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.25.1.104)(PORT=1521)))
  The listener supports no services
  The command completed successfully
 


 稍等一会,通过sqlplus连接数据库: 


  [oracle@yangtk2 ~]$ sqlplus sys/test@ora11g_s as sysdba 
  SQL*Plus: Release 11.1.0.6.0 - Production on Mon Sep 1 18:03:16 2008 
  Copyright (c) 1982, 2007, Oracle. All rights reserved. 
  Connected to: 
  Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production 
  With the Partitioning, OLAP, Data Mining and Real Application Testing options 
  SQL>

本文作者:



相关阅读:
MySQL 存储过程和"Cursor"的使用方法
6个DIV 135或246间隔一秒轮番显示效果
CMD下建立虚拟目录的方法
解析Ajax如何处理响应信息
win2003 原版光盘中增加SAS Raid 驱动实战经验
用dbv和RMAN检查数据文件中的坏块
在VS2005中创建并使用MasterPage
多广告投放代码 推荐" target="_blank">多广告投放代码 推荐
jquery ui resizable bug解决方法
动态网站web开发 PHP、ASP还是ASP.NET
Asp.net MVC Fckeditor的扩展
CSS 网页布局时常犯的10个小错误整理
hCalendar微格式:关于事件和基于时间或地点的活动
Awstats for Linux简易安装、配置测试
快速导航

Copyright © 2016 phpStudy | 皖ICP备18014864号-4