Getting username of sqls

Hi
I want to know the username of the particular query from the sql_text.
Tried below query, bot it doesnt show anything.
SELECT s2.username
from v$sqlarea s1,v$session s2
where s1.sql_text like '%SELECT%'
and s2.SQL_HASH_VALUE = s1.hash_value

Try to run it as a user which has DBA role
Kamran Agayev A. (10g OCP)
http://kamranagayev.wordpress.com
[Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

Similar Messages

  • Username form SQL

    How can I obtain portal username from SQL or from system variable. If I write "Select user from sys.dual;" I get database user instead portal user
    Thanks Radek

    Radek,
    the portal FAQ gives:
    Which API call can I use to get Current Portal User?
    Use WWCTX_API.GET_USER to get the username and WWCTX_API.GET_USERID to get the userid.
    Hth,
    Ton

  • In iPhoto, when i try to email a photo using "share", I keep getting"username/password" not recognized. It used to work automatically before.

    I cannot email  a photo using iPhoto "share. I keep getting "username/password not recognized". I used to use this function all the time but all of a sudden, I keep getting this message.

    In iPhoto, open Preferences (under iPhoto in the menu bar) and click the "Accounts" tab on top.  Make sure your email account(s) is/are set up there correctly, just as they are in Apple's Mail.  Make sure the password in included.

  • How to get username in the application?

    Hi,
    Do anyone knows how to get username from the application, for example, oracle provides a function to retreive a username from application?
    Please Help
    Amy

    read about the following function, it is usefull for you.
    sys_context

  • Reg : How can I get  Username and Password in FTP Server in HANA

    Hi All,
      Any one can you please guide me....How can i get username and Password of FTP Server in SAP HANA?
    Regards,
    Arjun

    Hi Arjun,
    Are you looking for external authentication(External ID option) in HANA Studio instead of logging by entering HANA User and Pwd(which is internal)?
    You can look for the following Security guide which will give you some insight on this.
    http://help.sap.com/hana/hana1_sec_en.pdf
    Rgds,
    Murali

  • How to get the real SQL statement from a preparedstatement?

    Hi,
    I am trying to log the actual SQL sent to database by the preparedStatement. Since the original SQL I used to prepare the statement has a lot of "?" in it, after setting all the parameters in the preparedStatement, I want to get the final SQL statement executed. Is there a way to get it? Probably the SQL will depend on different drivers.
    Thanks in advance.

    Thanks, changhsu. I tried the tracing technique. But it only prints out the original SQL statement sent to the preparedStatement. The following is part of the log file:
    ======================================================================
    --------NetDirect JSQLConnect Version:2.2708--------
    2002-04-10 14:23:54.818 (1) Connection attempt number 1 Connection ID:1 for host:perseus
    2002-04-10 14:23:55.429 (1) JSQLConnect(2.2708) Trial license - expires on:Thu Apr 25 17:47:32 CDT 2002, unlimited connections
    2002-04-10 14:23:55.449 (2) Connection allocated from pool ID:2
    2002-04-10 14:23:55.72 (2) [Thread[Thread-6,5,main], IO:88cb4, Dbc:1346]] SELECT SHARED_DRIVES FROM EPM_PREFS WHERE PRODUCT='PE'
    2002-04-10 14:23:57.913 (2) Connection closed and returned to connection pool ID:2
    2002-04-10 14:23:58.193 (3) Connection attempt number 2 Connection ID:3 for host:perseus database:epm20 SQL6.5:false
    2002-04-10 14:23:58.203 (3) [Thread[Thread-6,5,main], IO:88cb3, Dbc:1347]] use epm20 set quoted_identifier,ansi_null_dflt_on,ansi_padding on set textsize 2147483647 set transaction isolation level read committed set implicit_transactions off
    2002-04-10 14:24:00.356 (4) Connection allocated from pool ID:4
    2002-04-10 14:24:01.168 (4) [Not Loged In@localhost, IO:88cb2, Dbc:1347]] PreparedStatement::prepare stmt:SELECT PASSWD FROM RESOURCE_INFO WHERE USER_ID=? AND DELETE_FLG IS NULL
    2002-04-10 14:24:01.448 (4) [Not Loged In@localhost, IO:88cb2, Dbc:1347]] RPC:sp_prepare
    2002-04-10 14:24:01.488 (4) [Not Loged In@localhost, IO:88cb2, Dbc:1347]] RPC:sp_execute
    =======================================================================
    I did not try to trace in SQL Server 7. I will have to find out how to do that first.
    Thanks again.

  • Get collation of SQL Server database in C# application.

    Hi all,
    Is there any way to get collation of SQL Server database in C# application.
    Basically I have to read collation of two SQL Sever databases and compare them in C# application.
    If possible change the collation of two SQL Server databases to same. These databases are empty and newly created one's.
    Can any one provide pointers or sample.
    Thanks in advance.

    Hello somsekhark,
    May I ask the meaning of this "collation of SQL Server "? Do you mean data collection or you mean the whole database file?
    I saw that you want the two database the same and you want to use C#, in this way I would recommend you check the following tutorial as a start:
    1. Introuduce to Bulk Copy
    https://msdn.microsoft.com/en-us/library/7ek5da1a(v=vs.110).aspx
    2. Multiple Bulk Copy Operations
    https://msdn.microsoft.com/en-us/library/s4s223c6(v=vs.110).aspx
    However the above things need the target database table exist.
    If you don't want this you may think about using SQL Server Management Objects
    https://msdn.microsoft.com/en-us/library/ms162169.aspx
    Something like introuduced here:
    https://msdn.microsoft.com/en-us/library/ms162563.aspx
    For more details, I think you question need to be specific.
    Best regards, 
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • WS-security Need to Get Username and Password and time Stamp in SOAP Header

    HI ALL,
    i need to get USERNAME and PWD in my Soap header for consuming Webservice using SAP PI ,
    and my SOAP Header should look like this
    <soapenv:Header>
    <wsse:Security soapenv:mustUnderstand="1"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurityutility-
    1.0.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-
    secext-1.0.xsd">
    <wsu:Timestamp wsu:Id="Timestamp-296915943">
    <wsu:Created>2008-06-05T18:30:59.904Z</wsu:Created>
    <wsu:Expires>2009-06-05T18:35:59.904Z</wsu:Expires>
    </wsu:Timestamp>
    <wsse:UsernameToken wsu:Id="UsernameToken-192809888">
    <wsse:Username>midtier-service</wsse:Username>
    xxxxxxxx: Confidential Green 10
    <wsse:Password Type="http://docs.oasisopen.
    org/wss/2004/01/oasis-200401-wss-username-token-profile-
    1.0#PasswordText">password</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    </soapenv:Header>
    should i need to get some certificates from client and deploy it or should we do anything in SAP PI and send to soap header or can hard code it and send to webservice, please help me in this t
    hanking you
    Sridhar

    i need to get USERNAME and PWD in my Soap header for consuming Webservice using SAP PI ,
    Can be achieved by XSL Mapping or SOAP Axis Adapter. Search on SDN for further details as this has been discussed many a times on the forum.
    should i need to get some certificates from client and deploy it or should we do anything in SAP PI and send to soap header or can hard code it and send to webservice, please help me in this t
    First you need to confirm whether certificates are required or not. Might be the web service is using user id / password security (basic authorization).
    How to use certificates in PI - Search on SAP Help, this has been explained in great details over there.

  • How to get username from customer email id.

    Hi experts,
    How to get username from customer email id.I am using transaction XD02.
    I would be thankful for your kind replies .
    Regards,
    Sachin Hada

    Hi sachin,
    Re: Email id field
    Regards,
    Sravanthi

  • Get rid of SQL ID from database

    1. The SQL query is running nore than 30 mints with SQL ID aaaaabbb7RRRR . we killed the seesion and clear cache
    again we ran the query, the query is assigned to same sql ID aaaaabbb7RRRR we killed the seesion and clear cache
    ran query one more time it is assigned to same ID again
    anyone know how to get rid of SQL id from Database
    Edited by: user8680248 on 19/04/2010 22:32

    user8680248 wrote:
    I have shutdown the database and restarted , I can see the query assigened to teh same SQL IDYou seem to think SQL_ID is uniquely generated for each SQL Statement.
    I'd come to he conclusion that it is derived from the hash value of the SQL statement. Which to me means that the same SQL statement would result in the same SQL_ID. Some internet hits that support my way of thinking are
    http://www.experts-exchange.com/Database/Oracle/10.x/Q_23843388.html
    http://blog.tanelpoder.com/2009/02/22/sql_id-is-just-a-fancy-representation-of-hash-value/
    http://www.slaviks-blog.com/2010/03/30/oracle-sql_id-and-hash-value/
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:10353453905351
    from which I note that Tanel shows a way of converting the Hash value (derived directly from the statement) to the SQL_ID, and Tom says "sql_id survives database instance restarts and reloads."

  • Is there a way to get long running SQL Agent jobs information using powershell?

    Hi All,
    Is there a way to get long running SQL Agent jobs information using powershell for multiple SQL servers in the environment?
    Thanks in Advance.
    --Hunt

    I'm running SQL's to fetch the required details and store it in centralized table. 
    foreach ($svr in get-content "f:\PowerSQL\Input\LongRunningJobsPowerSQLServers.txt"){
    $dt = new-object "System.Data.DataTable"
    $cn = new-object System.Data.SqlClient.SqlConnection "server=$svr;database=master;Integrated Security=sspi"
    $cn.Open()
    $sql = $cn.CreateCommand()
    $sql.CommandText = "SELECT
    @@SERVERNAME servername,
    j.job_id AS 'JobId',
    name AS 'JobName',
    max(start_execution_date) AS 'StartTime',
    max(stop_execution_date)AS 'StopTime',
    max(avgruntimeonsucceed),
    max(DATEDIFF(s,start_execution_date,GETDATE())) AS 'CurrentRunTime',
    max(CASE WHEN stop_execution_date IS NULL THEN
    DATEDIFF(ss,start_execution_date,stop_execution_date) ELSE 0 END) 'ActualRunTime',
    max(CASE
    WHEN stop_execution_date IS NULL THEN 'JobRunning'
    WHEN DATEDIFF(ss,start_execution_date,stop_execution_date)
    > (AvgRunTimeOnSucceed + AvgRunTimeOnSucceed * .05) THEN 'LongRunning-History'
    ELSE 'NormalRunning-History'
    END) 'JobRun',
    max(CASE
    WHEN stop_execution_date IS NULL THEN
    CASE WHEN DATEDIFF(ss,start_execution_date,GETDATE())
    > (AvgRunTimeOnSucceed + AvgRunTimeOnSucceed * .05) THEN 'LongRunning-NOW'
    ELSE 'NormalRunning-NOW'
    END
    ELSE 'JobAlreadyDone'
    END)AS 'JobRunning'
    FROM msdb.dbo.sysjobactivity ja
    INNER JOIN msdb.dbo.sysjobs j ON ja.job_id = j.job_id
    INNER JOIN (
    SELECT job_id,
    AVG
    ((run_duration/10000 * 3600) + ((run_duration%10000)/100*60) + (run_duration%10000)%100)
    +
    STDEV
    ((run_duration/10000 * 3600) + ((run_duration%10000)/100*60) + (run_duration%10000)%100) AS 'AvgRuntimeOnSucceed'
    FROM msdb.dbo.sysjobhistory
    WHERE step_id = 0 AND run_status = 1
    GROUP BY job_id) art
    ON j.job_id = art.job_id
    WHERE
    (stop_execution_date IS NULL and start_execution_date is NOT NULL) OR
    (DATEDIFF(ss,start_execution_date,stop_execution_date) > 60 and DATEDIFF(MINUTE,start_execution_date,GETDATE())>60
    AND
    CAST(LEFT(start_execution_date,11) AS DATETIME) = CAST(LEFT(GETDATE(),11) AS DATETIME) )
    --ORDER BY start_execution_date DESC
    group by j.job_id,name
    $rdr = $sql.ExecuteReader()
    $dt.Load($rdr)
    $cn.Close()
    $dt|out-Datatable
    Write-DataTable -ServerInstance 'test124' -Database "PowerSQL" -TableName "TLOG_JobLongRunning" -Data $dt}
    You can refer the below link to refer out-datatable and write-dataTable function.
    http://blogs.technet.com/b/heyscriptingguy/archive/2010/11/01/use-powershell-to-collect-server-data-and-write-to-sql.aspx
    Once we've the table details, I'm sending one consolidated email to automatically.
    --Prashanth

  • I'm unable to send an email, i get username or password incorrect despite being correct. Has anyone had this problem before and fixed it?

    I'm unable to send an email, i get username or password incorrect despite being correct. Has anyone had this problem before and fixed it?

    Are you sure the settings are correct? Did you check the outgoing mail server setting? Make sure that your username and password are in there.
    Settings>Mail, Contacts, Calendars>Your email account>Account>Outgoing mail server - tap the server name next to SMTP and check in the primary server and make sure your username and password are entered and correct - even if it says that the password is optional.

  • How can I get this thru SQL ?

    Hi,
    I am having following sample data
    NUMRUB FORMAT
    1 X(02)
    2 9(02)
    3 9(08)
    4 X(20)
    5 9(01)
    6 X(03)
    7 9(1)
    8 X(02)
    9 9(02)
    I want output in following way
    NUMRUB FORMAT NewFormat Start Position
    1 X(02) 2 1
    2 9(02) 2 3
    3 9(08) 8 5
    4 X(20) 20 13
    5 9(09) 9 33
    6 X(03) 3 41
    7 9(1) 1 44
    8 X(02) 2 45
    9 9(02) 2 47
    How can I get this thru SQL ?
    Pl guide me.
    thanks & regards
    PJP

    SQL> create table mytable (numrub,format)
      2  as
      3  select 1, 'X(02)' from dual union all
      4  select 2, '9(02)' from dual union all
      5  select 3, '9(08)' from dual union all
      6  select 4, 'X(20)' from dual union all
      7  select 5, '9(09)' from dual union all
      8  select 6, 'X(03)' from dual union all
      9  select 7, '9(1)' from dual union all
    10  select 8, 'X(02)' from dual union all
    11  select 9, '9(02)' from dual
    12  /
    Tabel is aangemaakt.
    SQL> select numrub
      2       , format
      3       , to_number(regexp_replace(format,'(X|9)\((.*)\)','\2')) "NewFormat"
      4       , nvl
      5         ( sum(to_number(regexp_replace(format,'(X|9)\((.*)\)','\2')))
      6           over (order by numrub rows between unbounded preceding and 1 preceding)
      7         , 0
      8         ) + 1 "Start Position"
      9    from mytable
    10   order by numrub
    11  /
        NUMRUB FORMA  NewFormat Start Position
             1 X(02)          2              1
             2 9(02)          2              3
             3 9(08)          8              5
             4 X(20)         20             13
             5 9(09)          9             33
             6 X(03)          3             42
             7 9(1)           1             45
             8 X(02)          2             46
             9 9(02)          2             48
    9 rijen zijn geselecteerd.Regards,
    Rob.

  • Get Username

    How to get username from Client Machine in java
    More Specific
    My Jsp Files in a Server .when Client Acces Jsp Page his username should be displayed.(username:- System Username while loggging in)

    request.getRemoteUser() returns the user ID that was used to authenticate the user to your web server. If you were expecting to get the user name that I used to sign on to my computer when I come to your web server, no.

  • Need to get UserName of windows session

    Hi All!
    I need to get username under which user had logged in. How can I get it from my java code?

    Sorry, I has allready found the answer :
    System.getProperty ( "user.name" ) ;

Maybe you are looking for

  • Error while posting to Acounts..."Wagetype /557:Symbollic account Doesnt Ex

    Hi Experts, After successful running of  Payroll i executed the tcode pc00_m99_cipe to post into accounts.Here i am getting the Error "Wagetype /557:Symbollic account Does not Exist"". How to solve the problem. Thanking you. Regards, Sai.

  • Standard Report in SAP

    Hello Experts We would like to have Some standard report to check whether Any standard schema or rule changed by Anyone (Consultants) We want to target specifically for a country and standard schema and rules. Any updates appreciated. Regards SK

  • Import of existing Contract in Sourcing 7.0

    Hi All, I am trying to upload existing contract document in the Sourcing 7.0. I have utilized the workbook provided by SAP in the reference guide for contract import. There are 3 section in the workbook. They are:- contracts, agreements, contract_lin

  • How to create an object of type 99

    Hi guys, Am struck creating a HR object with subty = 99. I was trying to BDC  PP01 transaction. But I dont see the object type 99. They call it as FI hierarchy node... Am a HR Tech consultant.. Could not understand what that means... Please help me h

  • Lenovo T400 LCD Problem (shut off and bezel light abnormality )

    Hello !!! This is regarding a problem with the Thinkpad T400. The problem is -- When the lid is at ~65 degrees , everything works fine. Whereas , when the lid is raised to viewing angle of arounbd 90 degrees , it goes to sleep AND , I noticed that th