Retrieving OS username and Machine name

Is it possible to retrieve the Operating System username and name of the machine using SQL?

there are a couple of parameters you can retrieve. See the following view:
create or replace view my_userenv (
AUDITED_CURSORID ,
AUTHENTICATION_DATA ,
AUTHENTICATION_TYPE ,
BG_JOB_ID ,
CLIENT_IDENTIFIER ,
CLIENT_INFO ,
CURRENT_SCHEMA ,
CURRENT_SCHEMAID ,
CURRENT_SQL ,
CURRENT_USER ,
CURRENT_USERID ,
DB_DOMAIN ,
DB_NAME ,
ENTRYID ,
EXTERNAL_NAME ,
FG_JOB_ID ,
GLOBAL_CONTEXT_MEMORY ,
HOST ,
INSTANCE ,
IP_ADDRESS ,
ISDBA ,
LANG ,
LANGUAGE ,
NETWORK_PROTOCOL ,
NLS_CALENDAR ,
NLS_CURRENCY ,
NLS_DATE_FORMAT ,
NLS_DATE_LANGUAGE ,
NLS_SORT ,
NLS_TERRITORY ,
OS_USER ,
PROXY_USER ,
PROXY_USERID ,
SESSION_USER ,
SESSION_USERID ,
SESSIONID ,
TERMINAL
) AS SELECT
SYS_CONTEXT ('USERENV', 'AUDITED_CURSORID') ,
SYS_CONTEXT ('USERENV', 'AUTHENTICATION_DATA') ,
SYS_CONTEXT ('USERENV', 'AUTHENTICATION_TYPE') ,
SYS_CONTEXT ('USERENV', 'BG_JOB_ID') ,
SYS_CONTEXT ('USERENV', 'CLIENT_IDENTIFIER') ,
SYS_CONTEXT ('USERENV', 'CLIENT_INFO') ,
SYS_CONTEXT ('USERENV', 'CURRENT_SCHEMA') ,
SYS_CONTEXT ('USERENV', 'CURRENT_SCHEMAID') ,
SYS_CONTEXT ('USERENV', 'CURRENT_SQL') ,
SYS_CONTEXT ('USERENV', 'CURRENT_USER') ,
SYS_CONTEXT ('USERENV', 'CURRENT_USERID') ,
SYS_CONTEXT ('USERENV', 'DB_DOMAIN') ,
SYS_CONTEXT ('USERENV', 'DB_NAME') ,
SYS_CONTEXT ('USERENV', 'ENTRYID') ,
SYS_CONTEXT ('USERENV', 'EXTERNAL_NAME') ,
SYS_CONTEXT ('USERENV', 'FG_JOB_ID') ,
SYS_CONTEXT ('USERENV', 'GLOBAL_CONTEXT_MEMORY') ,
SYS_CONTEXT ('USERENV', 'HOST') ,
SYS_CONTEXT ('USERENV', 'INSTANCE') ,
SYS_CONTEXT ('USERENV', 'IP_ADDRESS') ,
SYS_CONTEXT ('USERENV', 'ISDBA') ,
SYS_CONTEXT ('USERENV', 'LANG') ,
SYS_CONTEXT ('USERENV', 'LANGUAGE') ,
SYS_CONTEXT ('USERENV', 'NETWORK_PROTOCOL') ,
SYS_CONTEXT ('USERENV', 'NLS_CALENDAR') ,
SYS_CONTEXT ('USERENV', 'NLS_CURRENCY') ,
SYS_CONTEXT ('USERENV', 'NLS_DATE_FORMAT') ,
SYS_CONTEXT ('USERENV', 'NLS_DATE_LANGUAGE') ,
SYS_CONTEXT ('USERENV', 'NLS_SORT') ,
SYS_CONTEXT ('USERENV', 'NLS_TERRITORY') ,
SYS_CONTEXT ('USERENV', 'OS_USER') ,
SYS_CONTEXT ('USERENV', 'PROXY_USER') ,
SYS_CONTEXT ('USERENV', 'PROXY_USERID') ,
SYS_CONTEXT ('USERENV', 'SESSION_USER') ,
SYS_CONTEXT ('USERENV', 'SESSION_USERID') ,
SYS_CONTEXT ('USERENV', 'SESSIONID') ,
SYS_CONTEXT ('USERENV', 'TERMINAL')
from dual;

Similar Messages

  • How to retrieve username and domain name on Macintosh.

    Hi,
    Can anyone tell me how to retrieve username and domain name on Macintosh
    Thanks
    Priyanka.

    There is no system property for the domain name.
    Can you please tell me some other way for solving
    this problem.No. If it's not an environment variable (System.getEnv IIRC) and no property, you can't get it without native calls using JNI or Runtime.exec/Process.

  • Retrieving admin username and password

    Hello:
    Can someone tell me how I can retrieve the username and password for the admin URL? The DBA is gone and he didn't document any of this info.
    Thanks.

    Hi,
    You can follow the steps here to change the password for the admin account ( the user name is ADMIN ):
    http://download.oracle.com/docs/cd/E10513_01/doc/install.310/e10496/db_install.htm#CIHBHAFJ
    It basically just involves running the @apxchpwd.sql script from the apex install directory ( in oracle home ).
    best,
    john

  • Username and domain name on Macintosh

    Hi,
    Can anyone tell me how to retrieve username and domain name of current logged in user on Macintosh.
    Thanks,
    Priyanka

    The system property "user.name" gets you the user. TrySystem.getProperties().store(System.out, "");to list all system properties, you might find the one that means "domain" to you.

  • GET IP and machine name of user....

    hi friends,
    i want to get IP address and machine name of the user who have access a form in web environment.
    be4 when i was working in client/server invorement i was using the following
    command
    SELECT SYS_CONTEXT('USERENV','IP_ADDRESS'),
    SYS_CONTEXT('USERENV','HOST'),
    SYS_CONTEXT('USERENV','OS_USER') from dual;
    when i try to implement this command for my web form... it gets the information
    (IP and machine name) of the server where applicaiton server resides and my application reside.
    how the get the information of user's mahcine and IP in web environment?
    please help!!!
    regards, imran baig

    hi again,
    thanks for the help, but i am still in problem. i am using forms6i and 9iAS for deployment.
    i tried to use d2kwutility and the code i used is:
    DECLARE
    OS_USER_NAME VARCHAR2(60);
    MACH_NAME          VARCHAR2(100);
    BEGIN
    OS_USER_NAME := win_api_environment.get_windows_username(toBoolean('Y'));
    MACH_NAME := WIN_API_ENVIRONMENT.Get_Computer_Name(toBoolean(MACH_NAME));
    INSERT INTO COMMON.COM_USER_INFO VALUES(:GLOBAL.G_EMPLOYEE_ID,:GLOBAL.G_MODULE_ID,SYSDATE,
    'SETUP > COMPANIES', 'F', :GLOBAL.G_USER_IP, MACH_NAME, OS_USER_NAME);
    COMMIT;
    CALL_FORM('COMPANIES_FRM',NO_HIDE,NO_REPLACE);
    END;
    :( BUT NO RESULTS..
    library is attached but it doest work...
    what to do now..
    Please help its very urgent..
    thanks, Imran Baig

  • To know windows user name and machine name

    Is it possible to automatically populating windows user name and machine name in form field?
    If so what should I do?

    Hi,
    You can, but it is considered a security risk by Adobe. Therefore you need to execute the script in a "trusted function". This is script in a JavaScript file that is stored in a set folder on the user's computer. This can make it difficult to maintain, as all users will need this .js file.
    Also if you Reader Enable the form through Accrobat, then the script will fail.
    See a thread here with examples: http://forums.adobe.com/message/2189021#2189021.
    Good luck,
    Niall

  • Valid windows username and domain name

    Hi,
    can anu one help me with regular expression of valid username and domain name for windows
    Abdul Khaliq

    figure out the rules and restrictions for those names, and it shouldn't be too hard to come up with a regular expression to describe those rules.
    Most likely it involves nothing more than checking for the length of the name and the existence of a small set of disallowed characters.

  • How to retrieve the path and the name of the destination file in a link annotation

    Hi,
    In C++:
    How to retrieve the path and the name of the destination file in a link annotation and a Launch action.
    Sample of my code:
    //Determine if the annotation is a Link annotation
    if (PDAnnotGetSubtype(annot) == ASAtomFromString("Link")) {
    //Determine if the action is a Launch action
    if (PDActionGetSubtype(action) == ASAtomFromString("Launch")) {
    // What is the method ?
    Regards
    David G

    In general, get the annotation as a Cos object and examine it, in
    accordance with the PDF Reference.
    Aandi Inston

  • How to retrieve DB links and column names details used in code

    Hi All,
    I am looking for code that will retrieve database links name, referenced object and column names used in source code within the schema.
    It’s easy enough to find the link names using xxx_db_links / user_source, the trick part it to list the column names used within the code.
    Any expert advice is much appreciate
    Thanks
    Aali

    That wil not give me column names .
    Thanks
    Message was edited by:
    aalishan

  • How to find username and tablespace name indatapump import

    I have a datapump export without the logfile .I would like to import it into a db.Before starting import I would like to know the schema and tablespace which it is exported so that I can remap the schema and tablespace to some other.Is there anyway I can do this

    You can run your import command but add this:
    include=tablespace,user sqlfile=look.sql
    The file look.sql will have the create tablespace commands and the create user commands.
    Edit look.sql to see what the tablespace and user names are.
    Dean

  • Accessing username and group name from an external app

    How can I access the user name and group name from an external app..? Where is that stored..?
    Thanks
    Fernando

    Post Author: pvierheilig
    CA Forum: Crystal Reports
    Each BOE document has a unique ID.  Knowing that will allow you to access it via a URL while passing required login credentials as well, if I recall correctly.  However, your very best bet is to review the SDK.

  • Retrieving my username and password on my router settings.

    Okay. So a while ago i secured my network and then i happened to unsecure it cause someone in our house couldnt seem to get their computer to access the internet even though all the other computers were able to. anways. I want to resecure the network, but I went to the ip 192.168.1.1 to change the settings back and it brings up a username and password window that i never remember popping up before.
    so i assume that i made a username and password for my router and just dont remember? anyways, How do i reset it to factory or get into my settings. arg. **bleep** technology.

    some of the lights were still flashing when i hit the reset button but its weird... i have tried the username and password that i figured i would have used to secure it and then also tried username "admin" w/ password as the password and also just password with no username. it goes to a page that says Opening page with the window to enter my info on top of it but it just says loading the entire time. nothing happens. not sure if that means i typed it in right and the site just sucks or what? cause I left it up for a good 5 minutes and it was still doing the same thing.

  • Using dbms_metadata to retrieve the datatype and parameter name of a procedure

    Greeting Guru,
    is there a subprogram in dbms_metadata that will retrieve the call spec of a procedure/function that ideally
    if the my program spec is proc1(id1 in number, cde in varchar2, id2 out number)
    if I call something like
    select * from table(dbms_metadata.<subprogram> ('proc2')) ;
    It gives me
    id1      in      number
    cde     in      varchar2
    id2      out     number
    any ideas/pointers ?

    Hi,
    Not really sure why you need it from dbms_metadata, but DESC and DBA_ARGUMENTS (dictionary view) would provide the same info. *_ARGUMENTS has lot more info in it
    desc dbn
    Argument Name  Type   In/Out Default
    <return value> NUMBER OUT           
    P1             NUMBER IN            
    desc show_html_from_url
    Argument Name Type     In/Out Default
    P_URL         VARCHAR2 IN            
    > col owner format a10
    > col object_name format a10
    > col argument_name format a10
    > select owner, object_name, argument_name, data_type, data_length, in_out
    from dba_arguments a where object_name = 'DBN'
    OWNER      OBJECT_NAM ARGUMENT_N DATA_TYPE                      DATA_LENGTH IN_OUT 
    HR         DBN        P1         NUMBER                                  22 IN       
    HR         DBN                   NUMBER                                  22 OUT      
    vr,
    Sudhakar

  • How to find the killed session and machine name

    Hi,
    At the time of batch job running .somebody killed that session .let me know how to find out the particular user name db level or oslevel .from which machine they killed how to find out at OS level . but when i have set the audit_trail=os only SYSDBA user activities are audited not the other user activities.
    The server is AIX and db version 11i .provide the query for finding or os level .
    thanks,
    DBC.
    Edited by: dbc001 on Mar 26, 2013 9:48 PM

    Are you sure that somebosy had killed the session? Did you get any error regarding kill session? Is there any other errors you can see in logs?its suspect only....
    >
    How that job was scheduled?...actually we have lot of source systems, from those source system we are getting the data into BI machine, by using BI apps team process data and trigger load jobs @db
    Apps team is having database unix logins aswell as db logins to process their requests.
    Your OS admin can check the history upto some extent? Check if he has auditing enabled at OS level?we are in the process of checking with OS sysadmin.
    upto now we didnt got any clue....apps team successfully re-ran failed job.

  • Username and DB name values-Interactive Reporting

    All,<BR>We are using the Interactive reporting webclient. We have a requirement to display the user logged in the report and the DB connected to the report (OCE connection name).<BR>I am not able to find any method or property for the same.<BR>Your Suggestions are appreciated.<BR><BR>Regards<BR>R.Prasanna

    some time ago, I needed to use table ORASSO.WWSSO_PSEX_USER_INFO$ too...
    Are you trying to get "User Name" selecting fval6 from wwsso_psex_user_info$?
    as I remember "User Name" was stored in field APP_USERNAME, but it was encrypted.
    To dencrypt it, we used orasso.wwsso_api_private.decrypt_string(app_username)
    Don't know how it is now, and if it's still possible to to get "User Name" in such way....

Maybe you are looking for

  • Quicktime does not work in firefox 24 in windows 8 desktop mode

    I am running Firefox 24 on Windows 8 Pro 64-bit in desktop mode. I have QuickTime Plug-in 7.7.4 installed. But when I try to go http://trailers.apple.com/trailers/ and play trailers all I get is black box and nothing is playing. No prompting to autho

  • Dreamweaver preview issue with Safari 4.0

    Description of Issue :    Recently I have upgraded my Safari browser to version to 4.0, after this was completed when I'm in dreamweaver design view I cannot preview my work in Safari as it comes up with a blank web page and opens the folder that the

  • 5.0.2 update?

    Any body know when a new update will be out?   We need it

  • Sound won't play in .fla file

    How can I get sound to play in .fla again like it did before actionscripting control buttons? When I installed control buttons in my .fla file for a maintimeline movie to stop, start, rewind, and jump to end of movie, sound would no longer play when

  • Can anyone help me figure out how to transfer music to a T-Mobile Sidekick?

    I have a T-Mobile 2008 Sidekick, which is music capable. Everytime I connect my phone to the computer, it does not show up on the sidebar of my iTunes window. My phone and the computer say they are connected. Why does it not show up on iTunes? Can an