home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


7.7 New DBMS_UTILITY Features

Oracle has added two functions to the DBMS_UTILITY package that allow you to obtain information about the currently connected instance as well as active instances.

7.7.1 CURRENT_INSTANCE: Returning the Instance Number

The CURRENT_INSTANCE function returns the currently connected instance number. Its header is:

FUNCTION DBMS_UTILITY.CURRENT_INSTANCE RETURN NUMBER;

This function returns NULL if the connected instance is unavailable (down).

7.7.2 ACTIVE_INSTANCES: Returning a List of Active Instances

The ACTIVE_INSTANCES procedure returns a list of all of the active instances. Its header is:

PROCEDURE DBMS_UTILITY.ACTIVE_INSTANCES (
   instance_table OUT DBMS_UTILITY.instance_table,
   instance_count OUT NUMBER);

instance_table will contain the returned list, and instance_count is the number of active instances. DBMS_UTILITY.INSTANCE_TABLE is defined as follows:

TYPE DBMS_UTILITY.INSTANCE_RECORD IS RECORD (
    inst_number NUMBER,
    inst_name   VARCHAR2(60));
  
TYPE DBMS_UTILITY.INSTANCE_TABLE IS 
   TABLE OF instance_record INDEX BY BINARY_INTEGER;

This procedure behaves as follows:

  • When no instance is available (or the parallel server is not in use), the list is empty.

  • The instance_count argument contains the number of active instances, or 0 if none are found.

  • The starting index of the instance_table is always 1 and the table is always densely filled. The only defined rows of the table, in other words, are 1 through instance_count .


Previous: 7.6 New DBMS_AQ and DBMS_AQADM Features Oracle PL/SQL Programming Guide to Oracle 8i Features Next: 8. Deploying Fine-Grained Access Control
7.6 New DBMS_AQ and DBMS_AQADM Features Book Index 8. Deploying Fine-Grained Access Control

The Oracle Library Navigation

Copyright (c) 2000 O'Reilly & Associates. All rights reserved.

Library Home Oracle PL/SQL Programming, 2nd. Ed. Guide to Oracle 8i Features Oracle Built-in Packages Advanced PL/SQL Programming with Packages Oracle Web Applications Oracle PL/SQL Language Pocket Reference Oracle PL/SQL Built-ins Pocket Reference