Oracle怎么增加表空间大小
第一步:查看表空间的名字及文件所在位置
select tablespace_name, file_id, file_name, round(bytes / (1024 * 1024), 0) total_space from dba_data_files order by tablespace_name
第二步:增大所需表空间大小
方法一:
alter database datafile '表空间数据文件位置'resize 新的尺寸
eg:
alter database datafile '/oracle/oradata/anita_02.dbf' resize 3000m
对于Oracle数据库的表空间,除了用手动增加大小外,还可以增加数据文件等方式扩展表空间大小。
方法二:增加数据文件个数
alter tablespace 表空间名称add datafile '新的数据文件地址' size 数据文件大小
eg:
alter tablespace ESPS_2008 add datafile '/oracle/oradata/anita_03.dbf' size 3000m
方法三:设置表空间自动扩展
alter database datafile '数据文件位置' autoextend on next 自动扩展大小maxsize 最大扩展大小
eg:
alter database datafile '/oracle/oradata/anita_03.dbf' autoextend on next 100m maxsize 10000m
第三步:查看表空间使用情况
select a.tablespace_name, a.bytes / 1024 / 1024 "sum MB", (a.bytes - b.bytes) / 1024 / 1024 "used MB", b.bytes / 1024 / 1024 "free MB", round(((a.bytes - b.bytes) / a.bytes) * 100, 2) "used%" from (select tablespace_name, sum(bytes) bytes from dba_data_files group by tablespace_name) a, (select tablespace_name, sum(bytes) bytes, max(bytes) largest from dba_free_space group by tablespace_name) b where a.tablespace_name = b.tablespace_name order by ((a.bytes - b.bytes) / a.bytes) desc;
原文链接:https://www.cnblogs.com/my-first-blog-lgz/p/17218902.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了