Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: table partitions

Re: table partitions

From: Jay Hostetter <jhostetter_at_decommunications.com>
Date: Tue, 16 Dec 2003 05:39:25 -0800
Message-ID: <F001.005DA159.20031216053925@fatcity.com>


Resending, since my message was truncated... <<<<
Your high value for each partition can just be the beginning of every month. For example:

CREATE TABLE ACCOUNTS
(

  STATEMENT_DATE                 DATE           NOT NULL,
  ACCOUNT_NUMBER                 VARCHAR2(8)    NOT NULL,
  BILLING_CYCLE                  VARCHAR2(2)    NOT NULL,
...
PARTITION BY RANGE (STATEMENT_DATE)
(
  PARTITION ACCOUNTS_JAN02 VALUES LESS THAN (TO_DATE(' 2002-02-01', 'YYYY-MM-DD))     TABLESPACE BILH_DATA_01,
  PARTITION ACCOUNTS_FEB02 VALUES LESS THAN (TO_DATE(' 2002-03-01', 'YYYY-MM-DD))     TABLESPACE BILH_DATA_02,
  PARTITION ACCOUNTS_MAR02 VALUES LESS THAN (TO_DATE(' 2002-04-01', 'YYYY-MM-DD))     TABLESPACE BILH_DATA_03
);

Jay

>>> RStephenson_at_Ovid.com 12/15/03 07:34PM >>>
create table aadedupekeys
(

   file_id number,
   rundate date,

   pk      number(10),
   dk      varchar2(128),

   constraint aadedupekeys_pk primary key (file_id,rundate) )
;

Is there anyway to partition a table (above) in months e.g. ('January','Februray'...). I want to use the rundate and list partition it using the months of the year. How can I do that without actually having to create another column in the table that only contains the month it belongs to? I cannot seem to use a function on the rundate field as part of the partition syntax to generate a month to partition the data.

Thanks for your help,

Rick Stephenson

**DISCLAIMER
This e-mail message and any files transmitted with it are intended for the use of the individual or entity to which they are addressed and may contain information that is privileged, proprietary and confidential. If you are not the intended recipient, you may not use, copy or disclose to anyone the message or any information contained in the message. If you have received this communication in error, please notify the sender and delete this e-mail message. The contents do not represent the opinion of D&E except to the extent that it relates to their official business.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jay Hostetter
  INET: jhostetter_at_decommunications.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Tue Dec 16 2003 - 07:39:25 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US