修改表所属表空间
1.修改表的空间alter table TABLE_NAME move tablespace TABLESPACENAME查询当前用户下的所有表select 'alter table '|| table_name ||' move tablespace tablespacename;' from user_tables;2.修改表的索引的空间alter index INDEX_NAME rebuild tablespace TABLESPACE...
表空间相关查询
1、查看表空间的物理路径以及大小SELECT tablespace_name, file_id, file_name, round(bytes / (1024 * 1024), 0) total_space FROM dba_data_files ORDER BY tablespace_name; 2、查看表空间的使用情况SELECT a.tablespace_name, a.bytes total, b.bytes used, c...
修改表空间文件路径
因虚拟机的根目录满了,扩展了一个新的分区,将数据文件放到新的分区首先查看表空间与文件路径的关系SELECT t1.name, t2.name FROM v$tablespace t1, v$datafile t2 WHERE t1.ts#=t2.ts# order by t1.name-- 1. alter tablespace tbs_name offline;&nb...