A kind of hack.
a. Obtain a list of the import related tables so that you can delete them to ensure that a new import job starts with the SYS_IMPORT_FULL_01 table. SYS account is required.
SQL> select 'drop table '||OWNER||'.'||TABLE_NAME||';' from DBA_TABLES where TABLE_NAME like '%IMPORT_FULL%';
b. Adjust the PL/SQL code below where l_wrongTZ is a TZ number of the dump file and l_correctTZ is a TZ number of the database. Run the PL/SQL code in a SQL*Plus session in a separated terminal. SYS account is required.
declare
l_imptablename varchar2(64) := 'SYS_IMPORT_FULL_01';
l_imptableowner varchar2(12) := '';
l_cnt simple_integer := 0;
l_wrongTZ simple_integer := 41;
l_correctTZ simple_integer := 35;
begin
while (l_wrongTZ = l_wrongTZ)
loop
begin
select count(*) into l_cnt from DBA_TABLES where TABLE_NAME=l_imptablename;
if (l_cnt = 1)
then
select OWNER into l_imptableowner from DBA_TABLES where TABLE_NAME=l_imptablename;
while (l_wrongTZ = l_wrongTZ)
loop
begin
execute immediate 'select count(*) from '||l_imptableowner||'.'||l_imptablename||' where property='||to_char(l_wrongTZ) into l_cnt;
if (l_cnt = 1)
then begin
execute immediate 'update '||l_imptableowner||'.'||l_imptablename||' set property='||to_char(l_correctTZ)||' where property='||to_char(l_wrongTZ);
commit;
dbms_output.put_line('TZ info has been updated in '||upper(l_imptableowner)||'.'||upper(l_imptablename));
goto l_exit;
end;
else
dbms_lock.sleep(0.1);
end if;
end;
end loop;
end if;
end;
end loop;
<<l_exit>>
l_wrongTZ:=l_wrongTZ;
end;
c. Run impdp utility as usual
d. “TZ info has been updated ….” message means hack is applied.
e. impdp process should go smoothly
P.S.
Before taking above actions, it is a good idea to check what data will be affected. Obviously it’s about data type “TIMESTAMP WITH TIME ZONE”.
declare
l_object_id simple_integer:=0;
l_table_name string(128):='';
l_tstz_presence char(1):='';
cursor l_cursor is
select OBJECT_ID, OBJECT_NAME
from dba_objects
where OWNER='schema-name-is-here'
and OBJECT_TYPE='TABLE'
order by OBJECT_NAME;
begin
open l_cursor;
loop
fetch l_cursor into l_object_id, l_table_name;
exit when l_cursor%NOTFOUND;
l_tstz_presence:=sys.dbms_metadata_util.has_tstz_cols(l_object_id);
if (l_tstz_presence) = 'Y'
then
dbms_output.put_line(l_table_name||':'||l_tstz_presence);
end if;
end loop;
close l_cursor;
end;