Search code examples
sqloracle11gcreate-tabledatabase-partitioning

Oracle table partition not working


I am new to the oracle database and I create a partitioned table and insert some date into it but the data are not partitioned.

Table:

Create Table Buclm_Adapterdb.zzzz
(
   Id     Number   
)
Partition By Range (Id)
(  
   Partition T1 Values Less Than (100),
   Partition T2 Values Less Than (maxvalue)
)
;

Insert data:

INSERT INTO Buclm_Adapterdb.zzzz (id) VALUES (50);
INSERT INTO Buclm_Adapterdb.zzzz (id) VALUES (150);
INSERT INTO Buclm_Adapterdb.zzzz (id) VALUES (250);

Data are inserted:

enter image description here

However, data are not partitioned, Num Rows are empty:

enter image description here

Why?


Solution

  • You need to gather statistics to see the NUM_ROWS updated:

    dbms_stats.gather_table_stats ( ownname => 'Buclm_Adapterdb', tabname => 'zzzz');

    Read up here:

    http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_stats.htm#ARPLS68600