alter table xxx move tablespace xxx; select 'alter table '||table_name||' move tablespace xxx;' from user_Tables; 执行去吧
看你的意思好像要使每个用户对应一个表空间,如果是这样现修改用户的default tablespace然后再移动用户所属的表,使用楼上的方法可以不过最好spool一下: set feedback off set heading off spool c:/move_table.sql select 'alter table '||table_name||' move tablespace xxx;' from user_Tables; spool off set feedback on set heading on 这样会生成一个脚本,然后执行这个脚本就可以了。
每个表的Index都要重建,工作量太大了吧
pool c:\move_table.sql select 'alter table '||table_name||' move tablespace xxx;' from user_Tables; spool offsqlplus执行脚本 SQL> @c:\move_table.sql;
select 'alter table '||table_name||' move tablespace xxx;' from user_Tables;
执行去吧
set feedback off
set heading off
spool c:/move_table.sql
select 'alter table '||table_name||' move tablespace xxx;' from user_Tables;
spool off
set feedback on
set heading on
这样会生成一个脚本,然后执行这个脚本就可以了。
select 'alter table '||table_name||' move tablespace xxx;' from user_Tables;
spool offsqlplus执行脚本
SQL> @c:\move_table.sql;
spool c:\move_table.sql
select 'alter table '||table_name||' move tablespace xxx;' from user_Tables;
spool offsqlplus执行脚本
SQL> @c:\move_table.sql;