Can I partition tables online?
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Can I partition tables online?

  1. #1
    Join Date
    Apr 2001
    Location
    Congleton
    Posts
    258
    I have a large table which I want to parition using a date (DD-MON-YY) as the partition key.

    Can I partition this table online? If so, How?

    Also, if I have 5 partitions and partition 5 was ranged from '01-Nov-01' to '30-Nov-01' and the last partition was <(MAXVALUE)) .... Can I create another partition (in the future), e.g. partition 6 for '01-Dec-01' to '31-Dec-01', and still have the last partition as <(MAXVALUE) online?

    Thanks.

  2. #2
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    you can create partition table online yes (well it depends how you do it)

    Code:
    transform table into partitioned table
    
    create table partemp(
    empno number(4) not null,
    ename varchar2(10),
    job varchar2(9),
    mgr number(4),
    hiredate date,
    sal number(7,2),
    comm number(7,2),
    deptno number(2))
    partition by range(empno)
    (partition partemp6 values less than (8000))
    /
    
    alter table partemp exchange partition partemp6 with table emp
    /
    
    alter table partemp split partition partemp6
    at (7000)
    into (partition partemp1,
    partition partemp6)
    /
    
    alter table partemp split partition partemp6
    at (7200)
    into (partition partemp2,
    partition partemp6)
    /
    
    alter table partemp split partition partemp6
    at (7400)
    into (partition partemp3,
    partition partemp6)
    /
    
    
    alter table partemp split partition partemp6
    at (7600)
    into (partition partemp4,
    partition partemp6)
    /
    
    alter table partemp split partition partemp6
    at (7800)
    into (partition partemp5,
    partition partemp6)
    /

    you dont add partition if you wanna add DECMBER partiton, you SPLIT the maxvalue into two partitions, maxvalue and dec

  3. #3
    Join Date
    Apr 2001
    Location
    Congleton
    Posts
    258
    Thanks for this info... but if you split the partitions can you still use seperate tablespaces, i.e. split Decembers data into tablespace DEC01 and maxvalue into maxtabsp.Thanks.

  4. #4
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    ye you can split into seperate tablespaces, look the SQL syntax in the docs and you will see

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width