Home » RDBMS Server » Server Administration » how can i add a subpartition (11g windows)
how can i add a subpartition [message #519776] Tue, 16 August 2011 20:11 Go to next message
andy huang
Messages: 498
Registered: July 2011
Senior Member
Dear all,
I have created a partition table using template,how can i add a subpartition named p_default which store default values for all pattitions ?


create table tb_p_test
(
  RECDATE      NUMBER(8) not null,
  USERNUMBER   VARCHAR2(32) not null,
  PROVCODE     NUMBER(5) default 0 not null,
  count        number
  
)
partition by range (RECDATE) subpartition by list(PROVCODE)
subpartition template ( 
 subpartition p_00  values (0)   , 
 subpartition p_01  values (1)   ,
 subpartition p_02  values (2)   , 
 Subpartition p_null Values(Null)
 )
(
  partition p_20110801 values less than (20110802),
  partition p_20110802 values less than (20110803)
);
Re: how can i add a subpartition [message #519777 is a reply to message #519776] Tue, 16 August 2011 20:29 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>how can i add a subpartition named p_default which store default values for all pattitions ?
what does above mean?

It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/

http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/statements_7002.htm#BABDAJFC

it is BAD! idea to store date, RECDATE, as NUMBER!
it is a bug waiting to infect the application

[Updated on: Tue, 16 August 2011 21:05]

Report message to a moderator

Re: how can i add a subpartition [message #520015 is a reply to message #519777] Thu, 18 August 2011 03:44 Go to previous message
andy huang
Messages: 498
Registered: July 2011
Senior Member
hi,
The issue have sloved. The flowing sql can do it.
Alter Table TB_HXL_USER Set Subpartition Template
(
subpartition p_00  values (0)   , 
 subpartition p_01  values (1)   ,
 subpartition p_02  values (2)   , 
 Subpartition p_null Values(Null),
 Subpartition p_default Values(default)
)
Previous Topic: Audit Log Oracle XE
Next Topic: partition-key using function issue
Goto Forum:
  


Current Time: Sat Apr 27 06:47:33 CDT 2024