search
HomeDatabaseMysql TutorialORA-12170: TNS:Connect timeout occurred ORA-06512: at “SYS.D

ORA-12170: TNS:Connect timeout occurred ORA-06512: at SYS.DBMS_SNAPSHOT

Oracle job 无法自动运行 报以下大量的错
 
Errors in file /oracle/admin/orcl/bdump/orcl_j000_2158798.trc:
ORA-12012: error on auto execute of job 482
ORA-12008: error in materialized view refresh path
ORA-12170: TNS:Connect timeout occurred
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 1883
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2089
ORA-06512: at "SYS.DBMS_IREFRESH", line 683
ORA-06512: at "SYS.DBMS_REFRESH", line 195
ORA-06512: at line 1
Sat Apr 26 21:57:53 2014
Errors in file /oracle/admin/orcl/bdump/orcl_j000_2158798.trc:
ORA-12012: error on auto execute of job 425
ORA-12170: TNS:Connect timeout occurred
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 1883
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2089
ORA-06512: at "SYS.DBMS_IREFRESH", line 683
ORA-06512: at "SYS.DBMS_REFRESH", line 195
 
 
主要环境介绍,两个数据库之间要刷新物化视图,平时都是正常的,某天开始主库的自动job执行失败,而且是持续的失败
 
查看原因主要是ORA-12170: TNS:Connect timeout occurred TNS超时所致,排查思路大概可以定在网络上
 
 
1.网络排查
 
在两台主机之间互相ping各自的IP地址和网关,看有无丢包情况
 
期初查看经查看无丢包
 
2.查看防火墙1521端口是否正常
 
网络工程师确认防火墙1521端口正常开放,telnet 1521也是通的
 
3.tnsping 各自的服务名
$tnsping orcl
TNS Ping Utility for 64-bit Aix: Version 10.2.0.4.0 - Production on 05-6月 -2014 11:47:24
Copyright (c) 1997, 2006, Oracle Corporation. All rights reserved.
Attempting to contact (DESCRIPTION= (ADDRESS_LIST = (ADDRESS=(PROTOCOL=TCP)(HOST =192.168.10.8)(PORT = 1521))) (CONNECT_DATA= (SERVICE_NAME=orcl)))
OK (0 msec)
OK (10 msec)
 
 
$tnsping yyzf
TNS Ping Utility for 64-bit Aix: Version 10.2.0.4.0 - Production on 05-6月 -2014 11:48:24
Copyright (c) 1997, 2006, Oracle Corporation. All rights reserved.
Attempting to contact (DESCRIPTION= (ADDRESS_LIST = (ADDRESS=(PROTOCOL=TCP)(HOST =192.168.11.9)(PORT = 1521))) (CONNECT_DATA= (SERVICE_NAME=yyzf)))
OK (0 msec)
OK (10 msec)
 
tnsping服务名也是OK的
 
4.到此为止所有网络看似都正常,网络似乎应该不存在问题,但job还是一直是报错,由于两台主机不再同一个网段,ping任务在持续,忽然在某几个时刻有丢包现象,telnet 1521端口也存在某几次不通的现象这么看来网络还是有问题,最后跟客户确认说是有人重新规划过网络,于是查看主机ip和路由
 
 
Command: OK stdout: yes stderr: no
 
Before command completion, additional instructions may appear below.
 
Routing tables
Destination Gateway Flags Refs Use If Exp Groups
 
Route tree for Protocol Family 2 (Internet):
default 192.168.10.1 UG 60 442255197 en0 - - =>
default 192.168.10.254 UG 40 432853407 en0 - -
10.0.0.0 10.0.0.1 UHSb 0 0 en1 - - =>
10/27 10.0.0.1 U 1 11339108 en1 - -
10.0.0.1 127.0.0.1 UGHS 0 1840821 lo0 - -
10.0.0.31 10.0.0.1 UHSb 0 10 en1 - -
10.0.1.0 10.0.1.1 UHSb 0 0 en0 - - =>
10.0.1/27 10.0.1.1 U 2 12382572 en0 - -
10.0.1.1 127.0.0.1 UGHS 2 3268795 lo0 - -
10.0.1.31 10.0.1.1 UHSb 0 10 en0 - -
127/8 127.0.0.1 U 31 6493884 lo0 - -
192.168.10.0 192.168.10.9 UHSb 0 0 en0 - - =>
192.168.10.0 192.168.10.10 UHSb 0 0 en1 - - =>
192.168.10/27 192.168.10.9 U 0 193565 en0 - - =>
192.168.10/27 192.168.10.10 U 1 209927 en1 - -
192.168.10.9 127.0.0.1 UGHS 23 13738093 lo0 - -
192.168.10.10 127.0.0.1 UGHS 0 151330 lo0 - -
192.168.10.31 192.168.10.9 UHSb 0 0 en0 - - =>
192.168.10.31 192.168.10.10 UHSb 0 0 en1 - -
 
Route tree for Protocol Family 24 (Internet v6):
::1 ::1 UH 0 0 lo0 - -
 
 
这样看来,主机的路由还是存在问题的,主机存在两条默认路由
 
在AIX中如果有默认网关设置多个的话,会存在时断时续的丢包现象,于是进入AIX的路由表查看,果然存在两条默认路由,192.168.10.1和192.168.10.254,同一个网卡存在这样两条路由肯定是有问题的,,两条路由的use使用都很高,与网络工程师确认后.254的路由是无效的,存在的原因可能是在之前修改路由的时候忘记***旧的路由导致
 
 
 
于是***废弃的路由
 
>#route delete -if en0 default 192.168.10.254
192.168.10.254 net default: gateway 192.168.10.254
 
***路由后,观察一小时,所有job均执行正常,没有再出现TNS超时现象
 
看来,修改生产系统的任何参数都要按照严格的标准和检查流程才行,稳定重于一切

--------------------------------------分割线 --------------------------------------

在CentOS 6.4下安装Oracle 11gR2(x64)

Oracle 11gR2 在VMWare虚拟机中安装步骤

Debian 下 安装 Oracle 11g XE R2

--------------------------------------分割线 --------------------------------------

本文永久更新链接地址:

linux

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What are stored procedures in MySQL?What are stored procedures in MySQL?May 01, 2025 am 12:27 AM

Stored procedures are precompiled SQL statements in MySQL for improving performance and simplifying complex operations. 1. Improve performance: After the first compilation, subsequent calls do not need to be recompiled. 2. Improve security: Restrict data table access through permission control. 3. Simplify complex operations: combine multiple SQL statements to simplify application layer logic.

How does query caching work in MySQL?How does query caching work in MySQL?May 01, 2025 am 12:26 AM

The working principle of MySQL query cache is to store the results of SELECT query, and when the same query is executed again, the cached results are directly returned. 1) Query cache improves database reading performance and finds cached results through hash values. 2) Simple configuration, set query_cache_type and query_cache_size in MySQL configuration file. 3) Use the SQL_NO_CACHE keyword to disable the cache of specific queries. 4) In high-frequency update environments, query cache may cause performance bottlenecks and needs to be optimized for use through monitoring and adjustment of parameters.

What are the advantages of using MySQL over other relational databases?What are the advantages of using MySQL over other relational databases?May 01, 2025 am 12:18 AM

The reasons why MySQL is widely used in various projects include: 1. High performance and scalability, supporting multiple storage engines; 2. Easy to use and maintain, simple configuration and rich tools; 3. Rich ecosystem, attracting a large number of community and third-party tool support; 4. Cross-platform support, suitable for multiple operating systems.

How do you handle database upgrades in MySQL?How do you handle database upgrades in MySQL?Apr 30, 2025 am 12:28 AM

The steps for upgrading MySQL database include: 1. Backup the database, 2. Stop the current MySQL service, 3. Install the new version of MySQL, 4. Start the new version of MySQL service, 5. Recover the database. Compatibility issues are required during the upgrade process, and advanced tools such as PerconaToolkit can be used for testing and optimization.

What are the different backup strategies you can use for MySQL?What are the different backup strategies you can use for MySQL?Apr 30, 2025 am 12:28 AM

MySQL backup policies include logical backup, physical backup, incremental backup, replication-based backup, and cloud backup. 1. Logical backup uses mysqldump to export database structure and data, which is suitable for small databases and version migrations. 2. Physical backups are fast and comprehensive by copying data files, but require database consistency. 3. Incremental backup uses binary logging to record changes, which is suitable for large databases. 4. Replication-based backup reduces the impact on the production system by backing up from the server. 5. Cloud backups such as AmazonRDS provide automation solutions, but costs and control need to be considered. When selecting a policy, database size, downtime tolerance, recovery time, and recovery point goals should be considered.

What is MySQL clustering?What is MySQL clustering?Apr 30, 2025 am 12:28 AM

MySQLclusteringenhancesdatabaserobustnessandscalabilitybydistributingdataacrossmultiplenodes.ItusestheNDBenginefordatareplicationandfaulttolerance,ensuringhighavailability.Setupinvolvesconfiguringmanagement,data,andSQLnodes,withcarefulmonitoringandpe

How do you optimize database schema design for performance in MySQL?How do you optimize database schema design for performance in MySQL?Apr 30, 2025 am 12:27 AM

Optimizing database schema design in MySQL can improve performance through the following steps: 1. Index optimization: Create indexes on common query columns, balancing the overhead of query and inserting updates. 2. Table structure optimization: Reduce data redundancy through normalization or anti-normalization and improve access efficiency. 3. Data type selection: Use appropriate data types, such as INT instead of VARCHAR, to reduce storage space. 4. Partitioning and sub-table: For large data volumes, use partitioning and sub-table to disperse data to improve query and maintenance efficiency.

How can you optimize MySQL performance?How can you optimize MySQL performance?Apr 30, 2025 am 12:26 AM

TooptimizeMySQLperformance,followthesesteps:1)Implementproperindexingtospeedupqueries,2)UseEXPLAINtoanalyzeandoptimizequeryperformance,3)Adjustserverconfigurationsettingslikeinnodb_buffer_pool_sizeandmax_connections,4)Usepartitioningforlargetablestoi

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.