使用数据链时报错ORA-12545/TNS-12545的重现和解决
1. 查看 tnsnames.ora中条目 :
linux_dblk =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = linux.linuxidc.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = linux)
)
)
/etc/hosts中不写linux.linuxidc.com与IP的对应,,也无法通过DNS得到linux.linuxidc.com的IP。
linuxidc@ linuxidcrac1>create database link linux_db connect to test9 identified by test9 using 'linux_dblk';
Database link created.
此时使用DBLINK: 执行了很长时间,报错:ORA-12545:Connect failed because target host or object does not exist
21:42:57 linuxidc@ linuxidcrac1>select * from test9@linux_DB;
select * from test9@linux_DB
*
ERROR at line 1:
ORA-12545: Connect failed because target host or object does not exist
Elapsed: 00:02:40.25
###########3
[Oracle@linuxidcrac1 ~]$ cat alert_linuxidcrac1.log
创建和使用数据链时会有类似如下报错日志: --截取部分
Sat Dec 28 21:41:29 2013
***********************************************************************
Fatal NI connect error 12545, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=racdg)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=racdg)(CID=(PROGRAM=oracle)(HOST=linuxidcrac1.linuxidc.com)(USER=oracle))))
VERSION INFORMATION:
TNS for Linux: Version 11.2.0.1.0 - Production
TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.1.0 - Production
Time: 28-DEC-2013 21:41:29
Tracing not turned on.
Tns error struct:
ns main err code: 12545
TNS-12545: Connect failed because target host or object does not exist
ns secondary err code: 12560
nt main err code: 515
TNS-00515: Connect failed because target host or object does not exist
nt secondary err code: 110
nt OS err code: 0
###########
/etc/hosts中增加相应条目:
192.168.1.211 linux.linuxidc.com linux
ping linux.linuxidc.com 测试正常。
linuxidc@ linuxidcrac1>select * from test9@linux_db;
AA
----------
dblink-ok ---此时重新登陆数据库,使用数据链正常:
相关阅读:
Oracle ORA-01555 快照过旧 说明
ORA-01078 和 LRM-00109 报错解决方法
ORA-01555超长的Query Duration时间
ORA-00471 处理方法笔记
ORA-00314,redolog 损坏,或丢失处理方法
ORA-00257 归档日志过大导致无法存储的解决办法

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

Article discusses securing MySQL against SQL injection and brute-force attacks using prepared statements, input validation, and strong password policies.(159 characters)


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

SublimeText3 Chinese version
Chinese version, very easy to use

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft
