Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
Script to ping all db links

Script to ping all db links

2005-02-11       - By Mercadante, Thomas F

Reply:     1     2     3  

Patrice,

The following unix script checks a single database link for us.  If the
tnsping is successful, it runs the check_dmv procedure which performs a
simple select using the db link to make sure that there is data in the db
table on the remote machine.  If there is no data, we turn access to the
remote db off (using a local table that the applications check before they
do anything).

If the test fails we update the same local table (again) to turn access to
the remote database off.

This works great for us.  We run this in a cron every minute during the
normal working hours of the day (7AM-5PM).

Hope this helps.

Tom



SQLSCR=$DBA_TEMP/line_test.sql
STATUS=`$ORACLE_HOME/bin/tnsping dmvdb |grep OK`
if [ $? = 0 ]; then
 echo set feedback off          >  $SQLSCR
 echo exec tcc_pkg.check_dmv\;  >> $SQLSCR
 echo exit                      >> $SQLSCR
else
 echo set feedback off          >  $SQLSCR
 echo exec tcc_pkg.not_found\;  >> $SQLSCR
 echo exit                      >> $SQLSCR
fi

 $ORACLE_HOME/bin/sqlplus -S $RICUSR/$RICPWD @$SQLSCR
 rm $SQLSCR


-- --Original Message-- --
From: Boivin, Patrice J [mailto:BoivinP@(protected)]
Sent: Thursday, February 10, 2005 3:28 PM
To: oracle-l
Subject: Script to ping all db links

Does anyone have a script that tnspings all db links to produce a list of
the invalid ones?

I did one in sqlplus, which hosts to the command line to run tnsping, but
the output never appears in the spool file.

Patrice.
--
http://www.freelists.org/webpage/oracle-l
--
http://www.freelists.org/webpage/oracle-l