Online Table redefinition(partition maintenance) in 10g

Hi,
I would like to know more about the 10g feture of online table redifinition. I am specifically looking for removing the partition or adding new partition to the the exisitng table while the sessions are accessing the table. Can you please guide me on this.
Thanks
Anand

I recommend you writing procedure for
appending paritions
dropping partitions
from existing partition tables.
Here is simple example of dropping partitions, remember, you should drop only when parition is no longer used by application. Similarly you can write pl/sql to append partitions
DECLARE
v_msg VARCHAR2 (200);
v_table VARCHAR2 (30);
v_partiion_cur VARCHAR2 (200);
v_sql VARCHAR2 (200);
CURSOR table_cur
IS
SELECT DISTINCT table_name
FROM user_tab_partitions
Where <your condition>= criteria;
-- reteriving partition qualified for being dropped ; pass retention period
CURSOR partition_date_cur (i_table_name IN varchar2
IS
SELECT TO_DATE (TO_NUMBER (SUBSTR (partition_name, 9, 10)),
'YYYYMMDDHH24'
partition_date,
partition_name,
tablespace_name,
table_name
FROM user_tab_partitions
WHERE table_name = i_table_name
AND TO_DATE (TO_NUMBER (SUBSTR (partition_name, 9, 10)),
'YYYYMMDDHH24'
) < (SELECT TRUNC (SYSDATE)
- (SELECT VALUE
FROM some_retention_period_conf
WHERE code = 'RETENTION_PERIOD')
FROM DUAL);
BEGIN
-- some logging message
OPEN table_cur;
FETCH table_cur INTO v_table;
CLOSE table_cur;
FOR partition_date_rec IN partition_date_cur (v_table)
LOOP
v_sql :=
'ALTER TABLE '
|| partition_date_rec.table_name
|| ' DROP PARTITION '
|| partition_date_rec.partition_name;
EXECUTE IMMEDIATE v_sql;
END LOOP;
EXCEPTION
WHEN OTHERS
THEN
v_msg :=
'Partition Removal Procedure Failed : ' || SUBSTR (SQLERRM, 1, 150);
END ;

Similar Messages

  • 10G online table redefinition

    We have a DWH large table T1 (one single partition) which needs to be loaded incrementally, but due to large number of updates and deletes, we create another table T2 (one single partition) where we load all the data as inserts and then use partition exchange to load T1 and retire T2 as we cant have any downtime. This entire process takes a long time. Is there a better way using Oracle 10G online table redefinition that we can use so that the entire process doesnt take too long?
    Thanks

    If you are getting a large number of updates and deletes then I believe you have more of an OLTP processing system rather than a Data Ware House.
    Have you thought about looking into redesigning the system to accomodate your large number of updates and deletes as well as your incremental loads?
    What about using partitioning as you eluded to briefly?
    Regards
    Tim

  • Shell script for online table redefinition

    Hi,
    Could someone help me out in building a script for online table redefinition in AIX 11g, moving the table into a new table space.
    Thanks

    You are embarking upon a voyage in which you will expend a substantial effort reinventing the wheel.
    Look at Oracle DBMS_REDEFINITION built-in package.
    http://www.morganslibrary.org/reference/pkgs/dbms_redefinition.html
    and never do something outside the database, in a proprietary language, that can be done far more efficiently inside the RDBMS in a platform independent language.
    In other words, inside the database, I could code your entire project with error handling, in far less than an 15 minutes including testing.
    With a simple DDL statement, issued at the command prompt in SQL*Plus ... I could do it in less than 15 seconds: Your choice.
    ALTER TABLE <table_name> MOVE TABLESPACE <new_tablespace_name>;

  • ONLINE TABLE RANGE PARTITIONING

    Hello Gurus,
    I have huge table which i want to partition by RANGE(DATE) .
    select count(*) from ECTMT.TEST_BORAL;
    COUNT(*)
    1070985
    Columns are :
    NID NUMBER,
    TICKET_NBR VARCHAR2(20),
    CHANGE_DATE DATE, (I want to partitioned by this column value )
    CHANGE_DESC VARCHAR2(4000),
    OPERATOR VARCHAR2(255),
    TYPE VARCHAR2(255),
    LAST_MODIFIED DATE
    Now, the issue is space. I know the simple partioned method in which we can create the emty table and load data into it.
    But, i don't want to do that. i want to do a partition into exisiting table (ECTMT.TEST_BORAL) only, in other word i can say online split partitioning.
    If somebody can help,, really appreciate
    Regards,
    Srinivas kumar

    You cannot partition a table that is not currently partitioned. You will have to create a new partitioned table and move the data from the current table into the partitioned table.
    I am a little concerned that your problem is with space. You have a 1 million row table (not particularly big) and each row is no more than 5k, so we're only talking about 5 GB of data (plus another few GB, likely, for indexes). If you're trying to use partitioning in a database that doesn't have 5 GB of free space, you're probably going to have much bigger problems down the line.
    You could create a new, empty, partitioned table that had a single partition that covered all CHANGE_DATE values, do a partition exchange to load the current table into your new partitioned table, and then proceed to split the one partition into the proper size and number of partitions. That is going to be slower than the alternative options, however, and involve more downtime, so it's not something that would be generally recommended. Getting 5 GB of space temporarily is likely a far easier solution.
    Justin

  • What are the step involved in online table reorg in oracle 10g?

    Hi All,
    Could you please provide the step by step how to perform the online table reorg ?
    Thaks
    Bala

    Etbin wrote:
    You mean http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_redefi.htm#ARPLS042 ?
    Regards
    EtbinNo, not table redefinition, I think he means a tablespace reorg as you can do through Enterprise Manager.

  • Tool for table partitioning maintenance?

    Hi,
    Anyone knows a tool for table partitioning maintenance?
    I have tested Oracle ILM and it gives me the scripts but are not executed automatically.
    I'm looking for something that helps me with creating new partitions automatically.
    Thanks.
    Carlos

    Which version?
    This is solved in 11g you need not search for outside tool. Oracle has Interval partitioning for tables available which creates automatic partitions based on time, partitions by date, month,.....
    you can script the partitions creation based on date, month in older versions.

  • Error while finishing the Table Redefinition

    Hi All ,
    I am performing the Table Redefinition for one of my tables CSP_RESOURCE.
    While performing the last step where we execute the finish_redef_table , I am getting the below error :-
    SQL> exec dbms_redefinition.finish_redef_table('CSP','CSP_RESOURCE','CSP_RESOURCE_TEMP');
    BEGIN dbms_redefinition.finish_redef_table('CSP','CSP_RESOURCE','CSP_RESOURCE_TEMP'); END;
    ERROR at line 1:
    ORA-42012: error occurred while completing the redefinition
    ORA-00600: internal error code, arguments: [17182], [0x2AC81E4E19F0], [], [], [], [], [], [], [], []
    ORA-06512: at "SYS.DBMS_REDEFINITION", line 82
    ORA-06512: at "SYS.DBMS_REDEFINITION", line 1524
    ORA-06512: at line 1
    The same piece of code was running in Oracle 10g successfully but its giving the above error in Oracle 11G Release .
    Could someone please let me know what could be the possible cause for that?

    Thanks a lot Damorgan.
    i checked my version and i got the below result which suggests that I already have 11.2.03
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    Could you please let me know how to raise a SR for Oracle Support Team?

  • How to Access Table Space Map in Oracle 10g OEM

    How and from where to Access Table Space Map in Oracle 10g OEM ??
    Thanks

    Hi,
    first of all, the online help system of grid control is outstanding. Just click on Help in the upper right corner and enter "Tablespace Extent Map" in the search form.
    Result:
    Show Tablespace Contents Page
    Each Oracle database is divided into one or more logical units called tablespaces. You can use Oracle Enterprise Manager to manage these tablespaces and create or modify the parameters for the tablespaces. Use the Tablespace property sheet to set general and storage information for the specified tablespace.
    Use the Show Tablespace Contents page to display the list of tablespace segments that comprise the existing tablespace. You can display Tablespace Extents by choosing Show Tablespace Extent Map at the bottom of the page. An extent is a logical unit of database storage space allocation made up of a number of contiguous data blocks. One or more extents in turn make up a segment. When the existing space in a segment is completely used, Oracle allocates a new extent for the segment.
    You can view segment extents by clicking on the link in the Extents column to display the Extents in Segments page.
    You can display the Show Tablespace Contents page by choosing Show Tablespace Contents from the command drop down list on the Tablespace property page, the Tablespace View page, or the Tablespace search results page.
    Note: Developers could only display the tablespace map to a maximum hard coded number of 30,000 extents. Tablespaces are often larger than that. If a tablespace is larger than 30,000 extents, the portion over that is displayed as Unmapped. To avoid exceeding the memory capacity of the tablespace map and to display the map without unmapped extents, use a search criteria displaying results of less than 30K extents.
    For an overview of tablespaces, see the "Overview of Tablespaces " chapter of the Oracle Database Concepts Guide.
    For more information about managing tablespaces, see the " Managing Tablespaces" chapter of the Oracle Database Administrators Guide.
    For more information about managing datafiles, see the " Managing Datafiles and Tempfiles" chapter of the Oracle Database Administrator's Guide.

  • Flashack table and partitions??

    Hi All,
    Can We use the flash back tables with partitions...
    Any idea or any document about Flash back table and partitions relationship in 11 or 10g would help...
    Thanks

    Hi,
    we need to input PRT material Number and get in which and all tasklists it is being used
    Our PRT material number is of 12 digits and i could not find any suitable field to input the PRT material number in the table PLFH
    our PRT is like this
    FA115200A001
    how to input these PRT material numbers and get the required data
    regards,
    Madhu Kiran

  • Convert non-partition table to partition table

    Hello Everybody
    I am just want to ask about how to Convert non-partition table to partition table ?
    Thanks
    Ramez S. Sawires

    Dear ARF
    First of all thank you for replying me , second do u have any links talking about dbms_redefinition package
    I am using Database Oracle 10g
    Thanks
    Ramez S. Sawires
    Message was edited by:
    Ramez S. Sawires

  • Partition Maintenance and Stats gathering running together

    Hi All,
    I have a scenario in my production database wherein Partition Maintenance and Stats Gathering jobs begin at the same time (both are run weekly on Sundays only).
    Partition Maintenance is a job which basically rebuilds indexes and creates new partitions on tables in the database. While Stats Gathering job gathers stats on database tables.
    My question was based on the scenario if we consider - Maintenance job is rebuilding indexes on a table and at the same time Stats gathering job is trying to gather stats for that same table. So will there be any issue caused due to this scenario ??
    I would like to know whether there is any issue with their running at the same time ?
    Database version: Oracle 10 R2
    Environment: Unix AIX version 5.3
    Thanks in advance.

    Sandyboy036 wrote:
    Thanks for the reply.
    Could you elaborate what effect could it have on the table or some issues if I were to run both at the same time please ?
    Thanks.I would be concerned that statistics would not reflect reality.
    A partition could be created and populated & the statistics would not reflect this recent activity.
    why are you regularly rebuilding indexes?

  • What is Table redefinition

    Hi,
    what is the concept of Table redefintion.

    Hi,
    Table redefinition allows you to modify tables online so that there is an increased availability of tables during the process of redefinition.
    With redefinition you can modify the storage parameters, change the tablespace, add support for parallel queries, add or drop a column etc.
    The dbms_redefinition is used for this purpose.
    hth

  • What are the standard tables for plant maintenance in r/3

    I need the list of standard tables for plant maintenance in r/3. and also
    is there any way we can find the field name  and table which it belongs to in r/3,  based on the description of the field.

    I NEED THE FIELD NAMES FOR FOLLOWING FIELDS AND CORRESPONDING TABLE NAMES
    Equipment status
    registration number
    insurance type
    insurance type description
    registration date
    expiry date
    insurance companies
    expiry date
    policy number
    amount insured
    premium paid
    created by  ..so ..on
    for our report in PM  .. insurance data report
    THANKS

  • Creating Partitions in Oracle 10G Express Edition

    Can I create partitions in oracle 10g express edition?

    See yourself :
    http://download.oracle.com/docs/cd/B25329_01/doc/license.102/b25456/toc.htm#BABJIJCJ

  • Table controlled partitioning - please share your experiences.

    hello ,
    is anyone using table controlled partitioning in the sap on db2 for z/os enviroment?
    can you please share your [good/bad]experiences on the subject ?
    is there anything we should all watchout for ?
    thanks
    omer brandis
    visit the sap on db2 for z/os blog
    http://blogs.ittoolbox.com/sap/db2/

    hello ,
    is anyone using table controlled partitioning in the sap on db2 for z/os enviroment?
    can you please share your [good/bad]experiences on the subject ?
    is there anything we should all watchout for ?
    thanks
    omer brandis
    visit the sap on db2 for z/os blog
    http://blogs.ittoolbox.com/sap/db2/

Maybe you are looking for