添加表空间
Posted zsh~
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了添加表空间相关的知识,希望对你有一定的参考价值。
一、查看表空间
SELECT a.tablespace_name tbsname,trunc(a.total,2) space_allocated, trunc((a.total-nvl(b.free,0.0)),2)space_used, trunc((a.total-NVL(b.free,0.0))/a.max * 1000) / 10 USED__PRC, trunc(a.max,2) space_max FROM (SELECT tablespace_name,sum(bytes)/1024/1024/1024 total,sum(maxbytes)/1024/1024/1024 max FROM (SELECT tablespace_name,bytes,decode(maxbytes,0,bytes,maxbytes)maxbytes FROM dba_data_files) GROUP BY tablespace_name) A, (SELECT tablespace_name,sum(bytes)/1024/1024/1024 free FROM dba_free_space GROUP BY tablespace_name) B WHERE a.tablespace_name=b.tablespace_name order by 4;
二、查看单个表空间
select file_name,bytes/1024/1024/1024 from dba_data_files where tablespace_name=\'PCM_OC\'; select file_name,bytes/1024/1024/1024 from dba_data_files where FILE_NAME like \'%shfw%\';
三、添加或resize数据文件
alter database datafile \'/路径/数据文件\' resize 30G; alter tablespace TBS_YUTONG_SHPJ add datafile \'/路径/数据文件f\' size 30G;
以上是关于添加表空间的主要内容,如果未能解决你的问题,请参考以下文章