on 03-05-2014 3:20 PM
Hello,
We are trying to do a partition for the first time.
We used the following:
ALTER TABLE "BNHP_UTILS"."TC_RDL_BAL_CP_3"
PARTITION BY
RANGE ("/BA1/C55POSTD")
(
PARTITION '20130901' <= VALUES < '20131001',
PARTITION '20131001' <= VALUES <'20131101',
PARTITION OTHERS
),
HASH ("/BA1/C55AOTYPE") PARTITION 5
We are getting a syntax error.
What are we doing wrong?
Thanks,
Amir
Hi Amir,
Please check
It will help you if still you facing issue please update screen shot.
BR
Atul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not sure you can do a range followed by hash sub-partition. (I will double check documentation) You can do a hash-range however. The syntax should look like this;
ALTER TABLE "MYSCHEMA"."MSEG" PARTITION BY HASH (MBLNR) PARTITIONS 10, RANGE (MJAHR)
(PARTITION 1 <= VALUES < 2002,
PARTITION 2002 <= VALUES < 2003,
PARTITION 2003 <= VALUES < 2004,
PARTITION 2004 <= VALUES < 2005,
PARTITION 2005 <= VALUES < 2006,
PARTITION 2006 <= VALUES < 2007,
PARTITION 2007 <= VALUES < 2008,
PARTITION 2008 <= VALUES < 2009,
PARTITION 2009 <= VALUES < 2010,
PARTITION 2010 <= VALUES < 2011,
PARTITION 2011 <= VALUES < 2012,
PARTITION 2012 <= VALUES < 2013,
PARTITION OTHERS)
-Patrick
Try this;
ALTER TABLE "BNHP_UTILS"."TC_RDL_BAL_CP_3"
PARTITION BY HASH ("/BA1/C55AOTYPE") PARTITIONS 5
RANGE ("/BA1/C55POSTD")
(
PARTITION 20130901 <= VALUES < 20131001,
PARTITION 20131001 <= VALUES <20131101,
PARTITION OTHERS
),
NOTE: I'm assuming "/BA1/C55A0TYPE" is a column in your table? Also I don't think you need the quotes around the column name, however I'm not sure how the SLASH will be interpreted.
The reason i think why the RANGE-HASH partitioning is not given may be because
HASH -- will properly do load balancing and distributes the load across all the nodes
RANGE -- will further help me to partition on Time characteristics
If i do RANGE before,we need to have better idea on the Time lines of the data to properly segregate and hence may not have given a option of doing RANGE before HASH.
Also at the first level i.e HASH , the primary key columns must be part of the Partitioning, however if the table doesn't have primary keys it will allow non key column.
And on second level, this primary key restriction is removed.
Regards,
Krishna Tangudu
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.