DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: want to know n/w username....

  1. #1
    Join Date
    Jul 2000
    Location
    india
    Posts
    213

    want to know n/w username....

    Hi Everybody,

    Does anybody have any idea how do i get the network userid (NO i do not want the oracle username). from the sqlplus or any other method.Is there any builtin which can give me network username.Say for e.g i have an intranet application which can be access by everybody in the office.Now in this application i have a comments section and anybody can express his/her views...and i want to trapped the network username who post the message.Pls help if somebody knows the solution/doc or hints pointing me the solution.

    Thanks in advance
    pras

  2. #2
    Join Date
    Jan 2002
    Location
    Up s**t creek
    Posts
    1,525
    OSUSER from v$session will give you the OS user name.

    Regards
    Jim
    Oracle Certified Professional
    "Build your reputation by helping other people build theirs."

    "Sarcasm may be the lowest form of wit but its still funny"

    Click HERE to vist my website!

  3. #3
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    u can use osuser from v$session...

    HTH
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  4. #4
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Every user (even if he/she has no permisson on V$ tables can use the following:

    SELECT sys_context('USERENV', 'OS_USER') FROM dual;
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  5. #5
    Join Date
    Jul 2000
    Location
    india
    Posts
    213

    Thanks

    Hi all,

    Thanks everybody...but still the prob is..

    if i type..

    SQL> select sys_context('USERENV','OS_USER') from DUAL;

    SYS_CONTEXT('USERENV','OS_USER')
    -----------------------------------------------------------
    prashg

    I get the correct user.But if i use the same thing in a procedure like..

    PROCEDURE print_osuser IS
    v_os_user varchar2(50);
    v_ip_address varchar2(30);
    BEGIN
    select sys_context('USERENV','OS_USER')
    into V_OS_USER
    from DUAL;
    htp.htmlopen;
    htp.p('your username is '|| v_os_user);
    htp.nl;
    htp.p('your ip address is '|| v_ip_address);
    htp.htmlclose;
    END;

    If I execute this procedure from web as

    http://d-wa1/pls/cg2/cg_pitmans.print_osuser

    it always returns SYSTEM as my operating system username.Now how do i get the os username of the webbrowser.Any suggestions will be helpful.

    Thanks again
    pras

  6. #6
    Join Date
    Jul 2000
    Location
    india
    Posts
    213

    ip address

    Hi again..

    The same is the case with the ip address also..if i type

    select sys_context('USERENV','IP_ADDRESS')from DUAL;

    SQL> select sys_context('USERENV','IP_ADDRESS') from DUAL;

    SYS_CONTEXT('USERENV','IP_ADDRESS')
    -----------------------------------------------------------
    134.177.208.60

    I get the correct ip address..But if i used the above procedure i do not get any ip address the field remains blank.

    If i can get the ip address also it will do...thanks again

    pras

  7. #7
    Join Date
    Jan 2002
    Location
    Up s**t creek
    Posts
    1,525
    I can run the same query on unix and I get both the os user and the os ip address even through the pls procedure, what OS are you using?

    Regards
    Jim
    Oracle Certified Professional
    "Build your reputation by helping other people build theirs."

    "Sarcasm may be the lowest form of wit but its still funny"

    Click HERE to vist my website!

  8. #8
    Join Date
    Jul 2000
    Location
    india
    Posts
    213
    Hi Jovery,

    I am using Windows on Novell.The problem is i do not get when i used the procedure on the webbrowser.

    Thanks
    pras

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width