home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / database / oracle / 1449 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  1.7 KB

  1. Path: sparky!uunet!munnari.oz.au!manuel!sserve!hhcs.gov.au!sharmp
  2. From: sharmp@hhcs.gov.au
  3. Newsgroups: comp.databases.oracle
  4. Subject: PL/SQL, V$ problem
  5. Message-ID: <1992Sep1.155256.336@hhcs.gov.au>
  6. Date: 1 Sep 92 15:52:56 +1000
  7. Organization: Aust. Dept. Health, Housing and Community Services
  8. Lines: 35
  9.  
  10. As part of our database monitoring, we have a system that collects stats on
  11. database performance each time a database is started or stopped.  The stats
  12. that are collected are based on snapshots of the dynamic v$ tables.  The 
  13. snapshots have exactly the same column definitions as the v$ tables.  When the 
  14. database is stopped or started, a series of insert statements load the 
  15. snapshot tables with the data in the v$ tables.
  16.  
  17. The problem that we have struck is that we are attempting to rewrite the insert
  18. statements in PL/SQL, because the current system dramatically slows down
  19. starting and stopping databases.  When we try to do this, trying to load our
  20. V$LOCK, V$PARAMETER, V$RESOURCE, V$ROWCACHE and V$WAITSTAT snapshot tables
  21. fails because columns in these tables are PL/SQL reserved words (TYPE, COUNT
  22. and RANGE).  A statement like 
  23.     INSERT INTO dbu.drs_snapshot_v$lock
  24.          SELECT d.db_started,
  25.             d.db_closed,
  26.             v.addr,
  27.             v.pid,
  28.             v.type,
  29.             v.id1,
  30.             v.id2,
  31.             v.lmode,
  32.             v.request
  33.            FROM v$lock v, dbu.drs_driver d
  34. fails because TYPE is a PL/SQL reserved word.  Sure, we could create the insert
  35. statement as select * from, or rename the column, but is there a way to get
  36. PL/SQL to accept a reserved word as a column name (how come ORACLE uses
  37. reserved words anyway?! :^)).
  38.  
  39. By the way, we are running ORACLE V6.0.34 on VAX/VMS 5.5-1, PL/SQL V1.0.33.1.
  40.  
  41.  
  42. Regards
  43.  
  44. Peter
  45.