473,606 Members | 3,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Partition -1

debasisdas
8,127 Recognized Expert Expert
USING PARTITION
=============== ====
PARTITION BY RANGE-as per Oracle 8
--------------------------------------
Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE RANGEPART
  2. (
  3. ID NUMBER(2) PRIMARY KEY,
  4. NAME VARCHAR2(20)
  5. )
  6. PARTITION BY RANGE(ID)
  7. (
  8. PARTITION P1 VALUES LESS THAN(10),
  9. PARTITION P2 VALUES LESS THAN(20),
  10. PARTITION P3 VALUES LESS THAN(MAXVALUE)
  11. );
  12.  
here in the sample code it creates a table with there parttions
1st value <10
2nd value 10-19
3rd 20 onwards

SAPMLE CODE FOR CREATING PARTITON BY HASH-as per 8i
=============== =============== =============== ===
Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE HASHPART
  2. (
  3. ID NUMBER(10) PRIMARY KEY,
  4. NAME VARCHAR2(20)
  5. )
  6. PARTITION BY HASH(NAME)
  7. PARTITIONS 5;
  8.  
In this case user can't specify the name of partitions only number .
In this case it creates 5 partitions.

SAMPLE CODE FOR CREATING PARTITIONS BY LIST-as per 9i
=============== =============== =============== ===
Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE LISTPART
  2. (
  3. ID NUMBER(10) PRIMARY KEY,
  4. NAME VARCHAR2(20)
  5. )
  6. PARTITION BY LIST(NAME)
  7. (
  8. PARTITION P1 VALUES ('A','B'),
  9. PARTITION P2 VALUES ('C','D'),
  10. PARTITION P3 VALUES ('E','F')
  11. );
  12.  
this type of partitons is mainly used for character datatypes.



Also check Using Partition - 2
May 19 '07 #1
0 3412

Sign in to post your reply or Sign up for a free account.

Similar topics

41
3528
by: Xah Lee | last post by:
here's another interesting algorithmic exercise, again from part of a larger program in the previous series. Here's the original Perl documentation: =pod merge($pairings) takes a list of pairs, each pair indicates the sameness of the two indexes. Returns a partitioned list of same indexes.
1
5679
by: Mark Dengler | last post by:
I am trying to write a C# backend program that will handle the database maintenance that I would otherwise have to do via Microsoft's Analysis Services front end GUI Wizards. Currently I am having a problem with recreating the SliceValue. The value is a time dimension and should equate to ... and instead it is these same values, but instead of being seperated by periods it has some sort of non-displayable character (maybe a newline)...
30
6073
by: junky_fellow | last post by:
I was looking at the source code of linux or open BSD. What I found that lots of typedefs were used. For example, consider the offset in a file. It was declared as off_t offset; and off_t is typedefed as typedef long off_t; I wanted to know what advantage do we get by typedefs ? Why we did not declare
4
6076
by: eavery | last post by:
I can't seem to find a way to do the following: create table part_table ( col1 int, col2 datetime ) on psX (datename(week,col2)) I want to partition based on the week number of a date field. So if I enter in data like the following in my part_table:
1
4951
by: Laurence | last post by:
Hi folks, As I konw: database partition (aka data partition?), the database can span multiple machines; table partition, the data within a table can seperate by certain condition. How about inter-partition and intra-partition? Is inter-partition database partition...?
3
4340
by: nbajrach | last post by:
how to partition on a table if table already exits without any partition. This is what i tried but gave me error SQL> alter table sip add partition by range(si_id) 2 partition p1_si values less than (50001), 3 partition p2_si values less than (100001),
0
12960
by: Vinod Sadanandan | last post by:
Table Partition Performance analysis ============================================ Collection of Statistics for Cost-Based Optimization/DBMS_STATS vs. ANALYZE The cost-based approach relies on statistics and if the cost-based Approach is used , then statistics should be gernerated for all tables, clusters, and all types of indexes accessed by SQL statements. If the size and data distribution of your tables change frequently, then...
0
3779
debasisdas
by: debasisdas | last post by:
SAMPLE CODE TO CREATE SUB PARTITIONS ======================================= RANGE-HASH-9i ------------------------- CREATE TABLE SUBPART ( ID NUMBER(10) PRIMARY KEY, NAME VARCHAR2(20) )
3
3624
by: Justin | last post by:
What is the syntax to overlap partitions? Lets assume I want a year split amount 4 months (3 partitions for a year) and later adding an additional set of partitions for every 6 months. Plus giving us the option to detach old partitions. For example: CREATE TABLE orders(id INT, shipdate DATE, …) PARTITION BY RANGE(shipdate) ( PARTITION m12y05 STARTING MINVALUE,
0
8036
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7978
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8461
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8448
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8317
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5470
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4010
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1572
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1313
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.