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

Similar Messages

  • 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.

  • 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>

  • 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

  • How to disable instances of items in forms 4.5 in a mlti row block

    I have a multi row database block in forms 4.5 . One of the items is a checkbox. Based on certain conditions the user should be allowed to select only the checkbox only for some rows. How can i selectively disable the checkbox for some record and enable it for the other records.
    I know this can be done in OFrms 6i using set_item_instance_property but this is not available in forms 4.5 . Any ideas or workarounds to achieve this ?
    Thank You
    Satya
    Edited by: Satya V on Aug 13, 2009 11:48 AM

    I fear there is no direct solution.
    May be this is a work-around:
    1. Apply the older built-in: Display_item. You can't disable the item with display_item, but you can change the visual attribute and show the user that this item should not be checked.
    2. To be shure that the user doesn't ignore this "disable", you need a trigger, which resets the item to the proper value after an illegal change.

  • How to handle Events in Blocked ALV report

    Hi All,
    I have a Blocked ALV report, I have a requirement where if I double click a row in blocked ALV report, it should branch off to MM01 transaction code and the material number and change number should get populated with the material number and change number  in my program.
    Is there any idea how to do this.
    Thanks,
    Vishal.

    hi anil,
    I have used user_command1 as the function module however the field details are not getting captured.
    How can we use set get parameters in this aspect.
    Please elaborate your answer.
    Thanks,
    Vishal.

  • Preventing empty rows in address formats

    Hallo everyone!
    I'd like to know if there is a method to prevent SBO2005A from printing empty rows in the address fields when for instance there is missing county in BP addresses like this:
    I have defined an address format that goes
    Block
    County
    Street
    ZipCode | Freetext(" ") | City
    We use Block as "Name2" and County as "Name3" in master data just in case the customer wants to use additional names for his BPs.
    If I use the "Block" - field and I leave the "County" - field blank it prints an empty row between "Block" and "Street". This is not the behaviour I would like to see. In case "county" is missing I would rather see something like this in a printout:
    Block
    Street
    ZipCode | Freetext(" ") | City
    So, is there a method to force this? or any workaround?

    Hello Patryk,
    PLD does not offer the functionality to control the blank lines in an address field.  I would suggest you use a formatted search in your address field on the marketing document and have it formatted in the document itself before you print.
    Please see sample code for your requirment for the Ship to address.  If you want this to applied to the Bill to address field then you have to slight alter the query by cha
    For Shipto address formatting
    SELECT CASE WHEN T0.Block IS NOT NULL THEN + CHAR(13) + CHAR(10) + T0.Block + CHAR(13) + CHAR(10) ELSE '' END +
    CASE WHEN T0.County IS NOT NULL THEN + CHAR(13) + CHAR(10) + T0.County + CHAR(13) + CHAR(10) ELSE '' END +
    ISNULL(T0.Street, '') + CHAR(13) + CHAR(10) + ISNULL(T0.ZipCode, '') + '  ' + ISNULL(T0.City, '')
    FROM  [dbo].[CRD1] T0 WHERE T0.AdresType = 'S' AND T0.Address = $[$40.0.0] AND T0.CardCode = $[$4.0.0]
    For Billto address formatting
    SELECT CASE WHEN T0.Block IS NOT NULL THEN + CHAR(13) + CHAR(10) + T0.Block + CHAR(13) + CHAR(10) ELSE '' END +
    CASE WHEN T0.County IS NOT NULL THEN + CHAR(13) + CHAR(10) + T0.County + CHAR(13) + CHAR(10) ELSE '' END +
    ISNULL(T0.Street, '') + CHAR(13) + CHAR(10) + ISNULL(T0.ZipCode, '') + '  ' + ISNULL(T0.City, '')
    FROM  [dbo].[CRD1] T0 WHERE T0.AdresType = 'B' AND T0.Address = $[$226.0.0] AND T0.CardCode = $[$4.0.0]
    Suda

  • Creating multiple records in a block while sitting in another block

    Hey friends....I've 2 blocks in my form. Block-A contains producats A,B etc and Block-B contains colors like Black, Blue etc. I wish that when user selects 2 or more colors in Block-B and presses a button in that block, then each color should be assigned to each of the product with a (No.of colors x No. of Products) recods e.g if user entered 2 products A & B in two rows of Block-A and 2 colors Black & White in Block-B, then Product A should have 2 records with each color i.e Black and White. In the same way Product B should have 2 records i.e Product B with 1 record with color Black and 2nd record with color White.
    Is there any body to accomplish this job?

    Product table is not a Master/Detail because Product itself is not dependant on color at the time of creationMaster-detail means that you can create a master (Product) without any details (colors).
    2 records for Paint with color Black and Red. And 2 records for Shirt with color Black and Red. So total 4 records will be created with a minimum entry from userDoing it that way will cause data-redundancy and possible inconsistences. I would go with a detail-table for Color-Assignments to products.
    I created one detail block of products and anothers detail block of colors with check-boxesOk so far. Lets assume you go with the "Detail"-table for color-assignments to products, then you would:
    - Base the Color-block on the color-table.
    - Create an additional checkbox as non-dasetable-item.
    - Create a POST-QUERY-trigger which check the PRODUCT_COLOR-table, if a record exists for the combination of color and product and sets the checkbox to checked or unchecked.
    - Create a ON-UPDATE-trigger on that block, which does an INSERT into PRODUCT_COLOR if the checkbox is checked or an DELETE from PRODUCT_COLOR if the checkbox is unchecked.
    hope this helps

  • Tuning row lock contention wait events

    Hello everyone,
    Working on 10g/windows
    Top 5 events
    EVENT TOTAL_WAITS TIME_WAITED AVG_MS PERCENT
    CPU 9462339 48
    enq: TX - row lock contention 12531 3660728 2921.34 18
    control file parallel write 1300731 3088079 23.74 16
    log file parallel write 1510503 1264080 8.37 6
    log file sync 1072553 968007 9.03 5
    Distribution of row lock wait during the last 4 days in the database server
    END_INTERVAL_TIME TOTAL_WAITS TIME_WAITED_MICRO AVG_WAIT_MS
    2008-04-01 16:00:58 909 2721008230 2993.41
    2008-04-01 15:00:27 50 149941140 2998.82
    2008-03-31 12:00:42 193 575595397 2982.36
    2008-03-29 23:00:13 172 513058700 2982.9
    2008-03-29 22:00:37 164 483940046 2950.85
    2008-03-27 22:00:35 565 1667120838 2950.66
    2008-03-26 18:00:59 348 1042918982 2996.89
    My analysis:
    It's obvious that the row lock contention wait time is huge, and this direct me to find out SQL stmt, causing this.
    all the SQL statement was SELECT ....... FOR UPDATE stmt.
    I was also able to find out locked tables.
    My tuning idea:
    1. I'm thinking to reorganize hot tables as well as their indexes, but by instinct it seems to not give so much value to avoid the huge row lock wait time.
    2. I'm also seeing if I can reduce the number of rows per block, by increasing PCTFREE and diminishing PCTUSED, so the contention will spread over many blocks instead of one heavy block.
    Question
    As SQL stmt related to those locked tables are select ... for update, how could I tune this kind of stmt?
    Does someone have other idea to come up with this row lock contention?
    Tanks for your effort and help

    Taking another look at your suggested function based index, it depends on the data type of the DEV.POS_FOLIO_ID.POS_FOLIO_ID column. If the column is defined as a number, and it is a primary key, there will already be a usable index on that column.
    Yesterday, I wrote this: "Once I understood why or how the sessions were trying to insert duplicate primary key values, I would try to determine why the average number of seconds for the wait event is almost 3 seconds (maybe a timeout)."
    After fixing the formatting of the top 5 wait events (total duration unknown):
    EVENT                        TOTAL_WAITS  TIME_WAITED   AVG_MS PERCENT
    CPU                                         94,623.39             48
    enq: TX - row lock contention     12,531    36,607.28  2921.34    18
    control file parallel write    1,300,731    30,880.79    23.74    16
    log file parallel write        1,510,503    12,640.80     8.37     6
    log file sync                  1,072,553     9,680.07     9.03     512,531 * 3 second time out = 37,593 seconds = 10.44 hours.
    What if the reason for the 3 second average wait time is due to a timeout. I performed a little experiment... I changed a row in a test table and then made a pot of coffee.
    In session 1:
    CREATE TABLE T1 (
      C1 NUMBER(10),
      C2 NUMBER(10),
      PRIMARY KEY (C1));
    INSERT INTO T1
    SELECT
      ROWNUM,
      ROWNUM*10
    FROM
      DUAL
    CONNECT BY
      LEVEL<=1000000;
    COMMIT;I now have a test table with 1,000,000 rows. I start monitoring the changes in the wait events roughly every 60 seconds, and V$SESSION_WAIT and V$LOCK roughly 4 times per second.
    Back in session 1:
    UPDATE
      T1
    SET
      C1=-C1
    WHERE
      C1<=100;I have now modified the first 100 rows that were inserted into the table, time to make the pot of coffee.
    In session 2, I try to insert a row with a primary key value of -10:
    INSERT INTO T1 VALUES (
      -10,
      10);Session 2 hangs.
    If I take the third 60 second snap of the system wide wait events as the zero point, and the 11th snap as the end point. There were 149 waits on ENQ: TX - ROW LOCK CONTENTION, 148 time outs, 446.62 seconds of total time in the wait event, with an average wait time of 2.997450 seconds.
    Rolling down to the session level wait events, SID 208 (my session 2) had 149 waits on ENQ: TX - ROW LOCK CONTENTION, for a total time of 446.61 seconds with an average wait time of 2.997383 seconds. All of the 149 waits and the wait time was in this one session that was locked up for the full duration of this time period because session 1 was making a pot of coffee.
    Rolling down to V$SESSION_WAIT (sampled roughly 4 times per second): At the start of the third time interval, SID 208 has been in the ENQ: TX - ROW LOCK CONTENTION wait event for 39 seconds and is actively waiting trying to execute SQL with a hash value of 1001532423, the wait object is -1, wait file is 0, wait block is 0, wait row is 0, P1 is 1415053316, P2 is 196646, P3 is 4754.
    At the end of the 11th time interval: , SID 208 has been in the ENQ: TX - ROW LOCK CONTENTION wait event for 483 seconds and is actively waiting trying to execute SQL with a hash value of 1001532423, the wait object is -1, wait file is 0, wait block is 0, wait row is 0, P1 is 1415053316, P2 is 196646, P3 is 4754.
    Rolling down to V$LOCK (sampled roughly 4 times per second): I see that SID 214 (session 1) is blocking SID 208 (session 2). SID 214 has a TX lock in mode 6 with ID1 of 196646 and ID2 of 4754. SID 208 is requesting a TX lock in mode 4 with ID1 of 196646 and ID2 of 4754.
    So, it seems that I need a faster coffee pot rather than an additional index on my table. It could be that the above process would have found that the application associated with SID 214 was abandoned or crashed and for some reason the lock was not released for a long period of time, a little less than 10.44 hours in your case.
    Charles Hooper
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.

  • My cursor is blocking table Inserts

    I have a function that copies any new rows from Database_A, Table_A to Database_B, Table_A via a database link. This happens periodically, and there can be around 100k new records accumulated in between these periods.
    I gather the records which need to be copied by filtering on a "copied" field on the table. Within the loop, I update the row's copied field so it won't be copied during the next pass. Here's the function:
    FUNCTION copy_records RETURN INTEGER IS
         pCount INTEGER := 0;       
            CURSOR recs IS
                SELECT * FROM TABLE_A
                WHERE FLG_COPIED = 'N' OR FLG_COPIED IS NULL
                ORDER BY MYKEY;    -- do the oldest first (only important if we commit during iterations)             
        BEGIN
            pCount := 0;
            FOR rec IN recs LOOP
                -- first copy to backup db
                INSERT INTO TABLE_A@BACKUP_DB
                    (FIELD_1, FIELD_2, FIELD_3)
                VALUES
                    (rec.FIELD_1, rec.FIELD_2, rec.FIELD_3);
                -- now flag as copied
                UPDATE TABLE_A
                SET FLG_COPIED = 'Y'
                WHERE MYKEY = rec.MYKEY;
                -- counter sent back for logging
                pCount := pCount + 1;              
            END LOOP;
            RETURN pCount;
        EXCEPTION
            WHEN OTHERS THEN
                RETURN SQLCODE;
        END;
    END;My problem is that it is blocking on the table while this process takes place. I would expect some row-level blocking, which is fine (this table is primarily INSERT only). But I'm not sure why it blocks such that it won't allow me to INSERT into the table. Can anyone explain this to me?
    If I do a COMMIT during each iteration, I can at least perform an Insert, but this seems to slow things down greatly when used across a DBLink, so I'd like to avoid it (plus I wish to make this function an all-or-none transaction). I'm also not sure if the effect of the COMMIT is to make the block row-only, or just minimize the window of the table locking.
    Edited by: xaeryan on Oct 14, 2011 3:51 PM

    xaeryan wrote:
    Solomon Yakobson wrote:
    xaeryan wrote:
    My problem is that it is blocking on the table while this process takes place.No it is not. Based on your code all it is locking are table TABLE_A rows it updates. So if any other session tries to update/delete rows updated by your function such session will wait till you commit/rollback. If any other session tries to update/delete rows NOT updated by your function such session will NOT wait.
    SY.Based on my observations, it is - when I try to perform an INSERT while the function is running, it will not complete. I can see in Toad that there is a row-level lock for my function which is NOT blocking, however there is also a transaction level lock associated with the same session ID which is listed as blocking. There's not much more detail on that one in Toad.
    Is there anything in Oracle that might do something unexpected when your cursor selects the majority of the records? Like optimization for performance that might involve blocking? It seems silly, I know, but I can't seem to understand why this function stops any use of this table.how can we reproduce what you report?

  • RAC에서 Current Block과 CR Block

    RAC 환경에서 시퀀스를 캐싱을 많이 할 경우 Index Leaf Block Contention 감소시켜서 속도를 증가 시킬수 있다고 들었습니다.
    Row가 Insert 될 때마다 가장 큰 Key를 가진 Index Leaf Block이 값이 계속 증가하면서 바뀌므로, 이것은 RAC 환경에서 노드간 Current Block과 CR Block의 높은 전송량을 유발하며 성능 저하 현상을 일으킨다고 하는데요.
    "노드간 Current Block과 CR Block의 높은 전송량을 유발" 한다는 말이 잘 이해가 안가는데 설명 부탁드립니다.

    두가지에 대한 정의
    cr block : Consistent Read block
    하나가 업데이트 중인데 커밋이 되지 않았을 경우 읽기 일관성을 위해
    누군가 select하게 되면 과거의 이미지를 만들어야 하는데 이는 언두세그먼트에가서 과거의 이미지를 찾아서 만들어야 한다. 이는 하나의 버퍼로 사용되지 않고 이 때 생성되는 버퍼블록이 cr block입니다. ( 과거와 현재의 ..버퍼 ) insert, delete는 cr block에 포함되지 않습니다. update만 해당됩니다.
    current block
    DML을 통해서 수정을 위해서 데이터를 읽을 때에 segment의 block을 읽을 때에 이것을 current block이라 한다. select의 경우에는 full scan 할 경우에 segment header를 읽는 것이 current block이 된다.
    누군가 테스트를 한 것인데 너무 좋은 자료라 올립니다.
    출처>
    http://www.insight-tec.com/en/mailmagazine/vol159.html
    X$BH
    Last time, I viewed STATE column of X$BH in a single server and in a single session and examined the following points:
    CR block is not created by SELECT or INSERT queries.
    CR block is created by UPDATE queries.
    There are some cases where CR block is not created by UPDATE queries, though. I will analyze these cases in this issue. DELETE queries operate almost the same as UPDATE queries.
    The following is the testing environment:
    (Environment)
    Linux 2.4.2-2
    Oracle9i EE Release 9.2.0.1.0
    (Table configuration)
    SQL> desc test
    Name Type
    ID1 NUMBER
    ID2 NUMBER
    TEXT VARCHAR2(2000)
    *Grant INDEX (TEST_IDX) to ID1
    Table contains following data.
    ID1 ID2 TEXT
    1 1 insight
    2 2 insight
    3 3 insight
    I executed the following statement last time.
    SQL> update test set id1 = 1 where id2 =2;
    WHERE clause specifies the row ID2. As ID2 is not indexed, full scan will be performed to update.
    The following query specifies ID1 in WHERE clause. As ID1 is indexed, index scan will be performed to update.
    (UPDATE query)
    SQL> update test set id1 = 1 where id1 =2;
    *ID1 is specified in WHERE clause so that index scan
    is performed.
    (Status of database buffer)
    SQL> select
    o.object_name
    ,decode(state,0,'free',1,'xcur',2,'scur',3,'cr', 4,'read',5,'mrec'
    ,6,'irec',7,'write',8,'pi') STATE
    , count(*) BLOCK
    from x$bh b , dba_objects o
    where b.obj = o.data_object_id
    and o.object_name like 'TEST%'
    group by o.object_name, state
    OBJECT_NAME STATE BLOCKS
    TEST xcur 2
    TEST_IDX xcur 1
    CR block is not created, as you see. Regarding index, there is only one block on database buffer. When I previously performed full scan under the condition where there was no data to be updated, CR block was not created.
    Status of database buffer when there is no target data
    to be updated at full scan.
    SQL> update test set id1=3 where id2=5;
    *ID2 is not indexed. There is no such data as ID2=5.
    0 row updated
    OBJECT_NAME STATE DBARFIL DBABLK BA
    TEST xcur 1 70913 54D28000
    TEST xcur 1 70914 54D20000
    CR blocks are created in the following cases.
    CR block is created (in a single session)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    UPDATE SELECT INSERT
    Full scan Yes No --
    Index scan No No --
    In a single session environment, CR blocks are created only by UPDATE query at full scan. Why CR blocks are created under this condition?
    CR block itself is a read consistent block, but I wonder why CR block is created in a single session environment. I assume that CR block is created to create rollback information or to satisfy lock function.
    CR block is not created at index scan because it is possible to identify ROWID of target data from the index. As UPDATE process is performed by each row, CR block is not necessary.
    Lastly, I will examine a mechanism of current block updating, which is quite different from the one of full scan and of index scan.
    The following table indicates the changes in the buffer address of a current block at index scan.
    UPDATE at index scan:
    [Before UPDATE]
    OBJECT_NAME STATE DBABLK BA
    TEST xcur 18716 54D0E000 <-target block
    TEST_IDX xcur 18724 54D04000
    [After UPDATE]
    OBJECT_NAME STATE DBABLK BA
    TEST xcur 18716 54D0E000 <-target block
    TEST_IDX xcur 18724 54D04000 *No changes
    I don't see any changes in the buffer address. This means that the data in the current block is updated directly.
    The following table indicates the changes in the buffer address of an XCUR block at full scan.
    UPDATE at full scan:
    [Before UPDATE]
    OBJECT_NAME STATE DBABLK BA
    TEST xcur 18717 54C3A000 <-target block
    [After UPDATE]
    OBJECT_NAME STATE DBABLK BA
    TEST xcur 18717 551F2000 <-target block
    TEST cr 18717 54C3A000 *BA is changed
    |
    BA of current block before being updated
    I see changes in the buffer address. In addition, the current block is changed to CR block after updating. The process is performed as follows:
    1. A current block (XCUR) in 54C3A000 is copied to 551F2000.
    2. The current block is changed to CR block.
    3. Update process is performed to XCUR.

  • Webi Alternate Row Colour

    Hi experts,
    I have a webi report which colour lines must have alternate colours. I customized that on the table proporties, in webi, but it's not working... is there some kind of trick to activate alternate row colours?
    Thanks you.
    Cheers!
    Inê

    If you change "Alternate Row/Column colors"property of block then it should applied for that particular block only.
    If you want other colors for other blocks then do the same steps.
    Frequency is by default 2. Which tells us the applied color should show alternatively, and 3,4, etc..., follows like that.
    FYI if you change property of a block and insert new objects then you can't see colors again for the same block.
    Manually you need to do it again to appear.
    Eg:
    if i individually insert say 5 rows to block and drag unique report variables to each row, the alternative colours are not coming up.
    How to acieve this?
    This is the problem, the alternate row fucntion works for a row which have more than one value. In your case you have different variables for each row then you have to do it manually. Remember that if you have more than one value for any variable the second row of that variable will be 255,255,255. By default first row gets the alternate color. You get the same alternate color for all 5 rows because it's first row of all the 5 variables.
    One trick is give alternate color as 239,239,239 for first row and 255,255,255 for second and so on.
    Hope you got me.
    Gracias...!!

  • ROW CHAINING 과 ROW MIGRATION

    제품 : ORACLE SERVER
    작성날짜 : 2002-04-10
    ROW CHAINING 과 ROW MIGRATION
    =============================
    Purpose
    Row chaining 과 Row Migration에 대해 이해하고 줄이는 방법을 확인한다.
    Problem Description
    Row chaining 은 단일 테이블 상의 특정 Row의 길이가 증가해서 더 이상
    동일한 데이타 블럭에 들어갈수 없을때 발생한다. 이때 RDBMS는 또
    다른 데이타 블럭을 찾는다. 이 데이타 블럭은 원래 블럭과 연결되어
    있다. 이 경우 데이타 블럭이 하나의 I/O 작업과 동일한 양을 수행하기
    위해 두 개의 I/O를 사용해야 한다는 점이다. 이 상황은 여러분의
    데이터베이스 성능을 빠르게 약화시킬 것이다.
    Data Block상의 하나의 Row는 길이가 증가하면서 갱신되며, Block의
    Freespace가 0%일 때, Row는 Migration을 일으킨다. 물론, 전체 Row가
    들어갈 만한 크기의 새로운 Block에 Row에 대한 Data가 Migration된다.
    이경우 ORACLE은 Row에 대한 정보를 가져오기 위해 하나 이상의 Data
    Block을 반드시 읽어야 하므로 I/O Perfmance는 감소한다.
    Solution Description
    1. Row chaining과 migration 확인
    1) run ?/rdbms/admin/utlchain.sql
    2) ANALYZE Command를 통해 Chaining과 Migrating의 횟수를 조사한다.
    analyze table emp list chained rows;
    2. 해결과정
    1) 데이터 열을 CHAINED_ROWS 테이블의 ROWID를 사용하여 원래
    테이블과 같은 행 구조를 가진 중간 테이블(intermediate table)로
    이동시킨다.
    2) 옮겨진 데이터 열을 CHAINED_ROWS 테이블의 ROWID를 사용하여 삭제 한다.
    3) 중간 테이블로부터 열들을 다시 원래 테이블로 삽입한다.
    4) 중간 테이블을 버린다.
    5) CHAINED_ROWS 테이블의 레코드를 삭제한다.
    이 과정이 수행되고 나면 analyze 명령은 다시 수행되야 한다. row가
    다시 CHAINED_ROWS 테이블에 쌓이면 어떤 블럭에도 전체row 가 들어갈
    충분한 공간이 없기 때문이다. 이것은 한 데이타 블럭의 한 row 가 너무
    길어서 이거나 테이블의 PCTFREE 가 적절하지 못하기 때문이다. 전자의
    경우는 chaine 현상이 일어날수 밖에 없고 후자의 경우 다음과 같이
    PCTFREE 를 수정한다.
    3. PCTFREE 값을 조정 하여야 하는 경우
    1) 테이블에 대한 더 나은 퍼센트 프리 요소(percent free factor)를 결정한다.
    2) 전체 테이블을 그 모든 의존관계(예를 들면, 인덱스, 그렌트(grants),
    제약조건들 등)와 함께 export한다.
    3) 원래 테이블을 버린다.
    4) 새로운 사양으로 다시 만든다.
    5) 테이블을 import한다.

    Hi,
    SQL> SELECT name, value FROM v$sysstat WHERE name = 'table fetch continued row';
    NAME VALUE
    table fetch continued row 163
    Is this mean 163 tables contains chained rows?
    Please suggest me.
    Thanks
    KSG

Maybe you are looking for