Oracle DBMS_REPUTIL
Version 12.1.0.1

General Information
Library Note Morgan's Library Page Footer
The Library is currently in the process of being upgraded from Oracle Database Version 12.1.0.1 to 12.1.0.2. Demos are being upgraded to reflect the new Container paradigm as well as EBR (Edition Based Redefinition) and may contain references to CDBs, PDBs, and other objects you may not be familiar with such as CDB_OBJECTS_AE: Welcome to 12c.

Interested in Oracle GoldenGate? Check out the IGGOUG,
Note Contains subprograms to generate shadow tables, triggers, and packages for table replication, as well as subprograms to generate wrappers for replication of standalone procedure invocations and packaged procedure invocations. This package is referenced only by the generated code.

This package has been previously reported as deprecated but contains some interesting functionality ... shown below. No attempt has been made on this page to document all of the contents of this package. Just pieces that look particular interesting.
AUTHID DEFINER
Dependencies
ALL_REPCOLUMN DBMS_RECTIFIER_DIFF DUAL
ALL_REPGENOBJECTS DBMS_REPCAT_CACHE GENERATOR$_S
DBMS_DEFER DBMS_REPCAT_DECL REPCAT$_CONFLICT
DBMS_DEFERGEN DBMS_REPCAT_INTERNAL REPCAT$_RESOLUTION_STATISTICS
DBMS_DEFERGEN_UTIL DBMS_REPCAT_MIG_INTERNAL REPCAT$_RESOL_STATS_CONTROL
DBMS_DEFER_SYS DBMS_REPCAT_UTL REPCAT_GENERATED
DBMS_IJOB DBMS_STANDARD SNAP$
DBMS_INTERNAL_TRIGGER DBMS_SYS_ERROR  
Documented Yes
First Available 7.3.4
Security Model Owned by SYS with EXECUTE granted to PUBLIC
Source {ORACLE_HOME}/rdbms/admin/dbmsgen.sql
Subprograms
ADDITIVE FROM_REMOTE RECURSION_OFF
APPEND_SEQUENCE GET_CONSTRAINT_NAME RECURSION_ON
APPEND_SEQUENCE_NC GLOBAL_NAME REPLICATION_IS_ON
APPEND_SITE_NAME IMPORT_REP_TRIGGER_STRING REPLICATION_OFF
APPEND_SITE_NAME_NC MAKE_INTERNAL_PKG REPLICATION_ON
AVERAGE MAXIMUM REP_BEGIN
CANONICALIZE MINIMUM REP_END
DISCARD OVERWRITE SET_GLOBAL_NAME
ENSURE_NORMAL_STATUS RAW_TO_VARCHAR2 SYNC_UP_REP
ENTER_STATISTICS    
 
CANONICALIZE
Canonicalize the string passed in as parameter name, determine the
longest prefix that fits in canon_len bytes, and return the result in canon_name
dbms_reputil.canonicalize(
name       IN  VARCHAR2,
canon_name OUT VARCHAR2,
canon_len  IN  NUMBER);
DECLARE
 outVal dba_objects.object_name%TYPE;
BEGIN
  dbms_reputil.canonicalize('TESTING1234567890', outVal, 10);
  dbms_output.put_line(outVal);
END;
/
 
GET_CONSTRAINT_NAME
Extracts a constraint name from an error message dbms_reputil.get_constraint_name(errmsg IN VARCHAR2) RETURN VARCHAR2;
INSERT INTO servers (srvr_id) VALUES (1);

SELECT dbms_reputil.get_constraint_name('ORA-00001: unique constraint (UWCLASS.PK_SERVERS) violated')
FROM dual;
 
GLOBAL_NAME
Returns the database global name dbms_reputil.global_name RETURN VARCHAR2;
SELECT dbms_reputil.global_name
FROM dual;
 
RAW_TO_VARCHAR2
Returns RAW from a source VARCHAR2 dbms_reputil.raw_to_varchar2(
r      IN  RAW,
offset IN  BINARY_INTEGER,
v      OUT VARCHAR2);
set serveroutput on

DECLARE
 outval VARCHAR2(20);
BEGIN
  dbms_reputil.raw_to_varchar2('0011', 1, outval);
  dbms_output.put_line(outval);
END;
/
 
SET_GLOBAL_NAME
An internal packages, Oracle doesn't want to call PL/SQL to set from_remote, hence, convert from_remote to a function clients are not supposed to assign values to this variable. If they do, use set_from_remote(flag) instead. Running this demo is dangerous. It is here for education purposes only. dbms_reputil.set_global_name(gdbname IN VARCHAR2);
exec dbms_reputil.set_global_name('TEST');

Related Topics
DBMS_UTILITY
Packages

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