Oracle DBMS_ADR_APP
Version 12.2.0.1

General Information
Library Note Morgan's Library Page Header
"I spent my entire adult life looking out for the well-being, the training, the equipping of the troops for whom I was responsible. I will not be lectured about what our military needs by a five-deferment draft dodger,"
~ Sen. Tammy Duckworth
Purpose Undocumented: The PL/SQL diagnosability API declared in this package is intended for use by internal non-RDBMS PL/SQL applications only.
AUTHID DEFINER
Constants
Name Data Type Value
NOERROR INTEGER 0
log_msg_type_unknown INTEGER 1
log_msg_type_incident INTEGER 2
log_msg_type_error INTEGER 3
log_msg_type_error INTEGER 4
log_msg_type_notification INTEGER 5
log_msg_type_trace INTEGER 6
Data Types call_status NUMBER;

call_err_msg VARCHAR2(1024);
Dependencies
ADR_HOME_T ADR_INCIDENT_T ADR_LOG_MSG_SUPPL_ATTRS_T
ADR_INCIDENT_CORR_KEYS_T ADR_LOG_MSG_ARGS_T ADR_MSG_TEMPLATE_T
ADR_INCIDENT_ERR_ARGS_T ADR_LOG_MSG_ECID_T DBMS_ADR_INTERNAL
ADR_INCIDENT_FILES_T ADR_LOG_MSG_ERRID_T  
Documented No
First Available 12.1.0
Security Model Owned by SYS with EXECUTE granted to the DBA role
Source {ORACLE_HOME}/rdbms/admin/dbmsadra.sql
Subprograms
 
CREATE_INCIDENT
Creates an incident in the current ADR Home dbms_adr_app.create_incident(
problem_key             IN VARCHAR2,                              /* incident problem key
error_facility          IN VARCHAR2 DEFAULT NULL,                 /* error facility
error_number            IN INTEGER DEFAULT NULL,                  /* error number
error_message           IN VARCHAR2 DEFAULT NULL,                 /* error message
error_args              IN adr_incident_err_args_t DEFAULT NULL,  /* error arguments
ecid                    IN VARCHAR2 DEFAULT NULL,                 /* execution context id
signalling_component    IN VARCHAR2 DEFAULT NULL,                 /* signalling component
signalling_subcomponent IN VARCHAR2 DEFAULT NULL,                 /* signalling subcomp.
suspect_component       IN VARCHAR2 DEFAULT NULL,                 /* suspect component
suspect_subcomponent    IN VARCHAR2 DEFAULT NULL,                 /* suspect subcomp.
correlation_keys        IN adr_incident_corr_keys_t DEFAULT NULL, /* correlation keys
files                   IN adr_incident_files_t DEFAULT NULL)     /* addnl incident files
RETURN adr_incident_t;
TBD
 
GET_CURRENT_PRECEDENCE
Returns the current precedence level set for current ADR Home dbms_adr_app.get_current_precedence RETURN INTEGER;
See GET_CURRENT_PRECEDENCE Demo Below
 
GET_LOG_LOCATION
Returns the complete path of the log directory in the ADR home dbms_adr_app.get_log_location RETURN VARCHAR2;
SELECT dbms_adr_app.get_log_location
FROM dual;
 
GET_TRACE_LOCATION
Returns the complete path of the trace directory in the ADR home dbms_adr_app.get_trace_location RETURN VARCHAR2;
SELECT dbms_adr_app.get_trace_location
FROM dual;
 
RUN_PURGE (new 12.2)
??? dbms_adr_app.run_purge(threshold IN NUMBER);
exec dbms_adr.run_purge(1);
 
SET_ADR_HOME
Creates a new adr home, including directory creation if they do not exist, that will be current ADR home for all subsequent calls to DBMS_ADR_APP.

Note that this does not allow you to define the location.
dbms_adr_app.set_adr_home(
product_type IN VARCHAR2 DEFAULT NULL,
product_id   IN VARCHAR2 DEFAULT NULL,
instance_id  IN VARCHAR2 DEFAULT NULL,
create_dir   IN BOOLEAN DEFAULT FALSE,
precedence   IN INTEGER DEFAULT 0);
TBD
 
SET_CURRENT_PRECEDENCE
Sets the current precedence level for the current ADR Home dbms_adr_app.set_current_precedence(precedence IN INTEGER);
SELECT dbms_adr_app.get_current_precedence
FROM dual;

exec dbms_adr_app.set_current_precedence(2);

SELECT dbms_adr_app.get_current_precedence
FROM dual;

exec dbms_adr_app.set_current_precedence(0);

SELECT dbms_adr_app.get_current_precedence
FROM dual;
 
SET_EXCEPTION_MODE
Sets the exception mode for the package. If TRUE all exceptions will be raised to the client. If FALSE they will be suppressed dbms_adr_app.set_exception_mode(exc_mode IN BOOLEAN DEFAULT FALSE);
exec dbms_adr_app.set_exception_mode(TRUE);
 
SET_LOG_MSG_TEMPLATE (new 12.2 parameters)
Creates a log message template object which can be used in the write_log API call dbms_adr_app.set_log_msg_template(
org_id             IN VARCHAR2 DEFAULT NULL,
component_id       IN VARCHAR2 DEFAULT NULL,
instance_id        IN VARCHAR2 DEFAULT NULL,
hosting_client_id  IN VARCHAR2 DEFAULT NULL,
msg_group          IN VARCHAR2 DEFAULT NULL,
host_id            IN VARCHAR2 DEFAULT NULL,
host_nwaddr        IN VARCHAR2 DEFAULT NULL,
module_id          IN VARCHAR2 DEFAULT NULL,
process_id         IN VARCHAR2 DEFAULT NULL,
thread_id          IN VARCHAR2 DEFAULT NULL,
user_id            IN VARCHAR2 DEFAULT NULL,
upstream_comp_id   IN VARCHAR2 DEFAULT NULL,
downstream_comp_id IN VARCHAR2 DEFAULT NULL,
ecid               IN adr_log_msg_ecid_t  DEFAULT NULL,
error_instance_id  IN adr_log_msg_errid_t DEFAULT NULL,
msg_args           IN adr_log_msg_args_t  DEFAULT NULL,
detail_location    IN VARCHAR2 DEFAULT NULL,
suppl_detail       IN VARCHAR2 DEFAULT NULL,
con_uid            IN NUMBER   DEFAULT NULL,
con_id             IN NUMBER   DEFAULT NULL,
con_name           IN VARCHAR2 DEFAULT NULL)
RETURN adr_msg_template_t;
TBD
 
SET_TRACEFILE_IDENTIFIER (new 12.2)
An API for performing the action ALTER SESSION SET TRACEFILE_IDENTIFIER = '<identifier_string>'; dbms_adr_app.set_tracefile_identifier(trc_identifier IN VARCHAR2);
exec dbms_adr_app.set_tracefile_identifier('test_plan1');
 
WRITE_LOG
used to write log entries in the ODL format to the alert log in the current ADR home dbms_adr_app.write_log(
  -- Mandatory ODL fields without defaults
msg_id                IN VARCHAR2,                               /* message id
msg_type              IN INTEGER,                                /* message type
msg_level             IN INTEGER,                                /* message level
msg_text              IN VARCHAR2,                               /* message text
-- Optional ODL fields and mandatory ones with defaults
timestamp_originating IN TIMESTAMP WITH TIME ZONE DEFAULT NULL,  /* time originating
timestamp_normalized  IN TIMESTAMP WITH TIME ZONE DEFAULT NULL,  /* time normalized
org_id                IN VARCHAR2 DEFAULT NULL,                  /* organization id
component_id          IN VARCHAR2 DEFAULT NULL,                  /* component id
instance_id           IN VARCHAR2 DEFAULT NULL,                  /* instance id
hosting_client_id     IN VARCHAR2 DEFAULT NULL,                  /* hosting client id
msg_group             IN VARCHAR2 DEFAULT NULL,                  /* message group
host_id               IN VARCHAR2 DEFAULT NULL,                  /* host id
host_nwaddr           IN VARCHAR2 DEFAULT NULL,                  /* host address
module_id             IN VARCHAR2 DEFAULT NULL,                  /* module id
process_id            IN VARCHAR2 DEFAULT NULL,                  /* process id
thread_id             IN VARCHAR2 DEFAULT NULL,                  /* thread id
user_id               IN VARCHAR2 DEFAULT NULL,                  /* user id
suppl_attrs           IN adr_log_msg_suppl_attrs_t DEFAULT NULL, /* supplemental attributes
problem_key           IN VARCHAR2 DEFAULT NULL,                  /* problem key
upstream_comp_id      IN VARCHAR2 DEFAULT NULL,                  /* upstream comp. id
downstream_comp_id    IN VARCHAR2 DEFAULT NULL,                  /* downstream comp. id
ecid                  IN adr_log_msg_ecid_t DEFAULT NULL,        /* execution context id
error_instance_id     IN adr_log_msg_errid_t DEFAULT NULL,       /* error instance id
msg_args              IN adr_log_msg_args_t  DEFAULT NULL,       /* message arguments
detail_location       IN VARCHAR2 DEFAULT NULL,                  /* detailed location
suppl_detail          IN VARCHAR2 DEFAULT NULL,                  /* supplemental detail
msg_template_obj      IN adr_msg_template_t DEFAULT NULL         /* message template object
con_uid               IN NUMBER             DEFAULT NULL,
con_id                IN NUMBER             DEFAULT NULL,
con_name              IN VARCHAR2           DEFAULT NULL);
TBD
 
WRITE_TRACE
Write trace lines to the trace file in the current ADR home dbms_adr_app.write_trace(trace_data IN VARCHAR2);
exec dbms_adr_app.write_trace('Testing the new database version 12cR2');

-- open the most recent .trc files in the directory returned by the GET_TRACE_LOCATION function.

Related Topics
ADRCI
DBMS_ADR
DBMS_ADR_INTERNAL
DBMS_IR
Packages
What's New In 12cR1
What's New In 12cR2

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2017 Daniel A. Morgan All Rights Reserved