查看INV用户的对象的存储情况
select * from dba_segments ds where ds.owner='INV';
--default tablespace users

创建表空间INV
create tablespace inv datafile '/oradata/ocm/inv01.dbf ' size 200M autoextend on next 10m maxsize 2048M extent management local segment space management auto;
设置默认表空间为INV
alter user inv default tablespace inv;

set linesize 200
set pagesize 2000
set term off verify off head off feedback off echo off

spool mtiddl.sql

select 'alter ' ||ds.segment_type || ' '|| ds.owner||'.' || ds.segment_name || ' ' ||
decode(segment_type, 'TABLE', 'MOVE', 'INDEX', 'REBUILD') ||
' tablespace INV;'
from dba_segments ds
where ds.owner = 'INV'
AND (segment_type = 'INDEX' OR segment_type = 'TABLE');

spool off