SQL query to see what the db/schema is doing

My apologies in advance as I am sure this has been covered. However, my google foo is failing me. :(
Oracle 11g on Centos 5
I am running a script against the database from my local pc through command prompt. I am wanting to run a query against the db to see what part of the script it is running and if it's possible I would like to be able to see if it is doing read / writes. Similar to an onstat on informix.

Welcome to the forum!
>
I am running a script against the database from my local pc through command prompt. I am wanting to run a query against the db to see what part of the script it is running and if it's possible I would like to be able to see if it is doing read / writes. Similar to an onstat on informix.
>
Oracle has no equivalent to onstat - http://www.oninit.com/onstat/
Oracle also has no knowledge of your 'script' contents.
As SB mentioned you can get a list of sessions and their identifiers. Then you can query the V$SESSION_LONGOPS system view to get information about long running operations.
See V$SESSION_LONGOPS in the Database Reference. The same doc (see index) has information about V$SESSION and V$SQL
http://docs.oracle.com/cd/B19306_01/server.102/b14237/dynviews_2092.htm#REFRN30227
>
V$SESSION_LONGOPS
This view displays the status of various operations that run for longer than 6 seconds (in absolute time). These operations currently include many backup and recovery functions, statistics gathering, and query execution, and more operations are added for every Oracle release.
To monitor query execution progress, you must be using the cost-based optimizer and you must:
•Set the TIMED_STATISTICS or SQL_TRACE parameter to true
•Gather statistics for your objects with the ANALYZE statement or the DBMS_STATS package
You can add information to this view about application-specific long-running operations by using the DBMS_APPLICATION_INFO.SET_SESSION_LONGOPS procedure.
>
If you provide more information about what commands are in your script, what the script does and what information you are trying to obtain maybe we can be of more help.

Similar Messages

  • SQL Query involved to Generate the reports

    Hi,
    I have created Vendor report which internally refers two tables from the vendor and store table (Both the tables are not directly Joined each other)
    i want to see the SQL Query involved to generate the report.
    where can i see that?
    Regards,
    Prasanthi

    in nqquery.log file:
    10g -> $BI_ORACLE_HOME/server/Log
    11g -> $ORACLE_INSTANCE/diagnostics/logs/OracleBIServerComponent/coreapplication_obis1

  • HT1349 Apparently you can have 5 computers registered for iTunes.  I have 3 active computers but I guess I have other computers that are still activated that I no longer use.  Is there a way to delete or see what the others are?  Please help!

    Apparently you can have 5 computers registered for iTunes.  I have 3 active computers but I guess I have other computers that are still activated that I no longer use and I no longer have as they crashed.  Is there a way to delete or see what the other computers are so that I can go in and delete them?  I've tried to email Apple directly but apparently I need my hardware # and obviously I do not have that # since I don't have the equipment any longer.  Any help is greatly appreicated.  I am trying to add another computer and it won't allow me to as they say I'm at my limit.  Please help!

    Sure.
    Just open up iTunes on your computer -> Go to the iTunes Store -> Click your e- maill address (top right corner of the window) -> Type in your password for your Apple ID -> Under Computer Authorisations (underneath your Apple ID account balance and address) -> Press 'Deauthorise All'
    -> This will deauthorise all computers and devices from your iTunes account -> you then need to re- authorise any computers/ devices you would like to use with your Apple ID for iTunes content -> to do this, select the Store tab along the menu at the top (where 'File', 'Edit', 'View' etc..... are) -> Then click 'Authorise this Computer' -> Type in your Apple ID -> Voila!
    For any iOS devices (non- computers) you wish to re- authorise, these will automatically do so when you go to play iTunes content, download an app or anything like that on those devices!
    Hope this helps!

  • My Verizon wireless service at my house has begun to degrade over the last 6 Month.  It has begun to be very frustrating seeing how we switched over from Satellite to Verizon 4GLTE wireless device.  How do I contact someone to see what the issue may be. Z

    My Verizon wireless service at my house has begun to degrade over the last 6 Month.  It has begun to be very frustrating seeing how we switched over from Satellite to Verizon 4GLTE wireless device.  How do I contact someone to see what the issue may be. Zip Code 22580.

    Out of curiosity how much data per month are you using?  Another factor could be if neighbors have all done the same thing as you and the node is being overloaded on home internet use.

  • Sql query to identify all the responsibilities attached to a form

    (oracle - apps) Can anyone help me by giving a sql query to identify all the responsibilities attached to a form and corresponding menu should not be in the menu exclusion.
    Thanks in advance
    Venki

    Bump

  • SQL query  which return all the NET SERVICES which are avaiable in tnsname

    hi all
    how to write a sql query which return all the net services which are avaiable in tnsname.ora
    Regards
    s

    Also, tnsnames.ora is stored on the client, and not necessarily on the server; it's possible (and quite likely) that the name I use for a database in my tnsnames.ora could be different from the name you use for the same database; conversely we might use the same name for two different databases.
    Regards Nigel

  • How can you see what the WLC ACL is denying?

    How can you see what the acl on our WLC5508 is denying? The counter keeps on going up but what is getting blocked is nowhere to be seen.

    You are right but you can monitor that through the hits counts on the (WLC)Security->Access crontrol list === Hits
    It will give you some idea for trouble shooting also you have the cmd line for details analysis.

  • I am trying to update my apps but it is asking for my card details and when i enter them it says my card was declined but i havent bought anything, can i see what the purchase is for?

    I am trying to update my apps but it is asking for my card details and when i enter them it says my card was declined but i havent bought anything, can i see what the purchase is for?

    Again,  Apps will always be tied to the account from which they were purchased and will always have to be updated using that account.
    Always, mean exactly that, always.
    If you want them to be on your account then you need to buy them using your account.

  • OTL I am trying to wright a SQL query that will return the date the timesheet was submitted and date/time it was approved, can anyone guide me on this?

    Hi
    I am trying to wright a SQL query that will return the date the timesheet was submitted and date/time it was approved, can anyone guide me on this?
    I basically need person name who submitted, date - time it was submitted for approval, then the person who approved it and the date - time that it was approved
    Thanks
    Ruby

    Ruby,
    you can start with HXC_TIMECARD_SUMMARY table for submitter detail. But for approver details, i think you need WF tables to get the data for item type HXCEMP.

  • Right hand doesn't know what the left hand is doing.  ARG!

    Yesterday... I lost 4G LTE access on my phone.  So, I call Technical Support asking what's going on.  By the way, they didn't have a clue what was going on and why 4G was on the fritz, 3G was working through.  I was just about to go to the Verizon Store to have my phone looked at when I stumbled upon a notice on another Android forum that stated that the Verizon 4G network was again on the fritz.  The article is located at http://stopthecap.com/2011/12/07/verizon-wireless-lte-outage-impacts-service-on-east-coast/.
    Also here... http://www.dslreports.com/forum/r26627655-VZW-LTE-data-outage-in-NYC-metro-area
    OK, if this sounds like a rant, then you'd be right!  Because it is!
    How hard is it to put a message somewhere on the main company message boards, send an email, send a notice... something?  Anything!  To let everyone in the company know what is going on.  You are doing a great disservice to your customers in not telling your representatives both on the phone and in the stores that something is wrong with the network.  You are sending people scrambling for a fix for their phones when in reality the network is broken again.
    Seriously... the right hand doesn't know what the left hand is doing!

    I agree, a simple text sent or a post on here would be nice!

  • SQL Query to return all the dependent objects

    Hi,
    I have a question.
    Suppose I am creating a table with a join on 10 other tables, views etc..
    And there are nested sub-queries in the CREATE statement.
    How can I get the list of all the dependent objects for that table without counting them manually.
    I know, we can right click the table/view name and check the dependent objects in Toad or SQL Developer.
    But, I want to know the SQL query for getting that information.
    Thanks
    Rajiv

    well there is no way oracle would know what query was used when the table was created.
    But here is one intuitive trick:
    Step 1: Create a procedure that will have a cursor declared on the query you want to know what tables/views are used.
    Step 2: Check USER_DEPENDENCIES to see what objects this procedure depends on
    Let say you want to create TEST_A table using the following statement:
    create table test_a
    as
    select *
    from scott.emp,
         scott.dept;
      1  create or replace procedure test_temp
      2  as
      3  cursor test_cur is
      4             select *
      5             from scott.emp,
      6                  scott.dept;
      7  begin
      8     null;
      9* end;
    SQL> /
    Procedure created.
    SQL> show errors
    No errors.
    SQL> desc user_dependencies
    Name                                      Null?    Type
    NAME                                      NOT NULL VARCHAR2(30)
    TYPE                                               VARCHAR2(17)
    REFERENCED_OWNER                                   VARCHAR2(30)
    REFERENCED_NAME                                    VARCHAR2(64)
    REFERENCED_TYPE                                    VARCHAR2(17)
    REFERENCED_LINK_NAME                               VARCHAR2(128)
    SCHEMAID                                           NUMBER
    DEPENDENCY_TYPE                                    VARCHAR2(4)
    SQL> select referenced_owner, referenced_name, referenced_type
      2  from user_dependencies
      3  where name='TEST_TEMP' and referenced_owner<>'SYS';
    REFERENCED_OWNER
    REFERENCED_NAME
    REFERENCED_TYPE
    SCOTT
    DEPT
    TABLE
    SCOTT
    EMP
    TABLE
    SQL>
    SQL> drop procedure test_temp;
    Procedure dropped.
    SQL>Message was edited by:
    tekicora
    Message was edited by:
    tekicora

  • PL/SQL String - To see what's in?

    Hello,
    I have a long sql-statement in a region source.
    The type ist "SLQ Query(PL/SQL function...)
    Example of my code:
    declare q varchar(4000);
    begin
    q:= ' SELECT org ';
    If :P110_EMPLOYEE = '%null%' and :P110_WRKCTRL1 = '%null%' then q:=q||' BUKRS Name, '; else null;
    end if;
    q:=q||' FROM csdb.v_user_org, csosap.pa2_mon a WHERE 1=1';
    if :P110_WRKCTRL1 <> '%null%' then q:=q||' and ARBPL = :P110_WRKCTRL1 '; else null; end if;
    return q;
    end;
    In "q" ist the long sql string. Now I get some error messages.
    It is very difficult to find a solutions because "q" ist very long.
    Is it possible, to get someting like messagebox. popup or print a file to see what's in "q" (the sql stringer)?
    Thanks a lot.
    Andre

    Hello Andre,
    Please check if the following have any relevance to your situation - Re: ORA-06550 recieved when trying to modify existing page after 3.1 Apex u .
    >> Is it possible, to get the content from the item (:P110_Enddate) and
    not the name?
    You can try using a substitution string notation e.g. “& P110_Enddate.”. The trailing period is part of the syntax.
    Regards,
    Arie.

  • Sql query runs slower from the application

    Hi,
    We are using oracle 9ias on AIX box.The jdk version used: 1.3.1 . From the j2ee application when we perfom a search, the sql query takes for ever to return the results. I know that we are waiting on the database because I can see the query working when I look at TOAD.But if i run the same query on the database server itself, it returns the results in less than a sec. Could you guys throw some light on how we could troubleshoot this problem. Thanks.

    When the results have to travel over the network, it is slow, and when they don't, it is fast.
    That is what you are saying, correct?
    So your approach should be to not bring so much data over the network. Don't select columns you don't need, and don't select rows you don't need.

  • Looking for a SQL query to get all the possible Alert Messages from the Rules in a Management Pack

    For reporting, I'm looking to get a SQL query of all the possible Alert Messages for Rules configured in a Management Pack (not necessarily the ones that have thrown alerts).  I can do this for Monitors, but not for Rules. 
    The configured alert messages for the Management Pack Monitors
    go like this:  ManagementPack > MonitorView> RuleModule > RuleModule.Alert Message > Localized Text
    The configured alert messages for the Management Pack Rules
    should go something like this, but there is a missing link:  ManagementPack > RuleView > RuleModule > ? Missing Link ? > Localized Text
    The Rules are tied to the Module, but I don't see a connection from the RulesModule to the Alert Message that I see in the LocalizedText. The Rule names do not always equal the Alert name. 
    Can someone provide the missing link?

    Hi,
    please try below powershell code to find the corresponding management pack for specific alert:
    $Alert = get-scomalert | where {$_.Name -like 'Agent Proxy Not Enabled*'} | select -first 1
    If ($alert.IsMonitorAlert -eq "True") {
    write-host "Ths is a monitor-generated alert"
    get-scommonitor -ID $Alert.MonitoringRuleID | select Enabled, DisplayName, ManagementPack
    else
    write-host "This is a rule-generated alert"
    get-scomrule -ID $Alert.MonitoringRuleID | select Enabled, DisplayName, ManagementPack
    In addition, please also refer to the below link:
    http://blogs.technet.com/b/mazenahmed/archive/2011/12/02/using-powershell-to-map-opsmgr-active-alert-to-its-corresponding-rule-monitor-and-management-pack-name.aspx
    Regards,
    Yan Li
    Regards, Yan Li

  • Sql query hangs close to the end

    Hi:
    I am on 10.2.0.3.
    My rather simple query hangs for a few minutes close to the end. It's supposed to return 288 rows and it immediately returns 285, then hangs for 4-5 min, than returns the remaining 3 rows. Kind of similar behavior to using "First_rows" hint - which I'm not using...
    The table has about 100,000 rows.
    Some relevant info is below.
    Any ides appreciated.
    TIA
    PLAN_TABLE_OUTPUT
    Plan hash value: 2481764356
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 30 | 3 (0)| 00:00:01 |
    |* 1 | INDEX RANGE SCAN| PSACOMBO_DATA_TBL | 1 | 30 | 3 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    1 - access("SETID"='GLOBL' AND "PROCESS_GROUP"='100ACDTPRJ' AND
    "COMBINATION"='100ACDTPRJ' AND "VALID_CODE"='V')
    optimizer_dynamic_sampling integer 6
    optimizer_features_enable string 10.2.0.3
    optimizer_index_caching integer 25
    optimizer_index_cost_adj integer 75
    optimizer_mode string ALL_ROWS
    optimizer_secure_view_merging boolean TRUE
    unnestsubquery boolean FALSE

    You said the query is supposed to return 288 rows, but from the explain plan, Oracle "see" only 1 row to be returned. Are the stats up-to-date ? What's the actual query ?
    Please, on the forum side, use tags before and after your code to keep it readable (preserve blanks and tabs).
    Nicolas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for