Oracle Enterprise Disable Constraints Option

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
leathermana
Premium Member
Premium Member
Posts: 19
Joined: Wed Jul 14, 2010 1:10 pm

Oracle Enterprise Disable Constraints Option

Post by leathermana »

The Oracle Enterprise Stage Properties panel offers a "Disable Constraints" option. It also offers the Index Mode options of Rebuild and Maintain. I am loading to an Oracle table with a Primary Key Constraint and of course a Unique index. When I set Disable Constraints = True, the log states "Table contains no constraints that need to be disabled before loading the table." When I try to eliminate the Index Mode option I get a fatal error "Indexes on table preclude direct parallel loading unless an index option is included. Add an index option or drop indexes and rerun step." Oracle documentation states that "When the database is using a UNIQUE or PRIMARY KEY index to enforce a constraint, and constraints associated with that index are dropped or disabled, the index is dropped, unless you specify otherwise."

So... IF the Disable Constraints option is behaving as Oracle says it does, I should not need an Index Mode option. And I don't understand why DataStage responds to the Disable Constraints option with "Table contains no constraints.....".

All this has come up because the DBA is requesting that rather than rebuild the indexes on our loads, we drop and recreate them. I do not understand why and am in the process of figuring out if that is even possible and to help make my argument against such a request. It seems to me that a constraint is there for a purpose and that there is not a good reason to circumvent it. On the other hand, it seems DS is not behaving consistently with what I would expect, as described above. Any observations or explanations from any of you experts?
Alden

"All we need is here." -Wendell Berry
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

Below is the text I got from the PDFs, check the "*Conditions apply" section of those.

By default, the stage sets the following options in the Oracle load control file:
DIRECT=TRUE
PARALLEL = TRUE

This causes the load to run using parallel direct load mode. In order to use theparallel direct mode load, the table must not have indexes, or you must include one of the Index Mode properties, 'rebuild' or 'maintenance' (see the Index Mode section). If the only index on the table is from a primary key or unique key constraint, you can instead use the Disable Constraints property (see the Disable Constraints section) which will disable the primary key or unique key constraint, and enable it again after the load.

Disable Constraints
This is False by default. Set True to disable all enabled constraints on a table when loading, then attempt to re-enable them at the end of the load. This option is not available when you select a Table Organization type of Index to use index organized tables.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Post Reply