|
|
|
|
|
|
|
|
Re: Check for status of a computer in the network [message #673295 is a reply to message #673293] |
Wed, 14 November 2018 07:10 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
chat2raj.s
Messages: 161 Registered: October 2010 Location: Chennai, India
|
Senior Member |
|
|
Yes Michael, it worked and i used as below. Thanks a lot.
CREATE OR REPLACE FUNCTION PING(P_HOST_NAME VARCHAR2,
P_PORT NUMBER DEFAULT 1000)
RETURN VARCHAR2 IS
TCPCONNECTION UTL_TCP.CONNECTION;
C_PING_OK CONSTANT VARCHAR2(10) := 'OK';
C_PING_ERROR CONSTANT VARCHAR2(10) := 'ERROR';
C_PING_LISTNER CONSTANT VARCHAR2(20) := 'LISTNER NOT FOUND';
BEGIN
TCPCONNECTION := UTL_TCP.OPEN_CONNECTION(REMOTE_HOST => P_HOST_NAME,
REMOTE_PORT => P_PORT);
UTL_TCP.CLOSE_CONNECTION(TCPCONNECTION);
RETURN C_PING_OK;
EXCEPTION
WHEN UTL_TCP.NETWORK_ERROR THEN
IF (UPPER(SQLERRM) LIKE '%HOST%') THEN
RETURN C_PING_ERROR;
ELSIF (UPPER(SQLERRM) LIKE '%LISTENER%') THEN
RETURN C_PING_LISTNER;
ELSE
RAISE;
END IF;
END PING;
|
|
|
|
Re: Check for status of a computer in the network [message #673305 is a reply to message #673303] |
Wed, 14 November 2018 08:28 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/102589.gif) |
Michel Cadot
Messages: 68675 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
Indeed, you have to execute something like:
BEGIN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(acl => 'ping.xml',
description => 'Access to a network address',
principal => USER,
is_grant => true,
privilege => 'connect');
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl => 'ping.xml',
principal => USER,
is_grant => true,
privilege => 'resolve');
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL(acl => 'ping.xml',
host => '*');
COMMIT;
END;
/
[Updated on: Wed, 14 November 2018 08:29] Report message to a moderator
|
|
|
|
|
|
|