Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Staging Table creation - Help needed

user1758353Feb 28 2011 — edited Mar 1 2011
Hi All,

My one of table is having 10 billion records and out of that we would like to extract 13 months data and create a new table.

So 13 months data is having 5 billion records and it is taking 2 days to create staging table. Please give me some suggestions

1. Create the table
2. Create index on the table
3. Gather DBMS_STATS on the table

Oracle - 10 G

Please see below example which we are using to create a table



CREATE TABLE schemaxyz.table_staging
TABLESPACE USERS_TEMP
PCTFREE 3
INITRANS 5
MAXTRANS 255
STORAGE (
INITIAL 10 m
MINEXTENTS 1
MAXEXTENTS 2147483645
BUFFER_POOL DEFAULT
)
NOLOGGING
as
SELECT *
FROM schemabc.USERS_Table e
WHERE e.created > add_months(sysdate,-13)
AND e.created <= sysdate
AND e.code IN(0,1,6)
and e.flag=0

Appreciate your help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 29 2011
Added on Feb 28 2011
7 comments
1,592 views