Fragmented tables or indexes

Dear all,
I am using the following command to find out the fragmented tables or indexes, which ofcource returns names of the tables and indexes which are fragmented.
select * from dba_segments where extents > 10 and owner like '%DB%'
output is 43 rows
Next I just rebuild certian indexes and still when I query the above sql statement I see the index which was rebuild is still present which means that the extents are stiil greater than 10.
I also tried by first dropping the index and creating it again. Still the index is fragmented.
What can I do.
Regards
SL

1) The fact that an object has more than 10 extents is completely unrelated to whether it is fragmented or not.
2) Since you haven't specified the Oracle version or the type of tablespace, assuming you've got a recent version of Oracle and are using locally managed tablespaces, the number of extents allocated to an object is pretty much irrelevent, particularly if you've got automatic extent allocation.
3) If you are on a recent version of Oracle using LMT's, it is essentially impossible for objects to be fragmented for most any reasonable definition of "fragmented".
Justin

Similar Messages

  • Fragmentation in tables and indexes with 9.2.0.5

    Hi guys ,
    I need of query to identified fragmentation in tables and indexes using Oracle 9i,someone could help me send that's querys
    tks
    spaulonci

    Fragmentation by itself at the tablespace level doesn't mean any thing from the performance point of view, only from the storage capacity perspective, and this just in case fragments are not necessarily the same size as in the case of dictionary manged tablespaces.
    You may be concerned about block density, which actually could lead to performance degradation. I suggest you to consider using coalesce instead of rebuilding in the case of indexes, and in the case of tables you should perform a segment reorganization. In the case of 9iR2 the coalesce command for table segments is not available so you will have to perform another segment reorganization strategy. If there are meaningful differences with the high water mark, average number of rows per block and chained rows then you will notice performance differences.
    I suggest you to take metrics for block usage prior to perform an index coalesce operation, as well as prior to perform a data segment reorganization to assess if the reorganization effort is useful.
    ~ Madrid
    http://hrivera99.blogspot.com/

  • Question on fragmentation and ALTER INDEX REBUILD/REORGANIZE not effecting it

    The problem I ran into was troubleshooting a sporadically slow singleton lookup on a Clustered Index in a table with about 8 million rows, which is a separate issue I may need to submit for help. That aside, during that troubleshooting I noticed fragmentation
    on the Unique Clustered Index (it's a VARCHAR(20)), and then noticed the fragmentation in other indexes on this table. See sys.dm_db_index_physical_stats and DBCC SHOWCONTIG results below.
    SELECT
     substring(OBJECT_NAME(i.object_id),1,30) AS TableName,
     substring(i.name,1,40) AS TableIndexName,
     i.index_id, phystat.index_level,
     phystat.avg_fragmentation_in_percent 
    FROM
     sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL, 'DETAILED') phystat inner JOIN sys.indexes i 
    ON i.object_id = phystat.object_id 
    AND i.index_id = phystat.index_id WHERE
    OBJECT_NAME(i.object_id) = 'CONSUMERS'
    TableName                      TableIndexName                           index_id    index_level avg_fragmentation_in_percent
    CONSUMERS                      UNI2K_CONSUMERS                          1           0      
        0.154827346202469
    CONSUMERS                      UNI2K_CONSUMERS                          1           1      
        35.2941176470588
    CONSUMERS                      UNI2K_CONSUMERS                          1           2      
        0
    CONSUMERS                      PK__CONSUMER__7F6B0B8B286302EC           2           0           0.336078590685822
    CONSUMERS                      PK__CONSUMER__7F6B0B8B286302EC           2           1           100
    CONSUMERS                      PK__CONSUMER__7F6B0B8B286302EC           2           2           0
    CONSUMERS                      UNI1K_CONSUMERS                          3           0      
        0.156451316031658
    CONSUMERS                      UNI1K_CONSUMERS                          3           1      
        61.1510791366906
    CONSUMERS                      UNI1K_CONSUMERS                          3           2      
        0
    CONSUMERS                      IDX1_CONSUMERS                           4           0      
        0.215271389144434
    CONSUMERS                      IDX1_CONSUMERS                           4           1      
        40
    CONSUMERS                      IDX1_CONSUMERS                           4           2      
        100
    CONSUMERS                      IDX1_CONSUMERS                           4           3      
        0
    CONSUMERS                      IDX2_CONSUMERS                           5           0      
        0.222614710968834
    CONSUMERS                      IDX2_CONSUMERS                           5           1      
        38.6281588447653
    CONSUMERS                      IDX2_CONSUMERS                           5           2      
        75
    CONSUMERS                      IDX2_CONSUMERS                           5           3      
        0
    (17 row(s) affected)
    DBCC SHOWCONTIG('CONSUMERS') WITH ALL_INDEXES
    DBCC SHOWCONTIG scanning 'CONSUMERS' table...
    Table: 'CONSUMERS' (645577338); index ID: 1, database ID: 5
    TABLE level scan performed.
    - Pages Scanned................................: 70401
    - Extents Scanned..............................: 8827
    - Extent Switches..............................: 8843
    - Avg. Pages per Extent........................: 8.0
    - Scan Density [Best Count:Actual Count].......: 99.51% [8801:8844]
    - Logical Scan Fragmentation ..................: 0.15%
    - Extent Scan Fragmentation ...................: 23.76%
    - Avg. Bytes Free per Page.....................: 47.2
    - Avg. Page Density (full).....................: 99.42%
    DBCC SHOWCONTIG scanning 'CONSUMERS' table...
    Table: 'CONSUMERS' (645577338); index ID: 2, database ID: 5
    LEAF level scan performed.
    - Pages Scanned................................: 27077
    - Extents Scanned..............................: 3402
    - Extent Switches..............................: 3402
    - Avg. Pages per Extent........................: 8.0
    - Scan Density [Best Count:Actual Count].......: 99.47% [3385:3403]
    - Logical Scan Fragmentation ..................: 0.34%
    - Extent Scan Fragmentation ...................: 11.88%
    - Avg. Bytes Free per Page.....................: 24.1
    - Avg. Page Density (full).....................: 99.70%
    DBCC SHOWCONTIG scanning 'CONSUMERS' table...
    Table: 'CONSUMERS' (645577338); index ID: 3, database ID: 5
    LEAF level scan performed.
    - Pages Scanned................................: 54330
    - Extents Scanned..............................: 6803
    - Extent Switches..............................: 6805
    - Avg. Pages per Extent........................: 8.0
    - Scan Density [Best Count:Actual Count].......: 99.79% [6792:6806]
    - Logical Scan Fragmentation ..................: 0.16%
    - Extent Scan Fragmentation ...................: 7.03%
    - Avg. Bytes Free per Page.....................: 50.3
    - Avg. Page Density (full).....................: 99.38%
    DBCC SHOWCONTIG scanning 'CONSUMERS' table...
    Table: 'CONSUMERS' (645577338); index ID: 4, database ID: 5
    LEAF level scan performed.
    - Pages Scanned................................: 54350
    - Extents Scanned..............................: 6808
    - Extent Switches..............................: 6837
    - Avg. Pages per Extent........................: 8.0
    - Scan Density [Best Count:Actual Count].......: 99.36% [6794:6838]
    - Logical Scan Fragmentation ..................: 0.22%
    - Extent Scan Fragmentation ...................: 7.17%
    - Avg. Bytes Free per Page.....................: 53.2
    - Avg. Page Density (full).....................: 99.34%
    DBCC SHOWCONTIG scanning 'CONSUMERS' table...
    Table: 'CONSUMERS' (645577338); index ID: 5, database ID: 5
    LEAF level scan performed.
    - Pages Scanned................................: 54354
    - Extents Scanned..............................: 6804
    - Extent Switches..............................: 6846
    - Avg. Pages per Extent........................: 8.0
    - Scan Density [Best Count:Actual Count].......: 99.24% [6795:6847]
    - Logical Scan Fragmentation ..................: 0.22%
    - Extent Scan Fragmentation ...................: 7.13%
    - Avg. Bytes Free per Page.....................: 53.8
    - Avg. Page Density (full).....................: 99.33%
    DBCC execution completed. If DBCC printed error messages, contact your system administrator.
    This fragmentation I found shocking because I reorg nightly and have a weekly rebuild task running that I set up through the Maintenance Plan wizard (which I've verified has been running). So I attempted to reorg these manually (especially index ID: 1)
    and to my shock the fragmentation % did not change at all. I then took the SQL provided by the Maintenance Plan for rebuilding the indexes and found that after running that it didn't change the fragementation % at all either (commands run shown below).
    ALTER INDEX [IDX1_CONSUMERS] ON [dbo].[CONSUMERS] REBUILD PARTITION = ALL WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, ONLINE = ON, SORT_IN_TEMPDB = ON )
    GO
    ALTER INDEX [IDX2_CONSUMERS] ON [dbo].[CONSUMERS] REBUILD PARTITION = ALL WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, ONLINE = ON, SORT_IN_TEMPDB = ON )
    GO
    ALTER INDEX [UNI1K_CONSUMERS] ON [dbo].[CONSUMERS] REBUILD PARTITION = ALL WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, IGNORE_DUP_KEY  = OFF, ONLINE = ON, SORT_IN_TEMPDB
    = ON )
    GO
    ALTER INDEX [UNI2K_CONSUMERS] ON [dbo].[CONSUMERS] REBUILD PARTITION = ALL WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, IGNORE_DUP_KEY  = OFF, ONLINE = ON, SORT_IN_TEMPDB
    = ON )
    GO
    Fragmentation did not change until I performed a "CREATE ... DROP_EXISTING = ON" on the 4 non PK indexes and a manual rebuild of Primary Key offline not specifying any other parameters, which all seemed completely overkill to ensure the defragmentation
    actually got done. Final sys.dm_db_index_physical_stats and DBCC SHOWCONTIG results below.
    SELECT
     substring(OBJECT_NAME(i.object_id),1,30) AS TableName,
     substring(i.name,1,40) AS TableIndexName,
     i.index_id, phystat.index_level,
     phystat.avg_fragmentation_in_percent 
    FROM
     sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL, 'DETAILED') phystat inner JOIN sys.indexes i 
    ON i.object_id = phystat.object_id 
    AND i.index_id = phystat.index_id WHERE
    OBJECT_NAME(i.object_id) = 'CONSUMERS'
    TableName                      TableIndexName                           index_id    index_level avg_fragmentation_in_percent
    CONSUMERS                      UNI2K_CONSUMERS                          1           0      
        0.0213458562356583
    CONSUMERS                      UNI2K_CONSUMERS                          1           1      
        11.2426035502959
    CONSUMERS                      UNI2K_CONSUMERS                          1           2      
        0
    CONSUMERS                      PK__CONSUMER__7F6B0B8B286302EC           2           0           0.0460971112476951
    CONSUMERS                      PK__CONSUMER__7F6B0B8B286302EC           2           1           14.2857142857143
    CONSUMERS                      PK__CONSUMER__7F6B0B8B286302EC           2           2           0
    CONSUMERS                      UNI1K_CONSUMERS                          3           0      
        0.0225314031431307
    CONSUMERS                      UNI1K_CONSUMERS                          3           1      
        10.6194690265487
    CONSUMERS                      UNI1K_CONSUMERS                          3           2      
        0
    CONSUMERS                      IDX1_CONSUMERS                           4           0      
        0.0225318262045139
    CONSUMERS                      IDX1_CONSUMERS                           4           1      
        10.7296137339056
    CONSUMERS                      IDX1_CONSUMERS                           4           2      
        0
    CONSUMERS                      IDX1_CONSUMERS                           4           3      
        0
    CONSUMERS                      IDX2_CONSUMERS                           5           0      
        0.0225314031431307
    CONSUMERS                      IDX2_CONSUMERS                           5           1      
        12.0171673819742
    CONSUMERS                      IDX2_CONSUMERS                           5           2      
        0
    CONSUMERS                      IDX2_CONSUMERS                           5           3      
        0
    (17 row(s) affected)
    DBCC SHOWCONTIG('CONSUMERS') WITH ALL_INDEXES
    DBCC SHOWCONTIG scanning 'CONSUMERS' table...
    Table: 'CONSUMERS' (645577338); index ID: 1, database ID: 5
    TABLE level scan performed.
    - Pages Scanned................................: 56217
    - Extents Scanned..............................: 7029
    - Extent Switches..............................: 7028
    - Avg. Pages per Extent........................: 8.0
    - Scan Density [Best Count:Actual Count].......: 99.99% [7028:7029]
    - Logical Scan Fragmentation ..................: 0.02%
    - Extent Scan Fragmentation ...................: 0.44%
    - Avg. Bytes Free per Page.....................: 32.4
    - Avg. Page Density (full).....................: 99.60%
    DBCC SHOWCONTIG scanning 'CONSUMERS' table...
    Table: 'CONSUMERS' (645577338); index ID: 2, database ID: 5
    LEAF level scan performed.
    - Pages Scanned................................: 26032
    - Extents Scanned..............................: 3256
    - Extent Switches..............................: 3255
    - Avg. Pages per Extent........................: 8.0
    - Scan Density [Best Count:Actual Count].......: 99.94% [3254:3256]
    - Logical Scan Fragmentation ..................: 0.05%
    - Extent Scan Fragmentation ...................: 0.31%
    - Avg. Bytes Free per Page.....................: 11.1
    - Avg. Page Density (full).....................: 99.86%
    DBCC SHOWCONTIG scanning 'CONSUMERS' table...
    Table: 'CONSUMERS' (645577338); index ID: 3, database ID: 5
    LEAF level scan performed.
    - Pages Scanned................................: 53259
    - Extents Scanned..............................: 6659
    - Extent Switches..............................: 6658
    - Avg. Pages per Extent........................: 8.0
    - Scan Density [Best Count:Actual Count].......: 99.98% [6658:6659]
    - Logical Scan Fragmentation ..................: 0.02%
    - Extent Scan Fragmentation ...................: 0.35%
    - Avg. Bytes Free per Page.....................: 40.5
    - Avg. Page Density (full).....................: 99.50%
    DBCC SHOWCONTIG scanning 'CONSUMERS' table...
    Table: 'CONSUMERS' (645577338); index ID: 4, database ID: 5
    LEAF level scan performed.
    - Pages Scanned................................: 53258
    - Extents Scanned..............................: 6659
    - Extent Switches..............................: 6658
    - Avg. Pages per Extent........................: 8.0
    - Scan Density [Best Count:Actual Count].......: 99.98% [6658:6659]
    - Logical Scan Fragmentation ..................: 0.02%
    - Extent Scan Fragmentation ...................: 0.53%
    - Avg. Bytes Free per Page.....................: 40.3
    - Avg. Page Density (full).....................: 99.50%
    DBCC SHOWCONTIG scanning 'CONSUMERS' table...
    Table: 'CONSUMERS' (645577338); index ID: 5, database ID: 5
    LEAF level scan performed.
    - Pages Scanned................................: 53259
    - Extents Scanned..............................: 6659
    - Extent Switches..............................: 6658
    - Avg. Pages per Extent........................: 8.0
    - Scan Density [Best Count:Actual Count].......: 99.98% [6658:6659]
    - Logical Scan Fragmentation ..................: 0.02%
    - Extent Scan Fragmentation ...................: 0.59%
    - Avg. Bytes Free per Page.....................: 40.5
    - Avg. Page Density (full).....................: 99.50%
    DBCC execution completed. If DBCC printed error messages, contact your system administrator.
    For the record, here's the version I'm running:
    select @@VERSION
    Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64) 
     Jun 17 2011 00:54:03 
     Copyright (c) Microsoft Corporation
     Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
    In summary my question is - why didn't ALTER INDEX ... REBUILD/REORGANIZE modify the index_level 1 fragmentation as reported by sys.dm_db_index_physical_stats, nor would it correct the Extent Scan Fragmentation as reported by DBCC SHOWCONTIG?

    Hi Brian.cs ,
    SQL Server will not rebuild indexes that are not large enough. Could you please have a look a the
    fragment_count which is  one of the fields in the
    sys.dm_db_index_physical_stats view to check whether it is low or not ?
    Best Regards,
    Peja
    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Peja, here's the information you requested, and of course this was after I dropped/recreated because rebuild didn't seem to actually address the fragmentation - the index I was most concerned about at index_level = 0 showed a fragment_count = 8922. FYI this
    table has over 8 million rows. And apologies for the delayed response, was on vacation over the near year.
    SELECT
     substring(OBJECT_NAME(i.object_id),1,30) AS TableName,
     substring(i.name,1,40) AS TableIndexName,
     i.index_id, phystat.index_level,
     phystat.avg_fragmentation_in_percent, fragment_count 
    FROM
     sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL, 'DETAILED') phystat inner JOIN sys.indexes i 
    ON i.object_id = phystat.object_id 
    AND i.index_id = phystat.index_id WHERE
    OBJECT_NAME(i.object_id) = 'CONSUMERS'
    TableName                      TableIndexName                           index_id    index_level avg_fragmentation_in_percent
    fragment_count
    CONSUMERS                      UNI2K_CONSUMERS                          1           0        
      0.259780818806428            8922
    CONSUMERS                      UNI2K_CONSUMERS                          1           1        
      39.4190871369295             86
    CONSUMERS                      UNI2K_CONSUMERS                          1           2        
      0                            1
    CONSUMERS                      PK__CONSUMER__7F6B0B8B286302EC           2           0           0.240887634434766    
           5182
    CONSUMERS                      PK__CONSUMER__7F6B0B8B286302EC           2           1           80.3738317757009    
            84
    CONSUMERS                      PK__CONSUMER__7F6B0B8B286302EC           2           2           0          
                     1
    CONSUMERS                      UNI1K_CONSUMERS                          3           0        
      0.0661472879611936           8532
    CONSUMERS                      UNI1K_CONSUMERS                          3           1        
      53.4883720930233             86
    CONSUMERS                      UNI1K_CONSUMERS                          3           2        
      0                            1
    CONSUMERS                      IDX1_CONSUMERS                           4           0        
      0.192426334498663            8598
    CONSUMERS                      IDX1_CONSUMERS                           4           1        
      31.5315315315315             95
    CONSUMERS                      IDX1_CONSUMERS                           4           2        
      85.7142857142857             7
    CONSUMERS                      IDX1_CONSUMERS                           4           3        
      0                            1
    CONSUMERS                      IDX2_CONSUMERS                           5           0        
      0.189494094835184            8613
    CONSUMERS                      IDX2_CONSUMERS                           5           1        
      31.8840579710145             97
    CONSUMERS                      IDX2_CONSUMERS                           5           2        
      85.7142857142857             7
    CONSUMERS                      IDX2_CONSUMERS                           5           3        
      0                            1

  • Fragmented tables

    Hi,
    We are using following query to check fragmented tables. Is it correct?
    Oracle 10.2.0.4 (64bit) and OS AIX 6.1 (64bit).
    select owner,table_name,blocks,num_rows,avg_row_len,round(((blocks*16/1024)),2)||'MB' "TOTAL_SIZE",
    round((num_rows*avg_row_len/1024/1024),2)||'Mb' "ACTUAL_SIZE",
    round(((blocks*16/1024)-(num_rows*avg_row_len/1024/1024)),2) ||'MB' "FRAGMENTED_SPACE"
    from all_tables WHERE Owner IN ('USERNAME');
    I am using alter table move with parallel (due to huge size of data ) option  and rebuild index for De-fragmentation. Is its OK?

    Hemant K Chitale,
    Your multiplier of 16 is correct if the block size of the tablespace containing that table is 16KB.
    DB block size is 16 kb.
    What amount / proportion of "FRAGMENTED_SPACE" would you consider as qualifying a table for a rebuild ?  Why ?  What if you insert more rows into the table ?
    Following is the ouptput of query I have posted in my first post. These are partitions tables
    TABLE_NAME
    BLOCKS
    NUM_ROWS
    AVG_ROW_LEN
    TOTAL_SIZE
    ACTUAL_SIZE
    FRAGMENTED_SPACE
    CRBT_DLY_SU
    3426310
    1134350200
    104
    53536.09MB
    112507.27Mb
    -58971.17MB
    PST_VOICE_SU
    5619763
    373006533
    376
    87808.8MB
    133753.26Mb
    -45944.46MB
    PRE_WEB_SU
    2545843
    627771700
    125
    39778.8MB
    74836.22Mb
    -35057.42MB
    After the end of month I move partitions of tables into new created tablespace (alter table move partition with parallel option) , then rebuild index with parallel option. Now I am confused that how tables are fragmented with huge amount of data.
    Are the tables in tablespaces with LMT and Segment Space Management AUTO ?  OR do you need to consider PCTUSED (which is ignored with Segment Space Management AUTO) ?   Are the tables set to the default PCTFREE of 10 ?
    Yes tablespaces are LMT and Segment Space Management is Auto.

  • Create fragmented table data

    Hi guys,
    I would like to create a table and populate it with lot of data to make some tests, but I also would like to have a high fragmented table to simulate this.
    is there any script that create this environment?
    thanks

    Hi ,
    Please try this ,Not tested.
    1-Create table without any index.
    2-insert data.
    3-create index
    4-update some data
    5-drop Index.
    6-create index
    7-insert another data
    check now select * from dba_segments where extents > 10;
    Regards
    faheem latif

  • DB02 view is empty on Table and Index analyses  DB2 9.7 after system copy

    Dear All,
                 I did the Quality refresh by System copy export/import method. ECC6 on HP-UX DB29.7.
    After Import Runstats status n Db02 for Table and Index analysis was empty and all value showing '-1'. Eventhough
    a) all standard backgrnd job scheduled in sm36
    b) Automatic runstats are enabled in db2 parameters
    c) Reorgchk all scheduled periodically from db13 and already ran twice.
    4) 'reorgchk update statistics on table all' was also ran on db2 level.
    but Run stats staus in db02 was not getting updated. Its empty.
    Please suggest.
    Regards
    Vinay

    Hi Deepak,
    Yes, that is possible (but only offline backup). But for the new features like reclaimable tablespace (to lower the high watermark)
    it's better to export/import with systemcopy.
    Also with systemcopy you can use index compression.
    After backup and restore you can have also reclaimable tablespace, but you have to create new tablespaces
    and then work with db6conv and online table move to move one tablespace online to the new one.
    Best regards,
    Joachim

  • How to get return type as Table of Index by BINAR from Procedure using JDBC

    Hi,
    We have stored procedure which takes Varchar as input and rerurn muiltiple recored of type Table of index by BINARY
    We created the procedure with in a package, its header part like below:
    CREATE OR REPLACE PACKAGE emp_pkid_pkg
    AS
    TYPE r_emp IS RECORD ( employe_profile_id NUMBER
    , client_profile_id VARCHAR2(240)
    , email VARCHAR2(240)
    , terms_acp VARCHAR2(1)
    TYPE tp_emp_profile IS TABLE OF r_emp INDEX BY BINARY_INTEGER;
    PROCEDURE er_employe_prov_profile ( e_inxid employe_provision_instance.inxid%TYPE
    , e_emp_recs OUT tp_emp_profile
    END emp_pkid_pkg;
    This procedure has body part, wich has origial business logic like below.
    CREATE OR REPLACE PACKAGE BODY emp_pkid_pkg
    AS
    PROCEDURE pr_customer_prov_profile ( e_inxid employe_provision_instance.inxid%TYPE
    , e_emp_recs OUT tp_customer_provision_profile
    IS
    CURSOR c_emp_prov_instance ( c_guid employe_provision_instance.guid%TYPE )
    etc ...
    END emp_pkid_pkg;
    We could execute the below script from oracle client tool and get the response.
    DECLARE
    e_cust emp_pkid_pkg.tp_emp_profile;
    BEGIN
    emp_pkid_pkg.er_employe_prov_profile ( 'ef45t6543y98'
    , e_cust
    FOR i in e_cust.FIRST..e_cust.LAST LOOP
    DBMS_OUTPUT.PUT_LINE ( e_cust(i).employe_profile_id
    ||'#'|| e_cust(i).client_customer_id
    ||'#'|| e_cust(i).email
    ||'#'|| e_cust(i).term_acp);
    END LOOP;
    END;
    We have requirement to get the results from procedure usind JDBC callable statement call.
    We have tried to call the procedure via JDBC callable statement but it didn't work.
    We have constructed it like the following. It was throwing error "java.sql.SQLException: invalid column type: emp_pkid_pkg.tp_emp_profile
    CallableStatement cs2 = con.prepareCall("{call emp_pkid_pkg.er_employe_prov_profile(?,?)}");
    cs2.registerOutParameter(2, OracleTypes.CURSOR, emp_pkid_pkg.tp_emp_profile);
    cs2.setString(1,empId);
    Not sure whether I am doing the logic correctly. But i tryed with diff type. Still am getting same error like above.
    Please point me to the correct approach.
    Thanks
    Edited by: 921689 on 18-Mar-2012 17:20

    >
    We have requirement to get the results from procedure usind JDBC callable statement call.
    >
    Can't be done - the reason has nothing to do with JDBC so you are in the wrong forum.
    Repost in the PL/SQL forum and I can give you an example of what you have to do
    PL/SQL
    First the TYPEs you defined are PL/SQL types so can't be referenced outside PL/SQL; you need to define SQL types.
    Second you will need to use a procedure that returns a REF CURSOR or is a PIPELINED procedure. Since your procedure doesn't fall into either category you can't use it with JDBC to do what you want.
    If your query was a PIPELINED function then you could simply query it like it was a table. I have a PIPELINED function name 'get_emp' so this works.
    select * from table(get_emp(30));Post in the PL/SQL forum and I can give you the code for the procedure. I'm not going to clutter up this forum with inappropriate material.

  • Only a few of rows in the table are indexed without an error message

    When I executed the sql command:"create index ... indextype is ctxsys.context...",
    only a few of rows were indexed.
    The number of rows returned from query clause "select * from table where contains(field,'keyword') " is much less than that returned from "select * from table where field like '%keyword%'",though its speed is very fast.
    I checked the I table,the indexed words was few.The create index command ends in 3 mins on a table with more than 2 millions rows.
    The language setting is Chinese.
    The documentations about the intermedia text services on chinese languages is difficult to find.Can someone give me some or help me to solve this problem?
    Thanks in advance!

    I get the same thing in Mac OSX 10.7.3.  When I control-click on a preview and select 'open in camera raw' I get a dialog that says it's not enabled and requires a qualifying app to have been launched first:
    I've launched bridge and photoshop and if I open an app from the mini-bridge within photoshop, camera raw is launched.

  • Report to find all table and index sizes

    Hi all,
    Good day..
    Is there any report.sql or so to find out the sizes of all the tables and indexes in a database.
    thanks,
    baskar.l

    1.To get table size
    What will be the table size if?
    <or>
    break on report
    set line 200
    COMPUTE SUM LABEL "Total Reclaimable Space" OF "KB Free Space" ON REPORT
    column "Table Size" Format a20
    column "Actual Data Size" Format a20
    column "KB Free Space" Format "9,99,999.99"
    select table_name,
    round((blocks*8),2)||'kb' "Table size",
    round((num_rows*avg_row_len/1024),2)||'kb' "Actual Data size",
    pct_free,
    round((blocks*8),2) - (round((blocks*8),2)*pct_free/100) - (round((num_rows*avg_row_len/1024),2)) "KB Free Space"
    from user_tables
    where round((blocks*8),2) - (round((blocks*8),2)*pct_free/100) - (round((num_rows*avg_row_len/1024),2)) > 0
    order by round((blocks*8),2) - (round((blocks*8),2)*pct_free/100) - (round((num_rows*avg_row_len/1024),2)) desc
    2.To get index size
    How to size the Index
    Hth
    Girish Sharma

  • Missing Tables and Indexes greyed out in DBACOCKPIT

    Hi All,
    I use Solution Manager 7.01 with MS SQL Server 2008 DB.
    I want to monitor with DBACOCKPIT a MS SQL Server 2005 DataBase of a SAP BPC 5.1.
    I connected the DB but in DBACOCKPIT some functionality are greyed out.
    I want to use in Diagnostics section the "MISSING TABLES AND INDEXES" function but this command is greyed out.
    Is it possible to use this function?
    Please, help me!
    Regards,
    Alessandro

    Hi,
    Gray color means that screen is disabled for any reason (authorization, SQL Server release, monitoring remote, etc).
    I believe, those items cannot be monitored unless these limitations are sorted out.
    Please refer to the Document "The SAP DBA Cockpit for Microsoft SQL Server" in SDN.
    You can get the status about the restriction in the bottom of dbacockpit screen.
    Thanks,
    Jagan
    Edited by: jagadheeshan govindasamy on Sep 16, 2009 1:03 PM

  • Missing Tables and Indexes in 3.5

    Hi,
    when i am executing Tcode DB02 then under Missing Tables and Indexes i find 35 Indexes as not created.
    can anybody tell me what does that signify. is this a issue if so how to fix it.
    Indexes not created
    ADCP-I04
    ADCP-I03
    ADCP-I02
    ADCP-I01
    ADCPS-I01
    ADCPS-I02
    ADCPS-I03
    ADCPS-I04
    ADRC-I14
    ADRC-I11
    ADRC-I05
    ADRC-I02
    ADRC-G
    ADRP-I01
    ADRP-I02
    ADRP-I03
    ADRP-I04
    ADRP-I07
    ADRP-I08
    ADRP-I09
    ADRV-I01
    BUT000-PER
    CDHDR-001
    CDHDR-002
    CRMD_ORDERADM_I-PKI
    CRMD_ORDERADM_I-DES
    ISSUE_RELATION-001
    NAST-ADQ
    RMPS_T_RESUB-RAG
    RMPS_T_RESUB-RCU
    SSPICSPRHD-S02
    SSPICSTRHEAD-S01
    SSPICSTRPL-FLD
    STXH-TDN
    SWBRULECOM-RSY
    Rakesh

    Hi Rakesh,
    First thing this is not an issue but an information that says that these indexes are not be created in the System.
    This option Indexes not created is an SAP table maintained from Dev to Prod just to indicate that these indexes cannot be created.
    That's the reason why u have a green mark beside them and this will make clear for you that this is not an issue.
    Hope it helps!!!!
    Thanks & Regards,
    Neelesh Jain.

  • DB02 = Missing Tables and Indexes = Unknown objects in ABAP Dictionary = DB views

    Hi SAP Gurus,
    on our SAP NetWeaver 7.x BW (based on AIX/Oracle) I find via transaction DB02 (path = Diagnostics => Missing Tables and Indexes) under "Unknown objects in ABAP Dictionary" under DB views a BW object /BI0/.....
    When I make a double click on the object, I am getting the popup window "Display not possible for this object":
    How can I identify the object and clarify with the BW application expert, if needed, how to resolve this object?
    I searched already via RSA1 for the object, but I wasn't able to find anything so far ...
    Thanks for your help and ideas.
    Best regards
    Carlos

    Hello Carlos
    The database view in question is a temporary database object created during a query execution.
    Please read this SAP note 449891 - Temporary database objects in BW 3.x to understand what that view is all about and impact if those views are removed.
    The SAP notes 449891 and 1139396 suggests to run the report SAP_DROP_TMPTABLES to drop these temporary objects. Whether the objects are still required or not is a question to be put across to the BW team. If the temporary objects are removed when they are used by a query, then the query will fail.
    Have a nice day
    RB

  • Import dumpfile with seperate tablespaces for table and index

    Hi,
    We have a schema for which the its tables are stored in seperate tablespace and indexes are stored in different tablespace. Now we have take full schema export. Now we want to import it on another schema. Now I want to know if the we have difference in the tablespace name we use REMAP_TABLESPACE clause of the impdp command but what about the seperate tablespace for table and indexes. How would Oracle handle this.
    Regards,
    Abbasi

    Hi,
    I hope you created the same tablespace structure on the target side if not so remap_tablespace option you have to use for specifying different tablespaces.Oracle will take care of putting data and index.Any how if a index is moved from one tablespace to other you have to rebuild them,once you rebuild them than only stattistics are gathered otherwise you
    might face some performance issue.
    Better option is to keep same tablespace structures in source and target environment.
    Best regards,
    Rafi.
    http://rafioracledba.blogspot.com
    Edited by: Rafi (Oracle DBA) on May 9, 2011 7:07 AM

  • Full Table Scans / Index Scans /Index Organized Tables...

    Can anyone give me an example where an index would be the best option to query 99% of data.
    Can anyone give me an example where a FTS is the best option to query 1% of data.
    If IOT are better in terms of performance and also in terms of saving storage space then why cant we always use IOT in the database . Why do we need to follow the regular table and index to store data.
    Responses are appreciated !
    null
    null

    It's easiest to consider extreme cases for thought experiments:
    Can anyone give me an example where an index would
    be the best option to query 99% of data.
    The obvious case would be where you had an order by clause with a matching index. With a well-clustered table, the optimizer might decide to do an index full scan to collect 100% of the data in order rather then doing a tablescan and sort.
    In fact, with first_rows_1 optimization, and certainly with first_rows optimization before it, you would sometimes see the optimizer use such a strategy to read 100% of the data in the right order, discarding 99% of it, rather than selecting 1% of the data through a more precise index and sorting it.
    Can anyone give me an example where a FTS is the
    best option to query 1% of data.
    Consider a table in a tablespace with an 8Kb block size - with short rows (roughly 80 bytes) you can get 100 rows per block. Run a query that wants to get one row from each block (i.e. 1% of the data). A tablescan with a db_file_multiblock_read_count of just 2 would be more efficient than an indexed access. For a more realistic example consider picking one row from every 16th block when your db_file_multiblock_read_count is 128.
    In fact, if you check what Oracle does when you sample 1% of the rows using the sample clause, you may see cases where it actualy uses multiblock reads to scan the whole table, discarding the blocks it doesn't want.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk

  • BW DB13 Tables and indexes missing

    hi, everyone,
    our team find a strangethings in DB02 about the growth of table space, there is even no any growth, and it keeps  about two months.  and then we found that in tables and indexes all table about BW like *ODSD, *FACTD, *DIMD are missing!
    I only find DB13C appear the error as" REOGR CHK for All Tables" at the same time .
    please tell me why I can't find BW tables ?  is there any relations between  tables missing and job calendar?
    our level is 701, and database is DB6.

    It's a fool questions, i found the reason is so easy^^

Maybe you are looking for

  • Extending materials to WM views

    Dear Experts, I am extending materials to WM views. For some reason its not letting me to do it as I can not see the WM views in material master. Where would I do a config setting in order to extend the views to WM ? Thanks for your time in advance

  • MacBook Pro/iMac/IBM laptop - Wireless compatibility?

    I have just had a BT Business line installed at home so I can use my work laptop (IBM) at home. BT sent us a wired modem that works with the IBM but the Mac's don't like it! We are looking to upgrade to wireless and want to get an Airport Extreme but

  • Tooltips for moving buttons

    Hi all, I am trying to add tooltips on mouse-over to moving buttons (the buttons are movie clips acting as buttons). It works at first, but when the movie clips enter the second motion tween they start blinking as the movie clips start to play all fo

  • SG300-28P: System LED not on. everything else working.

    Hi Everyone, Nice to meet you all. I received an used SG300-28P today and immediately I found its System LED never lits. I upgraded the firmware to the latests but did not make any difference. So far I have configured the switch for my environment an

  • Per Application Volume Control

    The one decent thing I have noticed about Vista is that it has an easy to use per-application volume control. I haven't seen anything like this in Leopard so far. Does anyone know if there is a free third-party application that can be used for this t