Oracle表空间扩容
程序员文章站
2022-07-05 17:11:30
报错异常:ORA-01653:表**无法通过1024(在表空间*中)扩展 #查询表空间文件大小SELECT tablespace_name,file_id, file_name, round(bytes / (1024 * 1024), 0) total_space FROM dba_data_fi ......
报错异常:ora-01653:表**无法通过1024(在表空间*中)扩展
#查询表空间文件大小
select tablespace_name,file_id, file_name, round(bytes / (1024 * 1024), 0) total_space from dba_data_files order by tablespace_name;
select tablespace_name,file_id, file_name, round(bytes / (1024 * 1024), 0) total_space from dba_data_files order by tablespace_name;
#查询表空间使用率
select a.tablespace_name,
a.bytes total,
b.bytes used,
c.bytes free,
(b.bytes * 100) / a.bytes "% used ",
(c.bytes * 100) / a.bytes "% free "
from sys.sm$ts_avail a, sys.sm$ts_used b, sys.sm$ts_free c
where a.tablespace_name = b.tablespace_name
and a.tablespace_name = c.tablespace_name;
a.bytes total,
b.bytes used,
c.bytes free,
(b.bytes * 100) / a.bytes "% used ",
(c.bytes * 100) / a.bytes "% free "
from sys.sm$ts_avail a, sys.sm$ts_used b, sys.sm$ts_free c
where a.tablespace_name = b.tablespace_name
and a.tablespace_name = c.tablespace_name;
#修改表空间大小,扩容
alter database datafile '/oradata/tbs_tablequery.dbf' resize 30000m
alter database datafile '/oradata/tbs_tablequery.dbf' resize 30000m
#设置表空间自动递增,最大30000m
alter database datafile '/oradata/tbs_tablequery.dbf' autoextend on next 100m maxsize 30000m
alter database datafile '/oradata/tbs_tablequery.dbf' autoextend on next 100m maxsize 30000m
上一篇: Windows Oracle连接ORA-12541:TNS:无监听程序
下一篇: mysql重置密码