Search code examples
oracleviewsynonym

Have view object number in oracle?


Have view object number ?
Have view segment ?
Have synonym object number ?

So I know dictionary view dba_,all_,user_objects, in this view have object_id column and is this counted object number of view or synonym and etc. which have types of object in the object_type column? And I know that view is query and not segment but need help in all for accuracy and sorry my english bad.. In some cases I cannot find clear answer in some questions ?


Solution

  • Views and synonyms are objects, so they have an object number, but a view does not consume physical space in the database, so it does not have a segment

    SQL> create or replace view V as select * from dual;
    
    View created.
    
    SQL> create synonym SYN for V;
    
    Synonym created.
    
    SQL> select object_id, object_name
      2  from user_objects
      3  where object_name in ('V','SYN');
    
     OBJECT_ID OBJECT_NAME
    ---------- ----------------------------------------
         73166 SYN
         73165 V
    
    SQL>
    SQL> select * from user_segments
      2  where segment_name = 'V';
    
    no rows selected