View in which all sql scripts are stored

Hello Guys,
I am a Oracle DBA (Fresher in the field). I want to know in which view or table all the sql queries are stored as i have a performance tuning problem. I want to know which sql scripts are afffecting the most time to execute which in turn affecting the overall performance of the database. I am working on oracle 10g.

You should also look at V$SQL_PLAN table for example:
rem fts report
rem based on V$SQL_PLAN table
col operation format a13
col object_name format a32
col object_owner format a10
col options format a15
col executions format 999,999,999
column dt new_value today noprint
select to_char(sysdate,'ddmonyyyyhh24miss') dt from dual;
set pages 55 lines 132 trims on
ttitle 'Full Table/Index Scans'
spool fts&&today
select
a.hash_value,a.object_owner,a.object_name, rtrim(a.operation) operation,
a.options, sum(b.executions) executions, c.bytes, (sum(b.executions)*c.bytes)/(1024*1024) fts_meg
from
v$sql_Plan a, v$sqlarea b, dba_segments c
where
(a.object_owner=c.owner
and a.object_name=c.segment_name)
and a.address=b.address
and a.operation IN ('TABLE ACCESS','INDEX')
and nvl(a.options,'NULL') in ('FULL','NULL','FULL SCAN')
and a.object_owner not in ('SYS','SYSTEM','PERFSTAT','SYSMAN','WKSYS','DBSNMP')
and b.executions>1
group by a.hash_value,a.object_owner, a.object_name, operation, options, c.bytes
order by a.object_owner,a.object_name,operation, options, executions desc
spool off
set pages 20
ttitle off
It will show you for active SQL what the plans are and some other important stats.
Mike

Similar Messages

  • All my contacts are stored with country code for eg   233 244 123456. Contact names do not appear during incoming calls. Once the country code is removed , names appear. Please help

    All my contacts are stored with country code for eg   +233 244 123456. Contact names do not appear during incoming calls.
    Please help

    http://discussions.apple.com/thread.jspa?threadID=2280669&tstart=0

  • Where all z report are stored

    hi
    where all z report are stored.
    in table or else where ?
    thanks in advanced.

    Hi !
    Z-reports code is stored in files.
    If you want use report code in a program, use the ABAP instruction  "READ REPORT  into itab".
    Names of ABAP programs ans Includes can be found in SAP table TRDIR.
    Reward if usefull !
    Regards,
    Stéphane.

  • Which all protocol adapters are supported by jrockit?

    In JMX architecture, the distribution level provide remote access to the agent level via a number of protocol adaptors/connectors.
    E.g. RMI adaptor, CORBA adaptor
    These adaptors are required for manager level applications to access agent level registered mbeans, for administration purposes.
    I want to know which all protocol/adopters are supported by JRockit (apart from RMI and CORBA)?

    We support the same protocol adaptors/connectors as Sun's JDK does.
    Regards,
    /Staffan

  • I would like to know how I can transfer all my purchases to a new computer. The laptop which all the music is stored, is broken.

    I would like to know how I can transfer all my purchases to a new computer. The laptop which all the music is stored, is broken.

    You can also re-download most previous purchases (not just songs) from the iTunes Store from the Purchased screen.  So, you should be able to get the "one missing purchase" back too.  Sign in to iTunes using the Apple ID used to make the purchases.  Go to the iTunes Store.  (With the new iTunes 12, select the Music category first, then go to the iTunes Store.)  Click on Purchased (along right side under QUICK LINKS).  From the Purchased screen, you can find and download previous song purchases, at no cost.
    You can also re-download purchases from other iTunes categories, such as Movies and TV Shows.

  • File Ownership while executing sql script from stored procedure

    We have a test_command.sql script which is spooling the result into a file. From database we have one Store Procedure(run_sql) which is
    calling and executing the .sql script.
    When we are calling the sql script directly from the database, i e SQL > @/dccops/test_command.sql it is creating the
    file under the Ownership of OS user which is connected to the system.
    The problem we are facing is when we are executing the stored procedure i e exec run_sql(), the file is creating under
    Oracle User.
    Could u please suggest me a solution inorder to create the output file under the user who is logged to the OS.

    First of all, your usage of IM speak is NOT appreciated. Please do not address anyone as if they were a 12-year old.
    'Our Applcation is in C. So we have to call the procedure to run the sql script.'
    This is just utter nonsense!
    Oracle has Pro*C which allows Embedded SQL in C. There is also OCI (Oracle Call Interface) to call Oracle directly in C, and there is OCCI, to do the same in C++.
    Apart from that, Oracle has Ole DB for Windows platforms, to allow for a .NET compatible interface to Oracle.
    There is NO NEED AT ALL to call PL/SQL to run a SQL script.
    Sybrand Bakker
    Senior Oracle DBA

  • Tables in which class and Characters are stored

    Hi all,
    Can any one tell me in which tables class and Characters are stored
    With Rgds
    vinod

    Characteristics :
    CABN Characteristics ( o.a. batch/vendor)
    CABNT Characteristics description
    CAWN Characteristics ( o.a. material)
    CAWNT Characteristics description
    AUSP Characteristic Values
    Class types and objects :TCLAO Several class types for object
    TCLA Class types ( vb. lfa1 => v10 en 010)
    TCLAT Class type text
    TCLT Classifiable objects
    TCLC Classification status
    regards,
    indranil

  • Migrating SQL Script to stored procedure...

    I created a SQL script file to run in SQLPlus to
    generate a fixed-format text file (See EDI_PrepForSend
    below)
    How do i do the same thing in a stored
    package/procedure? Can I utilize the
    script I already have working? I need to
    do it in a stored procedure because I need
    to do dynamic queries.
    TIA
    Chuck Plinta
    [email protected]
    ++++++++++++++++++++++++++
    -- EDI_PrepForSend.sql
    SET CONCAT '#';
    SET ESCAPE OFF;
    SET TERM OFF
    -- Set's for flat file
    SET NEWPAGE 0
    SET SPACE 0
    SET LINESIZE 50
    SET PAGESIZE 0
    SET ECHO OFF
    SET FEEDBACK OFF
    SET HEADING OFF
    SET VERIFY OFF
    SPOOL o:\ClientData\EDI-Send\&2\EDI-HCFA-Dtl-&1-&3.txt
    COLUMN MC_Number FORMAT A15 HEADING MC_Number
    COLUMN MC_Line_Number FORMAT A3 HEADING Ln#
    COLUMN MC_CPT_Code FORMAT A5 HEADING Code
    COLUMN MC_CPT_Modifier FORMAT A2 HEADING Mod
    COLUMN MC_FDOS FORMAT A8 HEADING FDOS
    COLUMN MC_LDOS FORMAT A8 HEADING LDOS
    COLUMN MC_Line_Charge FORMAT 99999.99 HEADING Charge
    SELECT MC.ICN MC_Number,
    '???' MC_Line_Number,
    MC.CPT_Code MC_CPT_Code,
    MC.CPT_Modifier_1 MC_CPT_Modifier,
    TO_CHAR(MC.First_DOS,'YYYYMMDD') MC_FDOS,
    TO_CHAR(MC.Last_DOS,'YYYYMMDD') MC_LDOS,
    MC.Charge MC_Line_Charge
    FROM &1.Decision_Support DS,
    &1.Medical_Claims MC
    WHERE DS.Reprice_Status = 'U' AND
    MC.CID = DS.CID
    ORDER BY MC.ICN, MC.CID;
    SPOOL OFF

    You need to put your select statement in a parameterised function that returns a REF CURSOR. This is all well documented in the PL/SQL users guide.
    Then you amend your SQL*PLUS script to call the function
    VAR rc REFCURSOR
    EXEC :rc := yr_function('&1')
    PRINT rc
    Cheers, APC

  • SQL Cluster 2008 RTM related issue- One of the Node is automatically disabiling the Agent XP's. However, all SQL Services are running

    Hi All,
    Please help. I am having a Prodution SQL 2008 RTM Cluster with two nodes-where node 1 works without any problem.However, if i failover to node 2-Agent xp's are disabled automatically. When i verify the SQL Services are node 2 are running fine.
    Checked Agent.out file which did not give much info than below:
    2012-09-09 08:00:12 - + [162] Internal request (from SetJobNextRunDate [reason: schedule will not run again]) to deactivate schedule 47
    2012-09-15 06:50:30 - ? [131] SQLSERVERAGENT service stopping due to a stop request from a user, process, or the OS...
    2012-09-15 06:50:41 - ? [098] SQLServerAgent terminated (normally)
    I have verified that hardware and software of both nodes are identical. Still ,this issue persists always.
    Please let me know the solution for this. it really pressurise on Production having one node active and other not active.
    Harithasri

    sp_configure 'show advanced options', 1;
    GO
    RECONFIGURE;
    GO
    sp_configure 'Agent XPs', 1;
    GO
    RECONFIGURE
    GO
    Are the SQL Agent running under the same accounts?
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Blog:
    Large scale of database and data cleansing
    MS SQL Consultants:
    Improves MS SQL Database Performance

  • I am upgrading from an iphone 4 to a 5. All my contacts are stored in icloud. Can they be downloaded onto my new iphone5

    Hi,
    I have an iphone 4S, and being supplied with an iphone 5. I use the icloud to store all my data, can this be downloaded from the icloud to my new phone, or should I store everything on my laptop first?
    Thanks
    JW

    Yes.
    You can transfer the backup for your iPhone 4 to the new iPhone which will include your iCloud account and account settings. Your iCloud contacts are stored in the cloud and will be downloaded by your new iPhone.

  • In Which Table Program codes are Stored

    Hi Gurus,
    I would like to know in which table the Program/Report Codes are stored.
    I have read the code for a Particular Program and I have to execute dynamically based of conditions.
    Please, Could anyone throw some lights....
    Regards,
    Anbalagan.V

    Hi!
    You can read source code with 'read report' and you can call programs with 'submit report'. Have a look at the documentation of the ABAP statements for details of the syntax.
    Regards,
    Christian

  • Tables in which basis users details are stored

    Hello,
    I'm writing an application to read Basis users details using JCO. But I'm not able to locate in which tables the users details are stored. I tried looking at USR* tables, but most of its tables doesn't have data. Only usr01 and usr02 are having some relevant data. I also tried looking at ADR* tables, which are again of no use.
    If anyone knows in which tables Basis users details are stored, please let me know.
    Thanks & Regards,
    Chandrasekhar.

    Hi Chandrasekhar,
    SAP users are stored in the usr01 table (see transaction SE16.)
    Best regards,
    Houcine

  • In which table,taxcode values are stored?

    Hi,
    Can anyone say in which tables and fields, tax codes values are stored.
    Values which are maintained in tcode FTXP.
    regards,
    sathya

    Hi,
    Education cess at PO level is not stored directly into any table, instead it is calculate at runtime using function module "PRICING" with calculation type "B".
    Edu. Cess for Invoice are stored in table BSET table. You can identify the record passing condition type (KSCHL).
    Manul excise condition goes to table KONV linked with EKKO-KNUMV field.

  • Which table  Variant datas are stored

    Hi ,
        I need to know where variant datas are stored and in which table they are stored .
    juts let me know the name of the table alone .
    Thanks ,
    vinay .

    Hi again,
    1. The contents of the field are NOT STORED
       in the manner which u are assuming
    a) field name - vield value
    b) field name - vield value
    x) field name - vield value
    2. Rather they are stored in the same table VARI
      in RAW format.
    3.  CLUSTD is the LRAW field,
       which stores this whole data
       in encoded format.
    regards,
    amit m.

  • Running a sql script from stored procedure

    Hi everyone!
    Has anybody tell me how to execute a sql script from a stored
    procedure!
    Thanks in advance!
    Sasa

    >
    Hi everyone!
    Has anybody tell me how to execute a .sql file from a stored
    procedure!
    Thanks in advance!
    Sasa Sorry, a .sql file!!

Maybe you are looking for