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

  1. rem 
  2. rem $Header: dbmspool.sql 7010300.1 94/02/24 18:26:06 snataraj Generic<base> $ 
  3. rem 
  4. Rem  Copyright (c) 1991 by Oracle Corporation 
  5. Rem    NAME
  6. Rem      dbmspool.sql - dbms_shared_pool utility package.
  7. Rem    DESCRIPTION
  8. Rem      This package allows you to display the sizes of objects in the 
  9. Rem      shared pool, and mark them for keeping or unkeeping in order to
  10. Rem      reduce memory fragmentation.
  11. Rem    RETURNS
  12. Rem 
  13. Rem    NOTES
  14. Rem    MODIFIED   (MM/DD/YY)
  15. Rem     adowning   02/23/94 -  split into public/private files
  16. Rem     ajasuja    01/06/94 -  merge changes from branch 1.1.312.1
  17. Rem     rkooi      04/20/93 -  change psdkeep to psdkep 
  18. Rem     ajasuja    11/05/93 -  handle UNIX addresses
  19. Rem     rkooi      12/08/92 -  Creation 
  20.  
  21. create or replace package dbms_shared_pool is
  22.   ------------
  23.   --  OVERVIEW
  24.   --
  25.   --  This package provides access to the shared pool.  This is the 
  26.   --  shared memory area where cursors and PL/SQL objects are stored.
  27.  
  28.   ----------------------------
  29.   --  PROCEDURES AND FUNCTIONS
  30.   --
  31.   procedure sizes(minsize number);
  32.   --  Show objects in the shared_pool that are larger than the specified
  33.   --    size.  The name of the object is also given which can be used as
  34.   --    an argument to either the 'keep' or 'unkeep' calls below.  You should
  35.   --    issue the SQLDBA or SQLPLUS 'set serveroutput on size xxxxx' 
  36.   --    command prior to using this procedure so that the results will
  37.   --    be displayed.
  38.   --  Input arguments:
  39.   --    minsize
  40.   --      Size, in kilobytes, over which an object must be occupying in the
  41.   --      shared pool, in order for it to be displayed.
  42.   procedure keep(name varchar2, flag char DEFAULT 'P');
  43.   --  Keep an object in the shared pool.  Once an object has been keeped in
  44.   --    the shared pool, it is not subject to aging out of the pool.  This
  45.   --    may be useful for certain semi-frequently used large objects since
  46.   --    when large objects are brought into the shared pool, a larger
  47.   --    number of other objects (much more than the size of the object 
  48.   --    being brought in, may need to be aged out in order to create a
  49.   --    contiguous area large enough.
  50.   --    WARNING:  This procedure may not be supported in the future when
  51.   --    and if automatic mechanisms are implemented to make this 
  52.   --    unnecessary.
  53.   --  Input arguments:
  54.   --    name
  55.   --      The name of the object to keep.  There are two types of objects:
  56.   --      PL/SQL objects which are specified by name, and SQL cursor
  57.   --      objects which are specified by a two-part number (indicating
  58.   --      a location in the shared pool).  For example:
  59.   --        dbms_shared_pool.keep('scott.hispackage')
  60.   --      will keep package HISPACKAGE, owned by SCOTT.  The names for
  61.   --      PL/SQL objects follows SQL rules for naming objects (i.e., 
  62.   --      delimited identifiers, multi-byte names, etc. are allowed).
  63.   --      A cursor can be keeped by
  64.   --        dbms_shared_pool.keep('0034CDFF, 20348871')
  65.   --      The complete hexadecimal address must be in the first 8 characters.
  66.   --      The value for this identifier is the concatonation of the
  67.   --      'address' and 'hash_value' columns from the v$sqlarea view.  This
  68.   --      is displayed by the 'sizes' call above.
  69.   --      Currently 'TABLE' and 'VIEW' objects may not be keeped.
  70.   --    flag
  71.   --      This is an optional parameter.  If the parameter is not specified,
  72.   --        the package assumes that the first parameter is the name of a
  73.   --        package and will resolve the name.  It can also be set to 'P' or
  74.   --        'p' to fully specify that the input is the name of a package.
  75.   --      In case the first argument is a cursor address and hash-value, the
  76.   --        parameter should be set to any character except 'P' or 'p'.
  77.   --  Exceptions:
  78.   --    An exception will raised if the named object cannot be found.
  79.   procedure unkeep(name varchar2, flag char DEFAULT 'P');
  80.   --  Unkeep the named object.
  81.   --    WARNING:  This procedure may not be supported in the future when
  82.   --    and if automatic mechanisms are implemented to make this 
  83.   --    unnecessary.
  84.   --  Input arguments:
  85.   --    name
  86.   --      The name of the object to unkeep.  See description of the name
  87.   --      object for the 'keep' procedure.
  88.   --  Exceptions:
  89.   --    An exception will raised if the named object cannot be found.
  90. end;
  91. /
  92.