Partitioning Concepts :
==============
Partitioning allows a table, index, or index-organized table to be subdivided into smaller pieces, where each piece of such a database object is called a partition. Each partition has its own name, and may optionally have its own storage characteristics.
We are having two types of partitions
Syntax: create table <table_name>(Col1 datatype(size),
Col2 datatype(size),……..,
Coln datatype(size))
Partition by range(column name)
(partition values less than (value),
partition values less than (value));
Example: create table emp1(eid number(5),
Ename varchar2(20),
Sal number(5))
Partition by range(sal)
(partition p1 values less than (5000),
partition p2 values less than (10000));
partition <partition_name>;
==============
Partitioning allows a table, index, or index-organized table to be subdivided into smaller pieces, where each piece of such a database object is called a partition. Each partition has its own name, and may optionally have its own storage characteristics.
We are having two types of partitions
- Range Partition
- Hash Partition
Syntax: create table <table_name>
Col2 datatype(size),……..,
Coln datatype(size))
Partition by range(column name)
(partition
partition
Example: create table emp1(eid number(5),
Ename varchar2(20),
Sal number(5))
Partition by range(sal)
(partition p1 values less than (5000),
partition p2 values less than (10000));
- Syntax to retrieve the data from partition
- Creating table with partitions and have with maximum value
Ename varchar2(20),
Sal number(5))
Partition by range(sal)
(partition p1 values less than (5000),
partition p2 values less than (10000),
partition p3 values less than (maxvalue));
- Adding new Partition
Example: alter table emp1 add partition p4 values less than(20000);
- Truncate the Partition
- Drop the Partition
- Splitting the partition
- Merging the partition
- Exchanging the partition
- To know the List Of Partitions
- List of partitions from specific table
![]() | ![]() | ![]() |
No comments:
Post a Comment