Home » SQL & PL/SQL » SQL & PL/SQL » Table partitioning
Table partitioning [message #376539] Wed, 17 December 2008 13:59 Go to next message
tutika_shilpa
Messages: 1
Registered: December 2008
Junior Member
I have a table with millions of records.I need to partition the table.I did list partitioning based on column value but when query the table user_tab_partitions for partitons, then the num_rows column is null;

This is how I did.

My table is

1) Create a partitioned table:

create table partbl (qty number(3), name varchar2(15))
partition by range (name)
(partition p1 values('abc'),
partition p1 values('def'),
partition p1 values(DEFAULT));

2) Insert into the partitioned table with a subquery from the
non-partitioned table:

insert into partbl
select * from origtbl;

3) drop the original table and rename the
new table:

drop table origtbl;
alter table partbl rename to origtbl;

4)
SELECT table_name,
partition_name,
high_value,
num_rows
FROM user_tab_partitions
ORDER BY table_name, partition_name;
Re: Table partitioning [message #376542 is a reply to message #376539] Wed, 17 December 2008 14:04 Go to previous message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
As for table, num_rows is filled when statistics are gathered.

Regards
Michel
Previous Topic: Views vs Materialized Views
Next Topic: NLS_LANG and ORA-00922
Goto Forum:
  


Current Time: Fri Dec 06 18:10:58 CST 2024