home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / programming / oracle7 7.2 / DB / UTIL72 / CATTRUST.SQL < prev    next >
Encoding:
Text File  |  1995-05-09  |  2.1 KB  |  67 lines

  1. rem 
  2. rem $Header: cattrust.sql 7020100.1 94/09/23 22:14:23 cli Generic<base> $ 
  3. rem 
  4. Rem  Copyright (c) 1991 by Oracle Corporation 
  5. Rem    NAME
  6. Rem      cattrust.sql - views for Trusted ORACLE
  7. Rem    DESCRIPTION
  8. Rem
  9. Rem    RETURNS
  10. Rem 
  11. Rem    NOTES
  12. Rem     This script must be run at DBLOW while connect as SYS or INTERNAL.
  13. Rem    MODIFIED   (MM/DD/YY)
  14. Rem     wmaimone   05/06/94 -  #184921 run as sys/internal
  15. Rem     wmaimone   11/05/92 -  fix all_labels synonym 
  16. Rem     glumpkin   10/21/92 -  Renamed from TRUSTED.SQL 
  17. Rem     jbellemo   06/29/92 -  add rawtolab function to olab in all_label 
  18. Rem     wmaimone   04/06/92 -  Creation 
  19.  
  20. Rem
  21. Rem Family TRUSTED ORACLE
  22. Rem
  23. Rem These view are relevent only to Trusted ORACLE
  24.  
  25. create view ALL_MOUNTED_DBS 
  26.   (NAME, DBLOW, DBHIGH, MOUNT_MODE, STATUS, MAC_MODE, TYPE)
  27. as
  28. select m.name,s.dblow,s.dbhigh, m.mtmode,m.status,
  29.  decode(bitand(flags,4),4,'DBMAC','OSMAC'),'SECONDARY' type
  30. from v$secondary m,v$syslabel s where m.mid = s.mid
  31. union all
  32. select d.name,s.dblow,s.dbhigh,upper(p.value),'OPEN',
  33. decode(bitand(flags,4),4,'DBMAC','OSMAC'),'PRIMARY'
  34. from v$database d,v$syslabel s,v$parameter p
  35. where s.mid = 0 and p.name = 'db_mount_mode'
  36. /
  37. comment on table ALL_MOUNTED_DBS is 'All databases mounted by this instance'
  38. /
  39. comment on column ALL_MOUNTED_DBS.NAME is 'Database name'
  40. /
  41. comment on column ALL_MOUNTED_DBS.DBLOW is 'Active value of DBLOW'
  42. /
  43. comment on column ALL_MOUNTED_DBS.DBHIGH is 'Active value of DBHIGH'
  44. /
  45. comment on column ALL_MOUNTED_DBS.MOUNT_MODE is 
  46.   'Mode in which this instance has the database mounted'
  47. /
  48. comment on column ALL_MOUNTED_DBS.STATUS is 'Database state (mounted, open)'
  49. /
  50. comment on column ALL_MOUNTED_DBS.MAC_MODE is 'MAC enforcement mode'
  51. /
  52. comment on column ALL_MOUNTED_DBS.TYPE is 'Primary or Secondary mount'
  53. /
  54.  
  55. create view ALL_LABELS (NAME)
  56. as select distinct(rawtolab(olab)) from sys.lab$
  57. /
  58. create public synonym all_labels for sys.all_labels
  59. /
  60. grant select on all_labels to public
  61. /
  62. comment on table all_labels is 'All mls labels currently in use'
  63. /
  64. comment on column all_labels.name is 'Label'
  65. /
  66.  
  67.