Online Tables Move Oracle | dbms_redefinition | Move to another tablespace | Online table move | Redefinition Online
DECLARE
tbsddl varchar2(5000);
tbdrop varchar (100);
ERR PLS_INTEGER;
begin
--execute immediate 'ALTER SESSION FORCE PARALLEL DML PARALLEL 8';
--execute immediate 'ALTER SESSION FORCE PARALLEL QUERY PARALLEL 8';
for tbs_list in (select owner,segment_name from dba_segments
where tablespace_name like 'NETWORK_DATA'
and segment_type like 'TABLE'
and segment_name not like '%$%'
)
loop
SELECT replace ( (replace( ( replace(
(DBMS_METADATA.GET_DDL('TABLE',tbs_list.segment_name,tbs_list.owner)) ,
'DH_DHD_NETWORK_DATA','DH_DHD_NETWORK_DATA_2')) ,tbs_list.segment_name, tbs_list.segment_name||'_TMP' )) , 'CONSTRAINT "','CONSTRAINT "TMP_')
as NEW_TBS_DDL into tbsddl FROM DUAL;
execute immediate tbsddl ;
DBMS_REDEFINITION.START_REDEF_TABLE(uname=>tbs_list.owner,orig_table=>tbs_list.segment_name,int_table=>tbs_list.segment_name||'_TMP',col_mapping=>NULL, options_flag=> 1 );
BEGIN
DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS (UNAME => tbs_list.owner,
ORIG_TABLE => tbs_list.segment_name,
INT_TABLE => tbs_list.segment_name||'_TMP',
COPY_INDEXES => 1,
NUM_ERRORS => ERR,
IGNORE_ERRORS => TRUE);
END;
DBMS_REDEFINITION.FINISH_REDEF_TABLE(uname=>tbs_list.owner,orig_table=>tbs_list.segment_name,int_table=>tbs_list.segment_name||'_TMP');
tbdrop:='DROP TABLE '||tbs_list.owner||'.'||tbs_list.segment_name||'_TMP' ;
execute immediate tbdrop;
end loop ;
end;
I give .. up ...
ORA-00600: kod błędu wewnętrznego, argumenty: [4883], [0x7000139549DB790], [0x7000139ACEF2320], [], [], [], [], [], [], [], [], []
ORA-06512: przy "SYS.DBMS_REDEFINITION", linia 75
ORA-06512: przy "SYS.DBMS_REDEFINITION", linia 3459
ORA-06512: przy linia 24
Komentarze
Prześlij komentarz