Oracle DBMS_ADR_INTERNAL
Version 21c

General Information
Library Note Morgan's Library Page Header
Which has the higher priority in your organization: Deploying a new database or securing the ones you already have? Looking for a website, and resources, dedicated solely to securing Oracle databases? Check out DBSecWorx.
Purpose Utility package supporting the Automatic Diagnostic Repository and related incident reporting.
AUTHID DEFINER
Dependencies
ADR_HOME_T ADR_LOG_MSG_ARGS_T DBMS_ADR
ADR_INCIDENT_CORR_KEYS_T ADR_LOG_MSG_ECID_T DBMS_ADRI_LIB
ADR_INCIDENT_ERR_ARGS_T ADR_LOG_MSG_ERRID_T DBMS_ADR_APP
ADR_INCIDENT_FILES_T ADR_LOG_MSG_SUPPL_ATTRS_T DBMS_STANDARD
ADR_INCIDENT_INFO_T ADR_LOG_MSG_T DBMS_UTILITY
ADR_INCIDENT_T ADR_MSG_TEMPLATE_T PLITBLM
Data Types CREATE OR REPLACE NONEDITIONABLE TYPE "SYS"."ADR_HOME_T" FORCE AS OBJECT (
product_type VARCHAR2(8),  /* product type */
product_id   VARCHAR2(30), /* product id */
instance_id  VARCHAR2(30), /* instance id */
precedence   INTEGER,      /* precedence level of this adr home */
adr_id       INTEGER,      /* hash value of the adr home */
-- **********************************************************************
-- Construct an ADR home object representing ADR home at a location
-- described by application specific naming
-- **********************************************************************
CONSTRUCTOR FUNCTION adr_home_t (
SELF         IN OUT NOCOPY adr_home_t,
product_type               VARCHAR2,
product_id                 VARCHAR2,
instance_id                VARCHAR2,
precedence                 INTEGER)
RETURN SELF AS RESULT);

CREATE OR REPLACE NONEDITIONABLE TYPE "SYS"."ADR_LOG_MSG_T" AS OBJECT (
-- Header attributes
timestamp_originating TIMESTAMP WITH TIME ZONE, /* time originating */
timestamp_normalized  TIMESTAMP WITH TIME ZONE, /* time normalized */
org_id                VARCHAR2(64),        /* organization id */
component_id          VARCHAR2(64),        /* component id */
instance_id           VARCHAR2(64),        /* instance id */
hosting_client_id     VARCHAR2(64),        /* hosting client id */
msg_id                VARCHAR2(64),        /* message id */
msg_type              INTEGER,             /* message type */
msg_group             VARCHAR2(64),        /* message group */
msg_level             INTEGER,             /* message level */
host_id               VARCHAR2(64),        /* host id */
host_nwaddr           VARCHAR2(46),        /* host address */
module_id             VARCHAR2(64),        /* module id */
process_id            VARCHAR2(32),        /* process id */
thread_id             VARCHAR2(64),        /* thread id */
user_id               VARCHAR2(128),       /* user id */
suppl_attrs           adr_log_msg_suppl_attrs_t, /* Supplemental attributes */
-- Correlation data fields
problem_key           VARCHAR2(64),        /* problem key */
upstream_comp_id      VARCHAR2(64),        /* upstream component id */
downstream_comp_id    VARCHAR2(64),        /* downstream component id */
ecid                  adr_log_msg_ecid_t,  /* execution context id */
error_instance_id     adr_log_msg_errid_t, /* error instance id */
-- Payload
msg_text              VARCHAR2(2048),      /* message text */
msg_args              adr_log_msg_args_t,  /* message arguments */
detail_location       VARCHAR2(160),       /* detailed location */
suppl_detail          VARCHAR2(128),       /* supplemental details */
-- CDB fields
con_uid               INTEGER,             /* container unique ID */
con_id                INTEGER,             /* container ID */
con_name              VARCHAR2(30));       /* container name */

TYPE log_msg ....
Documented No
First Available 12.1
Security Model Owned by SYS with no privileges granted
Source {ORACLE_HOME}/rdbms/admin/prvsadri.plb
Subprograms
 
CREATE_ADR_HOME
Undocumented dbms_adr_internal.create_adr_home(home IN OUT adr_home_t);
TBD
 
CREATE_INCIDENT
Create an incident dbms_adr_internal.create_incident(
problem_key             IN VARCHAR2,
error_facility          IN VARCHAR2,
error_number            IN NUMBER,
error_message           IN VARCHAR2,
error_args              IN adr_incident_err_args_t,
ecid                    IN VARCHAR2,
signalling_component    IN VARCHAR2,
signalling_subcomponent IN VARCHAR2,
suspect_component       IN VARCHAR2,
suspect_subcomponent    IN VARCHAR2,
correlation_keys        IN adr_incident_corr_keys_t,
files                   IN adr_incident_files_t,
current_home            IN adr_home_t)
RETURN adr_incident_t;
TBD
 
GET_LOCATION
Retrieve an ADR directory disk location dbms_adr_internal.get_location(
home        IN OUT adr_home_t,
adr_service IN     VARCHAR2)
RETURN VARCHAR2;
TBD
 
INCIDENT_ADD_METADATA
Add metadata to an existing incident dbms_adr_internal.incident_add_metadata(incident IN OUT adr_incident_t);
TBD
 
INCIDENT_CREATE
Undocumented dbms_adr_internal.incident_create(
incident IN OUT adr_incident_t,
data     IN     VARCHAR2);
TBD
 
RESERVE_INCIDS
Undocumented dbms_adr_internal.reserve_incids(
home     IN OUT adr_home_t,
id_count IN     POSITIVE)
RETURN NUMBER;
TBD
 
RUN_PURGE
Undocumented dbms_adr_internal.run_purge(
home      IN sys.adr_home_t,
threshold IN NUMBER);
TBD;
 
TEST_RESERVE_INCIDS
Undocumented dbms_adr_internal.test_reserve_incids;
exec dbms_adr_internal.test_reserve_incids;
BEGIN dbms_adr_internal.test_reserve_incids; END;
*
ERROR at line 1:
ORA-21560: argument ORA-21560: argument 2 is null, invalid, or out of range
is null, invalid, or out of range
ORA-06512: at "SYS.DBMS_ADR_INTERNAL", line 633
ORA-06512: at "SYS.DBMS_ADR_INTERNAL", line 121
ORA-06512: at "SYS.DBMS_ADR_INTERNAL", line 630
ORA-06512: at line 1
 
SET_TRACEFILE_IDENTIFIER
An API for performing the action ALTER SESSION SET TRACEFILE_IDENTIFIER = '<identifier_string>'; dbms_adr_internal.set_tracefile_identifier(
home           IN OUT sys.adr_home_t,
trc_identifier IN     VARCHAR2);
DECLARE
 adrHome sys.adr_home_t;
BEGIN
  dbms_adr_internal.set_tracefile_identifier(adrHome, 'TEST10046');
  dbms_output.put_line(adrHome.product_type);
END;
/

PL/SQL procedure successfully completed.
 
WRITE_LOG
Write a string to the current ADR log file dbms_adr_internal.write_log(
home    IN OUT adr_home_t,
log_msg IN     adr_log_msg_t);
TBD
 
WRITE_LOG_HANDLER
Undocumented dbms_adr_internal.write_log_handler(
msg_id                IN     VARCHAR2,
msg_type              IN     NUMBER,
msg_level             IN     NUMBER,
msg_text              IN     VARCHAR2,
timestamp_originating IN     TIMESTAMP WITH TIME ZONE,
timestamp_normalized  IN     TIMESTAMP WITH TIME ZONE,
org_id                IN     VARCHAR2,
component_id          IN     VARCHAR2,
instance_id           IN     VARCHAR2,
hosting_client_id     IN     VARCHAR2,
msg_group             IN     VARCHAR2,
host_id               IN     VARCHAR2,
host_nwaddr           IN     VARCHAR2,
module_id             IN     VARCHAR2,
process_id            IN     VARCHAR2,
thread_id             IN     VARCHAR2,
user_id               IN     VARCHAR2,
suppl_attrs           IN     adr_log_msg_suppl_attrs_t,
problem_key           IN     VARCHAR2,
upstream_comp_id      IN     VARCHAR2,
downstream_comp_id    IN     VARCHAR2,
ecid                  IN     adr_log_msg_ecid_t,
error_instance_id     IN     adr_log_msg_errid_t,
msg_args              IN     adr_log_msg_args_t,
detail_location       IN     VARCHAR2,
suppl_detail          IN     VARCHAR2,
msg_template_obj      IN     adr_msg_template_t,
con_uid               IN     NUMBER              DEFAULT NULL,
con_id                IN     NUMBER              DEFAULT NULL,
con_name              IN     NUMBER              DEFAULT NULL,
current_home          IN OUT adr_home_t);
TBD
 
WRITE_TRACE
Write trace lines to the trace file in the RDBMS ADR home dbms_adr_internal.write_trace(
home       IN sys.adr_home_t,
trace_data IN VARCHAR2);
DECLARE
 adrHome sys.adr_home_t;
BEGIN
  dbms_adr_internal.write_trace(adrHome, 'Testing the new database version 20c');
END;
/

PL/SQL procedure successfully completed.

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

Related Topics
ADRCI
Built-in Functions
Built-in Packages
DBMS_ADR
DBMS_ADR_APP
DBMS_IR
What's New In 19c
What's New In 20c-21c

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-2019 Daniel A. Morgan All Rights Reserved
  DBSecWorx