Max no.of rows capacity in a cursor ?

Gurus,
Do we have any limitations in cursors to hold max no.of rows returned by a SQL ?
My select returning 50 Million rows. Can I hold all of them in a single cursor ?
Thnaks.
S

Wrong question. A cursor does not have "capacity".
A cursor is an executable program. Not a set of results. It is not a copy of resulting rowids/rows for the SQL. Just imagine if it was.. how many cursors could we then open? Each cursor will consume loads of memory as each cursor will need to make a copy of the data. This is not scalable at all. A RDBMS will struggle to support more than just a couple of user sessions.
Source SQL is in fact a source program. A set of instructions in the SQL language of what the server needs to do. This program is parsed by the SQL Engine and then a binary executable program created for it. This is stored as a shared program (to be used by any session needing it) in the Shared Pool. This is why using bind variables are important (it allows the program to be generic without hardcoded values). The instructions of this binary program can be seen via its execution plan. This binary executable program is commonly called a cursor in database speak.
A program typically consists of a code segment and a data segment. The code segment is the cursor in the Shared Pool. And this code segment of the program can be used by any other session too.
When you open the cursor, you access the code segment of the program in the Shared Pool. A data segment is created just for your use of that program. This contains the state variables, bind variable values, and other data required for executing and managing the program. (A DLL in Windows and SO in Unix/Linux, work in the exact same fashion)
When you fetch from the cursor, the program is executed (as per the execution plan determined by the CBO). Your cursor's state data is updated. And you get, as output from this program, data in the form of rows.
Each subsequent fetch repeats this process, until the program (cursor) fails to find any more rows to return.
All SQL statements, every single one, is treated in this fashion. It is parsed and compiled, execution plan determined and then stuffed into the Shared Pool as a cursor. Does not matter if it is a SQL statement from Java, SQL*Plus, Delphi, inside PL/SQL, or a nested SQL generated by Oracle itself.
How many rows can be returned by a binary executable program (cursor)? You could just as well have asked, how many rows can a source code program (SQL statement) return?
The answer to that is, how many rows are in the table?
There is no limit in that regard. What is a limit in this respect, is the size of the redo when running a SQL on a table "slowly", while the table is subject to a lot of changes. The consistent read/view you have on that table (also called a snapshot) needs to be maintained for the duration of that cursor's execution. At some stage that cursor may fail to find the rows matching the version of data required to provide you with a consistent read. In such a case, the cursor will throw an exception saying that the snapshot is now too old and cannot be reconstructed anymore.

Similar Messages

  • Increasing row capacity of any excelcius component (Filter ,Combo Box)

    Hi
    Even though I have increased the capacity of Dashboard rows capacity from 512 to 2000.
    But my filter component or combo box component source data is mapped to more than 512 rows in the spreadsheet,while previewing it still shows data of 512 rows.
    Is there any way to increase component capability?
    I know the performance will be bad but still atleast it should capture the whole source data records and

    It could be two reasons
      First Reason: it could be due to the limit of no of rows in excel .Please check the preferences option in Xcelsius . By default it will be set as 512 rows of data increase that to required rows.
       Second Reason: if you are using live office in Xcelsius.By default it will fetch 512 rows of data.To increase limit we have to do some server side settings.Please refer to the following SAP Note which gives the solution to this problem.
      SAP Note:1307538
      or go through the following steps:
    These changes have to be made on the server side
    1.     Create a backup of dsws-liveoffice-provider.jar from serveru2019s InstallDrive:\program files\business objects\Tomcat\webapps\dswsbobje\WEB-INF\lib for future reference.
    2.     Copy dsws-liveoffice-provider.jar from serveru2019s InstallDrive:\program files\business objects\Tomcat\webapps\dswsbobje\WEB-INF\lib to your computer.
    3.     Rename the file just copied to dsws-liveoffice-provider.jar.zip (add.zip to end of filename)
    4.     Create folder in root of InstallDrive: named META-INF (case sensitive), in InstallDrive:\META-INF named BusinessObjects (case sensitive) and in InstallDrive:\META-INF\BusinessObjects named DSWS (case sensitive)
    5.     Using WinZip or WinRAR, unzip the file named liveoffice_config.properties from the dsws-liveoffice-ws.jar.zip file copied from the server. Place this file in InstallDrive:\META-INF\BusinessObjects\DSWS.
    6.     Edit the liveoffice_config.properties file and find the following section:
    #max number of range rows and range columns to return
    maxRowCount=512
    maxColumnCount=512
    7.     Edit the maxRowCount entry to the value youu2019d like to use
    8.     Save the file as liveoffice_config.properties (same filename)
    9.     Using winRAR or WinZip add the new liveoffice_config.properties file back to dsws-liveoffice-ws.jar.zip, making sure to use the "use absolute path" option.
    10.     Stop Apache Tomcat service on BO server
    11.     Copy dsws-liveoffice-ws.jar.zip to serveru2019s InstallDrive:\program files\business objects\Tomcat\webapps\dswsbobje\WEB-INF\lib.
    12.     Rename dsws-liveoffice-provider.jar in serveru2019s InstallDrive:\program files\business objects\Tomcat\webapps\dswsbobje\WEB-INF\lib directory to dsws-liveoffice-provider.jar.old.
    13.     Rename dsws-liveoffice-provider.jar.zip in serveru2019s c:\program files\business objects\Tomcat\webapps\dswsbobje\WEB-INF\lib directory to dsws-liveoffice-provider.jar
    14.      Empty the Tomcat cache by deleting the content of the folder <<C:\Program Files\Business Objects\Tomcat55\work>>
    15.     Restart Apache Tomcat on server
    This should increase the number of rows fetched by LiveOffice, however it may happen that changing the number of rows in the liveoffice_config.properties many times may result in liveoffice picking the data from the cache. Hence deleting the cache (C:\Program Files\Business Objects\Tomcat55\work) is necessary. Incase deleting the cache also doesn't work, we may have to redeploy the dswsbobje folder.
    To redeploy, follow the steps given below:
    1.     Go to C:\Program Files\Business Objects\Tomcat55\webapps and keep a backup of the dswsbobje folder.
    2.     Now delete this folder and restart Tomcat.
    3.     Restarting Tomcat will recreate the dswsbobje folder but will again default the number of rows fetched by LiveOffice to 512.
    4.     We will again have to follow the steps mentioned in the start to increase the number of rows from 512 to the desired value.
    5.     Restart Tomcat again for the changes to take place.
    Note: Increasing the number to large values might cause inconsistency in the behavior or instability.

  • Howto limit max. count of rows in a TABLES-based import-parameter?

    Hello all,
    I have created a web service based on a custom function module in SAP. Beside others this function module provides one TABLES input parameter, which is set to "optional". Now I want to publish the web service with this parameter optionally as well, but also allow it for max. 10 tmes (meaning max. 10 rows for this import table).
    I have found an entry for min and max settings in SE80 for this web service, but unfortunately these both fields are read-only, so I can't set the maxOccurs here.
    Any ideas how I can solve this problem?
    Thanks in advance for your help!
    Kind regards, Matthias
    Edited by: Matthias F. Brandstetter on Oct 21, 2010 10:32 AM

    Hi,
    It is not possible to change SAP generated service. Better you create new service in ESR and assign correct maxOccurs and then create proxy of this service in backend where you can also map ESR service to FM.
    To minimize effort you can copy same wsdl and then change wsdl and import in ESR as new service.
    Regards,
    Gourav

  • Max number of rows in a BEX structure

    Hi gurus,
    we need to create a structure with 164 key figures, and before starting doing it, does anybody knows which is the max number of rows that can be created on a BEX structure?
    I'm not asking about max number of rows on a query, i'm asking about the number of entries that you can manually create on a structure. Is there a maximum?
    Thanks in advance,
    regards,
    Miguel

    Hi Migual,
    You can add as per your requirement. Please refer the following link
    http://help.sap.com/saphelp_nw04/helpdata/en/4d/e2bebb41da1d42917100471b364efa/content.htm
    Assign Points if helpful.
    Regards,
    Amit

  • Max No of Rows

    Hi All,
    I am developing a dashboard using QWASS and oracle DB.
    The Base table is having more than 20 Lac records according to daily basis these records might increase.
    Right now i developed with dummy records when i moved to production the data is large.
    So that how can i work it out.
    Can any body tell how many max no of row s will give good performance.
    And also how many max records can hold by excel which is embedded with Xcelusius.
    Thanks
    Santhosh V

    Hi Santhosh,
    As i told you in my previous post we did created one of our dashboard on top of 1200+ records (not recommended though) and the connection is with the help of BSP application then we tried the same thing with liveoffice, with an intention to improve the performance but that one is a disaster Dashboard got hanged, Liveoffice is quite slow because of its added over hears.
    restriction is also from the flash  point of view. so its better to go for a summered data and create item level report on some other tool like crystal reports, export that report to Business object repository and use that link inside your Xcelsius dashboard (from where you can pass your parameters)
    or you can embed your dashboard inside crystal reports and then host that file on BOE .
    Good Luck & keep posting.

  • Max number of rows to display in a pivot table

    I have a pivot table with two row levels and I need to fix the max amount of rows to display at the second level to five. Can I do that on excel 2013?
    Example
    Row Levels
    Machine A
    Part 1 (to be displayed)
    Part 2 (to be displayed)
    Part 3 (to be displayed)
    Part 4 (to be displayed)
    Part 5 (to be displayed)
    Part 6 (not displayed)
    Machine B
    Part 1 (to be displayed)
    Part 2 (to be displayed)
    Part 3 (to be displayed)
    Part 4 (to be displayed)
    Part 5 (to be displayed)
    Part 6 (not displayed)
     and so go on. 

    Hello, 
    you can use a filter to display only the top 5 items of the second level, based on their value. To do that, right-click on a label in the second level, then select Filter > Top 10.  Change the 10 to a 5 in the next dialog.
    You can also create a label filter, but it only takes one filter condition.
    Another way is to select the rows you don't want to be shown, then use right-click > Filter > Hide Selected Items
    cheers, teylyn

  • "Numbers" when creating a sheet the max number of rows is only 255, is this correct because i thorght is was something like 65,000

    "Numbers" when creating a sheet the max number of rows is only 255, is this correct because i thorght is was something like 65,000

    max columns is 255
    max rows should be 65535

  • Find MIN, MAX of multiple rows from multiple columns

    Hello,
    I need to figure out how to pull the MIN/MAX of multiple rows from multiple columns into one column. Even if some are NULL/blank.
    For Example: (C: Column, R: Row, N - NULL/Blank)
    C:____1____2____3____ 4____Max
    R:____20___22___13____4____*22*
    R:____N____N____32____14___*32*
    R:____N____12____N____N____*12*
    That is, it always gives a value for MIN/MAX unless there are NO values in all the rows of the columns.
    So if there is one value, it will select that for the MIN/MAX, as it's the smallest/biggest since there is nothing to compare it to.
    Here is my current code:
    CASE WHEN COLUMN 1 < COLUMN 2 THEN COLUMN 2 ELSE COLUMN 1 END

    Hi Thank you for your feedback, unfortunately, I just found out that EVALUATE Function is disabled in our environment for security reasons, so the only other way I've discovered is this:
    The problem is that none of the conditions in the case statement are met--so the column is set to null. You can add a WHEN statement (section 2 below) to catch the nulls. There are five cases to consider:
    Case 1: begin insp > bad order
    Case 2: begin insp < bad order
    Case 3: bad order only (begin insp is NULL)
    Case 4: begin insp only (bad order is NULL)
    Case 5: both begin insp is NULL and bad order is NULL
    1) If bgn-crm-insp-ob > report-bo-ob then bgn-crm-insp-ob
    (Case 1)
    CASE WHEN filter ("- Terminal Task Measures"."Task Reported DateTime (Local)" using "Task Detail"."Task Code" = 'bgn-crm-insp-ob') > filter ("- Terminal Task Measures"."Task Reported DateTime (Local)" using "Task Detail"."Task Code" = 'report-bo-ob') THEN filter ("- Terminal Task Measures"."Task Reported DateTime (Local)" using "Task Detail"."Task Code" = 'bgn-crm-insp-ob')
    2) If report-bo-ob is NULL then bgn-crm-insp-ob
    (Case 4, 5) for case 5, you will get NULL
    WHEN filter ("- Terminal Task Measures"."Task Reported DateTime (Local)" using "Task Detail"."Task Code" = 'report-bo-ob') IS NULL THEN filter ("- Terminal Task Measures"."Task Reported DateTime (Local)" using "Task Detail"."Task Code" = 'bgn-crm-insp-ob')
    3) Else report-bo-ob
    (Cases 2, 3)
    ELSE filter ("- Terminal Task Measures"."Task Reported DateTime (Local)" using "Task Detail"."Task Code" = 'report-bo-ob') END
    Hopefully this works, I'll give feedback if it does, or if you have any further suggestions please submit, again, THANK YOU SO MUCH ANYWAYS!

  • Max of each row

    I want to select max column from a row.
    Students--table
    Name mark1 , mark2 ,mark3
    A 60 90 85
    How can I find the max of each row

    I want to select max column from a row.
    Students--table
    e mark1 , mark2 ,mark3
    A 60 90 85
    How can I find the max of each rowMax of each row?? Are you sure thats what you want? How come anyone select a max of each row?? A row is single and what max of the single one(row) can you select?
    Please provide the required output that you desire to have so that we can guide you!
    Jithendra

  • SQL: Find table with max no. of rows

    I have a table containing list of table names for each owner; as
    ## Table: db_tables
    OWNER TABLE_NAME
    a ta_1
    a ta_2
    a ta_3
    b tb_1
    b tb_2
    c tc_1
    Now, i want to know the table with max. no. of rows for each owner
    Plz....can anyone gimme a solution for the above ......

    Assuming 10g and above:
    SQL>  SELECT owner,
                 MAX(table_name) KEEP (DENSE_RANK FIRST ORDER BY XMLQUERY (t RETURNING CONTENT).getnumberval() DESC) table_name,
                 MAX(XMLQUERY (t RETURNING CONTENT).getnumberval()) cnt
        FROM (SELECT owner,table_name,    'count(ora:view("' || table_name || '"))' t
                FROM all_tables
               WHERE owner IN ('MICHAEL','SCOTT'))
               GROUP BY owner
    OWNER                          TABLE_NAME                            CNT
    MICHAEL                        SERVICE_ZIP                       1000000
    SCOTT                          EMP                                    14
    2 rows selected.

  • How can you set the max row for a 'open cursor' in a stored proc?

    I would like to know how can you set the maximum amount of row returned in a resultset coming from a stored proc?
    You can do it via JDBC with cStatement.setMaxRows(10); but it works only for select that you do via JDBC...
    I would like the same functionality using open cursor inside a stored proc...
    Thanks...

    is "where ROWNUM <= 10" the equivalent of "cStatement.setMaxRows(10);" because the ROWNUM as problem with the ORDER BY clause and the setMaxRows() as no problem...

  • How to get the number of rows in a DB-Cursor

    When i open a database cursor i do not know how much rows are stored in the cursor. To solve this problem i have to send a 'select count(1) ...' to get the number of rows before i set up the cursor. I think that this is not very clever and could possibly cause performance problems. But i need the num of rows to show the percentage of processed rows. Is there any other way to get the num of rows? May be by checking the cursor directly?
    Please help!
    Thanx a lot

    In order to find out how may rows are going to be processed, oracle has to visit every row. So with a cursor, there is no property that will accurately reflect the number of rows until you get to the last one. That said, you could use
    select count(*) over() as row_count, <rest of your columns> FROM <your table>
    which will give you the total row count agaist each row in the result set. There are performance penalties involved but they will be less than issuing the query twice, once to get the count and once to get the rows.
    Have a look on asktom for some very usefull info about all this.
    HTH

  • How to get value from First Row in an REF CURSOR

    I have a REF CURSOR defind like:
    open out_RESULT_SET for
    select
    EVENT_UID,
    EVENT_DATE,
    EVENT_ITEM
    from
    EVENT
    order by
    EVENT_DATE ASC;
    I want to also set the value of a variable v_FIRST_EVENT_DATE to the value in the EVENT_DATE column of the first row.
    I know I could do a:
    select
    min(EVENT_DATE)
    into
    v_FIRST_EVENT_DATE
    from
    EVENT;
    But I would rather just use the REF CURSOR (I think).
    Thanks for the help.

    How would I get v_FIRST_EVENT_DATE set to the date of the first event in the REF CURSOR out_RESULT_SET?Normal fetch into associated local variables should suffice.
    Something along those lines:
    declare
       v_first_event_date   event.event_date%type;
       v_event_uid          event.event_uid%type;
       v_event_date         event.event_date%type;
       v_event_item         event.event_item%type;
    begin
       open out_result_set for
          select   min (event_date) over () first_event_date, event_uid,
                   event_date, event_item
              from event
          order by event_date asc;
       loop
          fetch out_result_set
           into v_first_event_date, v_event_uid, v_event_date, v_event_item;
          exit when out_result_set%notfound;
          do_something;
       end loop;
      close out_result_set;
    end;
    /

  • Rows "lost" by a cursor

    In a software developed in C/SQL a curor is in charge of retreiving data from an Oracle table. For each row a specific treatment is performed. The problem is the following : some rows are not retreived from database and seem to be "lost" by the cursor. No Oracle error occurs.
    Can it be a memory problem ?
    Oracle version used : 7.3.4.4.0
    Unix used : HP UX B.11.0

    Are you sure those rows were present and committed before the query was issued? When you issue a query, Oracle will give you the data as it existed at the point in time that you issued the query-- any transactions that commit while your query is running will not be visible to you unless you re-issue the query.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Max number of rows?

    Hi,
    We have a new implementation of Enterprise X1 3.1 and are trying to determine what determines the maximum number of rows that can successfully be generated using Webi.  Is there a hard limit that Webi has (assuming the Universe max rows is deactivated)?
    Also, is there a limit for Live Office extractions into Excel?  What are the main drivers for this limit?
    Finally, all other factors being equal, are there different limits for the number of rows a query can return successfully in Webi vs Deski vs BEx?  How does the performance of these three tools compare to each other in terms of speed?
    Thanks!
    Darryl

    Thanks for your reply!  I also got a response back from SAP / BObj that I'll share:
    Q) We have a new implementation of Enterprise X1 3.1 and are trying to determine what determines the maximum number of rows that can successfully be generated using Webi. Is there a hard limit that Webi has (assuming the Universe max rows are deactivated)?
    => There is a limit to the number of pages Web Intelligence reports can have. This is because there are a maximum number of pages (per report) the server can process. This number depends on the paper size chosen. Generally, it is approximately 590000 inches vertically by 590000 inches horizontally. Therefore, if you choose a smaller paper size, you get more pages but may not see all the pages of the report.
    Resolution:
    To work around this behavior, you can either make each line smaller to get more records, or split your report into more than one report to see all your data.
    Q) Is there a limit for Live Office extractions into Excel? What are the main drivers for this limit?
    => By default its set to 512 rows and columns....however you can change this by modifying the Liveoffice_config.properties file...you can locate this file in /dswsbobje/lib/dsws_liveoffice_provider.jar.
    Q) Are there different limits for the number of rows a query can return successfully in Webi vs. Deski?
    => Although there is no official limit on the number of rows that can be handled by DeskI, it is really not meant to be used like a database, i.e. for returning millions of rows. The purpose of BusinessObjects reporting tools is to get useful information, which is not possible with millions of rows.
    => It has been observed that when the number of rows increases beyond 1.5 million approximately, it starts affecting the Desktop Intelligence performance. This behavior may vary from machine to machine depending upon the available resources and programs (processes) running in the background.
    => The limit is related to the number of rows those can actually be displayed in the report and not how many can be loaded into the data cube. All the rows get loaded in the cube however when it comes to rendering them in the report the problem may arise.
    Example: Report A returns 2 million rows into the cube however due to the report design there are only 200 rows in the actual report page and can be run successfully. Report B tries to render all 2 million rows into the actual report page and can fail.
    Workaround:
    Use filters in the report so that it will retrieve less number of rows and will also help to display useful data.

Maybe you are looking for