Calculate no.of rows in block/blocks in schema

Hi,
Database :10.2.0.4 RAC ASM
OS: AIX 5.2/5.3
I want to calculate no. of rows exists in a block or in all blocks.
I went to google and found some calculation to get ,but not able to understand in analyzing with minextens,etc.,
Here i am giving my schema dba_segments output for analysis.
SQL>select segment_type,bytes,blocks,extents,initial_extent,min_extents,max_extents from * dba_segments * where owner='SUNAND';
segment_type     bytes      blocks     extents     initial_extent     min_extents     max_extents     
INDEX     65536     *8*     1     *65536*     1     *2147483645*     
INDEX     65536     *8*     1     *65536*     1     *2147483645*     
TABLE     65536     *8*     1     *65536*     1     *2147483645*     
TABLE     65536     *8*     1     *65536*     1     *2147483645*
INDEX     84934656     *10368*     82     *65536*     1     *2147483645*     
I have separated the output with bold identification.
Could you tell me , * how do i have to find the no. of rows in a table or rows in blocks * ?.
Please tell me , if you need any further information for analysis.
Thanks & Regards,
Sunand

I've found an answer in "Ask Tom" site:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:707430700346624722
create table t ( x int ) pctfree 0;
insert into t select null from all_objects where rownum <= 10000;
select count(*)
from t
where dbms_rowid.rowid_block_number(rowid) = (select min(dbms_rowid.rowid_block_number(rowid)) from t);
COUNT(*)
734
Hope it helps.
Roni.

Similar Messages

  • Add row in block

    can i add row in block at runtime?
    i m using oracle forms 10g
    database oracle 10g
    regards
    Rupal

    hi
    I understand the above answer.
    But can you please explain me at what kind of situations , you need this options
    Thanks

  • Rows per block

    hi.
    how do i know number of rows per blocks

    One way is to use dbms_stats as howardjr suggested.
    YAS@10GR2 > drop table t;
    Table dropped.
    YAS@10GR2 > create table t as select * from all_objects where rownum<=100;
    Table created.
    YAS@10GR2 > exec dbms_stats.gather_table_stats(ownname=>null,tabname=>'T');
    PL/SQL procedure successfully completed.
    YAS@10GR2 > select NUM_ROWS,BLOCKS,NUM_ROWS/BLOCKS from user_tables where table_name='T';
      NUM_ROWS     BLOCKS NUM_ROWS/BLOCKS
           100          5              20Another way is to use dbms_rowid to find out how many rows each block has.
    YAS@10GR2 > select dbms_rowid.rowid_block_number(rowid) block,count(*)
      2  from t
      3  group by dbms_rowid.rowid_block_number(rowid);
         BLOCK   COUNT(*)
          1501          9
          1500         91

  • Dynamically creating XML using Sap-xMII Colum and Row Action Block

    Hi,
    I am trying to create a xMII-format XML using IlluminatorDocument Action Block.
    My problem statement is during run time I am required to create columns on the fly.which I have done using xMII Colum Action block.but now I am required to assing values to these dynamically created columns.I have tried using Data Item and Row action block but am not sucessful in doing so.Can anyone help in creating this xml Dynamically.
    The steps that I have followed is
    defined
    tagquery action block and defined tagquery
    blank Illuminator Document Action block
    put a repeater on result of tag query
    set a counter
    updated the counter
    used column action block and mapped the column name i.e IlluminatorColumn_0.Name------"test"&Local.count
    my column output looks like
    Rowsets DateCreated="2007-03-27T12:59:39" EndDate="2007-03-27T11:42:40" StartDate="2007-03-27T11:42:40" Version="11.5.0">
         <Rowset>
              <Columns>
                   <Column Description="" MaxRange="100" MinRange="0" Name="test1" SQLDataType="1" SourceColumn="test1"/>
                   <Column Description="" MaxRange="100" MinRange="0" Name="test2" SQLDataType="1" SourceColumn="test2"/>
                   <Column Description="" MaxRange="100" MinRange="0" Name="test3" SQLDataType="1" SourceColumn="test3"/>
                   <Column Description="" MaxRange="100" MinRange="0" Name="test4" SQLDataType="1" SourceColumn="test4"/>
                   <Column Description="" MaxRange="100" MinRange="0" Name="test5" SQLDataType="1" SourceColumn="test5"/>
              </Columns>
    </Rowset>
    </Rowsets>
    after this action block i want to assign values to each column i.e
         <Row/>
              <Row/>
              <Row/>
              <Row/>
              <Row/>
    i.e erach row tags should be filled with columntag and value
    but i am not able to achieve the same
    Can anyone help me doing this

    After adding IllumColum Action block I have created 5 columns dynamically
    but now I am unable to add row.
    currently for everycolumn created it is giving one row  without any column node
    the configurations that I have done in Data Item Action Block is
    In My Link Editor
    IlluminatorColumn_0.Name----
    >IlluminatorDataItem_0.Name
    hardcoded the value i.e 20----
    >IlluminatorDataItem_0.Value
    IlluminatorDocument_0.Output----
    >IlluminatorDataItem_0.IlluminatorDocument
    current resultset I am getting is
    <?xml version="1.0" encoding="UTF-8"?>
    <Rowsets DateCreated="2007-03-27T12:59:39" EndDate="2007-03-27T11:42:40" StartDate="2007-03-27T11:42:40" Version="11.5.0">
         <Rowset>
              <Columns>
                   <Column Description="" MaxRange="100" MinRange="0" Name="test1" SQLDataType="1" SourceColumn="test1"/>
                   <Column Description="" MaxRange="100" MinRange="0" Name="test2" SQLDataType="1" SourceColumn="test2"/>
                   <Column Description="" MaxRange="100" MinRange="0" Name="test3" SQLDataType="1" SourceColumn="test3"/>
                   <Column Description="" MaxRange="100" MinRange="0" Name="test4" SQLDataType="1" SourceColumn="test4"/>
                   <Column Description="" MaxRange="100" MinRange="0" Name="test5" SQLDataType="1" SourceColumn="test5"/>
              </Columns>
              <Row/>
              <Row/>
              <Row/>
              <Row/>
              <Row/>
         </Rowset>
    </Rowsets>

  • How to calculate number of rows for perticular characterstic in SAP BI Bex

    Hi experts,
    Please let me know how to calculate  ' number of rows  ' for perticular characterstic in Bex query. 
    Thanks & Regards,
    Babu..

    Hello,
    You can try this
    Create a CKF and assign the vale 1 to it. Open the query and select Character where you want to display ' number of rows ', go to properties windows, select 'display', in the results row drop down box, select  'always display'.
    Thanks.
    With regards,
    Anand Kumar

  • Calculate profit at row level in Discoverer Plus

    HI,
    I need to calculate profit at row level in Discoverer Plus as follows.
    There are columns
    1)     Account Name- Contains Expense and revenue account names
    2)     Account type- Contains Identifier for account (E or R)
    3)     Amount --- Contains amount
    4)     Period     Name -- Contains Numeric Amount.
    Cross Tabular Report Look like as follows
    Period Name          Feb-2009     Mar-2009
    Account Name
    Total Revenue          100          90     
    Total Labor Cost          30          30     
    Total G&A Cost          20          50
    Profit               ???          ??     
    Need to show PROFIT =Total Revenue- (Total Labor Cost- Total G&A Cost)
    at bottom for each period.
    I am unable to use calculations because it appears column wise…
    Would you please suggest solution for this?
    Thanks,
    Mahesh.

    Hi
    Try dragging the data point headings off the top axis and place them to the right of the Account Name. They will all drag together so just moving one will move them all.
    If your profit is already calculated and is a data point as you have commented then it too will come over to the left. For displaying it under the other items, a really cool feature about having data points on the left is that you can drag their heading and place it anywhere you want. I will be including this trick in my free March ask Michael webinar. (By the way, if anyone reading this thread you can sign up for my free webinar by clicking here: http://ascbi.com/question.htm)
    You should now be able to display your calculated profit as a row underneath the other items. I tried this on my own system and it worked just fine.
    Best wishes
    Michael

  • Calculate size of row

    HI all,
    I need to calculate size of row in bytes .
    Is there any way to do this ?
    I have heard about vsize function..
    TIA
    Sumukh

    Or since vsize requires data to exist run an analyze or dbms_stats and then see the dba_tables.avg_row_len column value.
    This is the average row length for the existing data including the row overhead.
    HTH -- Mark D Powell --

  • Determining number of rows in blocks

    Hello
    Assume 8k blocksize
    How can I know, how many rows will fit into one block?
    Cheers

    Not really no. What's a row look like? NUMBERs? VARACHARs? DATE types? If VARCHARs, the amount of data actually being stored could vary hugely.
    If you already have some data loaded in a table somewhere, you may try sampling existing data to give you some idea.
    Try something like this:
    MBOBAK@mstmfgpep> create table test_rows nologging as select * from dba_tables;
    Table created.
    MBOBAK@mstmfgpep> select count(*) from TEST_ROWS;
      COUNT(*)
          1589
    1 row selected.
    MBOBAK@mstmfgpep> l
      1* select dbms_rowid.ROWID_to_absolute_fno(rowid,'MBOBAK','TEST_ROWS'),dbms_rowid.ROWID_BLOCK_NUMBER(rowid),count(*) rows_in_block from test_rows group by dbms_rowid.ROWID_to_absolute_fno(rowid,'MBOBAK','TEST_ROWS'),dbms_rowid.ROWID_BLOCK_NUMBER(rowid)
    MBOBAK@mstmfgpep> /
    DBMS_ROWID.ROWID_TO_ABSOLUTE_FNO(ROWID,'MBOBAK','TEST_ROWS') DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID) ROWS_IN_BLOCK
                                                               6                                  212            31
                                                               6                                  216            32
                                                               6                                  218            31
                                                               6                                  221            31
                                                               6                                  222            32
                                                               6                                  224            31
                                                               6                                  255            31
                                                               6                                  206            32
                                                               6                                  213            32
                                                               6                                  220            31
                                                               6                                  223            31
                                                               6                                  225            32
                                                               6                                  227            31
                                                               6                                  239            30
                                                               6                                  245            31
                                                               6                                  208            32
                                                               6                                  211            32
                                                               6                                  240            30
                                                               6                                  243            31
                                                               6                                  247            33
                                                               6                                  253            34
    DBMS_ROWID.ROWID_TO_ABSOLUTE_FNO(ROWID,'MBOBAK','TEST_ROWS') DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID) ROWS_IN_BLOCK
                                                               6                                  204            32
                                                               6                                  228            31
                                                               6                                  230            31
                                                               6                                  232            31
                                                               6                                  234            31
                                                               6                                  235            30
                                                               6                                  250            41
                                                               6                                  254            33
                                                               6                                  256            31
                                                               6                                  207            31
                                                               6                                  237            30
                                                               6                                  241            31
                                                               6                                  242            32
                                                               6                                  244            32
                                                               6                                  246            31
                                                               6                                  248            38
                                                               6                                  251            34
                                                               6                                  209            32
                                                               6                                  231            31
                                                               6                                  236            30
                                                               6                                  238            30
    DBMS_ROWID.ROWID_TO_ABSOLUTE_FNO(ROWID,'MBOBAK','TEST_ROWS') DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID) ROWS_IN_BLOCK
                                                               6                                  210            32
                                                               6                                  214            32
                                                               6                                  215            32
                                                               6                                  219            31
                                                               6                                  226            31
                                                               6                                  205            32
                                                               6                                  229            31
                                                               6                                  252            34
    50 rows selected.
    MBOBAK@mstmfgpep> This will count the number of rows that you're actually getting in each block. Warning, on a large table, this could take a very long time to run and produce lots of output. But you should be able to use the technique to sample how many rows/block you see on various tables.
    Hope that helps,
    -Mark

  • Rows in block

    Hi
    Can a block contain rows of more than one heap table or a block can contain only rows of one heap table?
    Cheers

    Ora_83 wrote:
    Hi
    Thanks.
    As you confirmed, Unless it is cluster
    Each block can contain rows of one table.
    Does each block contain table name, I mean how does this one to one relation is maintained?Yes the block contains the information in its header, about whether it contains the information about table/index and which objects it belongs to not necessarily by having table name in its header, but by object id/extents id
    Regards
    Anurag

  • Calculate % using crosstab rows

    Hi,
    I  have a crosstab in my report header just like below. (Group by Country, then by state). I would like to display this as the summary of entire report.
    Country                                         2007            2008             2009
      State
    Total Issued          100               200               300
      Accepted           20                   30                 40
      % accepted       20%               15%            40/300
    That is, I want to calculate  '% of accepted based on the row values 'Total Issued' and  'Accepted' not based on summary.
    I tried couple of ways, it is not calculating properly. any help, really appreciated

    Hi,
    I  have a crosstab in my report header just like below. (Group by Country, then by state). I would like to display this as the summary of entire report.
    Country                                         2007            2008             2009
      State
    Total Issued          100               200               300
      Accepted           20                   30                 40
      % accepted       20%               15%            40/300
    That is, I want to calculate  '% of accepted based on the row values 'Total Issued' and  'Accepted' not based on summary.
    I tried couple of ways, it is not calculating properly. any help, really appreciated

  • Calculate Result in Rows

    In a Bex Query, the function NODIM() has been applied to the Key Figure ZAMOUNT.  In the rows I have 0UNIT. I want the Result of  ZAMOUNT to show an *, when different 0UNIT are involved. 
    0UNIT     AMOUNT     
    M2              700,000
    M2              500,000
    RESULT         1.200,000
    M                10,000
    M3          26.000.000,000     
    RESULT               *
    Please, someone could help me.
    Thanks.

    Mariana,
                 Try to check "Display scaling factors for key figures" in the Query Properties.
                  If you do that, the UNIT will go to the column header and you it will be possible to supress the usage of the NoDim() function.
    Regards,
    L. Felipe
    PS: do you work in PDVSA?

  • Creating views in a new schema to access certain rows of tables in source schema

    Hi,
    Oracle 10.2.0.4
    We are trying to mask certain data from some users. My suggestion is that we create a new schema view_schema on the same instance where we have source tables say in source_schema.
    We then create views in view_schema as below
    CREATE VIEW AS SELECT * FROM source_schema.table where COLUMN_n = 'XYZ';
    we then grant SELECT on these views to a role and assign new users that role to be able to see the viewed data.
    So the questions below.
    We can create views to look at data in another schema WITHOUT giving SELECT permissions directluy on source_schema.tanle?
    This will work and there is no need to create synonyms etc
    WE can manage users and views much easilier
    Does this make sense and would that be better than selecting views with say table_name_view in source schema for this purpose and even creating synonyms for these views with the same tanle names in sourece_schema?
    Thanks

    905989 wrote:
    Hi,
    Oracle 10.2.0.4
    We are trying to mask certain data from some users. My suggestion is that we create a new schema view_schema on the same instance where we have source tables say in source_schema.
    We then create views in view_schema as below
    CREATE VIEW AS SELECT * FROM source_schema.table where COLUMN_n = 'XYZ';
    we then grant SELECT on these views to a role and assign new users that role to be able to see the viewed data.
    So the questions below.
    We can create views to look at data in another schema WITHOUT giving SELECT permissions directluy on source_schema.tanle?
    This will work and there is no need to create synonyms etc
    WE can manage users and views much easilier
    Does this make sense and would that be better than selecting views with say table_name_view in source schema for this purpose and even creating synonyms for these views with the same tanle names in sourece_schema?
    Thanks
    1. You can create the view in another schema (first granting privileges to the view schema) without granting privileges from the source schema
    2. You probably want to create public synonyms for the view(s).  You can refer to the view as schema.view but this is cumbersome
    3. I am not sure about management being easier but added complexity should not be too bad.  Write documentation describing how everything works and the object involved.
    Another, more complicated but more powerful possibility is to use row level security also known as virtual private database - if you have the license.  You create a profile for a table and a procedure to generate WHERE clauses to filter any query against the table and columns defined in the profile.  Again, you need the license to do this.

  • Automatic ROW Processing error after changing Schema

    Hello all,
    I have an APEX 3.0 application referencing tables on a different schema from the parsing schema.
    Workspace A -> using parsing schema A1
    Application A -> installed in Workspace A
    Application A -> access tables in schema A2 from schema A1, through synonyms
    All is working fine.
    Then I had to duplicate the application (let me say: to have a test environment).
    So, I created a Workspace B, a parsing schema B1, I've installed application A as application B in workspace B, and I've created schema B2 and I gave the grants to schema B1.
    Application B is running fine when trying to access objects on the parsing schema B1, but it returns a lot of errors when accessing objects on schema B2, in particular on Automatic Row Processing and Automated Row Fetch processes. The error I'm getting vary from ORA-942 (table or view doesn't exist) to ORA-936 (missing expression).
    A strange thing is that in Automatic Row Processing and Automated Row Fetch processes, I can choose only schema A1 as Table Owner, and all is working fine.
    In application B, I can select as Table Owner also the schema B2, even if it's not associated to the workspace. By doing this something works better. But I don't want to modify every page in the application where this happens. Also because I want the opportunity to maintain only one application.
    I think that the application installed in workspace B, still tries to access objects in schema A2, but I don't know why.
    Do you have any suggestion?
    Thanks.
    Andrea

    It returns these results:
    WORKSPACE     APPLICATION_ID     APPLICATION_NAME     PAGE_ID     PROCESS_SOURCE
    WS_DEMO     107     myappname     73160     F|&FETCH_SCHEMA.:CDW_LST_GRP:P73160_LTG_ID:LTG_ID
    WS_DEMO     107     myappname     73160     &FETCH_SCHEMA.:CDW_LST_GRP:P73160_LTG_ID:LTG_ID|IUD
    The query returns the same results in PROCESS_SOURCE columns, when ran from workspace A or B.
    I've found that FETCH_SCHEMA is an "application definition", and I've setup correctly in workspace B. The problem persists.
    Bye,
    Andrea

  • How to copy data, table rows between tables in different schema

    how do I copy rows from one table in one schema into another table in another schema in same database?

    Hi,
    Give an Access to the respective table in Source Schema to Destinations Schema. If table does not exits in the destination schema use CTAS else Insert into..etc., with your select Query.
    - Pavan Kumar N

  • Avg num of rows per blk

    HI Can any one please point to me a document or a way to calculate the average number of rows per block in oralce 10.2.0.3

    This is a little late but for anyone interested here are some results from Jonathan's query plus for comparison purposes I added a query to do the blocks/num_rows calculation and I added a compute avg on avg_rows even though this is not 'proper' way to calculate the average rows per block. The target table is 4.2G in size.
    Enter value for tbl_name: xxx_xxxxx
    TWENTIETH   MIN_ROWS   MAX_ROWS TOT_BLOCKS   TOT_ROWS AVG_ROWS
             1          1          2       9439      10133     1.07
             2          3          4        972       3426     3.52
             3          5          6       1449       8101     5.59
             4          7          8       2425      18349     7.57
             5          9         10       4194      40204     9.59
             6         11         12       9946     115661    11.63
             7         13         14      28703     390941    13.62
             8         15         16      70452    1100064    15.61
             9         17         17      47960     815320    17.00
            10         18         18      52212     939816    18.00
            11         19         19      85585    1626115    19.00
            12         20         20      70143    1402860    20.00
            13         21         21      29570     620970    21.00
            14         22         22      23561     518342    22.00
            15         23         23      28524     656052    23.00
            16         24         24      20786     498864    24.00
            17         25         25       2291      57275    25.00
            18         26         26       1679      43654    26.00
            19         27         27       1897      51219    27.00
            20         28         28        992      27776    28.00
    avg                                                       16.91
    sum                                  492780    8945142
    20 rows selected.
    AVG ROWS/BLK
              17

Maybe you are looking for

  • IPod touch 2G not detected in iTunes 10.1.2.

    Hello, I have a Apple iPod touch 2nd Generation bought in 2009 running iOS 4.1. I'm currently running iTunes 10.1.2(x64) on Microsoft Windows 7 Ultimate(x64). Recently when I connected my iPod touch to my PC, it didn't got detected in iTunes but was

  • Illustrator CC crashes

    Hi Adobe I've got a problem with Illustrator - it very often crashes when I copy elements from one document to another and even when I copy an element to the same document - Error message looks as follow Log Name:   Application Source:     Applicatio

  • Can't open *any* files downloaded by Firefox

    I am running Firefox 13.0.1 on a Mac Powerbook under Mac OS 10.7.4. Firefox seems to download the files very nicely, but when I try to open them, I have gotten the error message "File does not exist" and it mentions my download folder. There's more t

  • Adobe Acrobat XI Crashes

    Creative Cloud Subscription on MAC OS 10.8.3 - Cant create PDF's Combine or anything really without it crashing. I also keep getting a blank box pop up asking for ADOBE SOFTWARE LICENSE. Distiller doesnt work either.

  • What is report unrecoverable;

    RMAN> report unrecoverable; Report of files that need backup due to unrecoverable operations File Type of Backup Required Name 22 full or incremental /u02/proddata/a_txn_data01.dbf 23 full or incremental /u02/proddata/a_txn_data02.dbf 24 full or incr