Return-Path: <oracle-l-bounce@freelists.org>
Delivered-To: 2-oracle-l@orafaq.com
Received: (qmail 325 invoked from network); 11 Dec 2007 20:29:23 -0600
Received: from freelists-180.iquest.net (HELO turing.freelists.org) (206.53.239.180)
  by static-ip-69-64-49-119.inaddr.intergenia.de with SMTP; 11 Dec 2007 20:29:23 -0600
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 80EDC7D8135;
 Tue, 11 Dec 2007 21:29:23 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 06199-05; Tue, 11 Dec 2007 21:29:23 -0500 (EST)
Received: from turing (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id E25DD7D6432;
 Tue, 11 Dec 2007 21:29:22 -0500 (EST)
Received: with ECARTIS (v1.0.0; list oracle-l); Tue, 11 Dec 2007 20:41:57 -0500 (EST)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 741D17D7860
 for <oracle-l@freelists.org>; Tue, 11 Dec 2007 20:41:57 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 30175-04 for <oracle-l@freelists.org>;
 Tue, 11 Dec 2007 20:41:57 -0500 (EST)
Received: from s-utl01-dcpop.stsn.net (s-utl01-dcpop.stsn.net [72.255.0.201])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with SMTP id 31D7C7D782B
 for <oracle-l@freelists.org>; Tue, 11 Dec 2007 20:41:56 -0500 (EST)
Received: from s-utl01-dcpop.stsn.net ([127.0.0.1])
 by s-utl01-dcpop.stsn.net (SMSSMTP 4.1.2.20) with SMTP id M2007121120415321382
 for <oracle-l@freelists.org>; Tue, 11 Dec 2007 20:41:53 -0500
X-Spam-Status: No, hits=0.0 required=9.9
 tests=ALL_TRUSTED: -2.867,AWL: -0.432,BAYES_00: -1.665,
 HTML_50_60: 0.539,HTML_MESSAGE: 0.001,MIME_HTML_ONLY: 1.156,
 UPPERCASE_25_50: 0.039
X-Spam-Level: 
Received: from [10.60.103.184] ([10.60.103.184])
 by s-utl01-dcpop.stsn.net
 for oracle-l@freelists.org;
 Tue, 11 Dec 2007 20:41:51 -0500
Message-ID: <475F3BC8.3000100@evdbt.com>
Date: Tue, 11 Dec 2007 18:39:20 -0700
From: Tim Gorman <tim@evdbt.com>
Organization: Evergreen Database Technologies, Inc.
User-Agent: Thunderbird 2.0.0.9 (Windows/20071031)
MIME-Version: 1.0
To: oracle-l@freelists.org
Subject: Re: partitioned tables
References: <BLU108-W11D750F8257780265E814897640@phx.gbl> <6d3967610712111625t199e5383s99c20278f022ba6b@mail.gmail.com>
In-Reply-To: <6d3967610712111625t199e5383s99c20278f022ba6b@mail.gmail.com>
Content-Type: text/html; charset=ISO-8859-1
X-archive-position: 3858
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: tim@evdbt.com
Precedence: normal
Reply-to: tim@evdbt.com
List-help: <mailto:ecartis@freelists.org?Subject=help>
List-unsubscribe: <oracle-l-request@freelists.org?Subject=unsubscribe>
List-software: Ecartis version 1.0.0
List-Id: oracle-l <oracle-l.freelists.org>
X-List-ID: oracle-l <oracle-l.freelists.org>
List-subscribe: <oracle-l-request@freelists.org?Subject=subscribe>
List-owner: <mailto:steve.adams@ixora.com.au>
List-post: <mailto:oracle-l@freelists.org>
List-archive: <http://www.freelists.org/archives/oracle-l>
X-list: oracle-l
X-Virus-Scanned: Debian amavisd-new at localhost.localdomain

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Why use a number to represent a date?&nbsp; There is no advantage
whatsoever, and numerous disadvantages.<br>
<br>
...and as Gus pointed out,&nbsp; range partitioning syntax is "VALUES LESS
THAN" not "VALUES LESS THAN OR EQUAL TO"...<br>
<br>
<br>
Gus Spier wrote:
<blockquote
 cite="mid:6d3967610712111625t199e5383s99c20278f022ba6b@mail.gmail.com"
 type="cite">Of course, it's up to you, but if you set
NLS_DATE_FORMAT='YYYYMMDD', you won't need the TXN_DATE_ID.&nbsp; I might
also recommend that your partition by range (TXN_DATE_ID) use values
less than 20070201 instead of 20070131.
  <br>
  <br>
r,<br>
  <br>
Gus<br>
  <br>
  <div class="gmail_quote">On Dec 11, 2007 4:51 PM, Joe Smith &lt;<a
 moz-do-not-send="true" href="mailto:joe_dba@hotmail.com">joe_dba@hotmail.com</a>&gt;
wrote:<br>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
    <div>My primary key is a composite of 3 columns, but I range
parition only on one column.<br>
&nbsp;<br>
&nbsp;It that a problem?<br>
&nbsp;<br>
    <br>
&nbsp;I know it is a date field, but we are using a number for a date, i.e.
yyyymmdd.<br>
&nbsp;<br>
&nbsp;Would I need to set up a partitioned tablespace for the index, i.e. PK?<br>
&nbsp;<br>
CREATE TABLE F_MBR_ACCT_TRANSACTION<br>
(<br>
MBR_ACCT_ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INTEGER&nbsp; NOT NULL ,<br>
TXN_DATE_ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INTEGER&nbsp; NOT NULL ,<br>
SPONSOR_TRAN_ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INTEGER&nbsp; NOT NULL ,<br>
TXN_DTTM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DATE&nbsp; NULL ,
    <br>
TXN_AMOUNT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NUMBER(14,2)&nbsp; NULL <br>
CONSTRAINT&nbsp; F_MBR_ACCT_TRANSACTION_PK PRIMARY KEY
(MBR_ACCT_ID,TXN_DATE_ID,SPONSOR_TRAN_ID))<br>
partion by range (TXN_DATE_ID)<br>
(partition jan_2007 values less than (20070131) tablespace
smart_part_jan_2007,
    <br>
&nbsp;partition feb_2007 values less than (20070228) tablespace
smart_part_feb_2007,<br>
&nbsp;.<br>
&nbsp;.<br>
&nbsp;.<br>
&nbsp;partition jan_2007 values less than (20071231) tablespace
smart_part_dec_2007);<br>
&nbsp;<br>
&nbsp;<br>
    <br>
    <hr>Share life as it happens with the new Windows Live. <a
 moz-do-not-send="true"
 href="http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_122007"
 target="_blank">Share now!</a></div>
  </blockquote>
  </div>
  <br>
</blockquote>
</body>
</html>

--
http://www.freelists.org/webpage/oracle-l


