saving client IP,Host name,User id in AS enviornment [message #278840] |
Mon, 05 November 2007 22:24 |
jamalmustafa
Messages: 3 Registered: November 2007 Location: pakistan
|
Junior Member |
|
|
hi,
I was using "SYS_CONTEXT" builtin package to store client IP & hostname in client server enviornment.
===============================================
e.g FUNCTION RETURN_HOST_NAME
RETURN VARCHAR2
IS
HOST_NAME_V VARCHAR2(100);
BEGIN
SELECT SYS_CONTEXT('USERENV','TERMINAL')
INTO HOST_NAME_V
FROM DUAL;
RETURN(HOST_NAME_V);
END;
================================================
Now in Application server Env i am unable to utalize this package as it is storing application server Host_name and IP Address
but I want to store clients Host_name and IP Address
in local area network.
Please do the needful asap.
Regards,
Jamal
|
|
|
|
|
|
Re: saving client IP,Host name,User id in AS enviornment [message #279334 is a reply to message #279107] |
Wed, 07 November 2007 18:46 |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
If you are using MOD_PLSQL to access Oracle from iAS, "all" the required Apache & browser variables are already available in OWA_UTIL pkg. You can't call OWA_UTIL unless your request comes in from MOD_PLSQL due to a "bug" - you'll get an ORA-06502: PL/SQL: numeric or value error
IF OWA.num_cgi_vars IS NOT NULL
THEN
-- PL/SQL gateway connection (WEB client)
v_ip := OWA_UTIL.get_cgi_env ('REMOTE_ADDR');
ELSE
-- Direct connection over tcp/ip network
v_ip := SYS_CONTEXT ('USERENV', 'IP_ADDRESS');
END IF;
The list of vaiables available varies by release so this may be out of date:
HTTP_AUTHORIZATION
DAD_NAME
DOC_ACCESS_PATH
HTTP_ACCEPT
HTTP_ACCEPT_CHARSET
HTTP_ACCEPT_LANGUAGE
HTTP_COOKIE
HTTP_HOST
HTTP_PRAGMA
HTTP_REFERER
HTTP_USER_AGENT
PATH_ALIAS
PATH_INFO
HTTP_ORACLE_ECID
DOCUMENT_TABLE
REMOTE_ADDR
REMOTE_HOST
REMOTE_USER
REQUEST_CHARSET
REQUEST_IANA_CHARSET
REQUEST_METHOD
REQUEST_PROTOCOL
SCRIPT_NAME
SCRIPT_PREFIX
SERVER_NAME
SERVER_PORT
SERVER_PROTOCOL
CREATE OR REPLACE PROCEDURE env
AS
BEGIN
HTP.htmlOpen;
HTP.headOpen;
HTP.title ('Environment Test');
HTP.headClose;
HTP.bodyOpen;
HTP.hr;
HTP.br;
HTP.p ('REMOTE_ADDR=' || OWA_UTIL.get_cgi_env ('REMOTE_ADDR'));
HTP.br;
HTP.p ('REMOTE_USER=' || OWA_UTIL.get_cgi_env ('REMOTE_USER'));
HTP.br;
HTP.p ('HTTP_HOST=' || OWA_UTIL.get_cgi_env ('HTTP_HOST'));
HTP.br;
HTP.p ('SERVER_NAME=' || OWA_UTIL.get_cgi_env ('SERVER_NAME'));
HTP.br;
HTP.p ('SERVER_PORT=' || OWA_UTIL.get_cgi_env ('SERVER_PORT'));
HTP.br;
HTP.p ('<H1>All CGI Environment variables...</H1>');
OWA_UTIL.print_cgi_env;
HTP.bodyClose;
HTP.htmlClose;
END;
See http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:500221786045
[Updated on: Wed, 07 November 2007 18:54] Report message to a moderator
|
|
|