Skip to Main Content

Database Software

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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Optimization of adding a new column with default value and a constraint in a single statement

Oren NakdimonApr 21 2017 — edited Apr 21 2017

When we add in a single ALTER TABLE statement a new nullable with no default value column and a corresponding:

- inline check constraint

or

- foreign key constraint (either inline or out-of-line)

then Oracle does a nice and useful optimization. In these cases Oracle enables the constraint (for future DML statements) and marks the constraint as VALIDATED (stating that existing records respect the constraint) without actually performing any check – counting on the fact that all the existing records have NULL in the new column. If the table already contains many records, then skipping the (unnecessary) validation phase can save lots of time (during which the table is locked in a highly restrictive mode).

But when adding a new column with a (constant) default value, no optimization is done.

Since all the existing records will have the same value in the new column (the default value) – then the validation phase can be very simple and short. Oracle should only check that this single value respects the constraint; there is no reason to visit each and every record in the table for repeating the same validation over and over again, as it is currently done.

For more details please see Adding a Column with a Default Value and a Constraint - @DBoriented

Comments

Russ Proudman
Well if you mean, can Discoverer look at tables / views on a SQL server then yes, I believe you can make a connection such as odbc or jdbc. However, not all SQL functions will be supported as Oracle has some of it's own whereas the protocol standards would only be supported.

If you mean can Discoverer run on the SQL server (ie: EUL tables, etc.), then no.

Russ
SteveF-Oracle
To add to what Russ stated.

You have to install the EUL on Oracle DB, then use Heterogenous Services (ODBC connectors) connectivity from Oracle DB to non-Oracle DB.

It is covered in the Adminstrator Guide in pretty good detail
http://download-west.oracle.com/docs/html/B13916_04/rdb_support.htm#CIHJEJBB
23 Discoverer support for non-Oracle databases and Oracle Rdb

Regards,

Steve.
Russ Proudman
And one thing I'm just passing by all, is the quote about non-Oracle database using / not using ODBC drivers.

This question came up a while ago and I quoted the manual saying that if you use ODBC drivers, then the EUL could be in the non-Oracle database.

After lotsa' posts, etc. it was decided that the documentation was wrong. Whether or not you use ODBC, you cannot have the EUL in a non-Oracle database.

Just passing this on as the manual differs.

Russ

=========================================================
quote from manual:

What is the difference between using generic connectivity and ODBC drivers to connect to non-Oracle databases?

In previous versions of Discoverer, users could connect to non-Oracle databases using ODBC drivers. The major difference between using ODBC drivers to connect to a non-Oracle database and using the Oracle database generic connectivity feature is the location of the EUL, as follows:

with ODBC drivers, the EUL is stored in the non-Oracle database

with generic connectivity, the EUL is stored in the Oracle database

===========================================================
1 - 3

Post Details

Added on Apr 21 2017
0 comments
1,079 views