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

Similar Messages

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

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

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

  • 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

  • Problem with DB6CONV online table move

    Hello,
    I tried to schedule a few concurrent online table move using DB6CONV (version 4.08, on NW07 SP17, DB2 9.5), and I got the error message below in two of the table move sessions:
    20090917 174517 ONLINE CONVERSION: Start of Step 1 (INIT)
    20090917 174517 CALL SAPTOOLS.ONLINE_TABLE_MOVE( 'SAPBD1', '/BIC/AZGL_D00600',
                      'BD1#ZDGLAD', 'BD1#ZDGLAI', '', '', '', 'INIT' )
    20090917 174518 ONLINE_TABLE_MOVE - INIT step aborted.
    20090917 174518 SQL0443N  Routine "*BLE_MOVE" (specific name "") has returned an error
                      SQLSTATE with diagnostic text "SQL0624N  Table
                      "SAPTOOLS.ONLINE_TABLE_MOVE" already has a ".  SQLSTATE=42889
    20090917 174518 Step 1 aborted with errors
    I then chose "Continue" on one session alone, it completed successfully.
    If this is a problem when running DB6CONV online table move in parallel? Is there any way to fix this problem?
    Thanks,
    Patrick

    Hi Siegfried,
    My trace file will excee the maximum 15000 characters allowed in this forum. If you like I can send you in the email.
    With a single table move, it will not fail. So the trace file below showed a successful init step:
    13286: entry: SQLT_db2sap_online_table_move     "SAPBD1"        "/BIC/B0001321000"      "INIT,TRACE"
      838: entry: SQLT_db2sap_Otm_constructor       fffffffffff5c40
        145: entry: SQLT_db2sap_StoredProcedure_connect     fffffffffff5c40
        172: exit:  SQLT_db2sap_StoredProcedure_connect=0
        113: entry: SQLT_db2sap_StoredProcedure_initVersion fffffffffff5c40
          130: SQLT_db2sap_StoredProcedure_initVersion      "driverVer"     "09.05.0002"
        136: exit:  SQLT_db2sap_StoredProcedure_initVersion=0       true    true
        877: SQLT_db2sap_Otm_constructor    "indexNameSz"   128
        880: SQLT_db2sap_Otm_constructor    "triggerNameSz" 128
      883: exit:  SQLT_db2sap_Otm_constructor=0
      2951: entry: SQLT_db2sap_Otm_getProtocolEntryAsInt    "TRACE" fffffffffff5c40 true    0
        2921: entry: SQLT_db2sap_Otm_getProtocolEntry       "TRACE" fffffffffff5138 129     fffffffffff5c40 true    "<null
    >"
          2847: entry: SQLT_db2sap_Otm_getProtocolEntry     "SAPBD1"        "/BIC/B0001321000"      "TRACE" fffffffffff513
    8       129     fffffffffff5c40
            305: entry: SQLT_db2sap_StoredProcedure_prepare "SELECT COALESCE(value, longvalue) AS VALUE FROM SAPTOOLS.ONLI
    NE_TABLE_MOVE WHERE tabschema = ? and tabname = ? and key = ? OPTIMIZE FOR 1 ROW"       fffffffffff5c40 false
            323: exit:  SQLT_db2sap_StoredProcedure_prepare=0
            2890: SQLT_db2sap_HANDLE_SQLCA  -100014
          2903: exit:  SQLT_db2sap_Otm_getProtocolEntry=-100014     ""
          2847: entry: SQLT_db2sap_Otm_getProtocolEntry     ""      ""      "TRACE" fffffffffff5138 129     fffffffffff5c4
    0
            2890: SQLT_db2sap_HANDLE_SQLCA  -100014
          2903: exit:  SQLT_db2sap_Otm_getProtocolEntry=-100014     ""
          2940: SQLT_db2sap_HANDLE_SQLCA    -100014
        2943: exit:  SQLT_db2sap_Otm_getProtocolEntry=-100014       ""
      2981: exit:  SQLT_db2sap_Otm_getProtocolEntryAsInt=0  0
      3469: entry: SQLT_db2sap_Otm_setLock  fffffffffff5c40
        2921: entry: SQLT_db2sap_Otm_getProtocolEntry       "LOCK"  fffffffffff50d8 129     fffffffffff5c40 false   ""
          2847: entry: SQLT_db2sap_Otm_getProtocolEntry     "SAPBD1"        "/BIC/B0001321000"      "LOCK"  fffffffffff50d
    8       129     fffffffffff5c40
            2890: SQLT_db2sap_HANDLE_SQLCA  -100014
          2903: exit:  SQLT_db2sap_Otm_getProtocolEntry=-100014     ""
        2943: exit:  SQLT_db2sap_Otm_getProtocolEntry=0     ""
        2993: entry: SQLT_db2sap_Otm_protocolTime   "LOCK"  fffffffffff5c40
          305: entry: SQLT_db2sap_StoredProcedure_prepare   "MERGE INTO SAPTOOLS.ONLINE_TABLE_MOVE AS t USING TABLE
      323: exit:  SQLT_db2sap_StoredProcedure_prepare=0
      922: entry: SQLT_db2sap_Otm_destroy   110029290       fffffffffff5c40
        3522: entry: SQLT_db2sap_Otm_releaseLock    fffffffffff5c40
        3536: exit:  SQLT_db2sap_Otm_releaseLock=0
        770: entry: SQLT_db2sap_Otm_deinitReplay    fffffffffff5c40
        788: exit:  SQLT_db2sap_Otm_deinitReplay=0
        181: entry: SQLT_db2sap_StoredProcedure_disconnect  fffffffffff5c40
        260: exit:  SQLT_db2sap_StoredProcedure_disconnect=0
        648: entry: SQLT_db2sap_StmtPool_destructor
          649: SQLT_db2sap_StmtPool_destructor      2
        654: exit:  SQLT_db2sap_StmtPool_destructor=0
        181: entry: SQLT_db2sap_StoredProcedure_disconnect  fffffffffff5148
        260: exit:  SQLT_db2sap_StoredProcedure_disconnect=0
      997: exit:  SQLT_db2sap_Otm_destroy=0
    13634: exit:  SQLT_db2sap_online_table_move=0   "00000" ""

  • ADF Faces 10g af:table row selection using SHIFT Key

    Hello,
    Is there a simple way in 10G af:table with multiple selection facet to enable selecting multiple rows of a table by selecting one row, holding the SHIFT key down, selecting another row way down, and having all the rows in the middle be automatically selected?
    So, this is essentially equivalent to "Select Range" Capability.
    Thank you for any information.

    I think the simple answer to your question is, no.
    In 11g, I think the answer is, yes; but you probably already knew that.
    You might consider altering the keySet associated with the table related to the multi-select checkbox facet. You could have some section above the table that selects these check boxes based on some entered filter criteria. The keySet is a little weird though. You might check out its usage in SRDemo Application Module Impl class code which deletes over this keyset, and work backwards from there.

  • I have function and producer how to apply in form 10g block table

    Dear All
    help me i have create function or package in plsql but i have not understand to apply form developer 10g  block tables so kindly guide me fully
    thank for cooperate and support me

    Hi,
    Do you want to call the function from the Form or do you want to base the block on the function? Please elaborate your question.
    Regards,
    Mark

  • DB6CONV Online table move

    Hi all,
        We used SAP standard report DB6CONV to move some tables from one tablespace to another in ECC 5.0.
        When all steps have finished following the SAP Notes 362325 and no errors occur, what make me confuse is that the table which has been moved still show in the old tablespace in SAP system using Tcode DB13, but we go to DB level we found this table has reside in the new tablespace.
        We use the latest version of DB6CONV 4.08 and do online table move.
        Should it like that?  Can somebody clarify my confusion? Thank you very much!
        PS: SAP NW640, DB2 8.2.2, AIX5.3
    Best Regards,
    Terry

    Hi Terry,
    For SAP table spaces historical information, they are collected by a standard SAP background job.  Just wait patiently until that job is run for the information to be updated. 
    To check whether your table actually resides in the new table space, you can go to se11, technical setting, to check the data class.  Your moved table should be residing in the data class that associated to the target table space.
    Regards,
    -Beck

  • ONLINE TABLE REDEFINATION

    Hi All,
    One of the production table which has 5500 extents but it does not have any data in it and its slowing down our application(Its an Advance Queue table).
    It is recommended by the application that we recreate this table and they have a script for that.
    I want to do it online without any downtime for the application.
    Can I reorganize this table online.
    Regards,
    Umair

    As far as I know your table will be locked during the ALTER TABLE MOVE. So there will be no insert/update/delete possible during this operation.
    If your table is realy empty you may simply execute a TRUNCATE DROP STORAGE
    If you are using 10g you may also have a look at ALTER TABLE SHRINK.

  • Deadlock issue in Oracle 10g Partitioned Tables

    Hi ALL,
    I am facing an issue of Deadlock while inserting data into a partitioned table.
    I get an error "ORA-00600: Deadlock detected". when i see the trace files, following lines are appearing in them:
    "Single resource deadlock: blocking enqueue which blocks itself".
    Here is the detail of my test case:
    1. I have a list-partitioned table, with partitioning defined on some business codes.
    2. I have a query that merges data into partitioned table (actually compares unique keys between temporary table and partitioned table and then issue an insert if keys not matched, no update part).
    3. The temporary table contains transactional data against many business codes.
    3. when calling the above query from multiple (PL/SQL) sessions, i observe that when we merge data in same partition (from different sessions) than deadlock issue occurs, otherwise it is OK.
    4. Note that all sessions are executed at same time. Also note that Commit is called after each session is completed. Each session contains 2-3 more queries after the mentioned merge statement.
    Is there an issue with oracle merge/insert on same partition (from different sessions)? What is the locking mechanism for this particular case (partitioned tables)?
    My oracle version is Oracle 10g (10.2.0.4). Kindly advice.
    Thanks,
    QQ.

    Could you print the deadlock tree so we can see the type and mode of the locking. (Please use the 'code' tags - see FAQ at top right of screen - to showthe output in fixed font). can you list any SQL operated by this session that gets reported in the trace file.
    Does the table reference itself in a foreign key.
    Is this table involved in any referential integrity constraints.
    Do you have a global primary key index, or a local primary key index ?
    Are there any triggers on the table - if so do they contain autonomous transactions.
    At present the only though that springs to mind is that the merge command has to lock the target table to do the insert/update, but it also has to lock any child table. The mode of the child lock depends on whether it has a suitable index or not, and whether the child table IS also the parent table. If you have two merges to the same partition one partition may get its locks, and the other partition may be in a state where it can't get one of the locks because it's wait for the other. (This shouldn't be a self-deadlock, though, but the scenario might be heading in the right direction for a self-deadlock).
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge." (Stephen Hawking)

  • 10g Nested Tables and APEX

    Trying to use the following within Apex:
    CREATE TYPE location_typ AS OBJECT (
    location_id NUMBER(4),
    street_address VARCHAR2(40),
    postal_code VARCHAR2(12),
    city VARCHAR2(30),
    state_province VARCHAR2(25));
    CREATE TYPE nt_location_typ AS TABLE OF location_typ;
    CREATE TYPE country_typ AS OBJECT (
    country_id CHAR(2),
    country_name VARCHAR2(40),
    locations nt_location_typ);
    CREATE TYPE nt_country_typ AS TABLE OF country_typ;
    CREATE TABLE region_tab (
    region_id NUMBER,
    region_name VARCHAR2(25),
    countries nt_country_typ)
    NESTED TABLE countries STORE AS nt_countries_tab (
    (PRIMARY KEY (NESTED_TABLE_ID, country_id))
    ORGANIZATION INDEX COMPRESS
    NESTED TABLE locations STORE AS nt_locations_tab);
    Can get Apex to function in the Tabular Report mode by modifying the query to use the correct syntax:
    select "REGION_ID",
    "REGION_NAME",
    c.COUNTRY_ID,
    c.COUNTRY_NAME,
    l.LOCATION_ID,
    l.STREET_ADDRESS, l.POSTAL_CODE,
    l.CITY,
    l.STATE_PROVINCE
    from "#OWNER#"."REGION_TAB", TABLE(COUNTRIES) C, TABLE(LOCATIONS) L
    Built a 'Maintenance' form. Put the Region base column on it. Then built a tabular form (with an updateable query) on the same page to access the first level Nest ( countries). Haven't figured out how to actually edit the values yet, but feel comfortable I will.
    But - trying to provide editing to the 2nd level nested table elements creates a problem. First, only 1 updateable query can be on a page. Hmmm - so to get around this I guess I have to build a new page that the calling updateable query will access when selecting one of the tabular form elements. Not elegant by any means. Was hoping to provide a blank form on the right side that would be populated by the Location Nested Table values when a select was made on the first level nest. Oh well.
    Just curious how anyone has handled this? I could pass stack between pages for sure, but was hoping page regions would be sufficient to handle this.
    Any white papers on this? Anything in the DEMO area to use as a template? The default Demo doesn't provide this based on querying user objects.
    Thanks,
    Dwight Taylor

    Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL> CREATE OR REPLACE TYPE table_type AS TABLE OF VARCHAR2 (8);
      2  /
    Type created.
    SQL> CREATE TABLE r(
      2    a INTEGER,
      3    b table_type)
      4    NESTED TABLE b STORE as b_1;
    Table created.
    SQL> CREATE TABLE s(
      2    a INTEGER,
      3    b table_type)
      4    NESTED TABLE b STORE as b_2;
    Table created.
    SQL> INSERT INTO r VALUES (1, table_type ('a', 'b'));
    1 row created.
    SQL> INSERT INTO s VALUES (1, table_type ('b', 'c'));
    1 row created.
    SQL> COLUMN c FORMAT A10;
    SQL> SELECT r.a, r.b MULTISET UNION DISTINCT s.b c
      2  FROM   r, s
      3  WHERE  r.a = s.a;
             A C
             1 TABLE_TYPE('a', 'b', 'c')
    SQL>

  • Oracle Tunning in 10g on table parallelism

    Hi,
    I am working in 10g database(10.2.0.1). I have insert statement which uses table A(120 M rows), B(0.5M rows) and C (0.2M rows) to insert on table D.
    Following are the table definitions:
    Table A - Is partitioned, has unique indexe and is declared NOPARALLEL DEGREE.
    Table B - Has unique indexe and is declared NOPARALLEL DEGREE.
    Table C - Has unique indexe and is declared NOPARALLEL DEGREE.
    Table D - Has declared NOPARALLEL DEGREE.
    a) When using the insert on table D using tables A,B and C using HINT /*+ APPEND PARALLEL(table name 12) / and also given on Inset table with /+ APPEND PARALLEL(table name 12). For most of the time it shows 17 to 21 sessions.
    INSERT INTO /*+ APPEND PARALLEL(d 12)*/ D d
    (x,y,z)
    SELECT /*+ PARALLEL(A 12) PARALLEL(B 12) PARALLEL(C 12)*/
    bla. bla...bla...
    with few joins on the respective tables
    b) Same query without any changes at table level definition and no query changes. Some time it shows only one session. At that particular time we (user) has to intervene and alter table definition from NOPARALLEL to PARALLEL (DEGREE DEFAULT) on target table D.
    My questions are:
    i) What could be reason that it varies and displays no of sessions are running ?
    ii) How oracle takes and uses no of sessions while executing the query?
    iii) Is there any where we can see or monitor the session tracking ?
    iv) How many max sessions can a query like above insert can take/use for the user schema?
    v) Is it possible for the developers to reduce and increase the sessions while executing the query ?
    vi) On what basis the sessions get increase or decrease?
    If any of them can provide answers to above query it will be helpful...
    Regards,
    Prakash C

    The following link might help u a bit in understanding parallelism concept for queries -
    http://docs.oracle.com/cd/B19306_01/server.102/b14223/usingpe.htm

  • JDeveloper 10g and Table Viewer

    For JDeveloper 10g, after creating a connection under the database node, right-clicking on a synonym or table does not provide a Table Viewer option in the popup menu. Additionally, double-clicking the synonym or table does not open the table viewer, "No Structure" is displayed in the structure window. However, when creating the same connection in JDeveloper 9i I am able to view the table structure... so the problem doesn't appear to be database rights. Is there some configuration setting in JDeveloper 10g that I have overlooked?

    What version of the database are you using?
    In JDeveloper 10g, you won't see "Table Viewer" on the context menu (you should just see "Open" instead). However, you should definitely be able to see the structure when the table is selected, and you should see the table viewer when double-clicking on the table.
    Also, can you check in the console window (run jdev.exe to see the console window) to see if there are any exceptions being thrown?
    -- Brian

Maybe you are looking for

  • How to install the SAP Java Connector

    Hi, I am unsure how to install the SAP Java Connector on Linux (Suse Linux Enterprise 10). The SAP Integration Kit install and admin guide says: === u2022 Copy the librfccm library and the libsapjcorfc library to busines sobjects_root/enterprise120/P

  • Outline agreements(contracts) - consignment

    Hello Experts! I have following problem and need your help. I have run the report ME80RN (General Analysis of Purchasing documents) for quantity contracts. We have normal and consignment contracts. Is there any chance that the report shows the values

  • Right place to include the file name of an attachment

    Hi... I'm using SAAJ to include some PDF files into my web service response... I would like to know where to place the filename of the each attachment I'm sending since the client needs that name to save the attachments to disk. Thanks for the help..

  • Using variables in mathematical forumulas

    I am using Adobe Captivate 4. My project uses both system variables and user variables.  Is there a way to use the user variables in an equation and then display the result?  For example, adding the value of two variables and displaying the sum.

  • Clients upgraded with CU3 still shown with lower version from SCCM console

    Hello, A couple of months ago, I upgraded all my clients with CU3.  As I still have about 2% of clients not shown as upgraded to CU3 when I look in the console, I started to investigate on client side. It appears those clients properly got the upgrad