Partition an Existing Table with Data

We have a table that is approx. 23Gb with 90 million rows. We need to partition it. What is the fastest or most efficient way to accomplish this? Oracle 10.2.0.4.

user1175547 wrote:
We have a table that is approx. 23Gb with 90 million rows. We need to partition it. What is the fastest or most efficient way to accomplish this? Oracle 10.2.0.4.you can use DBMS_REDEFINITION, also exchange partition is also a good solution :)
http://www.oracle-base.com/articles/misc/PartitioningAnExistingTableUsingExchangePartition.php

Similar Messages

  • Partitioning an Existing Table with data

    Hi All,
    I am few tables with data, I need to Partition the table without affecting existing table values is it possible?.
    if yes then Please suggest me some ideas to archive that..
    Thanks & Regards
    Sami

    Hi All,
    I Need to partition for existing table with 1 million records
    1. First partition should be created for 6 months
    2.Second partition should created for 1 year.
    3.So as of now we have 6 months Data in production + another 6 months data in First partition + another 1 year data in Second partition.
    4.More than 2 year’s data’s should be moved other partition or archived.
    kindly provide your valuabe suggestion.
    Thanks & Regards
    Sami

  • Creating Partitions in Existing tables with Data

    Hello everyone,
    I want to know what the best way of creating partitions, in tables having data, is .. ???
    thanks
    Rossy Rocs

    There are two ways :
    1a Create a new Partitioned Table
    1b Copy data from the existing table to the new table
    1c Create Indexes
    1d Rename old table
    1e Rename new table
    OR
    2 Use DBMS_REDEFINITION
    See
    http://www.oracle-base.com/articles/misc/PartitioningAnExistingTable.php
    Hemant K Chitale

  • How add primary key constraint to already existing table with data

    I want apply primary key constraint to already existing table with data
    is there any command or way to do

    Alternatively, assuming you want to ensure uniqueness in your primary key column you can do this:
    alter table <table name> add constraint <cons name> primary key (col1,col2) exceptions into <exception_table>
    If the altter table statement fails this will populate the EXCEPTIONS table with the rows that contain duplicate values for (col1,col2).
    You will need to run (or get a DBA to run) a script called UTLEXCPT.SQL (which will be in the $ORACLE_HOME/rdbms/admin directory) if you don't already have an EXCEPTIONS table.
    Cheers, APC

  • Rename the existing table with date suffix

    Hi,
    I'm trying to rename a table with date suffix at the end of the table name, and drop the date suffix table which is greater than 7 days. for that I have the below sql, I have not included the drop syntax in this.
    I'm not able to rename with the date suffix in the below sql, syntax error at '+'  
    DECLARE
    @TPartitionDate date
    IF EXISTS (SELECT * FROM sysobjects WHERE Name = 'IIS_4')
    BEGIN
    SELECT
    @TPartitionDate = MAX(PartitionDate)
    FROM PartitionLog (NOLOCK)
    EXEC sp_rename 'IIS_4','IIS_4_'+ @TPartitionDate
    END

    create table Test(sno int)
    DECLARE
    @TPartitionDate date = getdate()
    declare @a varchar(200)
    IF EXISTS (SELECT * FROM sysobjects WHERE Name = 'Test')
    BEGIN
    select @a='TEST_'+ cast(@TPartitionDate as varchar(10))
    EXEC sp_rename 'TEST',@a
    END
    drop table [test_2015-04-23]
    Hope it Helps!!

  • How to create a table from an existing table with new column

    Hi !
    Please help me.
    I want to create a table from an existing table with data and add two new column to the new table.
    What will be the syntax?

    craete table new_table as select a.*, 'somevalue' new_col1, 'somevalue'
    new_col2 from old_table a;Also there is a pitfall - newly created table will accept column type and precision from the select statement, so further you can be needed to modify columns
    if you want to have VARCHAR2 instead of CHAR for example:
    SQL> create table new_dept as select dept.*, 'New data' new_col from dept;
    Table created.
    SQL> desc new_dept
    Name                                      Null?    Type
    DEPTNO                                             NUMBER(2)
    DNAME                                              VARCHAR2(14)
    LOC                                                VARCHAR2(13)
    NEW_COL                                            CHAR(8)
    SQL> alter table new_dept modify (new_col varchar2(8));
    Table altered.
    SQL> desc new_dept
    Name                                      Null?    Type
    DEPTNO                                             NUMBER(2)
    DNAME                                              VARCHAR2(14)
    LOC                                                VARCHAR2(13)
    NEW_COL                                            VARCHAR2(8)Rgds.
    Didn't see michael's post - it reflects the fix for this problem using CAST.
    Message was edited by:
    dnikiforov

  • How to change the partition type on a table with data

    Hi
    I have a table, which is partitioned by list on date column. The table contains large volume of data.
    My requirement is to make the list partition into range on the same date column.
    I am working on Oracle10g
    Kindly advice

    partitioned by list on date How many distinct DATE values do you have ? Each DATE value would be a Partition in List Partitioning.
    Why do you need to convert this to RANGE Partitioning ? How many DATE values do you expect in the table in the future ?
    You can use DBMS_REDIFINITION to copy a LIST Partitioned Table to a RANGE Partitioned Table and then switch the tables at the end.
    See examples (where the source table is not partitioned)
    http://www.oracle-base.com/articles/misc/partitioning-an-existing-table.php
    http://uhesse.com/2010/02/15/partitioning-a-table-online-with-dbms_redefinition/
    But before converting I would justify why a LIST Partitioned Table be converted to RANGE Partitioned. Do you have Date-Range queries ?
    Hemant K Chitale
    Edited by: Hemant K Chitale on Mar 15, 2013 2:11 PM

  • What's the best practice to partition an existing table?

    We are using Oracle 11g EE 11.2.0.3.0. We want to partition an existing table. I found some information from this link [http://www.oracle-base.com/articles/misc/partitioning-an-existing-table.php], but I am not sure whether that's the best way. Could anyone share the best practice of partitioning an existing table?
    Thanks.
    Jun

    >
    We want to partition a few related tables. A couple of tables have about 30 million rows, and a couple of other tables have about 10 million rows. The data for those tables is for ~2000 accounts, each of them is identified by a column named "account_id". We want to partition the tables by using the "account_id" as the partition key to gain better performance for queries, so we would probably use hash partition. Please advise.
    >
    1. What evidence do you have that your performance will be any better if you partition those tables?
    2. What evidence do you have that there is anything wrong with the performance of your current queries?
    3. Have you reviewed the actual execution plans for your most important queries to see if there is even any room for improvement?
    If your query uses account_id as a predicate but only pulls a few records from a 'master' table for that key value your performance may actually be worse if you partition that table. That is because using an index range scan Oracle can easily find the ROWIDs of the rows that need to be selected and then easily retrieve them regardless of their physical location.
    If you have queries that do NOT use account_id but currently use indexes the performance of those queries may also be worse if you partition that table. Those indexes will be GLOBAL.
    There are two major implications when you use hash partitioning:
    1. Any query that does NOT include the partitioning key (account_id for your case) will, of necessity, have to use a full table scan if an appropriate index is not available.
    2. You will get NO management benefits such as being able to add/remove partitions that include old data.
    Before you decide to partition a table you should conduct tests and examine the execution plans for your important queries.

  • How to create a partition on existing table?

    Hey
    Could some one please tell me on how to create a partition on existing table?

    Could some one please tell me on how to create a partition on existing table?
    You can't - that isn't possible. Unless a table is already partitioned you can NOT create another partition on it.
    You must either redefine the table as a partitioned table (using the DBMS_REDEFINITION package) or create a new partitioned table and move the data to its new partitions.
    The choice will depend on how much data the existing table has and whether you can do it offline.

  • New DB from existing DB with data

    Hi All,
    How to create new DB from an existing DB with all the data? means what could be the sql for that. ?

    i mean to say when we want create a table in db from an existing db with data then we write like
    create table <table_name> as select * from <db_name>.<table_name>
    so is there any sql like this for creating db from an existing db with data?

  • Partition an existing table

    How can I partition an existing table? What's the SQL syntax?
    Thanks for help,
    Chen Zhao

    Does anybody know how to partition an existing table?
    YES! That is the simple answer to your question. There are a lot of people that know how to do that.
    Whether partitioning is appropriate and, if so, which method might be 'best' for YOU depends on the particulars of your use case. But as with most problems you need to make sure you troubleshoot whatever issue you have in the proper order:
    1. Identify a PROBLEM or issue that needs to be resolved - you haven't told us anything. Please post info about this
    2. Validate that the problem/issue actually exists (it could just be a fluke occurence)
    3. Identify potential solutions to the problem/issue - that list of solutions may, or may not, include partitioning
    4. Select a small number (e.g. 1 or 2) of those solutions for further analysis and actual tests.
    5. Select the 'best' (based on your orgs criteria) of those tested solutions for implemention
    You seem to already be on step #5. But in order for us to help you we have to understand what the results of steps 1 thru 4 are.
    Please post the information about your PROBLEM that we need to help you.

  • Partitioning an Existing Table

    Dear Forum,
    Can we create partition on an existing table without dropping it in Oracle 11.2.0.3.0?
    I know EXCHANGE PARTITION, but that I don't want.
    Thank you & regards.

    You cannot partition an existing table.
    You have to create a new partitioned table and move the data from the old table to the new table. If you want to do this online, you can potentially leverage the DBMS_REDEFINITION package to help you out. Behind the scenes, you're still creating a new table and, eventually, dropping the old table after moving all the data over. DBMS_REDEFINITION hides some of that from you and lets the table remain online while you are moving the data. But it adds some performance overhead.
    Justin

  • Create partition to existing table

    I have a existing table which is not partitioned. How can partition my existing table?

    oops.... This is more better....
    Partitioning an Existing Table
    http://www.oracle-base.com/articles/misc/PartitioningAnExistingTable.php
    Other method
    (1) create new_table with oen or more range partition.
    (2) alter table new_table exchange partition with old_table.
    (3) rename or drop old_table.
    (4) rename new_table to old_table.
    (5) split or add partition.
    -- Examples
    --(1)
    create table part_tab
    partition by range (col)
    (partition p1 values less than (maxvalue))
    as select * from org_tab where 1=0;
    --(2)
    alter table part_tab
    exchange partition p1 with table org_tab
    without validation
    --(3)
    rename org_tab to backup_table;
    --(4)
    rename part_tab to org_tab;
    --(5)
    alter table org_tab
    split partition p1 at (100)
    into (partition p1, partition p2);
    alter table org_tab
    split partition p2 at (200)
    into (partition p2, partition p3);
    -- Results
    SQL> select * from org_tab partition(p1);
    COL        VC
    99         abc
    SQL> c/p1/p2
      1* select * from org_tab partition(p2)
    SQL> /
    COL        VC
    199        def
    Original is written in Japanese language (OTN Japan)
    http://otn.oracle.co.jp/forum/message.jspa?messageID=3045618?
    Message was edited by:
    ushitaki

  • Help on export sybase iq tables with data and import in another database ?

    Help on export Sybase iq 16 tables with data and import into another database ?

    Hi Nilesh,
    If you have table/index create commands (DDLs), you can create them in Developper and import data using one of methods below
    Extract/ Load table
    Insert location method : require IQ servers to be entered in interfaces file
    Backup/Restore : copy entire database content
    If you have not the DDLs, you can generate them using IQ cockpit or SCC.
    http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc01773.1604/doc/html/san1288042631955.html
    http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc01840.1604/doc/html/san1281564927196.html
    Regards,
    Tayeb.

  • Problem while adding a new dimension in a existing cube with data in BW3.5

    Hi,
    We are trying to create a new dimension with new characteristics in a existing cube. But while activating we are getting error that "InfoCube contains data; intentional changes not permitted". Can we add a new dimension in a existing cube with data in BW3.5? If it is not possible then we can take the backup and delete the data from cube and then change the cube. But my question is that, when we will transport the cube with changes to quality then will it transport successfully or same procedure needs to be done there as well.
    Regards,
    Saikat

    hi,
    Adding new infoobject /dimension to the cube containing data in 3.5 is not possible.
    easier solution is create a new cube similar to old and add the new dimension and proceed.
    else you have to drop data and transport.
    Ramesh

Maybe you are looking for

  • Dual Booting with Windows 8 and 7 Pro in a G6 - 2235us Notebook

    I have a G6 - 2235us Notebook 64 bit  that came with Windows 8.0  installed. I would like to install Windows 7 Pro and make it dual book with Windows 8.0 with 7 as the default to start. Would you please give me steps as to how to proceed and also the

  • Can i have movies in Itunes you

    hello again. I justed started i topic, about changing the background in your libary. It looks like there is nothing to do, from what i've seen on the net. anyhow, i have a lot of cartoons. And i would like to keep them seperated from my movies. So i

  • Two Key figures in Report Painter column?

    Dear Experts, We have some company codes with group currency setup and others without this. I have created a report painter report with table GLT0. I want ability to produce a consolidated report for all the company codes. However, when I define the

  • SCOM 2012 reports missing.

    I've searched the google and this forum for answers but haven't found anything that worked so far. When I open the Reporting tab for SCOM I see the Application Monitoring report group for .Net Monitoring, Authored Reports, Favorite Reports, and Sched

  • I want to force lan cable plugin during login process on 802.1x computer only weird client

    Hi I Configured Wired and computer only  802.1x authentications on all my switch and client on my network  ,It works without any problem . I have user logon script to change local administrator password each time they log on ,I recently find out they