Oracle DBMS_LOGREP_UTIL
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 Internal support for log file replication.
AUTHID DEFINER
Data Types SYS.RE$NV_LIST
Dependencies SELECT name FROM dba_dependencies WHERE referenced_name = 'DBMS_LOGREP_UTIL'
UNION
SELECT referenced_name FROM dba_dependencies WHERE = 'DBMS_LOGREP_UTIL';

171 separate objects
Documented No
Exceptions
Error Code Reason
ORA-04052 error occurred when looking up remote object SYS.DBMS_UTILITY@<db_link_name>
First Available Not known
Security Model Owned by SYS with EXECUTE granted to SYSRAC.
Source {ORACLE_HOME}/rdbms/admin/prvthlut.plb
Subprograms
BIC GET_CONSTRAINT_NAME QUERY_DBA_APPLY
BIS GET_CURRENT_PDB_NAME QUERY_DBA_CAPTURE
BIT GET_LAST_ENQ_SCN QUERY_DBA_CAPTURE2
BITOR GET_LOCK QUERY_DBA_QUEUES
BOOLEAN_TO_VARCHAR2 GET_OBJECT_LOCK QUERY_DBA_XOUT_ATTACHED_SVR
BUMP_SCN GET_OBJECT_NAME QUERY_DIFF_APPLY_USER
CANONICALIZE GET_PDB_SHORT_NAME RAISE_CONFIG_ERROR
CANONICAL_CONCAT GET_PROC_USE_CONTEXT RAISE_SYSTEM_ERROR (9)
CANON_DBLINK GET_PROC_USE_CONTEXT_INT RAISE_SYSTEM_ERROR_3GL
CHECK_2LEVEL_PRIVILEGE GET_QUEUE_OID RAWS
CHECK_DBLINK GET_REAL_CHECKPOINT_SCNS RELEASE_LOCK
CHECK_PROCESS_PRIVILEGES GET_REQ_CKPT_SCN RELEASE_OBJECT_LOCK
CHECK_SOURCE_ROOT GET_RS_LOCKS RELEASE_RS_LOCKS
COMPATIBLE_VARCHAR_TO_INT GET_RULE_ACTION_CONTEXT RESET
CONVERT_INT_TO_EXT_LCR GET_STR_COMPAT SET_ALLOCATED_MEMORY
DB_VERSION GG_XSTREAM_QTABLE SET_CCA_MAX_PERCENTAGE
DDL_ANNOTATE IS_BUILT_IN_TYPE SET_PARAMETER
DROP_UNUSED_RULE_SETS IS_INVOKER_VALID_OGG_USER SET_STREAMS_AUTO_FILTER
DUMP_TRACE (2) IS_MAX_PRIV_USER SET_SUPP_LOGGING
ENQUOTE_LITERAL IS_PDB_ENABLED START_PROCESS
ENQUOTE_NAME IS_ROOT_PDB STOP_PROCESS
ENSURE_NONNULL IS_VALID_ROLE STREAMS_TRANSACTION_PURGE
ENSURE_STREAMS IS_VALID_SYSTEM_PRIV UNLOCK_PROCESS
FETCH_CAPTURE_USER LCR_CACHE_PURGE UPDATE_DBNAME_MAPPING
FETCH_DBA_XOUT_CAPTURE_USER LOCK_PROCESS WRAP_DQT
FORCE_XSTREAM MESSAGE_TRACKING_PURGE WRITE_ERROR
GENERIC_CANONICALIZE MESSAGE_TRACKING_RESIZE WRITE_TRACE (2)
GET_CHECKPOINT_SCNS PRE_11_2_DB WRITE_TRACE_APT
GET_CONSISTENT_SCN    
 
BITOR
Undocumented dbms_logrep_util.bitor(
flag  IN NUMBER,
value IN NUMBER)
RETURN NUMBER;
SELECT dbms_logrep_util.bitor(42, 1)
FROM dual;
 
BOOLEAN_TO_VARCHAR2
Returns "Y" for TRUE and "N" for FALSE dbms_logrep_util.boolean_to_varchar2(b IN BOOLEAN)
RETURN VARCHAR2;
BEGIN
  dbms_output.put_line(dbms_logrep_util.boolean_to_varchar2(TRUE));
  dbms_output.put_line(dbms_logrep_util.boolean_to_varchar2(FALSE));
END;
/
 
CANONICALIZE
Undocumented

Overload 1
dbms_logrep_util.canonicalize(
object_name IN  VACHAR2,
canon_name  OUT VARCHAR2,
is_dbname   IN  BOOLEAN);
DECLARE
 retVal VARCHAR2(30);
BEGIN
  dbms_logrep_util.canonicalize('TAB$', retVal, FALSE);
  dbms_output.put_line(retVal);
END;
/
Overload 2 dbms_logrep_util.canonicalize(
object_name IN VACHAR2,
is_dbname   IN BOOLEAN)
RETURN VARCHAR2;
DECLARE
 retVal VARCHAR2(30);
BEGIN
  retVal := dbms_logrep_util.canonicalize('TAB$', FALSE);
  dbms_output.put_line(retVal);
END;
/
 
CANONICAL_CONCAT
Returns the schema and object names concatenated with a period (.) separator and within double quotes dbms_logrep_util.canonical_concat(
canon_schema IN VARCHAR2,
canon_name   IN VARCHAR2)
RETURN VARCHAR2;
SELECT dbms_logrep_util.canonical_concat('UWCLASS', 'AIRPLANES')
FROM dual;


-- also see catprp.sql
 
CHECK_SOURCE_ROOT
Perhaps I am misunderstanding this proc but it seems not not care what I enter as source_root_name ... it returns it unchanged as well as the value TRUE dbms_logrep_util.canonical_concat(
source_db_name         IN     VARCHAR2,
source_root_name       IN OUT VARCHAR2,
include_root_condition    OUT BOOLEAN);
DECLARE
 srn VARCHAR2(60) := 'CDB$ROOT';
 irc BOOLEAN;
BEGIN
  dbms_logrep_util.check_source_root('PDBDEV', srn, irc);
  dbms_output.put_line(srn);
  IF irc THEN
    dbms_output.put_line('TRUE');
  ELSE
    dbms_output.put_line('FALSE');
  END IF;
END;
/
 
COMPATIBLE_VARCHAR_TO_INT
Undocumented dbms_logrep_util.compatible_varchar_to_int(compat_var IN VARCHAR2)
RETURN BINARY_INTEGER;
show parameter compatible

SELECT dbms_logrep_util.compatible_varchar_to_int('12.0.0.0.0')
FROM dual;
SELECT dbms_logrep_util.compatible_varchar_to_int('12.0.0.0.0')
*
ERROR at line 1:
ORA-00600: internal error code, arguments: [knllcmpat_var_2_ub4], [12.0.0.0.0], [], [], [], [], [], [], [], [], [], []
ORA-06512: at "SYS.DBMS_LOGREP_UTIL", line 1180
-- oracle has logged bug #6583759 - RC6: DBMS_LOGREP_UTIL.COMPATIBLE_VARCHAR_TO_INT ORA-600 [KNLLCMPAT_VAR_2_UB4]
 
DB_VERSION
Returns the database version from the database pointed to by a db link dbms_logrep_util.db_version(canon_dblink IN VARCHAR2)
RETURN BINARY_INTEGER;
SELECT dbms_logrep_util.db_version('TESTLINK')
FROM dual;
 
DDL_ANNOTATE
Undocumented dbms_logrep_util.ddl_annotate(
ddl_text   IN  VARCHAR2,
annotation OUT VARCHAR2);
DECLARE
 outVal VARCHAR2(256);
BEGIN
  dbms_logrep_util.ddl_annotate('CREATE TABLE t(testcol DATE)', outVal);
  dbms_output.put_line(outVal);
END;
/

[#annotation= 1, version=1, flags=SUC CMT_ANN ]
[aflags,pid,id,rid,fcid,lcid,node,pos,len,ident]
[DDL ,0,1,0,0,0,TAB,13,1,t]
 
ENQUOTE_LITERAL
Enquote a string literal. Add leading and trailing single quotes to a string literal dbms_logrep_util.enquote_literal(str IN VARCHAR2)
RETURN VARCHAR2;
set serveroutput on

DECLARE
 table_name user_tables.table_name%TYPE := 'SERVERS';
BEGIN
  dbms_output.put_line(table_name);
  table_name := dbms_logrep_util.enquote_literal(table_name);
  dbms_output.put_line(table_name);
END;
/
 
ENQUOTE_NAME
This function encloses a name in double quotes dbms_logrep_util.enquote_name(
str        IN VARCHAR2,
capitalize IN BOOLEAN DEFAULT TRUE)
RETURN VARCHAR2;
set serveroutput on

DECLARE
 table_name user_tables.table_name%TYPE := 'SERVERS';
BEGIN
dbms_output.put_line(table_name);
  table_name := dbms_logrep_util.enquote_name(table_name);
  dbms_output.put_line(table_name);
END;
/
 
ENSURE_NONNULL
Ensures a variable is not null by  raising an exception if it is dbms_logrep_util.enquote_name(
parameter_value  IN VARCHAR2,
parameter_name   IN VARCHAR2,
proc_use_context IN VARCHAR2);
DECLARE
 pval  VARCHAR2(10) := 'TEST_VALUE';
 pname VARCHAR2(10) := 'TEST_NAME';
BEGIN
  dbms_logrep_util.ensure_nonnull(pval, pname, NULL);
END;
/

DECLARE
 pval  VARCHAR2(10);
 pname VARCHAR2(10) := 'TEST_NAME';
BEGIN
  dbms_logrep_util.ensure_nonnull(pval, pname, NULL);
END;
/
begin
*
ERROR at line 1:
ORA-23605: invalid value "" for parameter TEST_NAME
ORA-06512: at "SYS.DBMS_LOGREP_UTIL", line 569
ORA-06512: at "SYS.DBMS_LOGREP_UTIL", line 623
ORA-06512: at "SYS.DBMS_LOGREP_UTIL", line 2773
ORA-06512: at line 2
 
ENSURE_STREAMS
Undocumented dbms_logrep_util.ensure_streams;
exec dbms_logrep_util.ensure_streams;
 
GET_CONSISTENT_SCN
Undocumented dbms_logrep_util.get_consistent_scn(consistent_scn OUT NUMBER)
RETURN BOOLEAN;
conn sys@pdbdev as sysdba

DECLARE
  retVal BOOLEAN;
BEGIN
  IF dbms_logrep_util.get_consistent_scn(retVal) THEN
    dbms_output.put_line('T: ' || TO_CHAR(retVal);
  ELSE
    dbms_output.put_line('F');
  END IF;
END;
/
 
GET_CURRENT_PDB_NAME
Returns the name of the current PDB dbms_logrep_util.get_current_pdb_name RETURN VARCHAR2;
conn sys@pdbdev as sysdba

SELECT dbms_logrep_util.get_current_pdb_name
FROM dual;
 
GET_LAST_ENQ_SCN
Undocumented dbms_logrep_util..get_last_enq_scn(capture_name IN VARCHAR2)
RETURN NUMBER;
See the source code in catcap.sql for the view _SXGG_DBA_CAPTURE
 
GET_OBJECT_NAME
Undocumented dbms_logrep_util.get_object_name(
object_name         IN  VARCHAR2,
canon_owner         OUT VARCHAR2,
canon_name          OUT VARCHAR2,
canon_default_owner IN  VARCHAR2);
conn sys@pdbdev as sysdba

DECLARE
k co VARCHAR2(30);
 cn VARCHAR2(30);
BEGIN
  dbms_logrep_util.get_object_name('SYS.DBMS_MVIEW', co, cn, 'SYS');
  dbms_output.put_line('Owner: ' || co);
  dbms_output.put_line('OName: ' || cn);
END;
/
 
GET_PDB_SHORT_NAME
Returns the database name stripped of domain information dbms_logrep_util.get_pdb_shortname(canon_dbname IN VARCHAR2)
RETURN VARCHAR2;
conn sys@pdbdev as sysdba

SELECT dbms_logrep_util.get_pdb_short_name('ORABASE.MLIB.COM')
FROM dual;
 
GET_REQ_CKPT_SCN
Undocumented dbms_logrep_util..get_req_ckpt_scn(
logmnr_sid  IN NUMBER,
applied_scn IN NUMBER)
RETURN NUMBER;
See the source code in catcap.sql for the view _SXGG_DBA_CAPTURE
 
GET_STR_COMPAT
Undocumented dbms_logrep_util..get_str_compat RETURN BINARY_INTEGER;
conn sys@pdbdev as sysdba

SELECT dbms_logrep_util.get_str_compat
FROM dual;


-- also see the source code in catstrc.sql for the view DBA_STREAMS_UNSUPPORTED
 
IS_BUILT_IN_TYPE
Undocumented dbms_logrep_util.is_built_in_type(type_name IN VARCHAR2) RETURN BOOLEAN;
conn sys@pdbdev as sysdba

BEGIN
  IF dbms_logrep_util.is_built_in_type('ADR_HOME_T') THEN
    dbms_output.put_line('Found');
  ELSE
    dbms_output.put_line('Not Found');
  END IF;
END;
/
 
IS_INVOKER_VALID_OGG_USER
Returns TRUE if the user is a valid GoldenGate user dbms_logrep_util.is_invoker_valid_ogg_user(canon_user_name IN VARCHAR2) RETURN BOOLEAN;
BEGIN
  IF dbms_logrep_util.is_invoker_valid_ogg_user(USER) THEN
    dbms_output.put_line('A Valid GG User');
  ELSE
    dbms_output.put_line('Not A Valid GG User');
  END IF;
END;
/
 
IS_PDB_ENABLED
Returns TRUE if a database is a Container database dbms_logrep_util.is_pdb_enabled RETURN BOOLEAN;
conn sys@pdbdev as sysdba

BEGIN
  IF dbms_logrep_util.is_pdb_enabled THEN
    dbms_output.put_line('Enabled');
  ELSE
    dbms_output.put_line('Not Enabled');
  END IF;
END;
/
 
IS_ROOT_PDB
Returns TRUE if the current container is CDB$ROOT dbms_logrep_util.is_root_pdb RETURN BOOLEAN;
conn sys@pdbdev as sysdba

BEGIN
  IF dbms_logrep_util.is_root_pdb THEN
    dbms_output.put_line('Root Container');
  ELSE
    dbms_output.put_line('Some Other Container');
  END IF;
END;
/
 
LCR_CACHE_PURGE
Undocumented dbms_logrep_util.lcr_cache_purge;
exec dbms_logrep_util.lcr_cache_purge;
 
MESSAGE_TRACKING_PURGE
Undocumented dbms_logrep_util.message_tracking_purge;
exec dbms_logrep_util.message_tracking_purge;
 
RESET (new 12.2)
Undocumented dbms_logrep_util.reset;
exec dbms_logrep_util.reset;
 
STREAMS_TRANSACTION_PURGE
Undocumented dbms_logrep_util.streams_transaction_purge;
exec dbms_logrep_util.streams_transaction_purge;

Related Topics
DBMS_LOGREP_DEFPROC_UTL
DBMS_LOGREP_EXP
DBMS_LOGREP_IMP
DBMS_LOGREP_IMP_INTERNAL
DBMS_LOGREP_UTIL_INVOK
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