Data warehousing question/best practices
523125Nov 3 2008 — edited Nov 4 2008I have been given the task of copying a few tables from our production database to a data warehousing database on a once-a-day (overnight) basis. The number of tables will grow over time; currently it is 10. I am interested in not only task success but also best practices. Here's what I've come up with:
1) drop the table in the destination database.
2) re-create the destination table from the script provided by SQL Developer when you click on the 'SQL' tab while you're viewing the table.
3) INSERT INTO the destination table from the source table using a database link. Note: I am not aware of any columns in the tables themselves which could be used to filter added/deleted/modified rows only.
4) After data import, create primary key and indexes.
Questions:
1) SQL Developer included the following lines when generating the table creation script:
<table creation DDL commands>
then
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE (INITIAL 251658240 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "TBLSPC_PGROW"
it generated this code snippet for the table, the primary key and every index.
Is this necessary to include in my code if they are all default values? For example, one of the indexes gets scripted as follows:
CREATE INDEX "XYZ"."PATIENT_INDEX" ON "XYZ"."PATIENT" ("Patient")
-- do I need the following four lines?
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 60817408 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "TBLSPC_IGROW"
2) Anyone with advice on best practices for warehousing data like this, I am very willing to learn from your experience.
Thanks in advance,
Carl