批量移动表和索引的表空间
--1.修改表的空间 alter table table_Name move tablespace TABLESPACENAME --查询当前用户下的所有表 select 'alter table '|| table_name ||' move tablespace cjlogistics;' from user_all_tables; --2.修改表的索引的空间 alter index INDEX_NAME rebuild tablespace TABLESPACENAME --查询当前用户下的所有索引 select 'alter index '|| index_name ||' rebuild tablespace cjlogistics;' from user_indexes; --3.用于移动lob索引表空间SELECT 'alter table ' || t.owner || '.' || t.table_name ||' move tablespace cjlogistics lob (' || t.column_name ||') store as(tablespace LOBTPS_NAME_MOVEBK);' v_sql FROM dba_lobs t WHERE t.tablespace_name='CJLOGISTICS';