CODE
Oracle Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
PSOUG Home Code Snippets Oracle Reference Oracle Functions PSOUG Forum Oracle Blogs Bookmark and Share
 
 Search the Reference Library pages:  

Free
Oracle Magazine
Subscriptions
and Oracle White Papers

Oracle DBMS_HA_ALERTS

Version 11.1
 
General Information
Note: This package is an API for Fast Application Notification (FAN) events which are part of RAC, CMAN, Net Services Listeners

What is posted here is for informational purposes only and we actively encourage you NOT to use it in any manner as it may do damage, it may violate your license with Oracle, and we thought it a great idea to tell you not to do it for the benefit of all concerned.
Source {ORACLE_HOME}/rdbms/admin/dbmshae.sql
First Available 10g

Defined Data Types
CREATE OR REPLACE TYPE "SYS"."ALERT_TYPE" AS OBJECT (
timestamp_originating   TIMESTAMP WITH TIME ZONE,
organization_id         VARCHAR2(10),
component_id            VARCHAR2(3),
message_id              NUMBER,
hosting_client_id       VARCHAR2(64),
message_type            VARCHAR2(12),
message_group           VARCHAR2(30),
message_level           NUMBER,
host_id                 VARCHAR2(256),
host_nw_addr            VARCHAR2(256),
module_id               VARCHAR2(50),
process_id              VARCHAR2(128),
user_id                 VARCHAR2(30),
upstream_component_id   VARCHAR2(30),
downstream_component_id VARCHAR2(4),
execution_context_id    VARCHAR2(128),
error_instance_id       VARCHAR2(142),
reason_argument_count   NUMBER,
reason_argument_1       VARCHAR2(513),
reason_argument_2       VARCHAR2(513),
reason_argument_3       VARCHAR2(513),
reason_argument_4       VARCHAR2(513),
reason_argument_5       VARCHAR2(513),
sequence_id             NUMBER,
reason_id               NUMBER,
object_owner            VARCHAR2(30),
object_name             VARCHAR2(513),
subobject_name          VARCHAR2(30),
object_type             VARCHAR2(30),
instance_name           VARCHAR2(16),
instance_number         NUMBER,
scope                   VARCHAR2(10),
advisor_name            VARCHAR2(30),
metric_value            NUMBER,
suggested_action_msg_id NUMBER,
action_argument_count   NUMBER,
action_argument_1       VARCHAR2(30),
action_argument_2       VARCHAR2(30),
action_argument_3       VARCHAR2(30),
action_argument_4       VARCHAR2(30),
action_argument_5       VARCHAR2(30));
/
Dependencies
ALERT_TYPE DBMS_HA_ALERT_LIB HAEN_TXFM_TEXT
Security Model No privileges granted by SYS

This code does not work ... but is held pending more information because ... at least ... it does not produce an error.

A very small victory indeed.
DECLARE
 x alert_type := alert_type(NULL, NULL, NULL, NULL, NULL, NULL,
   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
   NULL, NULL, NULL, NULL, NULL);

 v VARCHAR2(4000);
BEGIN
  x.timestamp_originating := SYSTIMESTAMP;
  x.message_level := 1;
  x.instance_name := 'ukoug';
  x.instance_number := 1;
  x.advisor_name := 'Default Advisor';

  v := dbms_ha_alerts.get_host(x);
  dbms_output.put_line('-' || v || '-');
  dbms_output.put_line(x.upstream_component_id);
END;
/
 
GET_CARDINALITY
The number of service members that are currently active; included in all UP events. Used by: Service member up. dbms_ha_alerts.get_cardinality(alert IN ALERT_TYPE)
RETURN BINARY_INTEGER;
TBD
 
GET_DB_DOMAIN
Used by: All events except node down. Default if unspecified at submission: domain of current database. dbms_ha_alerts.get_db_domain(alert IN ALERT_TYPE) RETURN VARCHAR2;
TBD
 
GET_DB_UNIQUE_NAME
The unique database supporting the service; matches the initialization parameter value for DB_UNIQUE_NAME, which defaults to the value of the initialization parameter DB_NAME. Used by: All events except node down. Default if unspecified at submission: db_unique_name of current database. dbms_ha_alerts.get_db_unique_name(alert IN ALERT_TYPE)
RETURN VARCHAR2;
TBD
 
GET_EVENT_TIME
Undocumented dbms_ha_alerts.get_event_time(alert IN ALERT_TYPE)
RETURN TIMESTAMP WITH TIME ZONE;
TBD
 
GET_HOST
Used by: Node down, and instance, service member, service preconnect, and ASM instance up/down events dbms_ha_alerts.get_host(alert IN ALERT_TYPE) RETURN VARCHAR2;
TBD
 
GET_INCARNATION
For node DOWN events; the new cluster incarnation. Used by: node down dbms_ha_alerts.get_incarnation(alert IN ALERT_TYPE) RETURN VARCHAR2;
TBD
 
GET_INSTANCE
The name of the instance that supports the service; matches the ORACLE_SID value. Used by: Instance, service member, service preconnect, and ASM instance up/down events dbms_ha_alerts.get_instance(alert IN ALERT_TYPE) RETURN VARCHAR2;
TBD
 
GET_REASON
Failure, Dependency, User, Autostart, Restart dbms_ha_alerts.get_reason(alert IN ALERT_TYPE) RETURN VARCHAR2;
TBD
 
GET_SERVICE
The service name; matches the service in DBA_SERVICES. Used by: Service, service member, and service preconnect up/down events dbms_ha_alerts.get_service(alert IN ALERT_TYPE) RETURN VARCHAR2;
TBD
 
GET_SEVERITY (new in 11g?)
The severity of the HA alert dbms_ha_alerts.get_severity(alert IN ALERT_TYPE)
RETURN BINARY_INTEGER;
TBD
 
GET_VERSION
Undocumented dbms_ha_alerts.get_version(alert IN ALERT_TYPE) RETURN VARCHAR2;
TBD
 
Related Topics
DBMS_SERVER_ALERT
RAC
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us [167 users online]    © 2010 psoug.org