home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-10-12 | 47.9 KB | 1,596 lines |
- decode(c.precision, null, 'NUMBER', 'FLOAT'),
- 'NUMBER'),
- 8, 'LONG', 9, 'VARCHAR',
- 12, 'DATE', 23, 'RAW', 24, 'LONG RAW',
- 69, 'ROWID', 'UNDEFINED'),
- c.length, c.precision, c.scale,
- decode(c.null$, 0, 'Y', 'N'), c.col#, c.deflength, c.default$
- from sys.col$ c, sys.obj$ o, sys.user$ u
- where o.obj# = c.obj#
- and o.owner# = u.user#
- and o.type in (2, 3, 4)
- /
- comment on table DBA_TAB_COLUMNS is
- 'Columns of all tables, views and clusters'
- /
- comment on column DBA_TAB_COLUMNS.OWNER is
- 'Owner of the table, view or cluster'
- /
- comment on column DBA_TAB_COLUMNS.TABLE_NAME is
- 'Table, view or cluster name'
- /
- comment on column DBA_TAB_COLUMNS.COLUMN_NAME is
- 'Column name'
- /
- comment on column DBA_TAB_COLUMNS.DATA_LENGTH is
- 'Length of the column in bytes'
- /
- comment on column DBA_TAB_COLUMNS.DATA_TYPE is
- 'Datatype of the column'
- /
- comment on column DBA_TAB_COLUMNS.DATA_PRECISION is
- 'Length: decimal digits (NUMBER), binary digits (FLOAT)'
- /
- comment on column DBA_TAB_COLUMNS.DATA_SCALE is
- 'Digits to right of decimal point in a number'
- /
- comment on column DBA_TAB_COLUMNS.NULLABLE is
- 'Does column allow NULL values?'
- /
- comment on column DBA_TAB_COLUMNS.COLUMN_ID is
- 'Sequence number of the column as created'
- /
- comment on column DBA_TAB_COLUMNS.DEFAULT_LENGTH is
- 'Length of default value for the column'
- /
- comment on column DBA_TAB_COLUMNS.DATA_DEFAULT is
- 'Default value for the column'
- /
- remark
- remark FAMILY "TAB_COMMENTS"
- remark Comments on objects.
- remark
- drop view USER_TAB_COMMENTS
- /
- create view USER_TAB_COMMENTS
- (TABLE_NAME,
- TABLE_TYPE,
- COMMENTS)
- as
- select o.name,
- decode(o.type, 0, 'NEXT OBJECT', 1, 'INDEX', 2, 'TABLE', 3, 'CLUSTER',
- 4, 'VIEW', 5, 'SYNONYM', 'UNDEFINED'),
- c.comment$
- from sys.obj$ o, sys.com$ c
- where o.owner# = uid
- and o.type in (2, 4)
- and o.obj# = c.obj#(+)
- and c.col#(+) is null
- /
- comment on table USER_TAB_COMMENTS is
- 'Comments on the tables and views owned by the user'
- /
- comment on column USER_TAB_COMMENTS.TABLE_NAME is
- 'Name of the object'
- /
- comment on column USER_TAB_COMMENTS.TABLE_TYPE is
- 'Type of the object: "TABLE" or "VIEW"'
- /
- comment on column USER_TAB_COMMENTS.COMMENTS is
- 'Comment on the object'
- /
- drop public synonym USER_TAB_COMMENTS
- /
- create public synonym USER_TAB_COMMENTS for USER_TAB_COMMENTS
- /
- grant select on USER_TAB_COMMENTS to PUBLIC
- /
- drop view ALL_TAB_COMMENTS
- /
- create view ALL_TAB_COMMENTS
- (OWNER, TABLE_NAME,
- TABLE_TYPE,
- COMMENTS)
- as
- select u.name, o.name,
- decode(o.type, 0, 'NEXT OBJECT', 1, 'INDEX', 2, 'TABLE', 3, 'CLUSTER',
- 4, 'VIEW', 5, 'SYNONYM', 'UNDEFINED'),
- c.comment$
- from sys.obj$ o, sys.user$ u, sys.com$ c
- where o.owner# = u.user#
- and o.obj# = c.obj#(+)
- and c.col#(+) is null
- and o.type in (2, 4)
- and (o.owner# = uid
- or
- o.obj# in ( select obj#
- from sys.tabauth$
- where grantee# in ( uid, 1 )
- )
- )
- /
- comment on table ALL_TAB_COMMENTS is
- 'Comments on tables and views accessible to the user'
- /
- comment on column ALL_TAB_COMMENTS.OWNER is
- 'Owner of the object'
- /
- comment on column ALL_TAB_COMMENTS.TABLE_NAME is
- 'Name of the object'
- /
- comment on column ALL_TAB_COMMENTS.TABLE_TYPE is
- 'Type of the object'
- /
- comment on column ALL_TAB_COMMENTS.COMMENTS is
- 'Comment on the object'
- /
- drop public synonym ALL_TAB_COMMENTS
- /
- create public synonym ALL_TAB_COMMENTS for ALL_TAB_COMMENTS
- /
- grant select on ALL_TAB_COMMENTS to PUBLIC
- /
- drop view DBA_TAB_COMMENTS
- /
- create view DBA_TAB_COMMENTS
- (OWNER, TABLE_NAME,
- TABLE_TYPE,
- COMMENTS)
- as
- select u.name, o.name,
- decode(o.type, 0, 'NEXT OBJECT', 1, 'INDEX', 2, 'TABLE', 3, 'CLUSTER',
- 4, 'VIEW', 5, 'SYNONYM', 'UNDEFINED'),
- c.comment$
- from sys.obj$ o, sys.user$ u, sys.com$ c
- where o.owner# = u.user#
- and o.type in (2, 4)
- and o.obj# = c.obj#(+)
- and c.col#(+) is null
- /
- comment on table DBA_TAB_COMMENTS is
- 'Comments on all tables and views in the database'
- /
- comment on column DBA_TAB_COMMENTS.OWNER is
- 'Owner of the object'
- /
- comment on column DBA_TAB_COMMENTS.TABLE_NAME is
- 'Name of the object'
- /
- comment on column DBA_TAB_COMMENTS.TABLE_TYPE is
- 'Type of the object'
- /
- comment on column DBA_TAB_COMMENTS.COMMENTS is
- 'Comment on the object'
- /
- remark
- remark FAMILY "TAB_GRANTS"
- remark Grants on objects.
- remark
- drop view USER_TAB_GRANTS
- /
- create view USER_TAB_GRANTS
- (GRANTEE, OWNER, TABLE_NAME, GRANTOR,
- SELECT_PRIV, INSERT_PRIV, DELETE_PRIV,
- UPDATE_PRIV, REFERENCES_PRIV, ALTER_PRIV, INDEX_PRIV,
- CREATED)
- as
- select ue.name, u.name, o.name, ur.name,
- decode(ta.select$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.insert$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.delete$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.update$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.references$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.alter$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.index$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- ta.time
- from sys.tabauth$ ta, sys.obj$ o, sys.user$ u, sys.user$ ur, sys.user$ ue
- where ta.obj# = o.obj#
- and ta.grantor# = ur.user#
- and ta.grantee# = ue.user#
- and u.user# = o.owner#
- and uid in (ta.grantor#, ta.grantee#, o.owner#)
- /
- comment on table USER_TAB_GRANTS is
- 'Grants on objects for which the user is the owner, grantor or grantee'
- /
- comment on column USER_TAB_GRANTS.GRANTEE is
- 'Name of the user to whom access was granted'
- /
- comment on column USER_TAB_GRANTS.OWNER is
- 'Owner of the object'
- /
- comment on column USER_TAB_GRANTS.TABLE_NAME is
- 'Name of the object'
- /
- comment on column USER_TAB_GRANTS.GRANTOR is
- 'Name of the user who performed the grant'
- /
- comment on column USER_TAB_GRANTS.SELECT_PRIV is
- 'Permission to SELECT from the object?'
- /
- comment on column USER_TAB_GRANTS.INSERT_PRIV is
- 'Permission to INSERT into the object?'
- /
- comment on column USER_TAB_GRANTS.DELETE_PRIV is
- 'Permission to DELETE from the object?'
- /
- comment on column USER_TAB_GRANTS.UPDATE_PRIV is
- 'Permission to UPDATE the object?'
- /
- comment on column USER_TAB_GRANTS.REFERENCES_PRIV is
- 'Permission to make REFERENCES to the object?'
- /
- comment on column USER_TAB_GRANTS.ALTER_PRIV is
- 'Permission to ALTER the object?'
- /
- comment on column USER_TAB_GRANTS.INDEX_PRIV is
- 'Permission to create/drop an INDEX on the object?'
- /
- comment on column USER_TAB_GRANTS.CREATED is
- 'Timestamp for the grant'
- /
- drop public synonym USER_TAB_GRANTS
- /
- create public synonym USER_TAB_GRANTS for USER_TAB_GRANTS
- /
- grant select on USER_TAB_GRANTS to PUBLIC
- /
- drop view TABLE_PRIVILEGES
- /
- create view TABLE_PRIVILEGES
- (GRANTEE, OWNER, TABLE_NAME, GRANTOR,
- SELECT_PRIV, INSERT_PRIV, DELETE_PRIV,
- UPDATE_PRIV, REFERENCES_PRIV, ALTER_PRIV, INDEX_PRIV,
- CREATED)
- as
- select ue.name, u.name, o.name, ur.name,
- decode(ta.select$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.insert$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.delete$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.update$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.references$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.alter$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.index$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- ta.time
- from sys.tabauth$ ta, sys.obj$ o, sys.user$ u, sys.user$ ur, sys.user$ ue
- where ta.obj# = o.obj#
- and ta.grantor# = ur.user#
- and ta.grantee# = ue.user#
- and u.user# = o.owner#
- and (uid in (ta.grantor#, ta.grantee#, o.owner#)
- or ta.grantee# = 1)
- /
- comment on table TABLE_PRIVILEGES is
- 'Grants on objects for which the user is the grantor, grantee, or owner, or PUBLIC is the grantee'
- /
- comment on column TABLE_PRIVILEGES.GRANTEE is
- 'Name of the user to whom access was granted'
- /
- comment on column TABLE_PRIVILEGES.OWNER is
- 'Owner of the object'
- /
- comment on column TABLE_PRIVILEGES.TABLE_NAME is
- 'Name of the object'
- /
- comment on column TABLE_PRIVILEGES.GRANTOR is
- 'Name of the user who performed the grant'
- /
- comment on column TABLE_PRIVILEGES.SELECT_PRIV is
- 'Permission to SELECT from the object?'
- /
- comment on column TABLE_PRIVILEGES.INSERT_PRIV is
- 'Permission to INSERT into the object?'
- /
- comment on column TABLE_PRIVILEGES.DELETE_PRIV is
- 'Permission to DELETE from the object?'
- /
- comment on column TABLE_PRIVILEGES.UPDATE_PRIV is
- 'Permission to UPDATE the object?'
- /
- comment on column TABLE_PRIVILEGES.REFERENCES_PRIV is
- 'Permission to make REFERENCES to the object?'
- /
- comment on column TABLE_PRIVILEGES.ALTER_PRIV is
- 'Permission to ALTER the object?'
- /
- comment on column TABLE_PRIVILEGES.INDEX_PRIV is
- 'Permission to create/drop an INDEX on the object?'
- /
- comment on column TABLE_PRIVILEGES.CREATED is
- 'Timestamp for the grant'
- /
- drop public synonym TABLE_PRIVILEGES
- /
- create public synonym TABLE_PRIVILEGES for TABLE_PRIVILEGES
- /
- drop public synonym ALL_TAB_GRANTS
- /
- create public synonym ALL_TAB_GRANTS for TABLE_PRIVILEGES
- /
- grant select on TABLE_PRIVILEGES to PUBLIC
- /
- drop view DBA_TAB_GRANTS
- /
- create view DBA_TAB_GRANTS
- (GRANTEE, OWNER, TABLE_NAME, GRANTOR,
- SELECT_PRIV, INSERT_PRIV, DELETE_PRIV,
- UPDATE_PRIV, REFERENCES_PRIV, ALTER_PRIV, INDEX_PRIV,
- CREATED)
- as
- select ue.name, u.name, o.name, ur.name,
- decode(ta.select$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.insert$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.delete$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.update$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.references$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.alter$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.index$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- ta.time
- from sys.tabauth$ ta, sys.obj$ o, sys.user$ u, sys.user$ ur, sys.user$ ue
- where ta.obj# = o.obj#
- and ta.grantor# = ur.user#
- and ta.grantee# = ue.user#
- and u.user# = o.owner#
- /
- comment on table DBA_TAB_GRANTS is
- 'All grants on objects in the database'
- /
- comment on column DBA_TAB_GRANTS.GRANTEE is
- 'User to whom access was granted'
- /
- comment on column DBA_TAB_GRANTS.OWNER is
- 'Owner of the object'
- /
- comment on column DBA_TAB_GRANTS.TABLE_NAME is
- 'Name of the object'
- /
- comment on column DBA_TAB_GRANTS.GRANTOR is
- 'Name of the user who performed the grant'
- /
- comment on column DBA_TAB_GRANTS.SELECT_PRIV is
- 'Permission to SELECT from the object?'
- /
- comment on column DBA_TAB_GRANTS.INSERT_PRIV is
- 'Permission to INSERT into the object?'
- /
- comment on column DBA_TAB_GRANTS.DELETE_PRIV is
- 'Permission to DELETE from the object?'
- /
- comment on column DBA_TAB_GRANTS.UPDATE_PRIV is
- 'Permission to UPDATE the object?'
- /
- comment on column DBA_TAB_GRANTS.REFERENCES_PRIV is
- 'Permission to make REFERENCES to the object?'
- /
- comment on column DBA_TAB_GRANTS.ALTER_PRIV is
- 'Permission to ALTER the object?'
- /
- comment on column DBA_TAB_GRANTS.INDEX_PRIV is
- 'Permission to create/drop an INDEX on the object?'
- /
- comment on column DBA_TAB_GRANTS.CREATED is
- 'Timestamp for the grant'
- /
- remark
- remark FAMILY "TAB_GRANTS_MADE"
- remark Grants made on objects.
- remark This family has no DBA member.
- remark
- drop view USER_TAB_GRANTS_MADE
- /
- create view USER_TAB_GRANTS_MADE
- (GRANTEE, TABLE_NAME, GRANTOR,
- SELECT_PRIV, INSERT_PRIV, DELETE_PRIV,
- UPDATE_PRIV, REFERENCES_PRIV, ALTER_PRIV, INDEX_PRIV,
- CREATED)
- as
- select ue.name, o.name, ur.name,
- decode(ta.select$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.insert$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.delete$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.update$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.references$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.alter$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.index$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- ta.time
- from sys.tabauth$ ta, sys.obj$ o, sys.user$ ue, sys.user$ ur
- where ta.obj# = o.obj#
- and ta.grantor# = ur.user#
- and ta.grantee# = ue.user#
- and o.owner# = uid
- /
- comment on table USER_TAB_GRANTS_MADE is
- 'All grants on objects owned by the user'
- /
- comment on column USER_TAB_GRANTS_MADE.GRANTEE is
- 'Name of the user to whom access was granted'
- /
- comment on column USER_TAB_GRANTS_MADE.TABLE_NAME is
- 'Name of the object'
- /
- comment on column USER_TAB_GRANTS_MADE.GRANTOR is
- 'Name of the user who performed the grant'
- /
- comment on column USER_TAB_GRANTS_MADE.SELECT_PRIV is
- 'Permission to SELECT from the object?'
- /
- comment on column USER_TAB_GRANTS_MADE.INSERT_PRIV is
- 'Permission to INSERT into the object?'
- /
- comment on column USER_TAB_GRANTS_MADE.DELETE_PRIV is
- 'Permission to DELETE from the object?'
- /
- comment on column USER_TAB_GRANTS_MADE.UPDATE_PRIV is
- 'Permission to UPDATE the object?'
- /
- comment on column USER_TAB_GRANTS_MADE.REFERENCES_PRIV is
- 'Permission to make REFERENCES to the object?'
- /
- comment on column USER_TAB_GRANTS_MADE.ALTER_PRIV is
- 'Permission to ALTER the object?'
- /
- comment on column USER_TAB_GRANTS_MADE.INDEX_PRIV is
- 'Permission to CREATE/DROP INDEX on the object?'
- /
- comment on column USER_TAB_GRANTS_MADE.CREATED is
- 'Timestamp for the grant'
- /
- drop public synonym USER_TAB_GRANTS_MADE
- /
- create public synonym USER_TAB_GRANTS_MADE for USER_TAB_GRANTS_MADE
- /
- grant select on USER_TAB_GRANTS_MADE to PUBLIC
- /
- drop view ALL_TAB_GRANTS_MADE
- /
- create view ALL_TAB_GRANTS_MADE
- (GRANTEE, OWNER, TABLE_NAME, GRANTOR,
- SELECT_PRIV, INSERT_PRIV, DELETE_PRIV,
- UPDATE_PRIV, REFERENCES_PRIV, ALTER_PRIV, INDEX_PRIV,
- CREATED)
- as
- select ue.name, u.name, o.name, ur.name,
- decode(ta.select$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.insert$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.delete$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.update$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.references$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.alter$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.index$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- ta.time
- from sys.tabauth$ ta, sys.obj$ o, sys.user$ u, sys.user$ ur, sys.user$ ue
- where ta.obj# = o.obj#
- and ta.grantor# = ur.user#
- and ta.grantee# = ue.user#
- and u.user# = o.owner#
- and uid in (o.owner#, ta.grantor#)
- /
- comment on table ALL_TAB_GRANTS_MADE is
- 'User''s grants and grants on user''s objects'
- /
- comment on column ALL_TAB_GRANTS_MADE.GRANTEE is
- 'Name of the user to whom access was granted'
- /
- comment on column ALL_TAB_GRANTS_MADE.OWNER is
- 'Owner of the object'
- /
- comment on column ALL_TAB_GRANTS_MADE.TABLE_NAME is
- 'Name of the object'
- /
- comment on column ALL_TAB_GRANTS_MADE.GRANTOR is
- 'Name of the user who performed the grant'
- /
- comment on column ALL_TAB_GRANTS_MADE.SELECT_PRIV is
- 'Permission to SELECT from the object?'
- /
- comment on column ALL_TAB_GRANTS_MADE.INSERT_PRIV is
- 'Permission to INSERT into the object?'
- /
- comment on column ALL_TAB_GRANTS_MADE.DELETE_PRIV is
- 'Permission to DELETE from the object?'
- /
- comment on column ALL_TAB_GRANTS_MADE.UPDATE_PRIV is
- 'Permission to UPDATE the object?'
- /
- comment on column ALL_TAB_GRANTS_MADE.REFERENCES_PRIV is
- 'Permission to make REFERENCES to the object?'
- /
- comment on column ALL_TAB_GRANTS_MADE.ALTER_PRIV is
- 'Permission to ALTER the object?'
- /
- comment on column ALL_TAB_GRANTS_MADE.INDEX_PRIV is
- 'Permission to CREATE/DROP INDEX on the object?'
- /
- comment on column ALL_TAB_GRANTS_MADE.CREATED is
- 'Timestamp for the grant'
- /
- drop public synonym ALL_TAB_GRANTS_MADE
- /
- create public synonym ALL_TAB_GRANTS_MADE for ALL_TAB_GRANTS_MADE
- /
- grant select on ALL_TAB_GRANTS_MADE to PUBLIC
- /
- remark
- remark FAMILY "TAB_GRANTS_RECD"
- remark Grants received on objects.
- remark This family has no DBA member.
- remark
- drop view USER_TAB_GRANTS_RECD
- /
- create view USER_TAB_GRANTS_RECD
- (OWNER, TABLE_NAME, GRANTOR,
- SELECT_PRIV, INSERT_PRIV, DELETE_PRIV,
- UPDATE_PRIV, REFERENCES_PRIV, ALTER_PRIV, INDEX_PRIV,
- CREATED)
- as
- select u.name, o.name, ur.name,
- decode(ta.select$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.insert$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.delete$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.update$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.references$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.alter$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.index$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- ta.time
- from sys.tabauth$ ta, sys.obj$ o, sys.user$ u, sys.user$ ur
- where ta.obj# = o.obj#
- and ta.grantor# = ur.user#
- and u.user# = o.owner#
- and ta.grantee# = uid
- /
- comment on table USER_TAB_GRANTS_RECD is
- 'Grants on objects for which the user is the grantee'
- /
- comment on column USER_TAB_GRANTS_RECD.OWNER is
- 'Owner of the object'
- /
- comment on column USER_TAB_GRANTS_RECD.TABLE_NAME is
- 'Name of the object'
- /
- comment on column USER_TAB_GRANTS_RECD.GRANTOR is
- 'Name of the user who performed the grant'
- /
- comment on column USER_TAB_GRANTS_RECD.SELECT_PRIV is
- 'Permission to SELECT from the object?'
- /
- comment on column USER_TAB_GRANTS_RECD.INSERT_PRIV is
- 'Permission to INSERT into the object?'
- /
- comment on column USER_TAB_GRANTS_RECD.DELETE_PRIV is
- 'Permission to DELETE from the object?'
- /
- comment on column USER_TAB_GRANTS_RECD.UPDATE_PRIV is
- 'Permission to UPDATE the object?'
- /
- comment on column USER_TAB_GRANTS_RECD.REFERENCES_PRIV is
- 'Permission to make REFERENCES to the object?'
- /
- comment on column USER_TAB_GRANTS_RECD.ALTER_PRIV is
- 'Permission to ALTER the object?'
- /
- comment on column USER_TAB_GRANTS_RECD.INDEX_PRIV is
- 'Permission to create/drop an INDEX on the object?'
- /
- comment on column USER_TAB_GRANTS_RECD.CREATED is
- 'Timestamp for the grant'
- /
- drop public synonym USER_TAB_GRANTS_RECD
- /
- create public synonym USER_TAB_GRANTS_RECD for USER_TAB_GRANTS_RECD
- /
- grant select on USER_TAB_GRANTS_RECD to PUBLIC
- /
- drop view ALL_TAB_GRANTS_RECD
- /
- create view ALL_TAB_GRANTS_RECD
- (GRANTEE, OWNER, TABLE_NAME, GRANTOR,
- SELECT_PRIV, INSERT_PRIV, DELETE_PRIV,
- UPDATE_PRIV, REFERENCES_PRIV, ALTER_PRIV, INDEX_PRIV,
- CREATED)
- as
- select ue.name, u.name, o.name, ur.name,
- decode(ta.select$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.insert$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.delete$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.update$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.references$, 0, 'N', 1, 'S', 2, 'A', 3, 'G', '?'),
- decode(ta.alter$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- decode(ta.index$, 0, 'N', 2, 'Y', 3, 'G', '?'),
- ta.time
- from sys.tabauth$ ta, sys.obj$ o, sys.user$ u, sys.user$ ur, sys.user$ ue
- where ta.obj# = o.obj#
- and ta.grantor# = ur.user#
- and ta.grantee# = ue.user#
- and u.user# = o.owner#
- and ta.grantee# in (uid, 1)
- /
- comment on table ALL_TAB_GRANTS_RECD is
- 'Grants on objects for which the user or PUBLIC is the grantee'
- /
- comment on column ALL_TAB_GRANTS_RECD.GRANTEE is
- 'Name of the user to whom access was granted'
- /
- comment on column ALL_TAB_GRANTS_RECD.OWNER is
- 'Owner of the object'
- /
- comment on column ALL_TAB_GRANTS_RECD.TABLE_NAME is
- 'Name of the object'
- /
- comment on column ALL_TAB_GRANTS_RECD.GRANTOR is
- 'Name of the user who performed the grant'
- /
- comment on column ALL_TAB_GRANTS_RECD.SELECT_PRIV is
- 'Permission to SELECT from the object?'
- /
- comment on column ALL_TAB_GRANTS_RECD.INSERT_PRIV is
- 'Permission to INSERT into the object?'
- /
- comment on column ALL_TAB_GRANTS_RECD.DELETE_PRIV is
- 'Permission to DELETE from the object?'
- /
- comment on column ALL_TAB_GRANTS_RECD.UPDATE_PRIV is
- 'Permission to UPDATE the object?'
- /
- comment on column ALL_TAB_GRANTS_RECD.REFERENCES_PRIV is
- 'Permission to make REFERENCES to the object?'
- /
- comment on column ALL_TAB_GRANTS_RECD.ALTER_PRIV is
- 'Permission to ALTER the object?'
- /
- comment on column ALL_TAB_GRANTS_RECD.INDEX_PRIV is
- 'Permission to create/drop an INDEX on the object?'
- /
- comment on column ALL_TAB_GRANTS_RECD.CREATED is
- 'Timestamp for the grant'
- /
- drop public synonym ALL_TAB_GRANTS_RECD
- /
- create public synonym ALL_TAB_GRANTS_RECD for ALL_TAB_GRANTS_RECD
- /
- grant select on ALL_TAB_GRANTS_RECD to PUBLIC
- /
- remark
- remark FAMILY "TS_QUOTAS"
- remark Tablespace quotas for users.
- remark This family has no ALL member.
- remark
- drop view USER_TS_QUOTAS
- /
- create view USER_TS_QUOTAS
- (TABLESPACE_NAME, BYTES, MAX_BYTES, BLOCKS, MAX_BLOCKS)
- as
- select ts.name, q.blocks * ts.blocksize,
- q.maxblocks * ts.blocksize,
- q.blocks, q.maxblocks
- from sys.tsq$ q, sys.ts$ ts
- where q.ts# = ts.ts#
- and q.user# = uid
- /
- comment on table USER_TS_QUOTAS is
- 'Tablespace quotas for the user'
- /
- comment on column USER_TS_QUOTAS.TABLESPACE_NAME is
- 'Tablespace name'
- /
- comment on column USER_TS_QUOTAS.BLOCKS is
- 'Number of ORACLE blocks charged to the user'
- /
- comment on column USER_TS_QUOTAS.MAX_BLOCKS is
- 'User''s quota in ORACLE blocks. NULL if no limit'
- /
- comment on column USER_TS_QUOTAS.BYTES is
- 'Number of bytes charged to the user'
- /
- comment on column USER_TS_QUOTAS.MAX_BYTES is
- 'User''s quota in bytes. NULL if no limit'
- /
- drop public synonym USER_TS_QUOTAS
- /
- create public synonym USER_TS_QUOTAS for USER_TS_QUOTAS
- /
- grant select on USER_TS_QUOTAS to PUBLIC
- /
- drop view DBA_TS_QUOTAS
- /
- create view DBA_TS_QUOTAS
- (TABLESPACE_NAME, USERNAME, BYTES, MAX_BYTES, BLOCKS, MAX_BLOCKS)
- as
- select ts.name, u.name,
- q.blocks * ts.blocksize, q.maxblocks * ts.blocksize,
- q.blocks, q.maxblocks
- from sys.tsq$ q, sys.ts$ ts, sys.user$ u
- where q.ts# = ts.ts#
- and q.user# = u.user#
- /
- comment on table DBA_TS_QUOTAS is
- 'Tablespace quotas for all users'
- /
- comment on column DBA_TS_QUOTAS.TABLESPACE_NAME is
- 'Tablespace name'
- /
- comment on column DBA_TS_QUOTAS.USERNAME is
- 'User with resource rights on the tablespace'
- /
- comment on column DBA_TS_QUOTAS.BLOCKS is
- 'Number of ORACLE blocks charged to the user'
- /
- comment on column DBA_TS_QUOTAS.MAX_BLOCKS is
- 'User''s quota in ORACLE blocks. NULL if no limit'
- /
- comment on column DBA_TS_QUOTAS.BYTES is
- 'Number of bytes charged to the user'
- /
- comment on column DBA_TS_QUOTAS.MAX_BYTES is
- 'User''s quota in bytes. NULL if no limit'
- /
- remark
- remark FAMILY "USERS"
- remark Users enrolled in the database.
- remark
- drop view USER_USERS
- /
- create view USER_USERS
- (USERNAME, USER_ID,
- CONNECT_PRIV, RESOURCE_PRIV, DBA_PRIV,
- DEFAULT_TABLESPACE, TEMPORARY_TABLESPACE, CREATED, EXPIRES)
- as
- select u.name, u.user#,
- u.connect$, u.resource$, u.dba$,
- dts.name, tts.name, u.ctime, u.ptime
- from sys.user$ u, sys.ts$ dts, sys.ts$ tts
- where u.datats# = dts.ts#
- and u.tempts# = tts.ts#
- and u.user# = uid
- /
- comment on table USER_USERS is
- 'Information about the current user'
- /
- comment on column USER_USERS.USERNAME is
- 'Name of the user'
- /
- comment on column USER_USERS.USER_ID is
- 'ID number of the user'
- /
- comment on column USER_USERS.CONNECT_PRIV is
- 'Does user have CONNECT privilege?'
- /
- comment on column USER_USERS.RESOURCE_PRIV is
- 'Does user have RESOURCE privilege?'
- /
- comment on column USER_USERS.DBA_PRIV is
- 'Does user have DBA Privilege?'
- /
- comment on column USER_USERS.DEFAULT_TABLESPACE is
- 'Default tablespace for data'
- /
- comment on column USER_USERS.TEMPORARY_TABLESPACE is
- 'Default tablespace for temporary tables'
- /
- comment on column USER_USERS.CREATED is
- 'User creation date'
- /
- comment on column USER_USERS.EXPIRES is
- 'Password expiration date'
- /
- drop public synonym USER_USERS
- /
- create public synonym USER_USERS for USER_USERS
- /
- drop public synonym MYPRIVS
- /
- create public synonym MYPRIVS for USER_USERS
- /
- grant select on USER_USERS to PUBLIC
- /
- drop view ALL_USERS
- /
- create view ALL_USERS
- (USERNAME, USER_ID,
- /* CONNECT_PRIV, RESOURCE_PRIV, DBA_PRIV,
- DEFAULT_TABLESPACE, TEMPORARY_TABLESPACE, */ CREATED)
- as
- select u.name, u.user#,
- /* u.connect$, u.resource$, u.dba$,
- dts.name, tts.name, */ u.ctime
- from sys.user$ u, sys.ts$ dts, sys.ts$ tts
- where u.datats# = dts.ts#
- and u.tempts# = tts.ts#
- /
- comment on table ALL_USERS is
- 'Information about all users of the database'
- /
- comment on column ALL_USERS.USERNAME is
- 'Name of the user'
- /
- comment on column ALL_USERS.USER_ID is
- 'ID number of the user'
- /
- remark comment on column ALL_USERS.CONNECT_PRIV is
- remark 'Does the user have CONNECT privilege?'
- remark /
- remark comment on column ALL_USERS.RESOURCE_PRIV is
- remark 'Does the user have RESOURCE privilege?'
- remark /
- remark comment on column ALL_USERS.DBA_PRIV is
- remark 'Does the user have DBA privilege?'
- remark /
- remark comment on column ALL_USERS.DEFAULT_TABLESPACE is
- remark 'Default tablespace for data'
- remark /
- remark comment on column ALL_USERS.TEMPORARY_TABLESPACE is
- remark 'Default tablespace for temporary tables'
- remark /
- comment on column ALL_USERS.CREATED is
- 'User creation date'
- /
- drop public synonym ALL_USERS
- /
- create public synonym ALL_USERS for ALL_USERS
- /
- grant select on ALL_USERS to PUBLIC
- /
- drop view DBA_USERS
- /
- create view DBA_USERS
- (USERNAME, USER_ID, PASSWORD,
- CONNECT_PRIV, RESOURCE_PRIV, DBA_PRIV,
- DEFAULT_TABLESPACE, TEMPORARY_TABLESPACE, CREATED, EXPIRES)
- as
- select u.name, u.user#, u.password,
- u.connect$, u.resource$, u.dba$,
- dts.name, tts.name, u.ctime, u.ptime
- from sys.user$ u, sys.ts$ dts, sys.ts$ tts
- where u.datats# = dts.ts#
- and u.tempts# = tts.ts#
- /
- comment on table DBA_USERS is
- 'Information about all users of the database'
- /
- comment on column DBA_USERS.USERNAME is
- 'Name of the user'
- /
- comment on column DBA_USERS.USER_ID is
- 'ID number of the user'
- /
- comment on column DBA_USERS.PASSWORD is
- 'Encrypted password'
- /
- comment on column DBA_USERS.CONNECT_PRIV is
- 'Does the user have CONNECT privilege?'
- /
- comment on column DBA_USERS.RESOURCE_PRIV is
- 'Does the user have RESOURCE privilege?'
- /
- comment on column DBA_USERS.DBA_PRIV is
- 'Does the user have DBA privilege?'
- /
- comment on column DBA_USERS.DEFAULT_TABLESPACE is
- 'Default tablespace for data'
- /
- comment on column DBA_USERS.TEMPORARY_TABLESPACE is
- 'Default tablespace for temporary tables'
- /
- comment on column DBA_USERS.CREATED is
- 'User creation date'
- /
- comment on column DBA_USERS.EXPIRES is
- 'Password expiration date'
- /
- remark
- remark FAMILY "VIEWS"
- remark All relevant information about views, except columns.
- remark
- drop view USER_VIEWS
- /
- create view USER_VIEWS
- (VIEW_NAME, TEXT_LENGTH, TEXT)
- as
- select o.name, v.textlength, v.text
- from sys.obj$ o, sys.view$ v
- where o.obj# = v.obj#
- and o.owner# = uid
- /
- comment on table USER_VIEWS is
- 'Text of views owned by the user'
- /
- comment on column USER_VIEWS.VIEW_NAME is
- 'Name of the view'
- /
- comment on column USER_VIEWS.TEXT_LENGTH is
- 'Length of the view text'
- /
- comment on column USER_VIEWS.TEXT is
- 'View text'
- /
- drop public synonym USER_VIEWS
- /
- create public synonym USER_VIEWS for USER_VIEWS
- /
- grant select on USER_VIEWS to PUBLIC
- /
- drop view ALL_VIEWS
- /
- create view ALL_VIEWS
- (OWNER, VIEW_NAME, TEXT_LENGTH, TEXT)
- as
- select u.name, o.name, v.textlength, v.text
- from sys.obj$ o, sys.view$ v, sys.user$ u
- where o.obj# = v.obj#
- and o.owner# = u.user#
- and (o.owner# = uid
- or o.obj# in
- (select ta.obj#
- from sys.tabauth$ ta
- where ta.grantee# in (uid, 1))
- )
- /
- comment on table ALL_VIEWS is
- 'Text of views accessible to the user'
- /
- comment on column ALL_VIEWS.OWNER is
- 'Owner of the view'
- /
- comment on column ALL_VIEWS.VIEW_NAME is
- 'Name of the view'
- /
- comment on column ALL_VIEWS.TEXT_LENGTH is
- 'Length of the view text'
- /
- comment on column ALL_VIEWS.TEXT is
- 'View text'
- /
- drop public synonym ALL_VIEWS
- /
- create public synonym ALL_VIEWS for ALL_VIEWS
- /
- grant select on ALL_VIEWS to PUBLIC
- /
- drop view DBA_VIEWS
- /
- create view DBA_VIEWS
- (OWNER, VIEW_NAME, TEXT_LENGTH, TEXT)
- as
- select u.name, o.name, v.textlength, v.text
- from sys.obj$ o, sys.view$ v, sys.user$ u
- where o.obj# = v.obj#
- and o.owner# = u.user#
- /
- comment on table DBA_VIEWS is
- 'Text of all views in the database'
- /
- comment on column DBA_VIEWS.OWNER is
- 'Owner of the view'
- /
- comment on column DBA_VIEWS.VIEW_NAME is
- 'Name of the view'
- /
- comment on column DBA_VIEWS.TEXT_LENGTH is
- 'Length of the view text'
- /
- comment on column DBA_VIEWS.TEXT is
- 'View text'
- /
- remark
- remark FAMILY "CONSTRAINTS"
- remark
- drop view USER_CONSTRAINTS
- /
- create view USER_CONSTRAINTS (OWNER, CONSTRAINT_NAME, CONSTRAINT_TYPE,
- TABLE_NAME, SEARCH_CONDITION, R_OWNER,
- R_CONSTRAINT_NAME)
- as
- select ou.name, oc.name,
- decode(c.type, 1, 'C', 2, 'P', 3, 'U', 4, 'R', 5, 'V', 6, 'RL', 7, 'RS',
- '?'),
- o.name, c.condition, ru.name, rc.name
- from sys.con$ oc, sys.con$ rc, sys.user$ ou, sys.user$ ru,
- sys.obj$ o, sys.cdef$ c
- where oc.owner# = ou.user#
- and oc.con# = c.con#
- and c.obj# = o.obj#
- and c.rcon# = rc.con#(+)
- and rc.owner# = ru.user#(+)
- and o.owner# = uid
- /
- comment on table USER_CONSTRAINTS is
- 'Constraint definitions on accessible tables'
- /
- comment on column USER_CONSTRAINTS.OWNER is
- 'Owner of the table'
- /
- comment on column USER_CONSTRAINTS.CONSTRAINT_NAME is
- 'Name associated with constraint definition'
- /
- comment on column USER_CONSTRAINTS.CONSTRAINT_TYPE is
- 'Type of constraint definition'
- /
- comment on column USER_CONSTRAINTS.TABLE_NAME is
- 'Name associated with table with constraint definition'
- /
- comment on column USER_CONSTRAINTS.SEARCH_CONDITION is
- 'Text of search condition for table check'
- /
- comment on column USER_CONSTRAINTS.R_OWNER is
- 'Owner of table used in referential constraint'
- /
- comment on column USER_CONSTRAINTS.R_CONSTRAINT_NAME is
- 'Name of unique constraint definition for referenced table'
- /
- grant select on USER_CONSTRAINTS to public
- /
- drop public synonym USER_CONSTRAINTS
- /
- create public synonym USER_CONSTRAINTS for USER_CONSTRAINTS
- /
- drop view ALL_CONSTRAINTS
- /
- create view ALL_CONSTRAINTS (OWNER, CONSTRAINT_NAME, CONSTRAINT_TYPE,
- TABLE_NAME, SEARCH_CONDITION, R_OWNER,
- R_CONSTRAINT_NAME)
- as
- select ou.name, oc.name,
- decode(c.type, 1, 'C', 2, 'P', 3, 'U', 4, 'R', 5, 'V', 6, 'RL', 7, 'RS',
- '?'),
- o.name, c.condition, ru.name, rc.name
- from sys.con$ oc, sys.con$ rc, sys.user$ ou, sys.user$ ru,
- sys.obj$ o, sys.cdef$ c
- where oc.owner# = ou.user#
- and oc.con# = c.con#
- and c.obj# = o.obj#
- and c.rcon# = rc.con#(+)
- and rc.owner# = ru.user#(+)
- and (o.owner# = uid
- or o.obj# in (select obj#
- from sys.tabauth$
- where grantee# in (1,uid)
- )
- )
- /
- comment on table ALL_CONSTRAINTS is
- 'Constraint definitions on accessible tables'
- /
- comment on column ALL_CONSTRAINTS.OWNER is
- 'Owner of the table'
- /
- comment on column ALL_CONSTRAINTS.CONSTRAINT_NAME is
- 'Name associated with constraint definition'
- /
- comment on column ALL_CONSTRAINTS.CONSTRAINT_TYPE is
- 'Type of constraint definition'
- /
- comment on column ALL_CONSTRAINTS.TABLE_NAME is
- 'Name associated with table with constraint definition'
- /
- comment on column ALL_CONSTRAINTS.SEARCH_CONDITION is
- 'Text of search condition for table check'
- /
- comment on column ALL_CONSTRAINTS.R_OWNER is
- 'Owner of table used in referential constraint'
- /
- comment on column ALL_CONSTRAINTS.R_CONSTRAINT_NAME is
- 'Name of unique constraint definition for referenced table'
- /
- grant select on ALL_CONSTRAINTS to public
- /
- drop public synonym ALL_CONSTRAINTS
- /
- create public synonym ALL_CONSTRAINTS for ALL_CONSTRAINTS
- /
- drop view DBA_CONSTRAINTS
- /
- create view DBA_CONSTRAINTS (OWNER, CONSTRAINT_NAME, CONSTRAINT_TYPE,
- TABLE_NAME, SEARCH_CONDITION, R_OWNER,
- R_CONSTRAINT_NAME)
- as
- select ou.name, oc.name,
- decode(c.type, 1, 'C', 2, 'P', 3, 'U', 4, 'R', 5, 'V', 6, 'RL', 7, 'RS',
- '?'),
- o.name, c.condition, ru.name, rc.name
- from sys.con$ oc, sys.con$ rc, sys.user$ ou, sys.user$ ru,
- sys.obj$ o, sys.cdef$ c
- where oc.owner# = ou.user#
- and oc.con# = c.con#
- and c.obj# = o.obj#
- and c.rcon# = rc.con#(+)
- and rc.owner# = ru.user#(+)
- /
- comment on table DBA_CONSTRAINTS is
- 'Constraint definitions on accessible tables'
- /
- comment on column DBA_CONSTRAINTS.OWNER is
- 'Owner of the table'
- /
- comment on column DBA_CONSTRAINTS.CONSTRAINT_NAME is
- 'Name associated with constraint definition'
- /
- comment on column DBA_CONSTRAINTS.CONSTRAINT_TYPE is
- 'Type of constraint definition'
- /
- comment on column DBA_CONSTRAINTS.TABLE_NAME is
- 'Name associated with table with constraint definition'
- /
- comment on column DBA_CONSTRAINTS.SEARCH_CONDITION is
- 'Text of search condition for table check'
- /
- comment on column DBA_CONSTRAINTS.R_OWNER is
- 'Owner of table used in referential constraint'
- /
- comment on column DBA_CONSTRAINTS.R_CONSTRAINT_NAME is
- 'Name of unique constraint definition for referenced table'
- /
- drop public synonym DBA_CONSTRAINTS
- /
- create public synonym DBA_CONSTRAINTS for DBA_CONSTRAINTS
- /
- remark
- remark FAMILY "CONS_COLUMNS"
- remark
- drop view USER_CONS_COLUMNS
- /
- create view USER_CONS_COLUMNS (OWNER, CONSTRAINT_NAME, TABLE_NAME, COLUMN_NAME,
- POSITION)
- as
- select u.name, c.name, o.name, col.name, cc.pos#
- from sys.user$ u, sys.con$ c, sys.col$ col, sys.ccol$ cc, sys.cdef$ cd,
- sys.obj$ o
- where c.owner# = u.user#
- and c.con# = cd.con#
- and cd.con# = cc.con#
- and cc.obj# = col.obj#
- and cc.col# = col.col#
- and cc.obj# = o.obj#
- and c.owner# = uid
- /
- comment on table USER_CONS_COLUMNS is
- 'Information about accessible columns in constraint definitions'
- /
- comment on column USER_CONS_COLUMNS.OWNER is
- 'Owner of the constraint definition'
- /
- comment on column USER_CONS_COLUMNS.CONSTRAINT_NAME is
- 'Name associated with the constraint definition'
- /
- comment on column USER_CONS_COLUMNS.TABLE_NAME is
- 'Name associated with table with constraint definition'
- /
- comment on column USER_CONS_COLUMNS.COLUMN_NAME is
- 'Name associated with column specified in the constraint definition'
- /
- comment on column USER_CONS_COLUMNS.POSITION is
- 'Original position of column in definition'
- /
- grant select on USER_CONS_COLUMNS to public
- /
- drop public synonym USER_CONS_COLUMNS
- /
- create public synonym USER_CONS_COLUMNS for USER_CONS_COLUMNS
- /
- drop view ALL_CONS_COLUMNS
- /
- create view ALL_CONS_COLUMNS (OWNER, CONSTRAINT_NAME, TABLE_NAME, COLUMN_NAME,
- POSITION)
- as
- select u.name, c.name, o.name, col.name, cc.pos#
- from sys.user$ u, sys.con$ c, sys.col$ col, sys.ccol$ cc, sys.cdef$ cd,
- sys.obj$ o
- where c.owner# = u.user#
- and c.con# = cd.con#
- and cd.con# = cc.con#
- and cc.obj# = col.obj#
- and cc.col# = col.col#
- and cc.obj# = o.obj#
- and (c.owner# = uid
- or cd.obj# in (select obj#
- from sys.tabauth$
- where grantee# in (1,uid)
- )
- )
- /
- comment on table ALL_CONS_COLUMNS is
- 'Information about accessible columns in constraint definitions'
- /
- comment on column ALL_CONS_COLUMNS.OWNER is
- 'Owner of the constraint definition'
- /
- comment on column ALL_CONS_COLUMNS.CONSTRAINT_NAME is
- 'Name associated with the constraint definition'
- /
- comment on column ALL_CONS_COLUMNS.TABLE_NAME is
- 'Name associated with table with constraint definition'
- /
- comment on column ALL_CONS_COLUMNS.COLUMN_NAME is
- 'Name associated with column specified in the constraint definition'
- /
- comment on column ALL_CONS_COLUMNS.POSITION is
- 'Original position of column in definition'
- /
- grant select on ALL_CONS_COLUMNS to public
- /
- drop public synonym ALL_CONS_COLUMNS
- /
- create public synonym ALL_CONS_COLUMNS for ALL_CONS_COLUMNS
- /
- drop view DBA_CONS_COLUMNS
- /
- create view DBA_CONS_COLUMNS (OWNER, CONSTRAINT_NAME, TABLE_NAME, COLUMN_NAME,
- POSITION)
- as
- select u.name, c.name, o.name, col.name, cc.pos#
- from sys.user$ u, sys.con$ c, sys.col$ col, sys.ccol$ cc, sys.cdef$ cd,
- sys.obj$ o
- where c.owner# = u.user#
- and c.con# = cd.con#
- and cd.con# = cc.con#
- and cc.obj# = col.obj#
- and cc.col# = col.col#
- and cc.obj# = o.obj#
- /
- comment on table DBA_CONS_COLUMNS is
- 'Information about accessible columns in constraint definitions'
- /
- comment on column DBA_CONS_COLUMNS.OWNER is
- 'Owner of the constraint definition'
- /
- comment on column DBA_CONS_COLUMNS.CONSTRAINT_NAME is
- 'Name associated with the constraint definition'
- /
- comment on column DBA_CONS_COLUMNS.TABLE_NAME is
- 'Name associated with table with constraint definition'
- /
- comment on column DBA_CONS_COLUMNS.COLUMN_NAME is
- 'Name associated with column specified in the constraint definition'
- /
- comment on column DBA_CONS_COLUMNS.POSITION is
- 'Original position of column in definition'
- /
- drop public synonym DBA_CONS_COLUMNS
- /
- create public synonym DBA_CONS_COLUMNS for DBA_CONS_COLUMNS
- /
- remark
- remark FAMILY "CONSTRAINT VIEWS" FOR ANSI
- remark
- drop view CONSTRAINT_DEFS
- /
- create view CONSTRAINT_DEFS (OWNER, CONSTRAINT_NAME, CONSTRAINT_TYPE,
- TABLE_NAME, SEARCH_CONDITION, R_OWNER,
- R_CONSTRAINT_NAME)
- as
- select ou.name, oc.name,
- decode(c.type, 1, 'C', 2, 'P', 3, 'U', 4, 'R', 5, 'V', 6, 'RL', 7, 'RS',
- '?'),
- o.name, c.condition, ru.name, rc.name
- from sys.con$ oc, sys.con$ rc, sys.user$ ou, sys.user$ ru,
- sys.obj$ o, sys.cdef$ c
- where oc.owner# = ou.user#
- and oc.con# = c.con#
- and c.obj# = o.obj#
- and c.rcon# = rc.con#(+)
- and rc.owner# = ru.user#(+)
- and (o.owner# = uid
- or o.obj# in (select obj#
- from sys.tabauth$
- where grantee# in (1,uid)
- )
- )
- /
- comment on table CONSTRAINT_DEFS is
- 'Constraint Definitions on accessible tables'
- /
- comment on column CONSTRAINT_DEFS.OWNER is
- 'Owner of the table'
- /
- comment on column CONSTRAINT_DEFS.CONSTRAINT_NAME is
- 'Name associated with constraint definition'
- /
- comment on column CONSTRAINT_DEFS.CONSTRAINT_TYPE is
- 'Type of constraint definition'
- /
- comment on column CONSTRAINT_DEFS.TABLE_NAME is
- 'Name associated with table with constraint definition'
- /
- comment on column CONSTRAINT_DEFS.SEARCH_CONDITION is
- 'Text of search condition for table check'
- /
- comment on column CONSTRAINT_DEFS.R_OWNER is
- 'Owner of table used in referential constraint'
- /
- comment on column CONSTRAINT_DEFS.R_CONSTRAINT_NAME is
- 'Name of unique constraint definition for referenced table'
- /
- grant select on CONSTRAINT_DEFS to public
- /
- drop public synonym CONSTRAINT_DEFS
- /
- create public synonym CONSTRAINT_DEFS for CONSTRAINT_DEFS
- /
- drop view CONSTRAINT_COLUMNS
- /
- create view CONSTRAINT_COLUMNS (OWNER, CONSTRAINT_NAME, COLUMN_NAME,
- POSITION)
- as
- select u.name, c.name, col.name, cc.pos#
- from sys.user$ u, sys.con$ c, sys.col$ col, sys.ccol$ cc, sys.cdef$ cd
- where c.owner# = u.user#
- and c.con# = cd.con#
- and cd.type in (2,3,4)
- and cd.con# = cc.con#
- and cc.obj# = col.obj#
- and cc.col# = col.col#
- and (c.owner# = uid
- or cd.obj# in (select obj#
- from sys.tabauth$
- where grantee# in (1,uid)
- )
- )
- /
- comment on table CONSTRAINT_COLUMNS is
- 'Information about accessible columns in constraint definitions'
- /
- comment on column CONSTRAINT_COLUMNS.OWNER is
- 'Owner of the constraint definition'
- /
- comment on column CONSTRAINT_COLUMNS.CONSTRAINT_NAME is
- 'Name associated with the constraint definition'
- /
- comment on column CONSTRAINT_COLUMNS.COLUMN_NAME is
- 'Name associated with column specified in the constraint definition'
- /
- comment on column CONSTRAINT_COLUMNS.POSITION is
- 'Original position of column in definition'
- /
- grant select on CONSTRAINT_COLUMNS to public
- /
- drop public synonym CONSTRAINT_COLUMNS
- /
- create public synonym CONSTRAINT_COLUMNS for CONSTRAINT_COLUMNS
- /
- remark
- remark FAMILY "FIXED (VIRTUAL) VIEWS"
- remark
- drop view v_$process;
- create view v_$process as select * from v$process;
- drop public synonym v$process;
- create public synonym v$process for v_$process;
-
- drop view v_$bgprocess;
- create view v_$bgprocess as select * from v$bgprocess;
- drop public synonym v$bgprocess;
- create public synonym v$bgprocess for v_$bgprocess;
-
- drop view v_$session;
- create view v_$session as select * from v$session;
- drop public synonym v$session;
- create public synonym v$session for v_$session;
-
- drop view v_$transaction;
- create view v_$transaction as select * from v$transaction;
- drop public synonym v$transaction;
- create public synonym v$transaction for v_$transaction;
-
- drop view v_$latch;
- create view v_$latch as select * from v$latch;
- drop public synonym v$latch;
- create public synonym v$latch for v_$latch;
-
- drop view v_$latchname;
- create view v_$latchname as select * from v$latchname;
- drop public synonym v$latchname;
- create public synonym v$latchname for v_$latchname;
-
- drop view v_$latchholder;
- create view v_$latchholder as select * from v$latchholder;
- drop public synonym v$latchholder;
- create public synonym v$latchholder for v_$latchholder;
-
- drop view v_$resource;
- create view v_$resource as select * from v$resource;
- drop public synonym v$resource;
- create public synonym v$resource for v_$resource;
-
- drop view v_$_lock;
- create view v_$_lock as select * from v$_lock;
- drop public synonym v$_lock;
- create public synonym v$_lock for v_$_lock;
-
- drop view v_$lock;
- create view v_$lock as select * from v$lock;
- drop public synonym v$lock;
- create public synonym v$lock for v_$lock;
-
- drop view v_$sesstat;
- create view v_$sesstat as select * from v$sesstat;
- drop public synonym v$sesstat;
- create public synonym v$sesstat for v_$sesstat;
-
- drop view v_$sysstat;
- create view v_$sysstat as select * from v$sysstat;
- drop public synonym v$sysstat;
- create public synonym v$sysstat for v_$sysstat;
-
- drop view v_$statname;
- create view v_$statname as select * from v$statname;
- drop public synonym v$statname;
- create public synonym v$statname for v_$statname;
-
- drop view v_$access;
- create view v_$access as select * from v$access;
- drop public synonym v$access;
- create public synonym v$access for v_$access;
-
- drop view v_$dbfile;
- create view v_$dbfile as select * from v$dbfile;
- drop public synonym v$dbfile;
- create public synonym v$dbfile for v_$dbfile;
-
- drop view v_$filestat;
- create view v_$filestat as select * from v$filestat;
- drop public synonym v$filestat;
- create public synonym v$filestat for v_$filestat;
-
- drop view v_$logfile;
- create view v_$logfile as select * from v$logfile;
- drop public synonym v$logfile;
- create public synonym v$logfile for v_$logfile;
-
- drop view v_$rollname;
- create view v_$rollname as select * from v$rollname;
- drop public synonym v$rollname;
- create public synonym v$rollname for v_$rollname;
-
- drop view v_$rollstat;
- create view v_$rollstat as select * from v$rollstat;
- drop public synonym v$rollstat;
- create public synonym v$rollstat for v_$rollstat;
-
- drop view v_$sga;
- create view v_$sga as select * from v$sga;
- drop public synonym v$sga;
- create public synonym v$sga for v_$sga;
-
- drop view v_$parameter;
- create view v_$parameter as select * from v$parameter;
- drop public synonym v$parameter;
- create public synonym v$parameter for v_$parameter;
-
- drop view v_$rowcache;
- create view v_$rowcache as select * from v$rowcache;
- drop public synonym v$rowcache;
- create public synonym v$rowcache for v_$rowcache;
-
- rem
- rem V5 views required for other Oracle products
- rem
-
- drop view syscatalog_;
- create view syscatalog_ (tname, creator, creatorid, tabletype)
- as
- select o.name, u.name, o.owner#,
- decode(o.type, 2, 'TABLE', 4, 'VIEW', 6, 'SEQUENCE','?')
- from sys.user$ u, sys.obj$ o
- where u.user# = o.owner#
- and o.type in (2, 4, 6)
- and ( o.owner# = uid
- or o.obj# in
- (select tau.obj#
- from sys.tabauth$ tau
- where tau.grantee# in (uid, 1)
- )
- )
- /
- drop view syscatalog;
- create view syscatalog (tname, creator, tabletype) as
- select tname, creator, tabletype
- from syscatalog_
- /
- grant select on syscatalog to public;
- create synonym system.syscatalog for syscatalog;
- rem
- rem The catalog view returns almost all tables accessible to the user
- rem except tables in SYS and SYSTEM ("dictionary tables").
- rem
- drop view catalog;
- create view catalog (tname, creator, tabletype) as
- select tname, creator, tabletype
- from syscatalog_
- where creatorid not in (0,2)
- /
- grant select on catalog to public;
- create synonym system.catalog for catalog;
-
- drop view tab;
- create view tab (tname, tabtype, clusterid) as
- select o.name,
- decode(o.type, 2, 'TABLE', 3, 'CLUSTER',
- 4, 'VIEW', 5, 'SYNONYM'), t.tab#
- from sys.tab$ t, sys.obj$ o
- where o.owner# = uid and o.type >=2 and o.type <=5
- and o.obj# = t.obj# (+)
- /
- grant select on tab to public;
- create synonym system.tab for tab;
- drop view col;
- create view col (tname, colno, cname, coltype, width, scale, precision, nulls,
- defaultval) as
- select t.name, c.col#, c.name,
- decode(c.type#, 1, 'CHAR',
- 2, decode(c.scale, null,
- decode(c.precision, null, 'NUMBER', 'FLOAT'),
- 'NUMBER'),
- 8, 'LONG', 9, 'VARCHAR',
- 12, 'DATE', 23, 'RAW', 24, 'LONG RAW',
- 69, 'ROWID', 'UNDEFINED'),
- c.length, c.scale, c.precision,
- decode(c.null$, 0, 'NULL', 'NOT NULL'), c.default$
- from sys.col$ c, sys.obj$ t
- where t.obj# = c.obj#
- and t.type in (2, 3, 4)
- and t.owner# = uid
- /
- grant select on col to public;
- create synonym system.col for col;
- drop view syssegobj;
- create view syssegobj (obj#, file#, block#, type, pctfree$, pctused$) as
- select obj#, file#, block#, 'TABLE', pctfree$, pctused$ from sys.tab$
- union
- select obj#, file#, block#, 'CLUSTER', pctfree$, pctused$ from sys.clu$
- union
- select obj#, file#, block#, 'INDEX', to_number(null), to_number(null)
- from sys.ind$
- /
- grant select on syssegobj to public;
- drop view tabquotas;
- create view tabquotas (tname, type, objno, nextext, maxext, pinc,
- pfree, pused) as
- select t.name, so.type, t.obj#, s.extsize, s.maxexts, s.extpct, so.pctfree$,
- so.pctused$
- from sys.seg$ s, sys.obj$ t, syssegobj so
- where t.owner# = uid
- and t.obj# = so.obj#
- and so.file# = s.file#
- and so.block# = s.block#
- /
- grant select on tabquotas to public;
- create synonym system.tabquotas for tabquotas;
-
- drop view sysfiles;
- create view sysfiles (tsname, fname, blocks) as
- select ts.name, dbf.name, f.blocks
- from sys.ts$ ts, sys.file$ f, sys.v$dbfile dbf
- where ts.ts# = f.ts#(+) and dbf.file# = f.file# and f.status$ = 2
- /
- grant select on sysfiles to public;
- create synonym system.sysfiles for sysfiles;
- drop view synonyms;
- create view synonyms (sname, syntype, creator, tname, database, tabtype) as
- select s.name,
- decode (s.owner#,1,'PUBLIC','PRIVATE'), t.owner, t.name, 'LOCAL',
- decode(ot.type, 1, 'INDEX', 2, 'TABLE', 3, 'CLUSTER', 4, 'VIEW',
- 5, 'SYNONYM', 6, 'SEQUENCE', 'UNDEFINED')
- from sys.obj$ s, sys.obj$ ot, sys.syn$ t, sys.user$ u
- where s.obj# = t.obj#
- and s.type = 5
- and ot.name = t.name
- and t.owner = u.name
- and ot.owner# = u.user#
- and s.owner# in (1,uid)
- and t.node is null
- union
- select s.name, decode(s.owner#, 1, 'PUBLIC', 'PRIVATE'),
- t.owner, t.name, t.node, 'REMOTE'
- from sys.obj$ s, sys.syn$ t
- where s.obj# = t.obj#
- and s.type = 5
- and s.owner# in (1, uid)
- and t.node is not null
- /
- grant select on synonyms to public;
- drop view publicsyn;
- create view publicsyn (sname, creator, tname, database, tabtype) as
- select sname, creator, tname, database, tabtype
- from synonyms
- where syntype = 'PUBLIC'
- /
- grant select on publicsyn to public;
- create synonym system.publicsyn for publicsyn;
-