user_constraints
Rajeshwaran, Jeyabal, September 29, 2016 - 11:06 am UTC
data dictionary that begins with DBA* , ALL*, CDB* have OWNER column to indicate to which schema these objects belongs to.
but why does user_constraints have OWNER column in it? any specific reason?
demo@ORA12C> set linesize 71
demo@ORA12C> desc user_constraints
Name Null? Type
----------------------------------- -------- -----------------------
OWNER VARCHAR2(128)
CONSTRAINT_NAME VARCHAR2(128)
CONSTRAINT_TYPE VARCHAR2(1)
TABLE_NAME VARCHAR2(128)
SEARCH_CONDITION LONG
SEARCH_CONDITION_VC VARCHAR2(4000)
R_OWNER VARCHAR2(128)
R_CONSTRAINT_NAME VARCHAR2(128)
DELETE_RULE VARCHAR2(9)
STATUS VARCHAR2(8)
DEFERRABLE VARCHAR2(14)
DEFERRED VARCHAR2(9)
VALIDATED VARCHAR2(13)
GENERATED VARCHAR2(14)
BAD VARCHAR2(3)
RELY VARCHAR2(4)
LAST_CHANGE DATE
INDEX_OWNER VARCHAR2(128)
INDEX_NAME VARCHAR2(128)
INVALID VARCHAR2(7)
VIEW_RELATED VARCHAR2(14)
ORIGIN_CON_ID NUMBER
demo@ORA12C>
September 30, 2016 - 8:54 am UTC
I dont know why.
There are plenty of inconsistencies in the dictionary, eg some views use "OWNER", others user "xxx_OWNER" where 'xxx' is the object type of reference. I always remember the USER column in v$sort_usage as being that always tripped people up, because it always looked like all sorting was being done by themselves :-)
Of course, it is then nearly impossible to fix these things, because we do our best to keep backward compatiblity.
inconsisties??
Ghassan, September 30, 2016 - 11:49 am UTC
the is no inconsisty no odd things and it is certainly needed for oracle engine performances and nomenclature purpose to meet objects logic existence.
the owner col. in the user_constraints is the owner not of the Constraint itself, but the very owner of the Table on which this constraint is. it is not ,for instance, similarly comparable to the -say- user_tables view where all tables in are for the user
to be more clear, take the dba_tables and the dba_constraints ; the user col there are not related to same identity object : so OWNER in the first is for owner of constraint'tables - not holding the same name - , and owner in the second is owner of the table itself holding the same name .
also , as you related there are other "xx_owner", and "index_owner" in this view, so it is -for me- very logic that the table owner be part of the cols.