Oracle DBMS_OBJECTS_APPS_UTILS
Version 12.2.0.1

General Information
Library Note Morgan's Library Page Header
The Library is currently in the process of being upgraded from Oracle Database Version 12.1.0.2 to 12.2.0.1. 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.

Also important ... there are rumors on the web about SPARC and Solaris being discontinued. Welcome to the age of fake news. There is absolutely not a byte of truth to these irresponsible rumors.
Purpose Utilities for working with user defined types.
AUTHID CURRENT_USER
Data Types CREATE OR REPLACE NONEDITIONABLE TYPE sys.dbms_objects_utils_tnamearr AS TABLE OF dbms_objects_utils_tname;
/

CREATE OR REPLACE NONEDITIONABLE TYPE sys.dbms_objects_utils_tsource AS
VARRAY(100) OF dbms_objects_utils_tselem;
/
Dependencies
COLTYPE$ DBMS_OUTPUT SUBCOLTYPE$
DBMS_OBJECTS_UTILS_TINFO DEPENDENCY$ TYPE$
DBMS_OBJECTS_UTILS_TNAME OBJ$ USER$
DBMS_OBJECTS_UTILS_TNAMEARR PLITBLM UTL_OBJECTS_LIB
DBMS_OBJECTS_UTILS_TSELEM SOURCE$ UTL_RECOMP
DBMS_OBJECTS_UTILS_TSOURCE    
Documented No
First Available 12.1.0.2
Security Model Owned by SYS with no privileges granted
Source {ORACLE_HOME}/rdbms/admin/dbmsobj.sql
Subprograms
 
OWNER_MIGRATE_UPDATE_HASHCODE
Invoked during type owner migration to update type hashcode dbms_objects_apps_utils.owner_migrate_update_hashcode(
toid IN RAW)
RETURN RAW;
TBD
 
OWNER_MIGRATE_UPDATE_TDO
Invoked during type owner migration to update object cache owner_migrate_update_tdo(
toid      IN RAW,
new_owner IN VARCHAR2);
TBD
 
RECOMPILE_TYPES
Takes an array (nested table) of type name and invalidate them with status 6. This status will keep the spec timestamp when recompiling, thus keeping the dependencies valid. This is used during upgrade/downgrade predominently and the only way to recompile a type with table dependents. Afterwards this will call utl_recomp.recomp_parallel to revalidate the invalidated types. dbms_objects_apps_utils.recompile_types(
names IN dbms_objects_utils_tnamearr);
conn / as sysdba

CREATE OR REPLACE NONEDITIONABLE TYPE t_app_util AS
TABLE OF dbms_objects_utils_tname;
/

DECLARE
 objarr dbms_objects_utils_tnamearr;
BEGIN
  objarr := dbms_objects_utils_tnamearr();
  objarr.extend(1);
  objarr(1) := dbms_objects_utils_tname('UWCLASS','T_APP_UTL');
  dbms_objects_apps_utils.recompile_types(objarr);
END;
/

SELECT status
FROM user_objects_ae
WHERE object_name = 'T_APP_UTIL';
 
SPLIT_SOURCE
Splits the source$ entry for the latest version of the type to its CREATE and ALTERs and will return it in sources, with with the corresponding obj#. The number or split sources will be the return value of the functions. dbms_objects_apps_utils.split_source(
tschema IN  CHAR,
tname   IN  CHAR,
sources OUT dbms_objects_utils_tsource)
RETURN NUMBER;
DECLARE
 n      NUMBER;
 retArr dbms_objects_utils_tsource;
BEGIN
  n := dbms_objects_apps_utils.split_source('SYS', 'T_APP_UTL', retArr);
  dbms_output.put_line(TO_CHAR(n));
  dbms_output.put_line(retArr.count);
  FOR i IN 1 .. retArr.count LOOP
    dbms_output.put_line(TO_CHAR(i) || ' : ' ||
                         TO_CHAR(retArr(i).objid) || ' : ' ||
                         retArr(i).source);
  END LOOP;
END;
/
 
UPDATE_TYPES
Takes in 2 schema names and for each type type present in both schemas will make any object column/table dependent on schema1.type1 point to schema2.type1. Can also be used for updating just one type in schema1. In which case give the typename as the 3rd parameter. If you give NULL for typename it will default to the above behaviour. dbms_objects_apps_utils.update_types(
schema1      IN VARCHAR2,
schema2      IN VARCHAR2,
typename     IN VARCHAR2,
check_update IN BOOLEAN);
exec dbms_objects_apps_utils.update_types('HRTEST', 'HRPROD', 'CUSTARRAY', TRUE);

Related Topics
DBMS_OBJECTS_UTILS
Packages
UTL_RECOMP
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