Document Type | TroubleShooting
Category | Administration
Applicable Product Version | 5SP1FS06
Document Number | TADTS023
Issue
This explains the symptom where wrapped package DDL is not unwrapped and extracted but skipped in the object DDL script extracted by tbexport.
The following package DDL extraction issue occurs.
The following package DDL extraction issue occurs.
$ tbexport username=sys password=tibero sid=tibero port=8629 file=export.dat log=export_ddl.log script=y rows=n full=y the entire database: Fri May 09 15:40:46 KST 2025 Export character set: UTF-8 Export national character set: UTF-16 exporting tablespaces exporting roles exporting directories exporting sys privileges exporting public synonyms Packing the file... Export completed successfully : Fri May 09 15:40:48 KST 2025 $ cat export_ddl.log ... BEGIN -- skipping wrapped PSM object : "TIBERO".WRAPPED_PACKAGE null; END; ...
Cause
In Tibero 5 version, wrapped package DDL can be unwrapped using the
sys.tool_utility.get_unwrapped_src(object_id) function. However, the return value of this function is limited to a maximum of 4000 BYTES (varchar2), so if the unwrapped DDL exceeds 4000 bytes, the unwrapping fails. Because of this, tbexport execution marks the DDL as skipped, and the unwrapped package DDL cannot be confirmed.In other words, in Tibero 5,
tbexport should unwrap and extract the wrapped package's DDL, but due to the return length limitation during the unwrapping process, an error occurs, resulting in the inability to view the unwrapped package DDL.
Solutions
tool_utility.get_unwrapped_src execution causes this issue due to the return value size limit, so to resolve it, the unwrapped DDL is extracted directly by bypassing the limit and storing it in a suitably sized variable for output. SQL> set serveroutput on;
SQL> declare a varchar2(32767);
begin a := tool_utility.get_unwrapped_src(skipped object id);
dbms_output.put_line(a);
end;
/
CREATE OR REPLACE PACKAGE BODY WRAPPED_PACKAGE WRAPPING
AS
PROCEDURE w(p_text IN VARCHAR2
)IS
v_file UTL_FILE.FILE_TYPE;
BEGIN
v_file := UTL_FILE.FOPEN('DB_LOG','DBLOG_'||TO_CHAR(SYSDATE,'YYYYMMDD')||'.log','A',32767);
UTL_FILE.PUT_LINE(v_file, TO_CHAR(SYSDATE, 'YYYY/MM/DD HH24:MI:SS')|| ' I: '|| p_text);
UTL_FILE.FCLOSE(v_file);
END;
PROCEDURE d(p_text IN VARCHAR2
)IS
...extraction successful