Link to home
Start Free TrialLog in
Avatar of Swaminathan K
Swaminathan KFlag for India

asked on

Oracle table partitions

Hi,

Iam working on oracle table partitions and need to provide a training on the types of partitions , I need the below information in regard to oracle hash partition

1. How does hash linear algorithm work , any example should be fine. I need an detailed explanation on how oracle applies Linear hash algorithm for each table partition using HASH .
ASKER CERTIFIED SOLUTION
Avatar of Naitik Gamit
Naitik Gamit
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Swaminathan K

ASKER

hi Naitik,

Can you explain me how the partitions are derived using the steps mentioned in the url above

I have followed the below steps to validate the Linear HASH algorithm

create table hash_tab
(
id number ,
name varchar2(40))
partition by hash (id)
partitions 4;

Below are the partitions created in oracle after the above statement

SYS_P25
SYS_P26
SYS_P27
SYS_P28

Analyze the tables so that the num_rows column in user_tab_partitions is updated.

Insert into hash_tab values (&i,'&n');

Values inserted are
1,sdsd
45,sdfsdf
34,dfgdfg
24,dssdf

I tried to validate the algorithm logic mentioned in the above url mentioned , iam not able to derive the correct partition into which oracle inserts the records But I noticed  , it starts inserting into the last partition SYS_P28



Below is the sample logic using the algorithm mentioned in the above url
num=4 --> no of partitions
v=power(2*ceil(log(2,4))); --> 4
n=f(column_value) & (v-1) --> 1 & (4-1) = 1 &3 =1

but the value 1 is getting inserted into 4th partition SYS_P28 instead of SYS_P25

Any help with the algorithm mentioned in the url is really appreciated.
This I need for training purpose
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks a lot , gave me an good idea about partitions in oracle.