問題描述
我有一個(gè)只有總部設(shè)置數(shù)據(jù)的主數(shù)據(jù)庫和不同分支機(jī)構(gòu)的幾個(gè)數(shù)據(jù)庫.我為每個(gè)分支機(jī)構(gòu)服務(wù)器創(chuàng)建了一個(gè)數(shù)據(jù)庫鏈接.
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.
在某些情況下,我想查詢所有有效鏈接(因?yàn)槟承╂溄涌赡苡捎谶B接問題或其他原因而無效),所以我的問題是如何在不出現(xiàn)連接超時(shí)問題的情況下檢查數(shù)據(jù)庫鏈接是否有效.是否有 SQL 語句讓 oracle 主服務(wù)器執(zhí)行該檢查并僅返回有效的數(shù)據(jù)庫鏈接?
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?
推薦答案
我不確定您是否可以創(chuàng)建查詢來檢查實(shí)時(shí)數(shù)據(jù)庫鏈接.您可以做的一件事是創(chuàng)建一個(gè)由后臺(tái)進(jìn)程更新的表,其中包含數(shù)據(jù)庫鏈接列表,并為每個(gè)鏈接創(chuàng)建一個(gè)最后一次看到活著的時(shí)間"時(shí)間戳
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
這篇關(guān)于如何在 Oracle 中檢查數(shù)據(jù)庫鏈接是否有效?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!