rem Support for ORACLE v7 system tables requires a DBA to set up the 
rem required system tables.
rem
rem
rem /***** DBA MUST do the following for ORACLE 7 support *****/
rem
rem DBA Connect as the SYS user and run $ORACLE_HOME/rdbms/admin/catalog6.sql
rem
rem
rem
rem /********************************************************/
rem DBA un-remark the following lines for ORACLE v7 support
rem
rem
rem grant select on obj$     to SYSTEM with grant option
rem/
rem grant select on user$    to SYSTEM with grant option
rem/
rem grant select on com$     to SYSTEM with grant option
rem/
rem grant select on tab$     to SYSTEM with grant option
rem/
rem grant select on view$    to SYSTEM with grant option
rem/
rem grant select on syn$     to SYSTEM with grant option
rem/
rem grant select on tabauth$ to SYSTEM with grant option
rem
rem
rem DBA un-remark the previous lines for ORACLE v7 support
rem /********************************************************/
rem
rem
rem
rem
rem
rem DBA Connect as the SYSTEM user and create the following view
rem
rem
rem dlncat.sql
rem
rem Create DATALENS_OBJECTS view on ORACLE v6 and v7 system tables.
rem
/
drop view DATALENS_OBJECTS
/
create view DATALENS_OBJECTS
    (OBJ_OWNER,
     OBJ_NAME,
     OBJ_TYPE,
     OBJ_COMMENT,
     SYN_TAB_OWNER,
     SYN_TAB_NAME,
     NUM_OF_COL)
as
select u.name,
       o.name,
       decode(o.type, 2, 1,                     /* table */
                      4, 2,                     /* view */
                      5, decode(owner#, 1, 4,   /* public synonym */
                                           3    /* synonym */ ),
                         NULL),
       c.comment$,
       decode(o.type, 5, s.owner,
                         NULL),
       decode(o.type, 5, s.name,
                         NULL),
       decode(o.type, 2, t.cols,
                      4, v.cols, 0)
from sys.obj$ o, sys.user$ u, sys.com$ c, sys.tab$ t, sys.view$ v, sys.syn$ s
where o.owner# = u.user#
  and o.obj# = t.obj#(+)
  and o.obj# = v.obj#(+)
  and o.obj# = c.obj#(+)
  and o.obj# = s.obj#(+)
  and c.col#(+) is null
  and o.type in (2,4,5)
  and (o.owner# = uid
       or
       o.obj# in (select obj#
                    from sys.tabauth$
                    where grantee# in (uid, 1)))
/
drop public synonym DATALENS_OBJECTS
/
create public synonym DATALENS_OBJECTS for DATALENS_OBJECTS
/
grant select on DATALENS_OBJECTS to PUBLIC
/
