What is the difference between Table & Tablespace Fragmentation

What is the difference between Table Fragmentation & Tablespace Fragmentation.
What causes Table Fragmentation and what cause Tablespace Fragmentation.
How can we avoid Table Fragmentation & Tablespace Fragmentation.
How can we fix already Fragmented Tables & Fragmented Tablespaces
Thanks
Naveen

Unless you are using an exceptionally old version of Oracle or are still using dictionary managed tablespaces or are using some interesting definitions of "fragmentation", fragmentation is practically impossible in Oracle.
Justin

Similar Messages

  • What is the difference between undo tablespace and online redo log files.

    what is the difference between undo tablespace and online redo log files. I am confused
    as per my knowledge undo tablespace is used to store the undo information when a table is being updated so that, just incase we need to rollback a transaction we know what was present in the table earlier.
    when a transaction fails the SMON performs the rollback of the data.
    This undo data is stored in the undo tablespace and read consistency if any is enforced.
    is my understanding till here correct?
    Now, can this undo data/before image not be stored in the redo log buffer and online redolog files?
    can redo-log files not store this information?
    in fact, is it that when undo tablespaces exist in a database, the undo data/before image is stored in both the undo tablespace and also the redo log files?
    kindly clarify my doubt.
    thank you.

    This question has been asked many times before. The answer is always the same.
    Yes, redo contains the before image of data (and the after-image). Therefore, it **COULD** be used to roll back a transaction.
    BUT... Redo is written sequentially. Using it to rollback your transaction would involve reading through all the redo written by maybe thousands of other people. It would be painfully slow.
    Your transaction is, however, directly linked to just the UNDO that it generates (which is JUST the before image of the data). So, your undo is your undo and doesn't share space with anyone else's undo. Therefore, using it to roll back YOUR transaction is fast.
    The fact that undo is only the before image of the data also makes it faster than wading through a sea of before and AFTER images as you'd find in redo. About twice as fast, in fact, since there's half the data. Roughly.
    Redo also gets written and flushed to disk whenever there's a commit, 3 seconds are up or too much (1MB, actually) redo gets generated between flushes caused by other factors. Your redo gets flushed when those things happen, even if you haven't actually committed your transaction. And redo logs recycle themselves, meaning that your redo -even if your transaction hasn't been committed yet- can be over-written by later transactions. Try rolling back when that's happened, if redo was the source of your rollback data!
    Undo, however, cannot be over-written if the transaction has not been committed. Ever. If you don't commit for three years, there will be three years' undo stored in your database (assuming you had the space, of course!).
    I could go on, but that will do. Redo is there fore RECOVERY, after catastrophe. Undo is there for read-consistency (and the occasional change of mind). Two different functions. Two different mechanisms. Each one highly tuned to doing what it does, why it does it, most efficiently and effectively.

  • What is the difference between a tablespace, a segment and an extent ?

    What is the difference between a tablespace, a segment and an extent ? Please explain in layman terms since I'm a total newbie to Oracle.
    Regards
    Gony

    Hi,
    These are logical structure of database
    1. Tablespace : A database is divided into logical storage units called tablespaces, which group related logical structures together. For example, tablespaces commonly group together all application objects to simplify some administrative operations.
    2.Segments
    Above extents, the level of logical database storage is a segment. A segment is a set of extents allocated for a certain logical structure. The following table describes the different types of segments.
    Segment Description
    Data segment
    Each nonclustered table has a data segment. All table data is stored in the extents of the data segment.
    For a partitioned table, each partition has a data segment.
    Each cluster has a data segment. The data of every table in the cluster is stored in the cluster's data segment.
    Index segment
    Each index has an index segment that stores all of its data.
    For a partitioned index, each partition has an index segment.
    Temporary segment
    Temporary segments are created by Oracle when a SQL statement needs a temporary work area to complete execution. When the statement finishes execution, the extents in the temporary segment are returned to the system for future use.
    Rollback segment
    If you are operating in automatic undo management mode, then the database server manages undo space using tablespaces. Oracle Corporation recommends that you use "Automatic Undo Management" management.
    3. Extents
    The next level of logical database space is an extent. An extent is a specific number of contiguous data blocks, obtained in a single allocation, used to store a specific type of information.

  • Hi guru's what is the difference between table and temlate in smartforms

    hi guru's what is the difference between table and temlate in smartforms

    Hi Vasu,
    Template is used for proper allignment of data which table is used for displaying multiple data.
    We can say Template is for static data and Table is for dynamic data.
    Suppose we have a requirement in which we have to allign the customer address in such a way as shown below:-
    Name- Vasu Company- WIPRO Location- Chennai
    Desig- S/W Native - Mumbai
    Then for proper allighnment we can create a template and split that into 3 columns and 2 rows and create text elements for each cell display a proper allighned data at the output.
    When we include a template inside a loop it gives the same property as a table.
    When we have mutiple data which is to be extended to the next page like when we display all employee details in a company we use table.
    Table has 3 sections , HEADER, ITEM ,FOOTER
    The header secntion will be executed once and it will loop at the item level. at the end footer will be executed.
    Hope this gives u some idea..
    <b>Please reward if useful</b>
    Regards,
    sunil kairam.

  • What is the difference between payment_method_code,payment_method_lookup_code  in ap_checks_all table ?

    Hi All,
    Could you explain me what is the difference between payment_method_code & payment_method_lookup_code  in ap_checks_all table.
    Is both the column store same values ?
    Regards,
    Uva

    Hi Prathima,
    In tech lingo:
    Payment_num is the same as AP_INVOICE_PAYMENTS_ALL.payment num.
    Check_number is same as check_number in AP_CHECKS_ALL -> which also has checkrun_name used in payment batch You can get to AP_CHECKS_ALL by using check_id in AP_INVOICE_PAYMENTS_ALL
    Raman.

  • What is the difference between infocube and fact table?

    hi bw gurus,
    what is the difference between infocube and fact table?
    thanks in advance
    bye

    Fact table contains only KeyFigures and foreign keys of dim ids.
    Infocube conatin fact table sorrounded by dimension tables.dimension table contain primary keys of dim ids and SIDs which link to master data.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6ce7b0a4-0b01-0010-52ac-a6e813c35a84

  • What is the difference between RT(Result table)& CRT(Cumilative result tabl

    what is the difference between RT(Result table)& CRT(Cumilative result table)

    Hi,
    RT Contains all the results of the payroll of the current
    period, i.e, ur current months Basic, HRA, CLA etc. Where as in CRT contains
    all the cummulated amount of the Basic, HRA, CLA, i.e, lets us assume that
    ur basic per month is 5000/- then in RT table u will have Basic amount for
    the month of September will be 5000/- and in CRT for the month of September
    u will have Basic amount as 30,000/- ie, 5000 * 7. And also CRT has Yearly
    amount and also Current month amount. you can check this with the Tcode
    pc00_m40_clsrt
    AWARD POINTS IF USEFUL

  • What is the difference between standard,sorted and hash table

    <b>can anyone say what is the difference between standard,sorted and hash tabl</b>

    Hi,
    Standard Tables:
    Standard tables have a linear index. You can access them using either the index or the key. If you use the key, the response time is in linear relationship to the number of table entries. The key of a standard table is always non-unique, and you may not include any specification for the uniqueness in the table definition.
    This table type is particularly appropriate if you want to address individual table entries using the index. This is the quickest way to access table entries. To fill a standard table, append lines using the (APPEND) statement. You should read, modify and delete lines by referring to the index (INDEX option with the relevant ABAP command). The response time for accessing a standard table is in linear relation to the number of table entries. If you need to use key access, standard tables are appropriate if you can fill and process the table in separate steps. For example, you can fill a standard table by appending records and then sort it. If you then use key access with the binary search option (BINARY), the response time is in logarithmic relation to
    the number of table entries.
    Sorted Tables:
    Sorted tables are always saved correctly sorted by key. They also have a linear key, and, like standard tables, you can access them using either the table index or the key. When you use the key, the response time is in logarithmic relationship to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique, or non-unique, and you must specify either UNIQUE or NON-UNIQUE in the table definition. Standard tables and sorted tables both belong to the generic group index tables.
    This table type is particularly suitable if you want the table to be sorted while you are still adding entries to it. You fill the table using the (INSERT) statement, according to the sort sequence defined in the table key. Table entries that do not fit are recognised before they are inserted. The response time for access using the key is in logarithmic relation to the number of
    table entries, since the system automatically uses a binary search. Sorted tables are appropriate for partially sequential processing in a LOOP, as long as the WHERE condition contains the beginning of the table key.
    Hashed Tables:
    Hashes tables have no internal linear index. You can only access hashed tables by specifying the key. The response time is constant, regardless of the number of table entries, since the search uses a hash algorithm. The key of a hashed table must be unique, and you must specify UNIQUE in the table definition.
    This table type is particularly suitable if you want mainly to use key access for table entries. You cannot access hashed tables using the index. When you use key access, the response time remains constant, regardless of the number of table entries. As with database tables, the key of a hashed table is always unique. Hashed tables are therefore a useful way of constructing and
    using internal tables that are similar to database tables.
    Regards,
    Ferry Lianto

  • What is the difference between straucture & table

    what is the difference between straucture & table

    Hi,
    Tables
    Represent the Database Tables where data actually resides.
    Tables can be defined independently of the database in the ABAP Dictionary.
    The fields of the table are defined with their (database-independent) ABAP/4 data types and lengths.
    Structures
    Are record declarations that do not correspond to a Database Table.
    Just like user-defined data type.
    Defined like a table and can then be addressed from ABAP/4 programs.
    Structures contain data only during the runtime of a program.
    In this link, you can find some useful coding samples.
    http://www.sapdevelopment.co.uk/java/jco/jcohome.htm
    http://www.henrikfrank.dk/abapexamples/Java/sapjava_getcompanycode_list.htm
    Following are the weblogs about JCO
    /people/gregor.wolf3/blog/2004/09/23/from-function-module-to-jco-application--part-1-of-3
    /people/gregor.wolf3/blog/2004/09/24/from-function-module-to-jco-application--part-2-of-3
    /people/gregor.wolf3/blog/2004/09/25/from-function-module-to-jco-application--part-3-of-3
    /people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection
    For Tables and Structures refer this.
    http://help.sap.com/saphelp_40b/helpdata/en/4f/991f82446d11d189700000e8322d00/applet.htm
    For RFC related information,check this.
    http://help.sap.com/printdocu/core/Print46c/en/Data/Index_en.htm
    http://www.sap-img.com/abap-function.htm

  • What is the difference between READ TABLE ITAB WITH KEY  and  TABLE KEY

    Hi Experts,
    what is the difference between
    READ TABLE <ITAB> WITH KEY <K1> = <C1>
                                                    <Kn> = <Cn> .
    and 
    READ TABLE <ITAB> WITH TABLE KEY <K1> = <C1>
                                                              <Kn> = <Cn> .
    Thanks
    Akash.

    Hi akashdeep,
    Nice question. I also tried to find out, but no much success. My opinion is that for practical purposes there is no difference.
    It may have difference in case of searching, especially sorted tables. (binary search or normal linear search).
    Case1: If our table is sorted table with defined key fields, and we give WITH TABLE KEY, then faster binary search is used.
    Case2 : If our table is sorted table with defined key fields, and we give WITH  KEY, (and no field contained in the keys), then normal linear search is used.
    regards,
    amit m.

  • What is the differences between Transparent,Pooled and Cluster tables?

    Hello all,
    What is Pool table?What is the differences between Transparent,Pooled and Cluster tables?
    Regards!
    Purna

    Transparent table:
    Tables can be defined independently of the database in the ABAP Dictionary. The fields of the table are defined together with their (database-independent) data types and lengths.
    A table definition in the ABAP Dictionary has the following components:
    Table fields: The field names and the data types of the fields contained in the table are defined here.
    Foreign keys: The foreign keys define the relationships between this table and other tables.
    Technical settings: The technical settings define how the table is created on the database.
    Indexes: Indexes can be defined for the table to speed up data selection from the table.
    There are three categories of database tables in the ABAP Dictionary.
    A physical table definition is created in the database for the table definition stored in the ABAP Dictionary for transparent tables when the table is activated. The table definition is translated from the ABAP Dictionary to a definition of the particular database.
    On the other hand, pooled tables and cluster tables are not created in the database. The data of these tables is stored in the corresponding table pool or table cluster. It is not necessary to create indexes and technical settings for pooled and cluster tables.
    Pooled table
    Pooled tables can be used to store control data (e.g. screen sequences, program parameters or temporary data). Several pooled tables can be combined to form a table pool. The table pool corresponds to a physical table on the database in which all the records of the allocated pooled tables are stored.
    Cluster table
    Cluster tables contain continuous text, for example, documentation. Several cluster tables can be combined to form a table cluster. Several logical lines of different tables are combined to form a physical record in this table type. This permits object-by-object storage or object-by-object access. In order to combine tables in clusters, at least parts of the keys must agree. Several cluster tables are stored in one corresponding table on the database.
    Regds,
    Manohar

  • What is the difference between exists and in

    hi all
    if i have these queries
    1- select ename from emp where ename in ( select ename from emp where empno=10)
    and
    2- select ename from emp where exists ( select ename from emp where empno=10)
    what is the difference between exists and in is that only when i use in i have to bring the field name or what.... i mean in a complex SQL queries is it will give the same answer
    Thanks

    You get two entirely different result sets that may be the same. Haah! What do I mean by that.
    SQL> select table_name from user_tables;
    TABLE_NAME
    BAR
    FOO
    2 rows selected.
    SQL> select table_name from user_tables where table_name in (select table_name from user_tables where table_name = 'FOO');
    TABLE_NAME
    FOO
    1 row selected.
    SQL> select table_name from user_tables where exists(select table_name from user_tables where table_name = 'FOO');
    TABLE_NAME
    BAR
    FOO
    2 rows selected.So, why is this? the WHERE EXISTS means 'if the next is true', much like where 1=1 being always true and 1=2 being always false. In this case, where exists could be TRUE or FALSE, depending on the subquery.
    WHERE EXISTS can be useful for something like testing if we have data, without actually having to return columns.
    So, if you want to see if an employee exists you might say
    SELECT 1 FROM DUAL WHERE EXISTS( select * from emp where empid = 10);
    If there is a row in emp for empid=10, then you get back 1 from dual;
    This is what I call an 'optimistic' lookup because the WHERE EXISTS ends as soon as there is a hit. It does not care how many - only that at least one exists. It is optimistic because it will continue processing the table lookup until either it hits or reaches the end of the table - for a non-indexed query.

  • WHAT'S THE DIFFERENCE BETWEEN.....

    Hi friends,
    Please enlighten me ....
    What's the difference between using this.....
    1. Add User command functionality to ALVgrid report
    In order to add user command functionality to the ALV grid you need to perform the following steps:
                        1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include 'USER_COMMAND' FORM
                    2. Create 'USER_COMMAND' FORM
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'
                I_callback_user_command = 'USER_COMMAND'   "see FORM
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
                i_save                  = 'X'
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
          FORM USER_COMMAND                                          *
          --> R_UCOMM                                                *
          --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
      Check field clicked on within ALVgrid report
        IF rs_selfield-fieldname = 'EBELN'.
        Read data table, using index of row user clicked on
          READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
        Set parameter ID for transaction screen field
          SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
        Sxecute transaction ME23N, and skip initial data entry screen
          CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
        ENDIF.
      ENDCASE.
    ENDFORM.
    and using this----
    2. Add User command functionality to ALVgrid report
    In order modify PF_STATUS of ALV grid report you need to perform the following steps:
         1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include:
                        i_callback_pf_status_set = 'SET_PF_STATUS' statement.
         2. Create 'SET_PF_STATUS' FORM
         3. Create pf_status (i.e. 'ZNEWSTATUS').
              - It is recommend that you copy standard status'STANDARD' from function group SALV
                and modify it accordingly. ALV standard function codes always start with '&'.
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'
                i_callback_pf_status_set = 'SET_PF_STATUS'   "see FORM
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
                i_save                  = 'X'
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
          FORM SET_PF_STATUS                                         *
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZNEWSTATUS'.
                      "Copy of 'STANDARD' pf_status from fgroup SALV
    ENDFORM.
    I have assumed the former is used  when I am selecting a field on the list
    and the later when I have  created a pf-status. I mean to say... I have slected a field and click on some button to get further information.
    Please remove my confusion.
    Thanking you alll in advance,
    Hari Kiran.

    From their Terms & Conditions page:
    Grade A - Working phone in as new/mint condition. Complete with original box and accessories as sold new.
    Grade B (and Discounted) - Working phone in good condition with slight cosmetic blemishes. Charger supplied. If the phone includes a music player/radio then it is supplied with headphones. If the phone has PDA functionality a sync cable and/or docking cradle is supplied. Missing original packaging.
    Grade C (and Budget) - Working phone in poor cosmetic condition. Original or 3rd party charger supplied but missing accessories and original packaging.
    Substitute iPod for phone and I think it makes sense...
    tt2

  • What is the difference between  Process Type TRIGGER AND CHAIN

    What is the difference between these two process types.  When I am looking process types, I want to provide information only about process chains and not individual steps of process chain. Looks like one can do using either.
    Along the same line, I am looking  at  data from RSPCPROCESSLOG, no where this table has a column process chain id. So How od I find information about a process chain.
    Thanks a lot,

    A "Chain Process" can be a a step in a Process Chain as well.    For Example: So you could have the following Process Chain:
    Process Chain Example
    Step 1. TRIGGER (Execute Daily at 4am)
    Step 2. DTP_LOAD Execute DSO Load
    Step 3. DTP_LOAD Execute InfoCube Load
    Step 4. CHAIN Execute Master Data Process Chain
    I believe the "Master Chain" is called a "MetaChain" since it controls the start of another Process Chain.
    Hope that helps...

  • What is the difference between TO_CHAR and TO_DATE()?

    Hi everybody,
    i am facing a problem in my system.It is quite urgent, can you explain me "What is the difference between TO_CHAR and TO_DATE()?".
    According to user's requirement, they need to generate a code with format "YYMRRR".
    YY = year of current year
    M = month of current month (IF M >=10 'A' ,M >=11 'B' , M >=10 'C')
    RRR = sequence number
    Example: we have table USER(USER_ID , USER_NAME , USER_CODE)
    EX: SYSDATE = "05-29-2012" MM-DD-YYYY
    IF 10
    ROW USER_ID , USER_NAME , USER_CODE
    1- UID01 , AAAAA , 125001
    2- UID02 , AAAAA , 125002
    10- UID010 , AAAAA , 12A010
    This is the original Script code. But This script runs very well at my Local. Right format. But it just happens wrong format on production.
    12A010 (Right) => 11C010 (Wrong).
    SELECT TO_CHAR(SYSDATE, 'YY') || DECODE( TO_CHAR(SYSDATE, 'MM'),'01','1', '02','2', '03','3', '04','4', '05','5', '06','6', '07','7', '08','8','09','9', '10','A', '11','B', '12','C') ||     NVL(SUBSTR(MAX(USER_CODE), 4, 3), '000') USER_CODE FROM TVC_VSL_SCH                                                       
         WHERE TO_CHAR(SYSDATE,'YY') = SUBSTR(USER_CODE,0,2)                         
         AND TO_CHAR(SYSDATE,'MM') = DECODE(SUBSTR(USER_CODE,3,1),'1','01',          
              '2','02', '3','03', '4','04', '5','05',          
              '6','06', '7','07', '8','08', '9','09',          
              'A','10', 'B','11', 'C','12')                    
    I want to know "What is the difference between TO_CHAR and TO_DATE()?".

    try to use following select
    with t as
    (select TO_CHAR(SYSDATE, 'YY') ||
             DECODE(TO_CHAR(SYSDATE, 'MM'),
                    '01', '1',
                    '02', '2',
                    '03', '3',
                    '04', '4',
                    '05', '5',
                    '06', '6',
                    '07', '7',
                    '08', '8',
                    '09', '9',
                    '10', 'A',
                    '11', 'B',
                    '12', 'C') as code
        from dual)
    SELECT t.code || NVL(SUBSTR(MAX(USER_CODE), 4, 3), '000') USER_CODE
      FROM TVC_VSL_SCH
    WHERE SUBSTR(USER_CODE, 1, 3) = t.codeand yes you need check time on your prodaction server
    good luck
    Edited by: Galbarad on May 29, 2012 3:56 AM

Maybe you are looking for

  • Hp dt2000i ac adapter

    could someone tell me the voltage & amperage on the ac adapter for this external hard drive ?

  • Need info related to log files

    Hi All, If a person tries to take backup of tables metadata from SQL Developer, then is such information stored in the logs? To be specific, is there any logging mechanism @ oracle server which tells that table metadata has been accessed from a parti

  • Setting up through aim mail

    I am having trouble setting up my mail account. I already have an online eMail adress at aim.com. what would I fill in when I want to set it up?

  • Mapping for MAC

    Where can I buy a mapping software (offline) for my Bluetooth GPS Receiver for my Macbook Air?

  • My Mail is not working properly after installing Lion

    I just installed Lion and my mail is not working.  It keeps asking me for the password and says it can not go online.  All my mail folders have disapeard and with them my saved emails!  Also the Back to Mac is not able to take my password either.