How to view connected session's SQL history

Using the below query, I can see whos connected.
select username,last_call_et,status,machine from v$session
How can I see the SQL history for a particular connected session?
DB version 10gR2

What about using Auditing ?  For historical analysis Audit is the best option.
Below link may also be of your interest :
sql - Oracle queries executed by a session - Stack Overflow
Regards
Girish Sharma

Similar Messages

  • How to invoke multiple sessions of sql*plus thru pl/sql program

    Hi
    How to invoke multiple sessions of sql*plus thru pl/sql program.
    Thanks

    How to invoke sql*plus in a procedure?????
    I have to invoke more pl/sql sessions?????No you don't "have to".
    Look at what you are trying to do.
    You have a program running inside the PL/SQL engine. This is running nicely inside the Oracle database and is perfectly capable of issuing other SQL statements, PL/SQL programs etc. inside it's nice cosy Oracle environment.
    You are asking for this PL/SQL to shell out to the operating system, run an external application, for which it will have to supply a username and password (are you planning on hard coding those into your PL/SQL?), and then that external application is supposed to run more SQL or PL/SQL against the database.
    a) Why hold all this code external to the database when it can quite happily reside on the database itself and be executed through jobs or whatever.
    b) Consider what would happen if someone were to replace the external application with their own program of the same file name... they'd be able to capture the username and password for connecting to the database, therefore a major security flaw.
    The whole idea of doing what you want through external calls to SQL*Plus is ridiculous.

  • How to do "connect" in PL/SQL ?

    Hi all
    I want to select the 8i database from 11gR2 database.
    So I created a middle DB running 10gR2 and made dblinks like below:
    DB A(8.1.7) <- DB B(10.2.0) <- DB C(11.2.0)
    Now I want select table t from 11.2.
    I Can do from C:
    connect id/pass@B
    select * from t@A;
    But I want it in PL/SQL.
    How to do connect in pl/sql or there are any solutions?
    Thanks.
    Jia Lu

    See Metalink Note 207303.1 for a compatibility matrix that details support for database links between database versions.

  • How to view alerlog contents using SQL?

    How to view alertlog contents using SQL?

    Hi,
    Why don't you use the OEM Database Console ?? Now, in order to view the contents of the alert log file using a SELECT statement, you need to create a external table:
    create or replace
    directory background_dump_dest_dir
    as '<your_oracle_home>/bdump';
    CREATE table alert_log_external
    (line varchar2(4000) )
    ORGANIZATION EXTERNAL
    (TYPE oracle_loader
    DEFAULT DIRECTORY background_dump_dest_dir
    ACCESS PARAMETERS (
    RECORDS DELIMITED BY newline
    nobadfile
    nologfile
    nodiscardfile
    FIELDS TERMINATED BY '#$~=ui$X'
    MISSING FIELD VALUES ARE NULL
    (line)
    LOCATION ('alert_<sid_of your_database>.log') )
    REJECT LIMIT UNLIMITED;Cheers

  • How to view the session in the web container

    hi, Folks,
    is there any way to view the sessions in J2EE web container? I need to know how many living session currently in the web container.
    Thanks

    You did not indicate the Web Server version that you are using for web container. Assuming its Sun Java System Web Server 6.1, per Servlet 2.3 specification, you should be able to use of session creation and destruction events. This can be done using HttpSessionListener to count active sessions. Here's the docs for reference:
    http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpSessionListener.html
    Thanks
    Manish

  • How can i connect to a SQL Server 2000 database usgin JSP?

    I need (URGENT) to connect to SQL Server 2000 databse using JSP. I do not know how to program using JSP, so if anyone has any code snippet please let me see it. What i need is to give my site some login/password security.
    Anyone?
    Thx.

    just create an ODBC of your database from control pannel -> administrative tools -> data sources (ODBC) ,double click it .....
    go to the tab SYstem DSN , click on ADD button. select the driver for your connection. it will be the last one in the list "SQL Server".
    click Next then give ur DSN name there, description and Server Name , on next give your username and password of SQL server. when it will be connected to the server celect your database from there and hence there will be an ODBC bridge same as in case of MS Access.
    code for connecting to ODBC is
    // DSN-NAME same as in System DSN.
    // username and password are of your databse
    try
              url = "jdbc:odbc:DSN-NAME";
              Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
              connect = DriverManager.getConnection( url,"username","password" );
              catch ( ClassNotFoundException cnfex ) {
                        setErrorMsg( cnfex.getMessage() );
              catch ( SQLException sqlex ) {
                        setErrorMsg( sqlex.getMessage() );
              catch ( Exception ex ) {
                        setErrorMsg( ex.getMessage() );
    Now you are connected to the SQL Server ..... use connect object for further processing .........

  • How to view clob data using sql

    Hi,
    In our database, we have one table that is having one column of CLOB datatype but now i want to view the data using sql select query but it throws error: "Datatype not supported".
    Could any one please let me know how to view the clob data using select query.
    Oracle DB version : 10.2.0.3
    Thanks

    h5.
    use read procedure
    PROCEDURE READ (
    lobsrc IN BFILE|BLOB|CLOB ,
    amount IN OUT BINARY_INTEGER,
    offset IN INTEGER,
    buffer OUT RAW|VARCHAR2 );
    example  Updating LOB by Using DBMS_LOB in PL/SQL
    DECLARE
    lobloc CLOB; -- serves as the LOB locator
    text VARCHAR2(32767):='Resigned: 5 August 2000';
    amount NUMBER ; -- amount to be written
    offset INTEGER; -- where to start writing
    BEGIN
    SELECT resume INTO lobloc
    FROM employees
    WHERE employee_id = 405 FOR UPDATE;
    offset := DBMS_LOB.GETLENGTH(lobloc) + 2;
    amount := length(text);
    DBMS_LOB.WRITE (lobloc, amount, offset, text );
    text := ' Resigned: 30 September 2000';
    SELECT resume INTO lobloc
    FROM employees
    WHERE employee_id = 170 FOR UPDATE;
    amount := length(text);
    DBMS_LOB.WRITEAPPEND(lobloc, amount, text);
    COMMIT;
    END;

  • Access to view blocking sessions in sql server 2008

    Hi,
    One of my client wrote a stored procedure. we scheduled this SP in a job. while job is running, it is blocking other sessions. It is happening frequently. So, client is asking me to grant permission to view blocking session( want to execute sp_who2). Could
    you please advise me, which permission I need to give. I don't like to give access other than sp_who2. Please advise.
    Thanks.
    Raja.
    Thanks, Raja

    You need VIEW SERVER STATE permissions for sp_who or sp_who2 to work. You can also use sys.dm_exec_requests which will also give blocking information and requires the same permissions.
    Else you can take a look at the other alternative which is sp_whoisactive - check this link -
    http://sqlblog.com/blogs/adam_machanic/archive/2012/03/22/released-who-is-active-v11-11.aspx
    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

  • How do I connect to an SQL Server Database from CR XI?

    Hello All,
    I posted previously to this forum but did not get any response. There surely must be a way to connect to SQL Server from CR XI? My problem is that I keep on getting prompted for a PW or get a message saying "Logon Failed"
    Please see my earlier post, with code sample, on Page 4 (or now 5 or 6 .....)
    "How to log on to SQL 2000 programmatically using VB6 RDC and CR XI "
    I would really appreciate a response from someone as I need to get some pressing work finished for a client.
    Thanks so much in advance
    Peter Tyler

    This shoul dbe posted to the Legacy Development forums

  • How can you connect to MS SQL Server through Oracle 9i?

    i.e. we want to connect through a stored procedure and NOT a form. Our live DB is still in 9i.

    CKPT wrote:
    user12240205 wrote:
    i.e. we want to connect through a stored procedure and NOT a form. Our live DB is still in 9i.we want to connect through a stored procedure -- connect through stored procedire? i never heard. can you please post your views this information is not enough.CREATE PROCEDURE proc1 (p_sqlsever_credentials varchar2, p_status OUT boolean) IS
    BEGIN
    -- Connect to SQL Server using p_sqlsever_credentials
    -- Execute Stored Procedure (SP) in the SQL Server DB passing paras to it.
    -- If SP in SQL Server is successful then SP will COMMIT in SQL Server
    -- If failure it will be rolled back there.
    -- SP will return status
    -- Pass the status to the calling program
    END;
    /

  • How to view long comments in CVS History?

    Hi,
    JDev version: 10.1.2.1.0
    There are some particularly long comments on some revisions when viewing the history of a source file. How do I view the entire comment within JDev? As the comment column is too narrow to fit it.
    Thanks.

    There is no easy way to do this in 10.1.2. In 10.1.2 you can copy the contents of the row and then paste it into an editor to view the comments as a basic workaround.
    In 10.1.3 selecting the history row, right-clicking, and selecting properties... will show the full comment.
    Thanks,
    Geoff

  • How to view /SAPAPO/ tables using SQL Studio question

    Hi,
    This is for Livecache 7.4 on AIX.
    I have installed a SQL Studio 7.6. When I logged using SUPERDBA/admin, I can only see tables owned by SUPERDBA, SYS, and DOMAIN.
    I cannot see any tables owned by SAP<LC Name>. I want to see details about table e.g. /SAPAPO/ORDKEY, which is owed by SAP<LC Name>.
    Is it possible to see it using SQL Studio?
    Please let me know if anybody has any idea about it.
    Regards.
    Sume.

    Hello Sume,
    If you would like to see details about table e.g. /SAPAPO/ORDKEY.
    =>
      Did you check the owner of this table?
    => You could check, for example, in LC10 -> liveCache:Monitoring
    -> Problem Analysis -> Tables/Views/Synonyms ->
       Database Object Schema           SAPLCT
       Name of Database Object          *
       < execute >
       & review if the table /SAPAPO/ORDKEY is listed.
    => If the table is listed, you should be able to run the select statement as SAPLCT user on this table.
    If you are sure that you was using the SAPLCT user, please
    Check if this user has application tables:
    < May be the password was changed from the default sap for the
    Standard liveCache user, you should know it. >
    dbmcli -d LCT -u control,control
    dbmcli on LCT>sql_connect SAPLCT,sap
    dbmcli on LCT> sql_execute select * from users
    dbmcli on LCT> sql_execute select * from users
    < I would like to see what DBA users you have in liveCche &
      when the SAPLCT user was created. >
    dbmcli on LCT>sql_execute select tablename from tables where owner='SAPLCT'
    < If the SAPLCT is the owner of the liveCche application tables,
      and the table /SAPAPO/ORDKEY will be listed. >
    dbmcli on LCT> sql_execute select * from tables where owner='SAPLCT'
    dbmcli on LCT> sql_execute select count(*) from "SAPLCT"."/SAPAPO/ORDKEY"
    < to get number of the entries in the table with owner - SAPLCT >
    dbmcli on LCT>exit
    You could also to check what user did you set for the LCA connection.
    And run //om16 transaction in the liveCache relevant client on the system
    to see the entries in the /sapapo/ordkey & /sapapo/ordmap in liveCache in this client.
    Question: What details you need about table /SAPAPO/ORDKEY?
              Do you have problems on your system?
    Thank you and best regards, Natlia Khlopina

  • How do I connect to a SQL Server DB?

    I have a menu designed in Flash which has to pull back
    database records, how do I go about that? Every tutorial seems to
    be different and none are exactly what I am looking for.
    thanks
    Em

    Very true. This is a wide open field of decisions you have to
    make.
    First choice you have is sending via URL variable encoding or
    XML. That will define your tasks needed in ASP. As well would you
    want to simply (most beginners would) just have the ASP send the
    URL variables or XML with Response.write or are you planning a web
    service type of app.
    For Flash you will find the examples in the docs are all you
    need to get the data from the ASP and send back if necessary. Still
    the choices depend on the server (ASP) choices.
    For URL Encoding from ASP:
    LoadVars.load
    For URL Encoding to and from ASP:
    LoadVars.sendAndLoad
    For XML from ASP:
    XML.load
    For XML to and from ASP:
    XML.sendAndLoad
    For overall details on data integration
    Many folks like using the Flash 8 Pro DataGrid component for
    a quick UI to display a SQL select result. You would populate it
    using
    DataGrid.addItem.
    You can also bind the DataGrid to data providers such as an
    array so it updates when the data source changes.
    You also can use many of the Flash 8 Pro UI components in a
    data integration that binds them to a data connector component:
    FLash
    8 Pro data binding component approach. You should review
    Data
    Integration in the Flash Docs for this approach.
    If you need some decisions:
    1. Select a scripting language: ASP, PHP, ASP.Net, JSP, Perl,
    ColdFusion
    2. Select the database: mySQL, SQL Server, Oracle
    3. Decide how you want to send data to and from Flash (XML,
    Url variables, Web Services)
    4. Write a server script that can do the database work you
    want and just use html forms to prove those scripts out.
    5. Look up the docs in Flash for #3 and do the Flash UI.
    You might see from this that Flash or HTML would work with
    the same server scripts.

  • How to view what session is causing heavy load

    Hi,
    currently I was tasked to view what is wrong with the production server, there's some processing that is causing heavy usage.
    May I know how should I go about investigating this?
    thanks
    more precisely which machine, which sid, what query is causing heavy load on the db server?
    thanks

    Hi,
    Better generate and statspack/AWR and analyse the report to find queries which are causing heavy load for the time period in which database consuming high CPU. You can use top command from OS level to check the process are consuming heavy load.
    HTH
    regards
    Jafar

  • How to view sys_context value in SQL Developer?

    hello
    i can view the results via sqlplus with following statements:
    SELECT SYS_CONTEXT ('empno_ctx', 'empno_attrib') empno_attrib FROM DUAL;
    SELECT * FROM SESSION_CONTEXT;
    both retrieve correct values;
    now, since i work mainly in SQL Developer i wanted to view the results in there as well;
    i ran the procedure in SQL Developer via right-click on the procedure -> run;
    it looked like it ran ok;
    however when i do the above queries nothing is retrieved;
    any suggestions?
    thanks
    rgds

    Hi,
    You can use
    SELECT SYS_CONTEXT ('empno_ctx', 'empno_attrib') empno_attrib into <Variable Name> FROM DUAL;
    dbms_output.putline (<Variable Name>
    So after you execute the procedure. You will be able to see the value in output window.
    Regards,
    Kushal Gupta

Maybe you are looking for

  • Ipod Will No Longer Turn On

    I'm having a issue with my Ipod Classic. It has worked fine since I purchased it but all of a sudden it simply won't turn on at all. I've tried all the methods of rebooting it and charging it but it simply will not do anything. It was not dropped or

  • Calendar on Home Screen of Nokia 6303 Classic

    I've just got one of the 6303 Classics and synced my Outlook calendar with the phone but now on the Home Screen it only displays one appointment rather than all i have that day like my old Nokia. Is there anyway i can get it to display more appointme

  • AWR report not getting generated hourly

    Hi We have an Oracle EE 11.2.0.1, on which i see that the AWR reports are being generated randomly not every hour , would anyone know if i am missing any config My renetention interval specified SQL> select SNAP_INTERVAL,RETENTION from DBA_HIST_WR_CO

  • Do Hard Shell cases protect your device?

    Hi, i'm looking to purchase the new ipad soon and i'm prioritising safety for the device (i.e. cases) I know silicone cases work well but there doesn't seem to be many of them that are compatible with the smart cover. On the other hand there are many

  • Enter Sql Statement is causing the Oracle SQL editor to freeze

    I find Oracle SQL Developer's editor keep on freezing as I am writing sql statement on the editor. Is there an option to turn off the freeze. If there is an option to turn off. Does it affect the sql editor not to automatically show objects on select