[GIS] Does the OBJECTID in an Oracle Geodatabase table have a primary key constraint, by default

enterprise-geodatabaseesri-geodatabaseobjectidoracle-dbmsoracle-spatial

Tables that are created in Oracle using ArcGIS Desktop are given an OBJECTID field by default. The OBJECTID field is assigned a unique not-nullable index.

Does the OBJECTID in an Oracle Geodatabase table have a primary key constraint, by default?

I ask, because there can only be one field with a primary key constraint per table. If the OBJECTID does not have a primary key constraint by default, I plan to add a primary key constraint to a different field — a field called ID. I will use the ID field in conjunction with a foreign key to enforce referential integrity at the database level. More info here.


Note: A primary key constraint is not to be confused with a unique not-nullable index, a candidate key or a so-called relationship class "primary key".

Best Answer

By default, yes, it normally is unless someone overrode that and designed the table differently.

Is this an ArcSDE database? There may also be GlobalID fields that act as primary keys across multiple databases with relationship tables, so that may add some complications.

You are correct; there can only be one primary key. However, with the right permissions, you should be able to edit which field is acting as a primary key if you needed to.