Oracle Spostamento Oggetti: differenze tra le versioni
Jump to navigation
Jump to search
Riga 10: | Riga 10: | ||
prompt 'ALTER SESSION SET ddl_lock_timeout=30;' |
prompt 'ALTER SESSION SET ddl_lock_timeout=30;' |
||
select 'alter index ' || owner || '.' || index_name || ' logging;' from dba_indexes where LOGGING='NO' and owner !='PERFSTAT'; |
select 'alter index ' || owner || '.' || index_name || ' logging;' from dba_indexes where LOGGING='NO' and owner !='PERFSTAT'; |
||
Metodo PL/SQL: |
|||
begin |
|||
for c1 in (select index_name from dba_indexes where owner='PERFSTAT' and tablespace_name='USERS') |
|||
loop |
|||
begin |
|||
execute immediate 'alter index perfstat.' || c1.index_name || ' rebuild tablespace "PERFSTAT" nologging'; |
|||
exception |
|||
when others then |
|||
null; |
|||
end; |
|||
end loop; |
|||
end; |
|||
/ |
|||
==Spostamento LOB== |
==Spostamento LOB== |
Versione delle 10:31, 15 mag 2018
Spostamento Indici
set pagesize 200 set linesize 200 set trim on set trims on
select 'alter index ' || owner || '.' || index_name || ' rebuild tablespace GW_IDX online nologging compute statistics;' from dba_indexes where tablespace_name='GW_DAT'; prompt 'ALTER SESSION SET ddl_lock_timeout=30;' select 'alter index ' || owner || '.' || index_name || ' logging;' from dba_indexes where LOGGING='NO' and owner !='PERFSTAT';
Metodo PL/SQL:
begin for c1 in (select index_name from dba_indexes where owner='PERFSTAT' and tablespace_name='USERS') loop begin execute immediate 'alter index perfstat.' || c1.index_name || ' rebuild tablespace "PERFSTAT" nologging'; exception when others then null; end; end loop; end; /
Spostamento LOB
ALTER TABLE table_name MOVE LOB (lob_column) STORE AS (TABLESPACE tablespace_name);