Skip to content

SQL Developer Create Table Partition

  • by

Since the create a table partitioning syntax is hard to keep in mind, we'd better use GUI tools to facilitate us to create. Here we introduce the way to create a new partitioned table by SQL developer.

Right click on Tables, it shows a function menu.

SQL Developer - Create a New Table

SQL Developer - Create a New Table

We enable "Advanced" option.

SQL Developer - Create Table Builder - Click Advanced

SQL Developer - Create Table Builder - Click Advanced

Add some columns.

SQL Developer - Create Table Builder - Column

SQL Developer - Create Table Builder - Column

We partition the table by range.

SQL Developer - Create Table Builder - Partition by Range

SQL Developer - Create Table Builder - Partition by Range

Select the partition key.

SQL Developer - Create Table Builder - Select Partition Key

SQL Developer - Create Table Builder - Select Partition Key

Click on + sign to add a new partition.

SQL Developer - Create Table Builder - Add a Partition

SQL Developer - Create Table Builder - Add a Partition

Add the first partition segment with values less than TO_DATE('2000-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS').

SQL Developer - Create Table Builder - First Partition

SQL Developer - Create Table Builder - First Partition

The rest of rows go to the second partition segment, so we choose MAXVALUE.

SQL Developer - Create Table Builder - MAXVALUE Partition

SQL Developer - Create Table Builder - MAXVALUE Partition

We review DDL for making sure that everything is ready.

SQL Developer - Create Table Builder - DDL

SQL Developer - Create Table Builder - DDL

Then click OK to confirm.

After we have created the new partitioned table, we can try to load some data.

SQL> insert into hr.sales select * from sh.sales;

918843 rows created.

SQL> commit;

Commit complete.

We made it.

Leave a Reply

Your email address will not be published. Required fields are marked *