From:Steve Adams
Date:04-Sep-2000 14:37
Subject:   X$ tables and keeping


The X$ "tables" are only visible to SYS. Have a look at the create_xviews.sql
script on the Ixora web site for an idea about how to make them visible to
others.

Incidentally, this script is odd in that it allows for types 13 and 14 which
were introduced in Oracle8, but expects machine dependent pseudo code chunks of
greater than 5120 bytes which should not exist beyond release 7.2. Large MPCODE
chunks have been paged from version 7.3 onwards, and I think maximum chunk size
possible is now 4136 bytes. You should also note that the EXECUTIONS count is
not reliable at 7.3 (and obsolete thereafter) and that the KSMCHPAR column is
incorrect at 8.0.


-----Original Message-----
Sent: Monday, 4 September 2000 12:42


I'm trying to use the following sql to determine which packages need
pinning, but I get an error saying x$kglob does not exist. Has anyone had
this problem ? How do I create it ? There's nothing on Metalink about it.
I'm on 7.3.4.  Thanks.

SELECT dbc.type,
       dbc.owner,
       dbc.name,
       dbc.executions,
       dbc.loads,
       dbc.sharable_mem,
       dbc.kept
  FROM v$db_object_cache dbc,
       ( SELECT DISTINCT DECODE(kglobtyp,0,'CURSOR',
                                7,'PROCEDURE',
                                8,'FUNCTION',
                                9,'PACKAGE',
                               11,'PACKAGE BODY',
                               12,'TRIGGER',
                               13,'TYPE',
                               14,'TYPE BODY',
                               'OTHER') type,
                kglnaown,
                kglnaobj
           FROM x$kglob
          WHERE kglobhd4 IN ( SELECT ksmchpar
                                FROM x$ksmsp
                               WHERE ksmchcom = 'PL/SQL MPCODE'
                                 AND ksmchsiz > 5120 ) ) chnk
 WHERE dbc.owner = chnk.kglnaown
   AND dbc.name = chnk.kglnaobj
   AND dbc.type = chnk.type
 ORDER BY dbc.sharable_mem desc;