home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!munnari.oz.au!manuel!sserve!hhcs.gov.au!sharmp
- From: sharmp@hhcs.gov.au
- Newsgroups: comp.databases.oracle
- Subject: PL/SQL, V$ problem
- Message-ID: <1992Sep1.155256.336@hhcs.gov.au>
- Date: 1 Sep 92 15:52:56 +1000
- Organization: Aust. Dept. Health, Housing and Community Services
- Lines: 35
-
- As part of our database monitoring, we have a system that collects stats on
- database performance each time a database is started or stopped. The stats
- that are collected are based on snapshots of the dynamic v$ tables. The
- snapshots have exactly the same column definitions as the v$ tables. When the
- database is stopped or started, a series of insert statements load the
- snapshot tables with the data in the v$ tables.
-
- The problem that we have struck is that we are attempting to rewrite the insert
- statements in PL/SQL, because the current system dramatically slows down
- starting and stopping databases. When we try to do this, trying to load our
- V$LOCK, V$PARAMETER, V$RESOURCE, V$ROWCACHE and V$WAITSTAT snapshot tables
- fails because columns in these tables are PL/SQL reserved words (TYPE, COUNT
- and RANGE). A statement like
- INSERT INTO dbu.drs_snapshot_v$lock
- SELECT d.db_started,
- d.db_closed,
- v.addr,
- v.pid,
- v.type,
- v.id1,
- v.id2,
- v.lmode,
- v.request
- FROM v$lock v, dbu.drs_driver d
- fails because TYPE is a PL/SQL reserved word. Sure, we could create the insert
- statement as select * from, or rename the column, but is there a way to get
- PL/SQL to accept a reserved word as a column name (how come ORACLE uses
- reserved words anyway?! :^)).
-
- By the way, we are running ORACLE V6.0.34 on VAX/VMS 5.5-1, PL/SQL V1.0.33.1.
-
-
- Regards
-
- Peter
-