1、查询哪个表空间不够,海信的表空间都是HS开头的,其他的不要动。IDX代表索引空间
SELECT a.tablespace_name "表空间名称", 100-ROUND((NVL(b.bytes_free,0)/a.bytes_alloc)*100,2) "占用率(%)", ROUND(a.bytes_alloc/1024/1024,2) "容量(M)", ROUND(NVL(b.bytes_free,0)/1024/1024,2) "空闲(M)", ROUND((a.bytes_alloc-NVL(b.bytes_free,0))/1024/1024,2) "使用(M)", TO_CHAR(SYSDATE,'yyyy-mm-dd hh24:mi:ss') "采样时间" FROM (SELECT f.tablespace_name, SUM(f.bytes) bytes_alloc, SUM(DECODE(f.autoextensible,'YES',f.maxbytes,'NO',f.bytes)) maxbytes FROM dba_data_files f GROUP BY tablespace_name) a, (SELECT f.tablespace_name, SUM(f.bytes) bytes_free FROM dba_free_space f GROUP BY tablespace_name) b WHERE a.tablespace_name = b.tablespace_name; 2、select name from v$datafile; ----查询物理文件地址下面显示的路径,
/home/oracle/oradata/CMPDB/HSCMP_TBL02.dbf---把这个复制到下面引号中替换,切记后面的数字要依次改变
alter tablespace HSCMP_IDX add datafile '/home/oracle/oradata/CMPDB/HSCMP_IDX04.dbf' SIZE 30000M autoextend on; alter tablespace HSCMP_TBL add datafile '/home/oracle/oradata/CMPDB/HSCMP_TBL04.dbf' SIZE 30000M autoextend on;