Oracle DBMS_EXPORT_EXTENSION
Version 19.3

General Information
Library Note Morgan's Library Page Header
Which has the higher priority in your organization: Deploying a new database or securing the ones you already have? Looking for a website, and resources, dedicated solely to securing Oracle databases? Check out DBSecWorx.
Purpose PL/SQL package containing functions called by export to dynamically link in PL/SQL logic in the export process.
AUTHID CURRENT_USER
Constants
Name Data Type Value
 Function codes for the expact$ table
func_pre_table (execute before loading table) NUMBER 1
func_post_tables (execute after loading all tables) NUMBER 2
func_pre_row (execute before loading row) NUMBER 3
func_post_row (execute after loading row) NUMBER 4
func_row (execute in lieu of loading row) NUMBER 5
Dependencies
DBMS_ASSERT DBMS_SQL  
DBMS_EXPORT_EXTENSION_I DBMS_SYS_SQL EXTIDX_IMP_LIB
DBMS_I_INDEX_UTL DBMS_UTILITY ODCI_SECOBJ$
DBMS_METADATA_UTIL EXPACT$  
Documented No
Exceptions
Error Code Reason
unExecutedActions A function was not called with the same parameters until it returned NULL indicating an internal error in EXPORT.
First Available Not Known
Security Model Owned by SYS with EXECUTE granted to PUBLIC
Source {ORACLE_HOME}/rdbms/admin/dbmspexp.sql
Subprograms
 
BEGIN_IMPORT_DOMAIN_INDEX
Truncates the table odci_secobj$, and set up index schema and name dbms_export_extension.begin_import_domain_index(
idxschema IN VARCHAR2,
idxname   IN VARCHAR2);
exec dbms_export_extension.begin_import_domain_index(USER, 'UW_TEST_DOMIDX');
 
CHECK_MATCH_TEMPLATE
Checks to see if a partition has made use of a template partition clause dbms_export_extension.check_match_template(pobjno IN INTEGER)
RETURN INTEGER;
TBD
 
FUNC_INDEX_DEFAULT
Returns default$ from col$ for a function-base index and converts it to VARCHAR2 from LONG dbms_export_extension.func_index_default(
tabobj  IN NUMBER,
colname IN VARCHAR2)
RETURN CLOB;
SELECT object_name, object_id, col#, name
FROM dba_objects o, col$ c
WHERE  o.object_id = c.obj#
AND o.object_type = 'TABLE'
AND c.default$ IS NOT NULL
AND rownum < 11;

OBJECT_NAME            OBJECT_ID       COL# NAME
--------------------- ---------- ---------- ----------------
USER$                         22         16 ASTATUS
USER$                         22         17 LCOUNT
HISTGRM$                      66          8 EP_REPEAT_COUNT
NTAB$                        117          5 NAME
CDB_LOCAL_ADMINAUTH$         150          3 PRIVILEGES
CDB_LOCAL_ADMINAUTH$         150          5 FLAGS
CDB_LOCAL_ADMINAUTH$         150          8 LCOUNT
CDB_LOCAL_ADMINAUTH$         150          9 ASTATUS
CDB_LOCAL_ADMINAUTH$         150         15 FED_PRIVILEGES
SQLERROR$                    161          5 SPARE1

SELECT dbms_export_extension.func_index_default(117, 'NAME')
FROM dual;

DBMS_EXPORT_EXTENSION.FUNC_INDEX_DEFAULT(117,'NAME')
-----------------------------------------------------
'NT$'
 
GET_DOMAIN_INDEX_METADATA
Acts as intermediary between export and the ODCIIndexGetMetadata method on a domain index's implementation type which allows the index to return PL/SQL-based "metadata" such as policy info. Strings are returned representing pieces of PL/SQL blocks to execute at import time. dbms_export_extension.get_domain_index_metadata(
index_name     IN  VARCHAR2,
index_schema   IN  VARCHAR2,
type_name      IN  VARCHAR2,
type_schema    IN  VARCHAR2,
version        IN  VARCHAR2,
newblock       OUT PLS_INTEGER,
gmflags        IN  NUMBER   DEFAULT -1,  -- Post-v1 DI only
datapump_debug IN  NUMBER   DEFAULT -1,
partition_name IN  VARCHAR2 DEFAULT NULL )
RETURN VARCHAR2;
TBD
 
GET_DOMAIN_INDEX_TABLES
Acts as intermediary between export and the ODCIIndexUtilGetTableNames method on a domain index's implementation type allowing theindex to return list of secondary table names (separated by comma) that are to be exported and imported to speed up rebuild of domain indexes during import. dbms_export_extension.get_domain_index_tables(
index_name   IN VARCHAR2,
index_schema IN VARCHAR2,
type_name    IN VARCHAR2,
type_schema  IN VARCHAR2,
read_only    IN PLS_INTEGER,
version      IN VARCHAR2,
get_tables   IN PLS_INTEGER)
RETURN VARCHAR2;
TBD
 
GET_OBJECT_COMMENT
Reurns the source string for COMMENT OPERATOR and COMMENT INDEXTYPE dbms_export_extension.get_object_comment(
objid   IN NUMBER,
objtype IN NUMBER)
RETURN VARCHAR2;
SQL> desc dba_operator_comments
Name           Null?    Type
-------------- -------- ----------------
OWNER          NOT NULL VARCHAR2(128)
OPERATOR_NAME  NOT NULL VARCHAR2(128)
COMMENTS                VARCHAR2(4000)

SQL> desc dba_operator_comments
Name            Null?    Type
--------------- -------- ----------------
OWNER           NOT NULL VARCHAR2(128)
INDEXTYPE_NAME  NOT NULL VARCHAR2(128)
COMMENTS                 VARCHAR2(4000)
 
GET_OBJECT_SOURCE
Used to get the source string for CREATE OPERATOR and CREATE INDEXTYPE. The function is passed the object number and the object type and the string returned is the SQL statement needed to create the operator or the index type.

As you will note in the demo, at right, if you don't pass it the right object_id it returns NULL.
dbms_export_extension.get_object_source(
objid   IN NUMBER,
objtype IN NUMBER)
RETURN VARCHAR2;
SQL> SELECT object_id
  2  FROM dba_objects
  3  WHERE object_name = 'TAB$';

 OBJECT_ID
----------
         4

SQL> select type# from obj$ where obj# = 4;

     TYPE#
----------
         2

SELECT dbms_export_extension.get_object_source(4, 2)
FROM dual;

DBMS_EXPORT_EXTENSION.GET_OBJECT_SOURCE(4,2)
--------------------------------------------
 
 
GET_V2_DOMAIN_INDEX_TABLES
Acts as intermediary between export and the ODCIIndexUtilGetTableNames method on a domain index's implementation type. Unlike the initial (v1) implementation, the _v2_ 0/1 value which export will use to determine if all the secondary objects associated with a domain index should be exported (1) or not (0) dbms_export_extension.get_v2_domain_index_tables(
index_name   IN VARCHAR2,
index_schema IN VARCHAR2,
type_name    IN VARCHAR2,
type_schema  IN VARCHAR2,
read_only    IN PLS_INTEGER,
version      IN VARCHAR2,
get_tables   IN PLS_INTEGER,
gmflags      IN NUMBER)
RETURN INTEGER;
TBD
 
INSERT_SECOBJ
Inserts an entry into the table odci_secobj$, dbms_export_extension.insert_secobj(
secobjschema IN VARCHAR2,
secobjname   IN VARCHAR2);
col idxschema format a10
col idxname format a10
col secobjschema format a13
col secobjname format a15

SELECT *
FROM odci_secobj$;

no rows selected

exec dbms_export_extension.insert_secobj(USER, 'UW_TEST_SECOBJ');

PL/SQL procedure successfully completed.

SQL> SELECT *
  2  FROM odci_secobj$;

IDXSCHEMA  IDXNAME    SECOBJSCHEMA  SECOBJNAME
---------- ---------- ------------- ---------------
                      SYS           UW_TEST_SECOBJ

SQL> DELETE FROM odci_secobj$;

1 row deleted.

SQL> COMMIT;

Commit complete.
 
NULLTOCHR0
Replaces \0 with CHR(0) in a VARCHAR2 dbms_export_extension.nulltochr0(value IN VARCHAR2)
RETURN VARCHAR2;
SQL> SELECT dbms_export_extension.nulltochr0('MOR\0GAN')
  2  FROM dual;

DBMS_EXPORT_EXTENSION.NULLTOCHR0('MOR\0GAN')
---------------------------------------------
MOR\0GAN

SQL> DECLARE
  2   inVal VARCHAR2(20) := '\0';
  3   retVal VARCHAR2(20);
  4  BEGIN
  5    retVal := dbms_export_extension.nulltochr0(inVal);
  6    dbms_output.put_line(retVal);
  7    dbms_output.put_line(ASCII(retVal));
  8  END;
  9 /
\0
92

PL/SQL procedure successfully completed.
 
POST_TABLES
Execute post-tables functions from the expact$ table, for the specified object dbms_export_extension.post_tables(
obj_schema IN VARCHAR2,
obj_name   IN VARCHAR2)
RETURN VARCHAR2;
CREATE TABLE t AS SELECT * FROM user_views;

SELECT dbms_export_extension.post_table(USER, 'T')
FROM dual;
 
PRE_TABLE
Execute pre-table functions from the expact$ table, for the specified object dbms_export_extension.pre_table(
obj_schema IN VARCHAR2,
obj_name   IN VARCHAR2)
RETURN VARCHAR2;
CREATE TABLE t AS SELECT * FROM user_views;

SELECT dbms_export_extension.pre_table(USER, 'T')
FROM dual;
 
RESET_EXP_OPQ_TYP_EVENT
Undocumented dbms_export_extension.reset_exp_opq_typ_event;
exec dbms_export_extension.reset_exp_opq_typ_event;
 
RESET_NLS_NUMERIC_CHAR
Undocumented dbms_export_extension.reset_nls_numeric_char;
exec dbms_export_extension.reset_nls_numeric_char;
 
RESET_SECONDARYOBJ_EVENT
Undocumented dbms_export_extension.reset_secondaryobj_event;
exec dbms_export_extension.reset_secondaryobj_event;
 
SET_EXP_OPQ_TYP_EVENT
Undocumented dbms_export_extension.set_exp_opq_typ_event;
exec dbms_export_extension.set_exp_opq_typ_event;
 
SET_EXP_SORTSIZE
Undocumented dbms_export_extension.set_exp_sortsize;
exec dbms_export_extension.set_exp_sortsize;
 
SET_EXP_TIMEZONE
Undocumented dbms_export_extension.set_exp_timezone;
exec dbms_export_extension.set_exp_timezone;
 
SET_HAKAN_EVENT
Undocumented dbms_export_extension.set_hakan_event;
exec dbms_export_extension.set_hakan_event;
 
SET_IMP_EVENTS
Undocumented dbms_export_extension.set_imp_events;
exec dbms_export_extension.set_imp_events;
 
SET_IMP_SKIP_INDEXES_OFF
Undocumented dbms_export_extension.set_imp_skip_indexes_off;
exec dbms_export_extension.set_imp_skip_indexes_off;
 
SET_IMP_SKIP_INDEXES_ON
Undocumented dbms_export_extension.set_imp_skip_indexes_on;
exec dbms_export_extension.set_imp_skip_indexes_on;
 
SET_IMP_TIMEZONE
Undocumented dbms_export_extension.set_imp_timezone(timezone IN VARCHAR2);
SQL> SELECT DISTINCT tzname
  2  FROM v$timezone_names
  3  WHERE SUBSTR(tzname,1,1) NOT IN ('A', 'B', 'C', 'E', 'G', 'I', 'P', 'U')
  4* ORDER BY 1;

TZNAME
-----------------
HST
Hongkong
Jamaica
Japan
Kwajalein
Libya
MET
MST
MST7MDT
Mexico/BajaNorte
Mexico/BajaSur
Mexico/General
NZ
NZ-CHAT
Navajo
ROC
ROK
Singapore
Turkey
W-SU
WET
Zulu

exec dbms_export_extension.set_imp_timezone('NAVAJO');

PL/SQL procedure successfully completed.
 
SET_IOT_EVENT
Undocumented dbms_export_extension.set_iot_event;
exec dbms_export_extension.set_iot_event;
 
SET_NLS_NUMERIC_CHAR
Undocumented dbms_export_extension.set_nls_numeric_char;
exec dbms_export_extension.set_nls_numeric_char;
 
SET_NO_OUTLINES
Undocumented dbms_export_extension.set_no_outlines;
exec dbms_export_extension.set_no_outlines;
 
SET_RESUM
Undocumented dbms_export_extension.set_resum;
exec dbms_export_extension.set_resum;
 
SET_RESUMNAM
Undocumented dbms_export_extension.set_resumnam(name INVARCHAR2);
TBD
 
SET_RESUMNAMTIM
Undocumented dbms_export_extension.set_resumnamtim(
name IN VARCHAR2,
time IN INTEGER);
TBD
 
SET_RESUMTIM
Undocumented dbms_export_extension.set_resumTim(time IN INTEGER);
exec dbms_export_extension.set_resumTim(1);
 
SET_SECONDARYOBJ_EVENT
Undocumented dbms_export_extension.set_secondaryObj_event;
exec dbms_export_extension.set_secondaryObj_event;
 
SET_STATSON
Undocumented dbms_export_extension.set_statson;
exec dbms_export_extension.set_statson;

Related Topics
Built-in Functions
Built-in Packages
DBMS_EXPORT_EXTENSION
DBMS_METADATA
DBMS_UTILITY
What's New In 18c
What's New In 19c

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