Linux无法连接到Windows Server 2008上的Oracle 11.2数据库怎么办?

在Windows Server 2008上安装了一个Oracle11.2数据库,在另外一台Windows 10上用Java 写了个程序可以连接和查询数据,用Navicat也可以连接和查询。但是在另外的Linux服务器上可以ping和telnet通,但就是连不上去数据库,看了监听里面,没有限制客户端ip,有人遇到过吗?

报错信息(下午重装了一次oracle,之后windows也连不上了,只有windows下面的Navicat可以连接成功):

java.sql.SQLRecoverableException: IO 閿欒: Connection reset
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:467) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:236) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-5.0.1.jar!/:na]
        at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:359) ~[HikariCP-5.0.1.jar!/:na]
        at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201) ~[HikariCP-5.0.1.jar!/:na]
        at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:470) ~[HikariCP-5.0.1.jar!/:na]
        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[HikariCP-5.0.1.jar!/:na]
        at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:100) ~[HikariCP-5.0.1.jar!/:na]
        at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-5.0.1.jar!/:na]
        at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:160) ~[spring-jdbc-6.1.6.jar!/:6.1.6]
        at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:118) ~[spring-jdbc-6.1.6.jar!/:6.1.6]
        at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:81) ~[spring-jdbc-6.1.6.jar!/:6.1.6]
        at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:80) ~[mybatis-spring-3.0.3.jar!/:3.0.3]
        at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:67) ~[mybatis-spring-3.0.3.jar!/:3.0.3]
        at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:348) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:89) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:64) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:336) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:158) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:110) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:90) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:154) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:142) ~[mybatis-3.5.14.jar!/:3.5.14]
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[na:na]
        at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[na:na]
        at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:425) ~[mybatis-spring-3.0.3.jar!/:3.0.3]
        at jdk.proxy2/jdk.proxy2.$Proxy47.selectList(Unknown Source) ~[na:na]
        at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224) ~[mybatis-spring-3.0.3.jar!/:3.0.3]
        at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:141) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86) ~[mybatis-3.5.14.jar!/:3.5.14]
        at jdk.proxy2/jdk.proxy2.$Proxy48.queryOrgList(Unknown Source) ~[na:na]
        at com.xxxxxxxx.test.service.impl.OrgDataServiceImpl.queryOrgDataList(OrgDataServiceImpl.java:25) ~[!/:0.0.1]
        at com.xxxxxxxx.test.testApplication.run(testApplication.java:31) ~[!/:0.0.1]
        at org.springframework.boot.SpringApplication.lambda$callRunner$5(SpringApplication.java:790) ~[spring-boot-3.2.5.jar!/:3.2.5]
        at org.springframework.util.function.ThrowingConsumer$1.acceptWithException(ThrowingConsumer.java:83) ~[spring-core-6.1.6.jar!/:6.1.6]
        at org.springframework.util.function.ThrowingConsumer.accept(ThrowingConsumer.java:60) ~[spring-core-6.1.6.jar!/:6.1.6]
        at org.springframework.util.function.ThrowingConsumer$1.accept(ThrowingConsumer.java:88) ~[spring-core-6.1.6.jar!/:6.1.6]
        at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:798) ~[spring-boot-3.2.5.jar!/:3.2.5]
        at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:789) ~[spring-boot-3.2.5.jar!/:3.2.5]
        at org.springframework.boot.SpringApplication.lambda$callRunners$3(SpringApplication.java:774) ~[spring-boot-3.2.5.jar!/:3.2.5]
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[na:na]
        at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357) ~[na:na]
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:557) ~[na:na]
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:546) ~[na:na]
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[na:na]
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[na:na]
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265) ~[na:na]
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:611) ~[na:na]
        at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:774) ~[spring-boot-3.2.5.jar!/:3.2.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:341) ~[spring-boot-3.2.5.jar!/:3.2.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-3.2.5.jar!/:3.2.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-3.2.5.jar!/:3.2.5]
        at com.xxxxxxxx.test.testApplication.main(testApplication.java:18) ~[!/:0.0.1]
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[na:na]
        at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[na:na]
        at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:91) ~[test-0.0.1.jar:0.0.1]
        at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:53) ~[test-0.0.1.jar:0.0.1]
        at org.springframework.boot.loader.launch.JarLauncher.main(JarLauncher.java:58) ~[test-0.0.1.jar:0.0.1]
Caused by: java.net.SocketException: Connection reset
        at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:318) ~[na:na]
        at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:346) ~[na:na]
        at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:796) ~[na:na]
        at java.base/java.net.Socket$SocketInputStream.implRead(Socket.java:1108) ~[na:na]
        at java.base/java.net.Socket$SocketInputStream.read(Socket.java:1095) ~[na:na]
        at oracle.net.ns.Packet.receive(Packet.java:300) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.net.ns.DataPacket.receive(DataPacket.java:106) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:315) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.net.ns.NetInputStream.read(NetInputStream.java:260) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.net.ns.NetInputStream.read(NetInputStream.java:185) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.net.ns.NetInputStream.read(NetInputStream.java:102) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:124) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:80) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1137) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.T4C8TTIdty.receive(T4C8TTIdty.java:669) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.T4C8TTIdty.doRPC(T4C8TTIdty.java:576) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1166) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:320) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        ... 63 common frames omitted

2024-05-31T21:33:36.357+08:00  INFO 21164 --- [           main] .s.b.a.l.ConditionEvaluationReportLogger :

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2024-05-31T21:33:36.374+08:00 ERROR 21164 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.mybatis.spring.MyBatisSystemException: null
        at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:97) ~[mybatis-spring-3.0.3.jar!/:3.0.3]
        at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:439) ~[mybatis-spring-3.0.3.jar!/:3.0.3]
        at jdk.proxy2/jdk.proxy2.$Proxy47.selectList(Unknown Source) ~[na:na]
        at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224) ~[mybatis-spring-3.0.3.jar!/:3.0.3]
        at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:141) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86) ~[mybatis-3.5.14.jar!/:3.5.14]
        at jdk.proxy2/jdk.proxy2.$Proxy48.queryOrgList(Unknown Source) ~[na:na]
        at com.xxxxxxxx.test.service.impl.OrgDataServiceImpl.queryOrgDataList(OrgDataServiceImpl.java:25) ~[!/:0.0.1]
        at com.xxxxxxxx.test.testApplication.run(testApplication.java:31) ~[!/:0.0.1]
        at org.springframework.boot.SpringApplication.lambda$callRunner$5(SpringApplication.java:790) ~[spring-boot-3.2.5.jar!/:3.2.5]
        at org.springframework.util.function.ThrowingConsumer$1.acceptWithException(ThrowingConsumer.java:83) ~[spring-core-6.1.6.jar!/:6.1.6]
        at org.springframework.util.function.ThrowingConsumer.accept(ThrowingConsumer.java:60) ~[spring-core-6.1.6.jar!/:6.1.6]
        at org.springframework.util.function.ThrowingConsumer$1.accept(ThrowingConsumer.java:88) ~[spring-core-6.1.6.jar!/:6.1.6]
        at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:798) ~[spring-boot-3.2.5.jar!/:3.2.5]
        at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:789) ~[spring-boot-3.2.5.jar!/:3.2.5]
        at org.springframework.boot.SpringApplication.lambda$callRunners$3(SpringApplication.java:774) ~[spring-boot-3.2.5.jar!/:3.2.5]
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[na:na]
        at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357) ~[na:na]
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:557) ~[na:na]
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:546) ~[na:na]
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[na:na]
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[na:na]
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265) ~[na:na]
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:611) ~[na:na]
        at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:774) ~[spring-boot-3.2.5.jar!/:3.2.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:341) ~[spring-boot-3.2.5.jar!/:3.2.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-3.2.5.jar!/:3.2.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-3.2.5.jar!/:3.2.5]
        at com.xxxxxxxx.test.testApplication.main(testApplication.java:18) ~[!/:0.0.1]
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[na:na]
        at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[na:na]
        at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:91) ~[test-0.0.1.jar:0.0.1]
        at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:53) ~[test-0.0.1.jar:0.0.1]
        at org.springframework.boot.loader.launch.JarLauncher.main(JarLauncher.java:58) ~[test-0.0.1.jar:0.0.1]
Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection
### The error may exist in URL [jar:nested:/D:/test-0.0.1.jar/!BOOT-INF/classes/!/mapper/system/OrgDataMapper.xml]
### The error may involve com.xxxxxxxx.test.mapper.OrgDataMapper.queryOrgList
### The error occurred while executing a query
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection
        at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:156) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:142) ~[mybatis-3.5.14.jar!/:3.5.14]
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[na:na]
        at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[na:na]
        at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:425) ~[mybatis-spring-3.0.3.jar!/:3.0.3]
        ... 34 common frames omitted
Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection
        at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:84) ~[spring-jdbc-6.1.6.jar!/:6.1.6]
        at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:80) ~[mybatis-spring-3.0.3.jar!/:3.0.3]
        at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:67) ~[mybatis-spring-3.0.3.jar!/:3.0.3]
        at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:348) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:89) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:64) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:336) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:158) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:110) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:90) ~[mybatis-3.5.14.jar!/:3.5.14]
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:154) ~[mybatis-3.5.14.jar!/:3.5.14]
        ... 39 common frames omitted
Caused by: java.sql.SQLRecoverableException: IO 閿欒: Connection reset
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:467) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:236) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-5.0.1.jar!/:na]
        at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:359) ~[HikariCP-5.0.1.jar!/:na]
        at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201) ~[HikariCP-5.0.1.jar!/:na]
        at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:470) ~[HikariCP-5.0.1.jar!/:na]
        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[HikariCP-5.0.1.jar!/:na]
        at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:100) ~[HikariCP-5.0.1.jar!/:na]
        at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-5.0.1.jar!/:na]
        at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:160) ~[spring-jdbc-6.1.6.jar!/:6.1.6]
        at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:118) ~[spring-jdbc-6.1.6.jar!/:6.1.6]
        at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:81) ~[spring-jdbc-6.1.6.jar!/:6.1.6]
        ... 49 common frames omitted
Caused by: java.net.SocketException: Connection reset
        at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:318) ~[na:na]
        at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:346) ~[na:na]
        at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:796) ~[na:na]
        at java.base/java.net.Socket$SocketInputStream.implRead(Socket.java:1108) ~[na:na]
        at java.base/java.net.Socket$SocketInputStream.read(Socket.java:1095) ~[na:na]
        at oracle.net.ns.Packet.receive(Packet.java:300) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.net.ns.DataPacket.receive(DataPacket.java:106) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:315) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.net.ns.NetInputStream.read(NetInputStream.java:260) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.net.ns.NetInputStream.read(NetInputStream.java:185) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.net.ns.NetInputStream.read(NetInputStream.java:102) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:124) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:80) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1137) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.T4C8TTIdty.receive(T4C8TTIdty.java:669) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.T4C8TTIdty.doRPC(T4C8TTIdty.java:576) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1166) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:320) ~[ojdbc6-11.2.0.3.jar!/:11.2.0.3.0]
        ... 63 common frames omitted

想通过Linux成功连接到Windows上安装的Oracle数据库。

阅读 634
avatarAI BotBETA

无法连接到Oracle数据库可能涉及多种因素,包括网络问题、配置错误、驱动问题、权限问题等。在没有具体的错误信息时,只能提供一些通用的排查步骤和可能的原因:

通用排查步骤

  1. 确认网络连接

    • 确保Linux服务器和Windows Server 2008之间的网络连接是通畅的。
    • 使用ping命令确保Linux可以到达Windows服务器的IP地址。
    • 使用telnet命令尝试连接到Oracle的监听端口(默认为1521)。
  2. 检查Oracle监听器配置

    • 登录到Windows Server 2008上的Oracle服务器。
    • 检查listener.ora配置文件,确保监听器配置正确,并且允许来自Linux服务器的连接。
    • 重新启动监听器以应用任何更改。
  3. 检查Oracle网络配置

    • 检查tnsnames.orasqlnet.ora文件,确保它们配置正确,没有限制来自Linux服务器的连接。
  4. 防火墙设置

    • 检查Windows Server 2008的防火墙设置,确保它允许来自Linux服务器的Oracle监听端口(默认为1521)的入站连接。
    • 检查Linux服务器上的防火墙设置,确保它可以发起到Windows服务器的出站连接。
  5. Oracle客户端配置

    • 在Linux服务器上安装与Oracle数据库版本兼容的Oracle客户端软件。
    • 确保Oracle客户端配置正确,包括tnsnames.ora文件。
  6. 驱动和JDBC问题

    • 如果使用JDBC连接,确保使用的JDBC驱动与Oracle数据库版本兼容。
    • 检查JDBC连接字符串是否正确。

可能的错误原因及解决方案

  • 监听器未运行或配置错误:确保Oracle监听器正在运行,并且监听正确的端口。
  • 网络问题:可能是网络延迟、丢包或路由问题。检查网络路径和设备。
  • 权限问题:确保用于连接的Oracle数据库用户具有适当的权限。
  • 驱动或客户端软件问题:更新或重新安装Oracle客户端软件和JDBC驱动。

补充信息

请提供具体的错误信息,例如连接时遇到的异常或错误代码,这将有助于更准确地定位问题所在。错误信息可能包含有关连接失败原因的详细信息,例如认证失败、网络问题、监听器无法识别服务等。

一旦有了具体的错误信息,可以进一步分析并提供更具体的解决方案。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏