-- =======================================================================
-- Muda a tablespace da tabela - sql
-- =======================================================================
select 'ALTER TABLE '||a.OWNER||'.'||a.TABLE_NAME||' move tablespace SITE_DADOS;'
from dba_tables a
where a.owner = 'DBSVS'
select b.owner, b.segment_name, b.segment_type, b.tablespace_name, b.header_block, b.header_file, b.segment_type
-- ,'ALTER TABLE '||b.OWNER||'.'||b.segment_name||' move tablespace TD_DBGERALENTIDADE;'
,'ALTER INDEX '||b.OWNER||'.'||b.segment_name||' rebuild ONLINE tablespace TI_DBGERALENTIDADE;'
from dba_segments b
where b.tablespace_name = 'TH_DBSVS'
--and b.segment_type = 'INDEX'
--and b.header_block > 90000
order by 3
-- =======================================================================
-- Muda Lob de Tablespace - sql
-- =======================================================================
ALTER TABLE dbsngpc.tb_recebimento_arquivo MOVE LOB(ds_arquivo_recebido2) STORE AS (TABLESPACE TD_DBSNGPC_LOBS);
ALTER TABLE dbsngpc.tb_recebimento_arquivo MOVE LOB(ds_validacao2) STORE AS (TABLESPACE TD_DBSNGPC_LOBS);