From the course: Oracle Database 12c: Advanced SQL

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Using HASH partitions

Using HASH partitions - Oracle Database Tutorial

From the course: Oracle Database 12c: Advanced SQL

Start my 1-month free trial

Using HASH partitions

- [Instructor] Another type of table partitioning in Oracle is called hash partitioning. Let's see an example. We'll create a sales_hash table. You can find the create table statement provided in your exercise file. Let's copy this command and paste it to our SQL Developer window. Note that we create the sales_hash table specifying the table columns as usual and specify a partition by hash clause followed by the column with which we want to partition our table sales_no and here is the special part for hash partitioning, we just specify the number of partitions we desire, four in our case. We don't explicitly name our partitions or specify any parameters that relate to which rows should be stored in these partitions. This is useful when you have data that cannot be divided manually into individual partitions, but you still want to partition your data set for performance reasons. So assuming that your sales data does not have a date column or a state column in our example here, it means…

Contents