码迷,mamicode.com
首页 > 数据库 > 详细

Oracle 异常处理汇总

时间:2016-07-03 14:17:29      阅读:207      评论:0      收藏:0      [点我收藏+]

标签:

Oracle 异常处理汇总

1、plsql无法连接

安装oracle,中间录入密码,用户是:sys,pass: 录入的密码。

连接数据库,建议创建新的用户,最好别直接用sys

安装完毕,则需要配置Net Configration Assistant,才能通过pl/sql连接

确保服务监听服务已经启动

2、遇到ORACLE错误12514

技术分享

解决方案:

1) 找到监听文件

C:\Oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora

打开:

# listener.ora Network Configuration File: C:\Oracle\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = WIN-L7MD6EPHO8Q.localdomain)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = C:\Oracle

修改为:

# listener.ora Network Configuration File: C:\Oracle\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = WIN-L7MD6EPHO8Q.localdomain)(PORT = 1521))
    )
    (SID_DESC =
       (GLOBAL_DBNAME = orcl)
       (ORACLE_HOME = \product\11.2.0\dbhome_1)
       (SID_NAME = orcl)
     ) 
  )

ADR_BASE_LISTENER = C:\Oracle

ORACLE_HOME: oracle安装目录

GLOBAL_DBNAME: 实例名,默认为orcl

2) 重启监听器,当然可以在windows服务中重启

打开cmd,执行:

    lsnrctl stop   // 关闭
    lsnrctl start  // 启动

 

3、oracle 11g如果遇到这个问题12514

解决方案:

1、SID_NAME改为具体的实例名,如:orcl

2、删除  (PROGRAM = extproc)

# listener.ora Network Configuration File: D:\oracle\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = orcl)
      (ORACLE_HOME = D:\oracle\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:D:\oracle\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
  )

SID_LIST_ORCL =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = D:\oracle\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:D:\oracle\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.30.134)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = D:\oracle

 

4、imp还原数据库时报错:错误12514

IMP-00058: 遇到 ORACLE 错误 12514
ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务
IMP-00000: 未成功终止导入

 

 注意导入的实例名是否正确,可参考上述解决方案。

 

Oracle 异常处理汇总

标签:

原文地址:http://www.cnblogs.com/yank/p/5127314.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!