home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / po7_win / db / rdbms71 / cattrust.sql < prev    next >
Encoding:
Text File  |  1994-08-07  |  1.9 KB  |  66 lines

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