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

  1. rem 
  2. rem $Header: catsvrmg.sql 7020200.1 95/02/15 18:32:00 cli Generic<base> $ 
  3. rem 
  4. Rem  Copyright (c) 1991 by Oracle Corporation 
  5. Rem    NAME
  6. Rem      catsvrmg.sql - Create the views and tables required for Server Manager
  7. Rem    DESCRIPTION
  8. Rem      
  9. Rem    RETURNS
  10. Rem 
  11. Rem    NOTES
  12. Rem      Connects as internal (no password)
  13. Rem    MODIFIED   (MM/DD/YY)
  14. Rem     dsternbe   02/10/95 -  update version number
  15. Rem     msinykin   01/25/94 -  update version number 
  16. Rem     barthur    01/23/94 -  Remove the sm$security items we no longer need 
  17. Rem     barthur    01/11/94 -  Add DROP SYS.SM$ROLE_TREE
  18. Rem     barthur    12/30/93 -  Add new views and table for improvements to secu
  19. Rem     ameyer     10/28/93 -  Updated version number to match database (7.1.2)
  20. Rem     ameyer     10/21/93 -  Fixed sm$version.version_number to be VSNNUMBER.
  21. Rem                         -  Also removed old tables and @@catnosvm.sql
  22. Rem     ameyer     10/12/93 -  Added sm$version and comments. 
  23. Rem     durry      09/22/93 -  add public alias for v$sess_io 
  24. Rem     sstorkel   09/10/93 -  Remove connect command. 
  25. Rem     barthur    07/30/93 -  Change sm$ts view for the new tablespace select 
  26. Rem     msinykin   06/21/93 -  Clean up views. 
  27. Rem     barthur    05/07/93 -  Creation 
  28.  
  29. REM List of Server Manager Tables and views
  30. REM These need to be created by SYS when Server Manager is installed.
  31. REM
  32. REM This script needs to be run as INTERNAL or SYS
  33. REM
  34.  
  35. REM For debugging
  36. REM set echo ON
  37.  
  38. REM You *must* be connected as SYS or INTERNAL for this script to
  39. REM work correctly.
  40.  
  41. REM sm$version
  42. REM Version_number is conceptually VSNNUMBER(version_text).
  43. REM In the case of '7.1.2.0.0', it's hex 0x07102000
  44. REM converted to decimal 118497280.
  45. create or replace view sys.sm_$version as
  46.     select '7.2.2.0.0' version_text, 119545856 version_number, created
  47.     from sys.dba_objects where owner = 'SYS' and object_name = 'SM_$VERSION';
  48. grant select on sys.sm_$version to public;
  49. drop public synonym sm$version;
  50. create public synonym sm$version for sys.sm_$version;
  51.  
  52. REM sm$ts_avail
  53. create or replace view sys.sm$ts_avail as
  54.     select tablespace_name, sum(bytes) bytes from dba_data_files
  55.     group by tablespace_name;
  56.  
  57. REM sm$ts_used
  58. create or replace view sys.sm$ts_used as
  59.     select tablespace_name, sum(bytes) bytes from dba_segments
  60.     group by tablespace_name;
  61.  
  62. REM sm$ts_free
  63. create or replace view sys.sm$ts_free as
  64.     select tablespace_name, sum(bytes) bytes from dba_free_space
  65.     group by tablespace_name;
  66.  
  67. REM sm$audit_config
  68. create or replace view sys.sm$audit_config
  69.     ( audit_type, schema_user, audit_target) as
  70.     select 'Object', owner, object_type || ' ' || object_name
  71.     from sys.dba_obj_audit_opts
  72.     where ALT != '-/-' OR AUD != '-/-' OR COM != '-/-' OR DEL != '-/-'
  73.        OR GRA != '-/-' OR IND != '-/-' OR INS != '-/-' OR LOC != '-/-'
  74.        OR REN != '-/-' OR SEL != '-/-' OR UPD != '-/-' OR REF != '-/-'
  75.        OR EXE != '-/-'
  76.     union all select 'Privilege', user_name, privilege
  77.     from sys.dba_priv_audit_opts
  78.     union all select 'Statement', user_name, audit_option
  79.     from sys.dba_stmt_audit_opts;
  80.  
  81. REM sm$integrity_cons
  82. create or replace view sys.sm$integrity_cons as
  83. select owner || '.' || table_name table_name, constraint_name,
  84.     decode(status, 'ENABLED', 'Y', NULL) enabled from sys.dba_constraints;
  85.  
  86. REM Now, make v$sess_io public.
  87. REM This is here as a workaround for bug #149629.  Basically, there is a bug
  88. REM in catalog.sql.  It fails to create the view and public synonym for
  89. REM v$sess_io.  This makes it impossible for regular DBA's to run monitors
  90. REM using this view.
  91. REM This should disappear at some point.
  92. create or replace view sys.v_$sess_io as select * from sys.v$sess_io;
  93. drop public synonym v$sess_io;
  94. create public synonym v$sess_io for sys.v_$sess_io;
  95.