Oracle DBMS_OBJECTS_APPS_UTILS
Version 21c

General Information
Library Note Morgan's Library Page Header
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 Utilities for working with user defined types.
AUTHID DEFINER
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 DBMS_STANDARD TYPE$
DBMS_OBJECTS_UTILS_TNAME DEPENDENCY$ USER$
DBMS_OBJECTS_UTILS_TNAMEARR OBJ$ UTL_OBJECTS_LIB
DBMS_OBJECTS_UTILS_TSELEM PLITBLM UTL_RECOMP
DBMS_OBJECTS_UTILS_TSOURCE SOURCE$  
Documented No
First Available 12.1
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
Built-in Functions
Built-in Packages
DBMS_OBJECTS_UTILS
UTL_RECOMP
What's New In 21c
What's New In 23c

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