如何在 Oracle 中检查数据库链接是否有效?

How to check if a database link is valid in Oracle?(如何在 Oracle 中检查数据库链接是否有效?)
本文介绍了如何在 Oracle 中检查数据库链接是否有效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我有一个只有总部设置数据的主数据库和不同分支机构的几个数据库.我为每个分支机构服务器创建了一个数据库链接.

I have a main database with only setup data at the headquarter and several databases at different branches.I created a database link for each branch server.

在某些情况下,我想查询所有有效链接(因为某些链接可能由于连接问题或其他原因而无效),所以我的问题是如何在不出现连接超时问题的情况下检查数据库链接是否有效.是否有 SQL 语句让 oracle 主服务器执行该检查并仅返回有效的数据库链接?

In some case I would like to query all the valid links (as some links could be invalid due to connection problems or anything else),so my question is How to check if the database link is valid without getting in Connection timeout problems. Is there a SQL statement to let the oracle main server do that check and return only the valid database links?

推荐答案

我不确定您是否可以创建查询来检查实时数据库链接.您可以做的一件事是创建一个由后台进程更新的表,其中包含数据库链接列表,并为每个链接创建一个最后一次看到活着的时间"时间戳

I'm not sure you can create a query to check live db links. One thing you could do is create a table updated by a background process with the list of db links and for each of them a 'last time seen alive' timestamp

这篇关于如何在 Oracle 中检查数据库链接是否有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)
Creating a flattened table/view of a hierarchically-defined set of data(创建分层定义的数据集的扁平表/视图)
MySQL: how to do row-level security (like Oracle#39;s Virtual Private Database)?(MySQL:如何做到行级安全(如 Oracle 的 Virtual Private Database)?)
What is the best way to enforce a #39;subset#39; relationship with integrity constraints(强制执行具有完整性约束的“子集关系的最佳方法是什么)
Split String by delimiter position using oracle SQL(使用 oracle SQL 按分隔符位置拆分字符串)
How to unfold the results of an Oracle query based on the value of a column(如何根据列的值展开Oracle查询的结果)