DBAtlas · 数据库运维图谱

调整数据文件大小 / 设置 autoextend

Oracle存储

命令

-- Grow/shrink to a fixed size:
ALTER DATABASE DATAFILE '/u01/oradata/ORCL/customer_data01.dbf' RESIZE 5G;

-- Enable autoextend:
ALTER DATABASE DATAFILE '/u01/oradata/ORCL/customer_data01.dbf'
  AUTOEXTEND ON NEXT 256M MAXSIZE 30G;

-- Disable autoextend:
ALTER DATABASE DATAFILE '/u01/oradata/ORCL/customer_data01.dbf' AUTOEXTEND OFF;

作用

将数据文件设为固定大小或配置其自动增长行为。

适用场景

用于回收空间(收缩)、预分配空间或阻止失控增长。

注意

使用 RESIZE 收缩时,不能小于文件末尾已使用的块(ORA-03297)。请先迁移段。

在 DBAtlas 中打开 →

相关内容