ACE Director Alum Daniel Morgan, founder of Morgan's Library, is scheduling
complimentary technical Workshops on Database Security for the first 30
Oracle Database customers located anywhere in North America, EMEA, LATAM, or
APAC that send an email to
asra_us@oracle.com. Request a Workshop for
your organization today.
Purpose
The source code for the package specification and body are listed below but the origin of how it got into the 21.3 database, and what it is intended to accomplish, is still a mystery.
That said, it doesn't look like especially robust well written code, unlike 'REDO_DIFF' and we expect will not be a permanent inhabitant of our domain.
AUTHID
DEFINER
Dependencies
DBMS_SESSION
TKHCS_LOG_CURRSESS_VIEW
Documented
No
First Available
21c
Security Model
Owned by SYS with no privileges granted
Source: Formatted for clarity
Oracle ... please note ... you are still naming parameters with reserved words that are called out by your very own PL/SQL warnings. Please stop it!
cd $ORACLE_HOME
grep -ir "TKHCS_LOG_PKG"
did not identify a single file that contained this string.
CREATE OR REPLACE NONEDITIONABLE PACKAGE "SYS"."TKHCS_LOG_PKG"
IS
PROCEDURE init;
PROCEDURE set_call(
c1 IN VARCHAR2 DEFAULT NULL,
c2 IN VARCHAR2 DEFAULT NULL,
c3 IN VARCHAR2 DEFAULT NULL,
c4 IN VARCHAR2 DEFAULT NULL,
c5 IN VARCHAR2 DEFAULT NULL,
c6 IN VARCHAR2 DEFAULT NULL,
c7 IN VARCHAR2 DEFAULT NULL,
c8 IN VARCHAR2 DEFAULT NULL);
PROCEDURE include_allocs(inc IN NUMBER);
PROCEDURE start_new_log;
PROCEDURE set_sessionid(id IN NUMBER);
END;
/
CREATE OR REPLACE NONEDITIONABLE PACKAGE BODY "SYS"."TKHCS_LOG_PKG" IS
--=====================================================================
PROCEDURE init IS
BEGIN
set_call();
include_allocs(1);
END;
--=====================================================================
PROCEDURE set_call(
c1 IN VARCHAR2 DEFAULT NULL,
c2 IN VARCHAR2 DEFAULT NULL,
c3 IN VARCHAR2 DEFAULT NULL,
c4 IN VARCHAR2 DEFAULT NULL,
c5 IN VARCHAR2 DEFAULT NULL,
c6 IN VARCHAR2 DEFAULT NULL,
c7 IN VARCHAR2 DEFAULT NULL,
c8 IN VARCHAR2 DEFAULT NULL) IS
BEGIN
dbms_session.set_context('TKHCS_LOG_CTX_SYS', 'call1', c1);
dbms_session.set_context('TKHCS_LOG_CTX_SYS', 'call2', c2);
dbms_session.set_context('TKHCS_LOG_CTX_SYS', 'call3', c3);
dbms_session.set_context('TKHCS_LOG_CTX_SYS', 'call4', c4);
dbms_session.set_context('TKHCS_LOG_CTX_SYS', 'call5', c5);
dbms_session.set_context('TKHCS_LOG_CTX_SYS', 'call6', c6);
dbms_session.set_context('TKHCS_LOG_CTX_SYS', 'call7', c7);
dbms_session.set_context('TKHCS_LOG_CTX_SYS', 'call8', c8);
END;
--=====================================================================
PROCEDURE include_allocs(inc IN NUMBER) IS
BEGIN
dbms_session.set_context('TKHCS_LOG_CTX_SYS', 'allocs', TO_CHAR(inc));
END;
--=====================================================================
PROCEDURE start_new_log IS
max_order_num NUMBER;
BEGIN
-- Find the max order_num from tkhcs_log_currsess_view
SELECT MAX(order_num)
INTO max_order_num
FROM tkhcs_log_currsess_view;
-- If max_order_num is null it means that either there are no log
-- entries for this session, or that there are no log entries for the
-- session since the last call to this function. In either case, we
-- want to keep the value that is there, so only set the context value when not null.
IF max_order_num IS NOT NULL THEN
-- Call set_context to set the max order number
dbms_session.set_context('TKHCS_LOG_CTX_SYS','start_order_num', max_order_num);
END IF;
END;
--=====================================================================
PROCEDURE set_sessionid(id IN NUMBER) IS
BEGIN
dbms_session.set_context('TKHCS_LOG_CTX_SYS', 'sessionid', id);
END;
END;
/