Removing Indexes

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
rafidwh
Participant
Posts: 179
Joined: Mon Oct 10, 2005 11:30 pm

Removing Indexes

Post by rafidwh »

Hi Gurus,

I have a task where

1) In the first job I need to drop indexes from the table.
2) Load the table using SQL loader.
3)Add the indexes againg in the table.

My concern is how to drop and add indexes to the Table through Datastage

Best suggestions please

Thanks in advance
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Use sqlplus to run any SQL script. Choose a Batch or Sequence job to do the deed.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

On some databases you can disable and then enable indexes after the load which is faster than dropping and creating.
Mamu Kim
rafidwh
Participant
Posts: 179
Joined: Mon Oct 10, 2005 11:30 pm

Post by rafidwh »

Is there any option in datastage to disable and enable indexes .

How can I enable and disable the indexes,suggest me please
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

Hi

There is no direct way to disable and enable index from datastage. As Kenneth said you can have SQL script which does all these things and can be called from datastage.

Check the Oracle Reference Guide for syntax to disable and enable index
Regards
Siva

Listening to the Learned

"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar
rleishman
Premium Member
Premium Member
Posts: 252
Joined: Mon Sep 19, 2005 10:28 pm
Location: Melbourne, Australia
Contact:

Post by rleishman »

Unless you are using Oracle v7.3, leave the indexes where they are and use SQL*Loader in Direct Path mode. Index maintenance is deferred until after the load. This is usually much better than dropping them or marking them as unusable. The exception is when the loaded data is large compared to the existing rows in the table - this is unusual in a Data Warehouse environment.

See this chapterin the manual.

If you still really want to do it, it would be simple enough to write a stored procedure that selected the names from USER_INDEXES and used dynamic SQL to mark them UNUSABLE.
Ross Leishman
manojmathai
Participant
Posts: 23
Joined: Mon Jul 04, 2005 6:25 am

Post by manojmathai »

Hi

Try a dummy job to select count(*) from some table .In the before / after SQL write the index dropping SQL.

Thanks
Manoj
Post Reply