lingxiao102

增加oracle表空间

查找用户对应的表空间

1、查询表空间物理文件路径
select tablespace_name, file_id, file_name,
round(bytes/(1024*1024),0) total_space
from dba_data_files
where tablespace_name=\'NXWSPT\';

2、增加数据文件个数
alter tablespace NXWSPT add datafile \'+DATA/nxwspt03.dbf\' size 32767m;

 

******************************************

 

1、查询表空间使用情况

select b.file_id 文件ID号,
b.tablespace_name 表空间名,
b.bytes / 1024 / 1024/ 1024 字节数G,
(b.bytes - sum(nvl(a.bytes, 0))) / 1024 / 1024 / 1024 已使用G,
sum(nvl(a.bytes, 0)) / 1024 / 1024/ 1024 剩余空间G,
100 - sum(nvl(a.bytes, 0)) / (b.bytes) * 100 占用百分比
from dba_free_space a, dba_data_files b
where a.file_id = b.file_id
group by b.tablespace_name, b.file_id, b.bytes
order by b.file_id;

2、查询表空间物理文件路径
SELECT tablespace_name,
file_id,
file_name,
round(bytes / (1024 * 1024), 0) total_space
FROM dba_data_files
ORDER BY tablespace_name;

3、增加表空间
(1)允许已存在的数据文件自动增长
alter database datafile \'+DATA/orcl/datafile/system.260.879527735\' autoextend on next 5m maxsize unlimited;

(2)手工改变已存在数据文件的大小
ALTER DATABASE DATAFILE \'+DATA/orcl/datafile/system.260.879527735\'
RESIZE 10240M;

 

分类:

技术点:

相关文章:

  • 2022-01-06
  • 2022-02-12
  • 2022-02-18
  • 2022-12-23
  • 2022-02-09
  • 2022-01-12
  • 2022-01-05
  • 2022-01-28
猜你喜欢
  • 2021-11-28
  • 2022-02-15
  • 2021-11-30
  • 2021-11-20
  • 2022-02-27
相关资源
相似解决方案