Check connection between client and server
Check connection between client and server machine using sqlplus ( shell script ):
--------cut here--------------
check_conn()
{
name=$1
dblink=$2
sqlplus -s $name/$name@$dblink _there_is_an_EOF_here
col inst for a6
col client for a12
col usr for a8
col srvr for a12
SELECT sys_context('USERENV', 'SESSION_USER') usr,
sys_context('USERENV', 'INSTANCE_NAME') inst,
sys_context('USERENV', 'HOST') client,
sys_context('USERENV', 'SERVER_HOST') srvr
FROM dual;
_there_is_an_EOF_here
}
check_conn
----------end here------------------------
--------cut here--------------
check_conn()
{
name=$1
dblink=$2
sqlplus -s $name/$name@$dblink _there_is_an_EOF_here
col inst for a6
col client for a12
col usr for a8
col srvr for a12
SELECT sys_context('USERENV', 'SESSION_USER') usr,
sys_context('USERENV', 'INSTANCE_NAME') inst,
sys_context('USERENV', 'HOST') client,
sys_context('USERENV', 'SERVER_HOST') srvr
FROM dual;
_there_is_an_EOF_here
}
check_conn
----------end here------------------------
0 Comments:
Post a Comment
<< Home