本文的目的是介绍Oracle11gR2RAC数据库不能连接(ORA-12537:TNS:connectionclosed)的解决的详细情况,特别关注oracle数据库连接报错ora-12154的相关信
本文的目的是介绍Oracle 11gR2 RAC 数据库不能连接 (ORA-12537: TNS:connection closed) 的解决的详细情况,特别关注oracle数据库连接报错ora-12154的相关信息。我们将通过专业的研究、有关数据的分析等多种方式,为您呈现一个全面的了解Oracle 11gR2 RAC 数据库不能连接 (ORA-12537: TNS:connection closed) 的解决的机会,同时也不会遗漏关于11G RAC使用本地名登陆时遇到监听报错:ORA-12537 TNS:connection closed、c# – oracleConnection.close()不要在会话浏览器中关闭连接、Fedora 安装Oracle 11gR2数据库、jboss6.x – 无法将oracle.jdbc.driver.T4CConnection强制转换为oracle.jdbc.OracleConnection的知识。
本文目录一览:- Oracle 11gR2 RAC 数据库不能连接 (ORA-12537: TNS:connection closed) 的解决(oracle数据库连接报错ora-12154)
- 11G RAC使用本地名登陆时遇到监听报错:ORA-12537 TNS:connection closed
- c# – oracleConnection.close()不要在会话浏览器中关闭连接
- Fedora 安装Oracle 11gR2数据库
- jboss6.x – 无法将oracle.jdbc.driver.T4CConnection强制转换为oracle.jdbc.OracleConnection
Oracle 11gR2 RAC 数据库不能连接 (ORA-12537: TNS:connection closed) 的解决(oracle数据库连接报错ora-12154)
Oracle 11gR2 RAC 数据库不能连接 (ORA-12537: TNS:connection closed) 的解决
[oracle@rac01 ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Wed Aug 29 21:06:10 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> connect system/***@astt
ERROR:
ORA-12537: TNS:connection closed
[root@rac01 app]# ls -ltr
drwxr-xr-x 3 root oinstall 4096 08-28 19:05 grid
drwxrwx--- 6 grid oinstall 4096 08-29 00:03 oraInventory
drwxrwxr-x 7 oracle oinstall 4096 08-29 00:20 oracle
[root@rac01 app]# chmod 755 oracle
[root@rac01 app]# chmod 755 grid
[root@rac01 app]# ls -ltr
drwxr-xr-x 3 root oinstall 4096 08-28 19:05 grid
drwxrwx--- 6 grid oinstall 4096 08-29 00:03 oraInventory
drwxr-xr-x 7 oracle oinstall 4096 08-29 00:20 oracle
[oracle@rac01 ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Wed Aug 29 21:28:23 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> connect system/***@astt;
????
SQL>
SQL> select instance_name from gv$instance;
INSTANCE_NAME
----------------
astt1
astt2
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
astt1
SQL>
参考:
metalink [ID 1069517.1]:
Symptoms
In environment where listener home (including SCAN listener which resides in Grid Infrastructure/ASM home) and database home are owned by different OS user, ORA-12537 could happen when connecting through listener, when creating database through DBCA, or when installing database software and creating a database in runInstaller. Job Role Separation is a typical example as SCAN and local grid home listener is owned differently than database.
Error detail
// *Cause: "End of file" condition has been reached; partner has disconnected.
// *Action: None needed; this is an information message.
SQL> conn system/xxx@OSES
ERROR:
ORA-12537: TNS:connection closed
CRS-5011: Check of resource db11 failed: details at ..
CRS-2674: Start of ora.db11.db on racnode1 failed
ORA-12546: TNS:permission denied
listener_scann.log or listener.log
TNS-12518: TNS:listener could not hand off client connection
TNS-12546: TNS:permission denied
TNS-12560: TNS:protocol adapter error
TNS-00516: Permission denied
Linux Error: 13: Permission denied
TNS-12547: TNS:lost contact
TNS-12560: TNS:protocol adapter error
TNS-00517: Lost contact
Linux Error: 32: Broken pipe
runInstaller error if installing
INFO: Parsing KFOD-00300: OCI error [-1] [OCI error] [ORA-12547: TNS:lost contact
INFO: Parsing ] [12547]
INFO: Parsing
INFO: The process /ocw/grid/bin/kfod exited with code 1
..
SEVERE: [FATAL] [INS-30502] No ASM disk group found.
CAUSE: There were no disk groups managed by the ASM instance +ASM1.
$ ls -l $RDBMS_HOME/bin/oracle
ls: /home/oracle/app/oracle/product/11.2/db/bin/oracle: Permission denied
2. Oracle binary in database home has wrong permission:
ls -l $RDBMS_HOME/bin/oracle
-rwxr-x--x 1 oracle asmadmin 184286251 Aug 9 16:25 /home/oracle/app/oracle/product/11.2/db/bin/oracle
-rwsr-s--x 1 oracle asmadmin 184286251 Aug 9 16:25 /home/oracle/app/oracle/product/11.2/db/bin/oracle
3. File System for database home does not support setuid/suid or has nosetuid/nosuid set:
mount| grep
/home/oracle on /dev/dsk/diskoracle read/write/nosuid..
Solution is to make sure file system for database home has setuid/suid set, database binary($RDBMS_HOME/bin/oracle) has correct ownership and permission, and listener owner is able to access database oracle binary (as listener owner, "ls -l $RDBMS_HOME/bin/oracle" will tell)
Installation Guide
11g Release 2 (11.2)
官方解释如下:
Applies to:
Oracle Net Services - Version: 8.1.7.0 to 11.2.0.1 - Release: 8.1.7 to 11.2
Generic UNIX
Checked for relevance on 30-Apr-2010
Symptoms
Connection to the database server fails with ORA-12546 or ORA-12537
Local connections working fine but the connection via listener fails with ORA-12537 or ORA-12547
[oracle@myhost]$ sqlplusmyuser/mypass@mytns
SQL*Plus: Release 11.1.0.7.0 - Production on Fri Apr 30 21:32:18 2010
Copyright (c) 1982, 2008, Oracle. All rights reserved.
ERROR:
ORA-12537: TNS:connection closed
The listener log for the failing connection shows following error message -
TNS-12518: TNS:listener could not hand off client connection
TNS-12546: TNS:permission denied
TNS-12560: TNS:protocol adapter error
TNS-00516: Permission denied
Linux Error: 13: Permission denied
Or
TNS-12518: TNS:listener could not hand off client connection
TNS-12547: TNS:lost contact
TNS-12560: TNS:protocol adapter error
TNS-00517: Lost contact
IBM/AIX RISC System/6000 Error: 32: Broken pipe
Cause
Permissions on oracle binary ( $ORACLE_HOME/bin/oracle ) are not set correctly.
Solution
The OS level error message in the listener log "Linux Error: 13: Permission denied" indicates that the listener was not able to hand off the connection to oracle processes or not able to spawn a new dedicated user process because of lack of permission at the OS level. To resolve the error -
1. Check and correct the permission on /var/tmp/.oracle directory. Permissions on this directory should be 777 with sticky bit set.
# chmod 01777 /var/tmp/.oracle
2. Check and correct permissions on $ORACLE_HOME/bin/oracle binary and make sure that it is set to 6751.
$ chmod 6751 $ORACLE_HOME/bin/oracle
检查自己环境,确实发现不是正确的权限
[root@ract1 bin]# pwd
/oracle/product/11.2.0/bin
[root@ract1 bin]# ls -la oracle
-rwxr-s--x 1 oracle asmadmin 228886426 Jan 7 15:46 oracle
[root@ract1 bin]# chmod 6751 oracle- - 注意使用 root 用户给权限
[root@ract1 bin]# ls -la oracle
-rwsr-s--x 1 oracle asmadmin 228886426 Jan 7 15:46 oracle
修改后登陆正常:
[oracle@ract2 ~]$ sqlplussys/oracle@10.20.31.36:1521/racdbas sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Thu Jan 17 14:48:25 2013
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL>
11G RAC使用本地名登陆时遇到监听报错:ORA-12537 TNS:connection closed
一个群友遇到了监听的错误:ORA-12537: TNS:connection closed搜索发现引起此错误的原因可能是:ORA-12537 if Listener (includin
一个群友遇到了监听的错误:ORA-12537: TNS:connection closed
搜索发现引起此错误的原因可能是:
ORA-12537 if Listener (including SCAN Listener) and Database are Owned by Different OS User [ID 1069517.1]
也就是说监听器和数据库属于不同的OS用户就可以遇到如下问题。
当前的监听器用户是GRID,数据库软件用户是Oracle。
而数据库装在ORACLE用户下:且ORACLE_HOME目录权限设置不允许GRID用户操作ORACLE软件。
下面实验重现此错误:
[grid@bysrac1 11.2.0]$ su - root
Password:
[root@bysrac1 ~]# cd /u01/app/oracle/product/11.2.0/ ---这个目录是ORACLE 数据库的家目录
[root@bysrac1 11.2.0]# ls
dbhome_1
[root@bysrac1 11.2.0]# ls -al
total 12
drwxr-xr-x 3 oracle oinstall 4096 Jun 20 14:09 .
drwxr-xr-x 3 oracle oinstall 4096 Jun 20 14:09 ..
drwxr-xr-x 75 oracle oinstall 4096 Jun 22 17:57 dbhome_1
[root@bysrac1 11.2.0]# chmod 700 dbhome_1/
[root@bysrac1 11.2.0]# ls -al
total 12
drwxr-xr-x 3 oracle oinstall 4096 Jun 20 14:09 .
drwxr-xr-x 3 oracle oinstall 4096 Jun 20 14:09 ..
drwx------ 75 oracle oinstall 4096 Jun 22 17:57 dbhome_1
[root@bysrac1 11.2.0]# su - oracle
[oracle@bysrac1 ~]$ sqlplus bys/bys@caiwu
SQL*Plus: Release 11.2.0.1.0 Production on Fri Dec 6 13:24:33 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
ERROR:
ORA-12537: TNS:connection closed
恢复目录正常权限,SQLPLUS登陆正常:
[root@bysrac1 11.2.0]# chmod 755 dbhome_1/
[root@bysrac1 11.2.0]# ls -al
total 12
drwxr-xr-x 3 oracle oinstall 4096 Jun 20 14:09 .
drwxr-xr-x 3 oracle oinstall 4096 Jun 20 14:09 ..
drwxr-xr-x 75 oracle oinstall 4096 Jun 22 17:57 dbhome_1
[root@bysrac1 ~]# su - oracle
[oracle@bysrac1 ~]$ sqlplus bys/bys@caiwu
SQL*Plus: Release 11.2.0.1.0 Production on Fri Dec 6 13:31:59 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
BYS@ caiwu>exit
这个问题已经解决。原来是我同事跳过了一个sql没有执行,导致数据不一致。有几个 table是有主外键关联的。
相关阅读:
ORA-01172、ORA-01151错误处理
ORA-00600 [2662]错误解决
ORA-01078 和 LRM-00109 报错解决方法
ORA-00471 处理方法笔记
ORA-00314,redolog 损坏,或丢失处理方法
ORA-00257 归档日志过大导致无法存储的解决办法
c# – oracleConnection.close()不要在会话浏览器中关闭连接
但是在程序结束时,我在会话浏览器中看到了6个以上的会话
这是代码:
private void testConnection() { string connectionString = "data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=1111)(PORT=1699))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = abcd)));Min Pool Size=10; Connection Lifetime=120;"; OracleConnection oraConn = new OracleConnection(connectionString); try { oraConn.open(); } catch (Exception e) { } finally { oraConn.dispose(); oraConn.Close(); } }
请帮帮我!
解决方法
finally { oraConn.dispose(); oraConn.Close(); OracleConnection.ClearPool(oraConn); }
Fedora 安装Oracle 11gR2数据库
一.所使用的软件1.Fedora linux 系统下载地址http://torrent.fedoraproject.org/网上有很多安装方法在这就不说了,但是有些不一定
一.所使用的软件
1.fedora linux 系统下载地址
网上有很多安装方法在这就不说了,但是有些不一定能用,,这些都是自己整理的,
2.oracle11gr2下载地址
根据自己机子的情况而选择安装文档
二.查看自己机子的信息
oracle官方指定要1G以上的内存跟1.5G以上的交换空间
三.安装oracle database11gr2依赖包:
这里参考Red Hat EnterpriseLinux 5安装(也许应该是Red Hat Enterprise Linux 6才对但官方文档给出了5)
安装软件包检查:
rpm -qa | grep binutils //检查有没有这个包,有就会列出来
1 binutils-2.17.50.0.6-2.el5
rpm -qa | grep compat-libstdc++
2 compat-libstdc++-33-3.2.3-61
rpm -qa | grep elfutils-libelf
3 elfutils-libelf-0.125-3.el5
4 elfutils-libelf-devel-0.125
rpm -qa | grep glibc
5 glibc-2.5-12
6 glibc-common-2.5-12
7 glibc-devel-2.5-12
8 glibc-headers-2.5-12
rpm -qa | grep gcc
9 gcc-4.1.1-52
10 gcc-c++-4.1.1-52
rpm -qa | grep libaio
11 libaio-0.3.106
12 libaio-devel-0.3.106
rpm -qa | grep libgcc
13 libgcc-4.1.1-52
rpm -qa | grep libstdc++
14 libstdc++-4.1.1
15 libstdc++-devel-4.1.1-52.e15
rpm -qa | grep make
16 make-3.81-1.1
rpm -qa | grep numactl
17 numactl-devel-0.9.8.i386
rpm -qa | grep sysstat
18 sysstat-7.0.0
rpm -qa | grep ksh
ksh-20100202-1.el5
这些程序包一般使用yum命令进行安装,所以,在安装Oracle Database 11g时保证网络连接正常(没有网络就自己下载好包再进行安装)。安装这些软件包前可是用rpm命令检查一下这些程序包是否存在且是否满足安装的需求(我这里没用具体给出对各个程序包的版本需求,因为我打算直接通过yum进行更新或安装)。下面是使用rpm和yum命令对程序包的检查和更新、下载安装的一般命令形式:
# rpm –q packge_name
# yum install packge_name
注意:这里还有一个依赖包注意一下Red Hat5 默认安装上一个pdksh包而Red Hat6 用ksh代替了pdksh包(而fedora 源也只有ksh包pdksh也许淘汰了.很多fedora安装oracle的帖子都强行安装上了pdksh这个包,因为pdksh跟bash有冲突.)所在只安装ksh包就够了.前面已经检查了。
# yum install ksh
接下来请看第2页精彩内容:
jboss6.x – 无法将oracle.jdbc.driver.T4CConnection强制转换为oracle.jdbc.OracleConnection
WrappedConnectionJDK6 wrapped = (WrappedConnectionJDK6) dbStrategy.getConnection(); Connection underlyingConn = wrapped.getUnderlyingConnection(); OracleConnection oracleConn = (OracleConnection)underlyingConn;
最后一行给出错误 –
> ERROR > [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/web].[resteasy-servlet]] > (http-/0.0.0.0:8080-1) Servlet.service() for servlet resteasy-servlet > threw exception: org.jboss.resteasy.spi.UnhandledException: > java.lang.classCastException: oracle.jdbc.driver.T4CConnection cannot > be cast to oracle.jdbc.OracleConnection
恕我直言你有2个驱动程序实现,一个在app服务器上,一个在你的项目依赖项中,必须有一个类加载问题,因为检索到的驱动程序实现由共享类加载器加载,你试图将它转换为webApp加载的类类加载器.
您可以确保您的Web应用程序依赖项与服务器提供的实现相同,或者在打包时仅从Web应用程序中排除依赖项.
如果你正在使用maven,只需将范围设置为提供.
今天关于Oracle 11gR2 RAC 数据库不能连接 (ORA-12537: TNS:connection closed) 的解决和oracle数据库连接报错ora-12154的介绍到此结束,谢谢您的阅读,有关11G RAC使用本地名登陆时遇到监听报错:ORA-12537 TNS:connection closed、c# – oracleConnection.close()不要在会话浏览器中关闭连接、Fedora 安装Oracle 11gR2数据库、jboss6.x – 无法将oracle.jdbc.driver.T4CConnection强制转换为oracle.jdbc.OracleConnection等更多相关知识的信息可以在本站进行查询。
本文标签: