Removal of the records in the tables

Oracle 11g - Windows Server 2008

After you delete a large number of records in a table, I think I should reorg or do something for it to be fine.

The table name is def_lancs.
I deleted records over 1 million of this table. It now has 2 million records.
What commands can I use to put this table in order?

Eduardo

788042 wrote:
Hello

In the SQL databases after you delete a large number of rows in a table, we have a very large space with no information.
Lines are deleted, but the space using these lines is always there.
We must therefore use retractable in order to remove this empty space.
After that, the present table less space and performance improves.

I don't know how it works in Oracle.
But as you tell me to relax and have a cup of coffee, I think that the Oracle databases do this automatically.
Is this true?

Eduardo

No, they don't to shrink automatically and free up space, but usually no need to. Oracle manages to somehow fundamentally and profoundly different than SQLServer. Best practices in may very well be the worst practices in the other. In oracle, allocation and deallocation extensions are quite expensive activity. If I delete a bunch of lines that normally I guess at some point the space the lines take it will take once again, so I'm not going to Oracle through the effort to free the space just for having to recover again. At least not outside has demonstrated clearly need to do.

Tags: Database

Similar Questions

  • Add and remove users from the table

    Hi, guys. I do a system that allowed admin in the user control.

    The ID is = admin

    The neck is = 6649481

    Can someone help me to check add it and remove the part.

    Actually, it may work, but I would like to make he repeats no is allowed, but it works on the index of '0' and then index 1, it will not stop the user to add id repeated.

    Delete if I had to remove the loop will be fine and work well, but it can only remove the top. It's like first first concept but I would like to do as a function of the ID given to remove from the table.


  • Delete the row in the Table by using the report link column

    Hello

    I a report advocating the rows in a table - I would like to for users to be able to delete rows in the table by clicking on the link in the column "ID". I thought about trying to call a process by using a javascript URL (as mentioned in this thread - Re: how to call PL/SQL process when you press link column ) but I don't know how to write the process so that he knows what 'ID' to remove from the table.

    Any ideas would be greatly appreciated.

    Forrest

    Forrest:

    Follow these steps

    Create an item hidden on the page P_ID named who said
    In the column link definition set the goal URL as the URL as
    JavaScript:doDelete(#ID#);
    Add this JS ito header HTML of the page

     
    

    Create a process page ' on submit ' with the code to delete the record from the table. Subordinate this process by using a "pl/sql expression" type of condtion. Will be the expression of pl/sql

    :request='DELETE';
    

    Treat code

    delete from  where pk_column=:p_id; //adjust as needed 

    Add a branch that branches off to the page

    CITY

  • Hi people. IM new here. Need to accelerate a clarification on the table!

    We have a scheme of production with 200 ~ tables in my body and I feel the performance of important queries in reports can be increased up to with the approach below.

    Current settings - movement of the line is disabled for all tables.

    What I can,

    (1) to activate the movement of the line with "change the movement line of table_name enable;" ~ This allows the rows in the table to move dynamically remove the unused blocks.

    (2) remove the unused blocks with "alter table table_name retractable space;"

    (3) turn off the movement of the line with "modify the movement table table_name disable;"line ~ this will stop allowing the lines in the table move dynamically.

    If I do, I get free unused blocks or removed making the table to perform at least a little more fast?

    Will there be an impact elsewhere?

    PS - It was never tried before by someone else in our scheme of production.

    See you soon,.

    Rachida.

    India.

    Use the Segment space Advisor to see what are the tables could benefit from a SHRINK

    Hemant K Collette

  • Removal of the video clips in arrays

    Hello

    I have this code in my Flash file:

    for(bubble in bubbleArray){
         bubbleArray[bubble]._y -= 3;
         if(bubbleArray[bubble]._y < 370){
              bubbleArray[bubble].removeMovieClip();
         }
    }

    I wonder, when I remove the film clips should I also be burst their table?

    I have an onEnterFrame function that attaches the video clips and the drives in the array, so I'm afraid that if I don't pop the table will continue to increase in size and slow down the film. This is the case, or will they be automatically removed from the table by the above removeMovieClip() method?

    They will not be removed from the table, but the table can now point to an undefined object.  So if the intention is not to try to deal with in this code, then you must delete them from the table.

  • duplicate only delete records in a table w / composite primary

    I have a table that uses three columns of the primary key.
    There a few records in doubles because of some mistakes of the past.
    How can I remove only one of each record in duplicate using a sql statement?
    I don't want to do anything that requires the removal of the table.
    All I found so far have been average to drop two duplicate records, not one of them.

    I'm sure I could write a pl sql script to do this, but I just want to know how to do it with sql only if possible. Someone knows how to do that, or nobody knows whether or not it is still possible given my constraints?

    Thank you

    849655 wrote:
    Brian,

    That's what I did with his suggestion and 2-3 other times where I found he does the same in other places. However, as I said, I lose again all duplicates, not one of the duplicates (isn't it logical?)

    Maybe it's a bad support so far. Why would you not want to remove ALL duplicates (that means you leave exactly ONE instance of a single record).

    Can you put together a simple case for us show what you need to keep?

    ME_ORCL?drop table tutorial;
    
    Table dropped.
    
    Elapsed: 00:00:00.14
    ME_ORCL?
    ME_ORCL?create table tutorial
      2  (
      3     col1 number,
      4     col2 number
      5  );
    
    Table created.
    
    Elapsed: 00:00:00.00
    ME_ORCL?
    ME_ORCL?insert into tutorial select mod(level, 3), level from dual conne
    
    10 rows created.
    
    Elapsed: 00:00:00.00
    ME_ORCL?
    ME_ORCL?commit;
    
    Commit complete.
    
    Elapsed: 00:00:00.01
    ME_ORCL?
    ME_ORCL?select * from tutorial;
    
                  COL1               COL2
    ------------------ ------------------
                     1                  1
                     2                  2
                     0                  3
                     1                  4
                     2                  5
                     0                  6
                     1                  7
                     2                  8
                     0                  9
                     1                 10
    
    10 rows selected.
    
    Elapsed: 00:00:00.03
    ME_ORCL?
    ME_ORCL?delete from tutorial
      2  where rowid not in
      3  (
      4     select min(rowid)
      5     from tutorial
      6     group by col1
      7  );
    
    7 rows deleted.
    
    Elapsed: 00:00:00.01
    ME_ORCL?
    ME_ORCL?select * from tutorial;
    
                  COL1               COL2
    ------------------ ------------------
                     1                  1
                     2                  2
                     0                  3
    
    3 rows selected.
    
    Elapsed: 00:00:00.01
    ME_ORCL?
    ME_ORCL?rollback;
    
    Rollback complete.
    
    Elapsed: 00:00:00.01
    ME_ORCL?
    ME_ORCL?delete from tutorial
      2  where rowid in
      3  (
      4     select rid
      5     from
      6     (
      7        select
      8           rowid rid,
      9           row_number() over ( partition by col1 order by rowid ) rn
     10     from tutorial
     11     )
     12     where rn > 1
     13  );
    
    7 rows deleted.
    
    Elapsed: 00:00:00.01
    ME_ORCL?
    ME_ORCL?select * from tutorial;
    
                  COL1               COL2
    ------------------ ------------------
                     1                  1
                     2                  2
                     0                  3
    
    3 rows selected.
    
    Elapsed: 00:00:00.03
    ME_ORCL?
    

    Something like that. As you can see, these two removed all duplicates, leaving 1 unique value for COL1.

  • Recording on DVD - "Unable to retrieve the table of contents" error

    Hi all

    Whenever I try to record on a DVD a face "could not retrieve the table of contents.

    I tried to change the recording speed, but no use.

    When I go to properties of DVD and click on activate record it does not recognize the DVD or any CD in the drive.

    Please help

    Hello

    1. what software to use to burn cd/dvd discs? Try using Nero, Ashampoo burning studio, alcohol CD and DVD software of engraving,
    2. then, I advise you to use high quality as TDK or Verbatim media.

    3
    Go to Device Manager and remove the drive from the list of devices CD/DVD.
    Then access the registry and delete the Upperfilters and Lowerfilters completely from the following registry key values:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Class {4D36E965-E325-11CE-BFC1-08002BE10318}

    Reboot the laptop and wait for the CD/DVD drive would appear once again

    If your problems persist, there may be a problem with your cd/DVD-ROM

  • Purge of the records of the Table and the size of the data file

    11.2.0.4/Oracle Linux 6.4

    We want to reduce the size of the DB (file size of data), so that our RMAN backup size will be reduced. So, let's create stored procedures that will purge old data in huge tables.

    After you remove records, we will decrease the tables using the:

    change the movement line of table ITEM_MASTER enable;

    change the waterfall table retractable ITEM_MASTER space;

    ALTER table ITEM_MASTER deallocate unused;

    The commands above will reduce the file size of data (see dba_Data_files.bytes) or it will reduce the size of the segment?

    Only the segment formats will be reduced.  Oracle has never reduced the sizes of data file automatically.  You would have to reduce them.  You may not be able to reduce the size of data file if there are extensions to the 'end' (highwatermark) data files.  In this case, you will need to create a new tablespace and move all the objects for the new tablespace OR export, drop, create tablespace and import.

    Hemant K Collette

  • Add new records to the table of the ADF

    Hello

    I use Jdev 11.1.1.3.0.
    I have a Page of the ADF with detail Table of form - master, I want to add new records to the table reflecting in DB. Is it possible to do? pointers or demo?


    Thank you
    MB

    What are the components are used in your table? When you created the table originally, you specified as a table read-only? If your table contains components of af: outputText, then you will need either manually change components entry way, or remove the table and re-drop-the-in the form of table (not read-only)

    John

  • Impossible to delete the record from the table using the form

    I have a stored procedure (function, actually) that allows an administrator to manually delete a record in a table.

    When I call my form there will be no effect. The record remains in the table.

    In both cases, I connect to the database to the same user.

    I am able to call a test function in the database which returns a field in the record, so I think I can at least communicate with and retrieve results from the database using a stored function. As soon as I approach him "select" "delete from", no luck.

    If I try to run the SQL in my form with a statement of FORMS_DDL, it seems to run smoothly when I not in the code in the debugger, but it had no effect. FORMS_SUCCESS reports TRUE if DBMS_ERROR_TEXT has the following: ORA-01403: no data found. I don't know how the DBMS_ERROR_TEXT is that FORMS_SUCCESS is not set to FALSE.

    Any ideas as to why I am unable to remove using my form but can when you call the function registered directly/manually?

    Using Oracle Forms & DB 10.0.2.0.1.

    Patrick,

    After each Insert / Update / Delete statement, you have to COMMIT . Then only it will be in select statements.

    Kind regards

    Manu.

  • Form check synchronize on Popup to the selected record from the table

    I'm trying to recreate what I did on the portals of the OAS in Weblogic/ADF. I have JDeveloper 11.1.1.2.0. What I do seems to be a little different than the tutorials: I need something like the tutorial master-detail, but instead the details appearing on the same page, it should appear in a popup. I managed to build the part table/popup. But when the popup appears, it displays the wrong record. Here are the steps I used to create this page:

    After you create the ADF Fusion Middleware project:

    1 create templates for the tables I need.
    2. create the JSF Page.
    3 drop panelCollection on the page.
    4. remove my data to see in panelCollection control and choose the Table read-only ADF. Select the sorting and selection options.
    5 change table properties: selected = DisplayRow, EditingMode = clickToEdit
    6 drag the Popup on the page.
    7. remove my data from view in popup control and choose the form of the ADF. Select the send option.
    8 drop showPopupBehavior on the page. Name of the popup. The value triggerType to the 'selection '. (triggerType "click" works, too)
    9 deploy.

    The table is displayed. I click on a line. The pop-up window appears. The form of popup displays the first record in the table. I click on any line.

    I just bought the merger Oracle 11g Developer Guide, but were not able to answer this question yet.

    Any ideas?

    Thank you.

    See this video for how it works for me:
    http://www.ScreenToaster.com/watch/stWUtcRkVLQ1BcSV1aX15Q

  • delete all the records in a table, the speed of insertion is not change.

    I have an empty table, and I insert a record need 100ms.
    During this table a 40,0000 trace, I insert a record need 1 s, it's ok, because I need to make a comparison according to an index before inserting a record need, so more record, more time.
    The problem is when I delete all the record in this table, the insertion time is always 1s, not reduce to 100ms. Why?

    Hello

    Read this part of the oracle documentation

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14220/logical.htm#CNCPT004

    The reason is always 1s, because when you inserted 400ko record as HWM (high tide is the border between old and new space in a segment.) moved to the top. And when you remove all records of your HWM still in the same coordinate system and that you have not reset to 0. So when you insert 1 it save free space and after finding faces (usually a regular insertions got 6 steps it inserts data). If you truncate your table you and try it again it will be faster that your HWM is reset to 0.

    Concerning

  • Delete multiple records in the table...

    Hello

    I have a table with 720 000 records, I want to delete records for the date of joining i, e for 20/10/2008. To this date there 1065 records. can I use a simple delete for this statement?

    Delete from Test where Join_date = 20 October 2008 ';

    Is this is a good way to do it? Any suggestion splease.


    Thank you!!

    Hello

    user642297 wrote:
    Hello

    I have a table with 720 000 records, I want to delete records for the date of joining i, e for 20/10/2008. To this date there 1065 records. can I use a simple delete for this statement?

    Delete from Test where Join_date = 20 October 2008 ';

    Is this is a good way to do it? Any suggestion splease.

    Thank you!!

    Yes, you can use statements like this to delete several lines at once.

    Remember that all DATEs include a time. The statement you posted only deletes the lines dated at midnight (that is, 20 October 2008 00:00:00).
    To remove all the same day, regardless of the time, say

    WHERE   Join_date >= TO_DATE ('20-oct-2008', 'dd-mon-yyyy')
      AND   Join_date <  TO_DATE ('21-oct-2008', 'dd-mon-yyyy')
    

    If encoding time is more valuable than the run time, one could also say:

    WHERE   TRUNC (Join_date) = TO_DATE ('20-oct-2008', 'dd-mon-yyyy')
    
  • How to remove columns from the table on the master 1-0?

    I have an array of 96 columns with strings. I also have the array of int 96-elemets (mask) with 1 and 0.

    What I want to do is to is to remove (or hide - but I read that it is not possible) all the columns with index corresponding to 0 in the mask table.

    example:

    columns in the table

    1 2 3 4 5

    mask

    0 1 0 0 1

    I want to remove the columns 1, 3 and 4 and leave only 2 and 5 in my table.

    How can I do?

    If I create loop for with i as the index of the column, when I do DeleteTableColumns() columns number decreases, and I get an error of range out of

    Or do I have an option to hide the unnecessary columns (not set their width to 1, it's very ugly-looking)?

    Please help me (())

    Hello rovnyart!

    1. removal of columns in the table:

    I suspect that the reason why you get the out-of-range error is due to fact that in your loop, you delete the columns in the table, you'll eventually end up by referring to a column that no longer exists, because the other columns before it have been deleted. While you remove each column of your table in the loop for example, the column index number will move, because you deleted the other columns in front of her.

    To resolve this, even if you delete a column in your loop, make sure that you take also into account that the index of the column is moved because of the removed columns.

    2 hide columns in table:

    You can use the ATTR_COLUMN_VISIBLE attribute to hide columns in the table:

    http://forums.NI.com/T5/LabWindows-CVI-idea-exchange/add-attr-column-visible-attribute-for-table-Col...

    http://zone.NI.com/reference/en-XX/help/370051Y-01/CVI/uiref/cviattrcolumnvisible_column/

    3 alternatives:

    Note that another alternative would also use a tree instead, control as the tree control also supports the hidable columns:

    http://forums.NI.com/T5/LabWindows-CVI/table-hide-column/TD-p/569773

    Best regards!

    -Johannes

  • Remove the checksum of each row in the table

    Hallo

    I got out as table and since I have just read the data with the checksum

    For example, I have to neglect the last 2 bytes in each row of the table. I tried several times but I can't succeed. It would be nice if someone help me to go around this problem.

    thanking you

    Best regards

    Karine

    Hi Karine,.

    have you tried really 'several times' to remove the last two characters of each string? Using an autoindexing FOR loop?

  • Maybe you are looking for