Not able to retrieve data from table faster

Hi All,
I have a table tab1, and I am creating one more table tab2 by selecting col1,col2 of tab1.
creation query would be like this.
create table tab2 as
select as select /*+ parallel(qla,20) */ col1,col2 from tab1;
Table tab2 is created, but the problem is when we query tab2 it is taking too long time to display the results, and the table tab2 is having arount 400 million data.
Request every one to suggest how to improve the query performance which is
select * from tab2;

See the forum FAQ
SQL and PL/SQL FAQ
*3. How to improve the performance of my query? / My query is running slow.*
SQL and PL/SQL FAQ

Similar Messages

  • Not able to retrieve data from database through servlet

    Hi friends,
    I am trying to open a excel sheet through servlet. In this servlet i am retriving data from mssql database.I am not getting any error but no data is retrived
    i m also pasting the code here
    // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
    // Jad home page: http://www.kpdus.com/jad.html
    // Decompiler options: packimports(3)
    // Source File Name:   EmployeeData.java
    import java.io.*;
    import java.sql.*;
    import javax.sql.*;
    import javax.servlet.ServletException;
    import javax.servlet.http.*;
    public class EmployeeData extends HttpServlet
        public EmployeeData()
        public void service(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
            throws ServletException, IOException
            httpservletresponse.setContentType("text/html");
            httpservletresponse.setHeader("Content-Type", "application/excel");
            httpservletresponse.setHeader("Content-Disposition", "filename=reports.xls");
            PrintWriter printwriter = httpservletresponse.getWriter();
            try
                javax.servlet.http.HttpSession httpsession = httpservletrequest.getSession(true);
                int i = 0;
             /*   Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
                Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:3413;DatabaseName=newreportsodbc", "reportuser", "cisco");*/
                String url="jdbc:odbc:newreportsodbc";
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
                Connection connection = DriverManager.getConnection("jdbc:odbc:newreportsodbc","reportuser","cisco");
                Statement statement = connection.createStatement();
                printwriter.println("<b><center><u> Search Results </u></center></b>");
                printwriter.print("<table><tr><th color=brown background-color=#fff000>  No.  </th>");
                printwriter.print("<th> DateTime      </th></tr></table>");
           ResultSet resultset = statement.executeQuery("SELECT * FROM t_Call_Type_Half_Hour");
                boolean flag;
                for(flag = false; resultset.next(); flag = true)
                    i++;
                    SerialNo = resultset.getString(2);
                    printwriter.print((new StringBuilder()).append("<table><tr><td> ").append(i).append("</td>").toString());
                    printwriter.print((new StringBuilder()).append("<td> ").append(SerialNo).append("</td></tr></table>").toString());
                if(!flag)
                    printwriter.println("<h1> No records selected </h1>");
            catch(Exception exception)
                System.out.println((new StringBuilder()).append("SQLException: ").append(exception).toString());
        static String empid1;
        static String empid;
        static String SerialNo;
        static String designation;
    }thanks in advance. i just feel there is something to be done with connection string.

    post the table format in SQL

  • How to retrieve data from table(BOM_ITEM)

    Hi All,
    I wrote webservices using axis1.4 to get BOM information from SAP.. funtional module is CAD_DISPLAY_BOM_WITH_SUB_ITEMS
    webservices works fine..I'am able to retrieve data from Export Parameter..But not able to retrieve data from table
    How to retrieve data from table(BOM_ITEM)..?
    Cheers, all help would be greatly appreciated
    Vijay

    Hi,
    1. Create Page Process.
    2. Select Data Manipulation
    3. In category select "Automated Row Fetch"
    4. Specify process name, sequence, select "On Load - Before Header" in point.
    5. Specify owner, table, primary key, and the primary key column(Item name contains primary key).
    6. Create a process.
    7. In each item select "Database Column" in "Source Type".
    Regards,
    Kartik Patel
    http://patelkartik.blogspot.com/
    http://apex.oracle.com/pls/apex/f?p=9904351712:1

  • Problems with retrieving data from tables with 240 and more records

    Hi,
    I've been connecting to Oracle 11g Server (not sure exact version) using Oracle 10.1.0 Client and O10 Oracle 10g driver. Everything was ok.
    I installed Oracle 11.2.0 Client and I started to have problems with retrieving data from tables.
    First I used the same connection string, driver and so on (O10 Oracle 10g) then I tried ORA Oracle but with no luck. The result is like this:
    I'm able to connect to database. I'm able to retrieve data but from small tables (e.g. with 110 records it works perfectly using both O10 and ORA drivers). When I try to retrieve data from tables with like 240 and more records retrieval simply hangs (nothing happens at all - no error, no timeout). Application seems to hang forever.
    I'm using Powerbuilder to connect to Database (either PB10.5 using O10 driver or PB12 using ORA driver). I used DBTrace, so I see that query hangs on the first FETCH.
    So for the retrievals that hang I have something like:
    (3260008): BIND SELECT OUTPUT BUFFER (DataWindow):(DBI_SELBIND) (0.186 MS / 18978.709 MS)
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=0
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=1
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=0
    (3260008): EXECUTE:(DBI_DW_EXECUTE) (192.982 MS / 19171.691 MS)
    (3260008): FETCH NEXT:(DBI_FETCHNEXT)
    and this is the last line,
    while for retrievals that end, I have FETCH producing time, data in buffer and moving to the next Fetch until all data is retrieved
    On the side note, I have no problems with retrieving data either by SQL Developer or DbVisualizer.
    Problems started when I installed 11.2.0 Client. Even if I want to use 10.0.1 Client, the same problem occurs. So I guess something from 11.2.0 overrides 10.0.1 settings.
    I will appreciate any comments/hints/help.
    Thank you very much.

    pgoel wrote:
    I've been connecting to Oracle 11g Server (not sure exact version) using Oracle 10.1.0 Client and O10 Oracle 10g driver. Everything was ok.Earlier (before installing new stuff) did you ever try retrieving data from big tables (like 240 and more records), if yes, was it working?Yes, with Oracle 10g client (before installing 11g) I was able to retrieve any data, either it was 10k+ records or 100 records. Installing 11g client changed something that even using old 10g client (which I still have installed) fails to work. The same problem occur no matter I'm using 10g or 11g client now. Powerbuilder hangs on retrieving tables with more than like 240 records.
    Thanks.

  • Not able pass the data from component to other component.

    Hello All
    I am not able pass the data from component to other component.
    I have done like this.
    1 Main Component (Parent component ) having below  two child components.Embeded as used components.
    2)     Search Component  and Details Component
    3)     In the Search Component having buttons,  Say : Button u201CXu201D on click of button I am navigating to Details component view through FPM.
    4)     When I am clicking above button u201CXu201D raising the event to call the parent   business logic method, there I am getting  Structure with values and binded this structure to the node and Mapped this node to the Details component  interface node. FYI : I kept the debugging point Structure is having data , I had set static attributes table to node instance.
    5)     In the Details component node data is not coming mean empty.
    Thanks in Advance.
    Br-
    CW
    Edited by: CarlinWilliams on Jul 4, 2011 9:21 AM

    Hi,
    When you use input Ext. check that the parent component should not be used as used component in child component.
    Only in the parent component the child components should be used as used components and the usage has to be created for the
    Child Components and the binding of the Node should be done from comp. controller of parent component to child node
    by which you will be able to see double arrow against the node.This should work
    Thanks,
    Shailaja Ainala.

  • Not able to query data from View

    Hi,
    I am not able to fetch data from views even while running simple select statements. I am using SQL Developer Version 3.0.04,
    Same query is fetching data on other computers running SQL Developer or Toad.
    Has anyone faced this issue??

    Is that the first version ever you installed? You unzipped in a clean directory, right?
    What OS/JDK/DB versions?
    So do you get an error or what?
    K.

  • Not able insert ,query data from forms

    hi,
    I am not able to insert data or query data from forms(10g devsuite).getting error frm-40505,frm 40508 .i am able to insert and select record from sql plus.the block ihave created is control block .it is connected to the table using the properties.
    should i do anything to insert record.please help

    the block ihave created is control block .it is connected to the table using the properties.A Control Block, by definition, is a non-database block. This means the block is not directly connected to a table so you have to manually display data in the block and any DML you want to perform on data in this block you must do manually as well.
    There are four database objects you can base your database block on; 1) a Table, 2) a View, 3) From Clause Query (basically an In-line View), and 4) a database stored procedure. I recommend you use one of these four methods rather than manually display your data.
    Craig...

  • I am not able to fetch data from r3

    Hi all,
    we have schduled process chain for transaction data and master data.when check the process chain status is green.
    but when not a single record is coming for any of the process chain.when i check the step by step analysis.
    gray RFC to source system successful ?
    red  Does selectable data exist in the source system?
    red  Data selection successfully started ?
    red  Data selection successfully finished ?
    gray RFC to Warehouse successful ?
    gray Processing successfully finished?
    gray All reported data packets received?
    gray All data packets complete ?
    remaining things are in green status.
    for every thing it is fetching zero records.i have already checked rfc connection and all the update and tranfer rules.every thing is fine.
    can anybody help me out...
    regards,
    viren.

    Hi,
       well,,I have after lot of replies,.. so let me see..
       I understand this is LO extraction. Also, since your load is running in Process chain, I "assume" these are delta loads.( right?). You also say there are records in the related tables.
      So, I feel, foll. are the things that you may need to check.
       1. Did you check in RSA7 for delta records?
       2. Did you check if the delta jobs are running fine to collect the data from the application tables?
       3. Did you correctly do the settings for delta for your extract structure?(direct delta, queued delta.. etc)
       4. These are the basic settings that will ensure that the delta records are collected in the right way!!!
        Once all the above listed are fine, then you should be able to see some data collected in your delta Q( assuming ur loads are delta loads)
        Let us know!!!
    Thanks,
    Raj

  • Web Template is not able to fetch data from Data Provider

    hi friends,
               i have created a reporting agent for a particular query and given all the necessary parameters, defined the variants and activated this and created a scheduling package to this ,assigned my query to the scheduling package
               later in the web template,in the web item tab i maintained  the read mode as precalculated web template and the final report on the web is saying web tempalte is not able to get the data from the data provider  ,
    am i missing any where...
            i look forward to your help ,
    regards,
    sasidhar gunturu

    Hi,
    use the correct link to call the report.
    you can check the links : Re: Concept Of Precalculated Template
    https://www.sdn.sap.com/irj/sdn/developerareas/bi?rid=/webcontent/uuid/a8cd1f71-0a01-0010-4783-f119b6132d25 [original link is broken]
    Regards
    Happy Tony

  • Not able to get data from ce_reconciled _transactions_v in a function after intialising the view

    Hi all ,
    I have written a function  to  get the gl_date from ce_reconcilied transactions_v . but when i call th function in a select query , it is not returning any data.
    I have used the following intialization in the function
    Mo_Global.set_policy_context('S',p_org_id);
    cep_standard.init_security;
    But when i use anonymous block to get gl_date printed it is fetching data from the view.
    Below is the  code for Function
    CREATE OR REPLACE Function l3get_gl_date(p_org_id NUMBER,p_statement_line_id NUMBER)
    RETURN DATE
    AS
    v_gl_date DATE;
    ct NUMBER;
    BEGIN
    Mo_Global.set_policy_context('S',p_org_id);
    cep_standard.init_security;
    SELECT count(*) into ct from ce_reconciled_transactions_v where org_id=p_org_id ;
    dbms_output.put_line('count:' ||ct || 'org ' ||p_org_id || ' line ' ||p_statement_line_id);
    SELECT  gl_date INTO v_gl_date
      FROM ce_reconciled_transactions_v where statement_line_id=p_statement_line_id;
      RETURN v_gl_date;
    EXCEPTION
    WHEN OTHERS
    THEN
    dbms_output.put_line('unable to get GL_DATE' ||SQLERRM);
    RETURN NULL;
    END;
    below is tha anonymous block
    declare
    p_org_id NUMBER;
    p_statement_line_id NUMBER;
    ct NUMBER;
    v_gl_date DATE;
    BEGIN
    select org_id into p_org_id from ce_bank_acct_uses_all where bank_account_id=10911;
    select statement_line_id  into p_statement_line_id from ce_statement_lines where statement_header_id=41130 and line_number=4;
    Mo_Global.set_policy_context('S',p_org_id);
    cep_standard.init_security;
    SELECT count(*) into ct from ce_reconciled_transactions_v where org_id=p_org_id ;
    dbms_output.put_line('count:  ' ||ct || 'org  ' ||p_org_id || ' line  ' ||p_statement_line_id);
    SELECT  gl_date INTO v_gl_date
      FROM ce_reconciled_transactions_v where statement_line_id=p_statement_line_id;
    dbms_output.put_line('GL Date:   ' || v_gl_date);
    EXCEPTION
    WHEN OTHERS
    THEN
    dbms_output.put_line(SQLERRM);
    END;
    please suggest .

    Hi,
    Try adding the following code so we can verify the org is set in your function:
    Add to the definition:
    v_org_id number;
    Add after setting the policy:
    select MO_GLOBAL.get_current_org_id()
    into v_org_id from dual;
    FND_FILE.PUT_LINE(FND_FILE.LOG,'Current MO Org_id='||v_org_id);
    This will verify that the org_id was set.
    Are you getting any errors, or simply no data found.
    Cheryl

  • Confirmed Dimensions. OBIEE Not able to pull data from two fact tables.

    Hi Experts,
    I have a very simple set up of Star Schema with two fact tables and 1 dimension. Both fact tables joined to the dimension at the same level.
    When i pull a column from both fact tables and the dimension table in OBIEE, it has to create simple SQL like below:
    select FACT1.column1,
    Fact2.Column1,
    Dim.Column1
    from FACT1, FACT2, DIM
    where FACT1.ID = DIM.ID and FACT2.ID = DIM.ID
    but instead it creating a query in a very complex way:
    select case  when D1.c2 is not null then D1.c2 when D2.c2 is not null then D2.c2 end  as c2,
         D1.c1 as c3,
         D2.c1 as c4
    from
         (select FACT1.Column1 as c1,
                   DIM.Column1 as c2
              from
                   DIM T1287863,              
                   FACT1 T1287945              
       where  (DIM.ID = FACT1.ID)
           ) D1 full outer join (
            select FACT2.Column1 as c1,
                   DIM.Column1 as c2
              from
                   DIM,              
                   FACT2
              where  ( DIM.ID = FACT2.ID)
         ) D2 On isnull(D1.c2 , '1') = isnull(D2.c2 , '1') and isnull(D1.c2 , '2') = isnull(D2.c2 , '2')
    I even tried setting the levels for both the fact tables and it still creates the query in avove way. Any thoughts on this will be vary helpful.

    Subramanian,
    see below the code we're using for the RFM.
    on the ct_containers table i'm passing a line, and its getting updated after the call.
    on the ct_errors table i just want to receive the errors and i only receive the line, we add manually there ('Serious error with validation code').
    kr, achim
    FUNCTION zbapi_ra_validations .
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(IS_RA_SCREEN) TYPE  ZBAPI_S_RA_SCREEN
    *"  CHANGING
    *"     VALUE(CT_ERRORS) TYPE  ZRA_T_ERRORS
    *"     VALUE(CT_CONTAINERS) TYPE  ZRA_T_CONT_IP
      DATA:
        lo_badi_handle TYPE REF TO zra_validation_rule,
        ls_error       TYPE zra_s_error.
      GET BADI lo_badi_handle.
      TRY.
          CALL BADI lo_badi_handle->validate_rules
            EXPORTING
              is_screen_flds = is_ra_screen
            CHANGING
              ct_containers  = ct_containers
              ct_errors      = ct_errors.
        CATCH zcx_ra.
          ls_error-message = 'Serious error with validation code'.
          APPEND ls_error TO ct_errors.
      ENDTRY.
    ENDFUNCTION.
    if i call this rfm in SE37 the ct_errors table is populated with all errors and the manually created line.
    Message was edited by: Achim Hauck

  • Not able to load data in tables with correct way

    Hi
    i made one trigger to load data in view and tables.
    CODE FOR TRIGGER>>>>
    Object Details Code Errors SQL
    CREATE OR REPLACE TRIGGER "WELL_GENERATOR_TRIGGER_1"
    INSTEAD OF INSERT ON VIEW_WELL_GENERATOR_FORM
    FOR EACH ROW
    DECLARE
    rowcnt number;
    BEGIN
    INSERT INTO facility (FAC_PK) VALUES (:NEW.FAC_PK);
    SELECT COUNT(*) INTO rowcnt FROM WELL WHERE WEL_PK = :NEW.WEL_PK;
    IF rowcnt = 0 THEN
    INSERT INTO WELL (WEL_PK,SITE,FAC_FK) VALUES(:NEW.WEL_PK,:NEW.SITE,:NEW.FAC_PK);
    ELSE
    UPDATE WELL SET WELL.SITE = :NEW.SITE,
    WELL.FAC_FK = :NEW.FAC_PK
    WHERE WELL.WEL_PK = :NEW.WEL_PK;
    END IF;
    SELECT COUNT(*) INTO rowcnt FROM WELL_STATUS WHERE WELL_STATUS.STA_PK = :NEW.STA_PK;
    IF rowcnt = 0 THEN
    INSERT INTO WELL_STATUS (WELL_TYPE, WELL_TYPE_DATE, OPER_STATUS, CLASS,WEL_FK)
    VALUES(:NEW.WELL_TYPE, :NEW.WELL_TYPE_DATE, :NEW.OPER_STATUS, :NEW.CLASS,:NEW.WEL_PK);
    ELSE
    UPDATE WELL_STATUS SET WELL_STATUS.WELL_TYPE = :NEW.WELL_TYPE,
    WELL_STATUS.WELL_TYPE_DATE = :NEW.WELL_TYPE_DATE,
    WELL_STATUS.OPER_STATUS = :NEW.OPER_STATUS,
    WELL_STATUS.CLASS = :NEW.CLASS,
    WELL_STATUS.WEL_FK = :NEW.WEL_PK
    WHERE STA_PK = :NEW.STA_PK;
    END IF;
    SELECT COUNT(*) INTO rowcnt FROM PERMIT WHERE PERMIT.PER_PK = :NEW.PER_PK;
    IF rowcnt = 0 THEN
    INSERT INTO PERMIT (AUT_STATUS,WEL_FK) VALUES (:NEW.AUT_STATUS,:NEW.WEL_PK);
    ELSE
    UPDATE PERMIT SET PERMIT.AUT_STATUS = :NEW.AUT_STATUS,
    PERMIT.WEL_FK = :NEW.WEL_PK
    WHERE PERMIT.PER_PK = :NEW.PER_PK;
    END IF;Now But still i am not getting result which i want.Like in WELL_STATUS table i could nt able to insert the value (WEL_FK) from (WEL_PK).And In PERMIT table column (WEL_FK) still i could nt able to insert the value (WEL_PK).
    Now WEL_PK value autogenerate from the SEQ same with STA_PK and PER_PK.But instead of taking value from seq STA_PK take the value from WEL_PK (dnt know why ? But in data its shows me Same value WEL_PK and STA_PK).Same thing With PER_PK.
    so where i am wrong ? i really need your help.
    workspace:PRACTISE
    UN:[email protected]
    PW:testing
    Application:     39289 - TESTTING
    Thanks
    Edited by: vijaya45 on Jul 13, 2009 9:44 PM
    Edited by: vijaya45 on Jul 14, 2009 12:48 AM

    Hello vijaya45,
    Not sure if this will help, but I noticed you currently have a WELL_GENERATOR_TRIGGER_1 and a WELL_GENERATOR_TRIGGER_2, and "1" is disabled but "2" is enabled. Which one is supposed to be running at this point?
    John

  • Urg: Not able to import data from DB in OBIEE 11g : Connection has failed.

    Hi Team
    Recently while working in OBIEE 11g , I was trying to import tables from the data-base but I am getting an error " Connection has failed " .
    I have put the tnsora file in the network admin folder and the
    C:\OracleBIHome\Network\admin
    \OracleBI1\network\admin (Example: C:\OBI\Oracle_BI1\network\admin)
    \oracle_common\network\admin (Example: C:\OBI\oracle_common\network\admin)
    and have set the TNS_ADMIN variable in the User.cmd path  with the above path .
    But it is still not working . I have tried all the options but its still not working .
    Any help is appreciated.
    Regards
    R

    Is it Compulsory to give Schema and Work Schema while creating the Physical Schema in Oracle Data server?
    This is mandatory to have a schema and a work schema here.
    The schema and work schema could be the same user as the user who is connected to the dataserver!

  • Not able to get data from Reference Purchase Organization

    Hi,
        the scenario is
    Need to have one global pur. org for 3 company codes and
    one each company code specific purchase org.
    so i created Z300 as a ref purchasing org
    and created Z100 for a specific company 3000 n assigned to it
    and assigned Z100 to ref purchase org Z300
    and i  created a vendor master with Z300 purchase org n company code 3000
    but when i creating a PO with ME21n
    when i enter the vendor and Z100 as the purchase org ...it tells me that vendor is not maintained for Z100.
    ( but as per the documentation the data shud come from ref. purchase org ? isnt that true)
    and
    when i enter the vendor and Z300 as the purchase org and enter the material and plant it says
    plant is not maintained for Z300 ..? i understand this ...the correct process is the first one ..
    can nyone let me know y this error is coming ....is there anything i am missing in assigning.
    thanks a bunch

    purchasing staff of your enterprise to work with conditions and contract  
    release orders on a cross-purchasing-organization basis.                                                                               
    It is then possible for:                                                                               
    o  The conditions of a reference purchasing organization to be used by    
       other purchasing organizations for the purpose of price determination  
    o  Several purchasing organizations to access the contracts of a certain  
       reference purchasing organization                                      
    You have to maintianed the vendor for all the Pur org for which you want to use
    the ref pur org will come inthe picture when you create the contract at global level means at ref pur org so all other pur org can use the same contract.
    So if you creating PO for your std pur org then you have to maintain the vendor and you can refer the contract from ref pur org

  • Not able to view data from more than one data package in PSA

    Hi Friends,
    Desparetly trying to view data in PSA. Problem :
    If i mark more than one datapackage this error raises:
    You must only select one data packet when entering data record numbers
    Message no. RSAODS127
    And there is no change to reset data record numbers.
    What is wrong ?
    Thanks in advance for help.
    Joe
    BW3.5, SP21
    Edited by: J.F.B. on Jul 2, 2009 11:40 AM

    Hi again,
    Seems I'm too stupid for this issue.......
    As I understand there are two ways to view PSA :
    1. PSA maintenance in RSA1
    2. In SE11/SE16 viewing the underlaying transparent table
    ad 1.
    When I try to filter erroneous records for more than one datapackage situation is as described above.
    ad 2.
    Trying to view the table works, but where is the chararcteristic/field marking a  record as erroneous
    in table /BIC/Bxxxxxxxx (table containing PSA-Data) ?
    Thanks
    Joe

Maybe you are looking for

  • Remote app is not working atv2

    Before ios5 was out I was using apple remote app from my iphone.  I was also using airplay.  I cannot get any of my devices to connect to remote app, or air play now that we have upgraded to ios5. Anyone else having this issue? Everything is updated

  • What's a good external keyboard for MBP

    Given that the MBP keyboard is so inadequate and Apple is seemingly too stubborn to give us a good one, an external keyboard is mandatory. However, I'm not sure what's good in the Apple world. There is, of course, the Apple keyboards and I'm going to

  • Error using IDoc SALESORDER_CREATEFROMDATA202

    Hi I'm trying to use IDoc SALESORDER_CREATEFROMDATA202 to create a sales order in the R/3 system, but I' keep getting the following error: "Maintain billing plan type in sales document type or item category" We are not using billing plan type at all

  • Fm8 and png graphics in XML export

    Hi, If I add a gif-image (for example) to structured doc and write out XML, fm8 writes out the dpi value to dpi-attribute (dtd uses default fmimage attrs in this case) if the facet is not resized. If it wsa resized, frame writes out impsize. This is

  • What fact tables get affect in open hub services whether E or F

    hi, what fact tables get affect in open hub services whether E or F when an info provider is accessed. regards, -a