(1)查询用户对应的表空间,我们可以看到针对不同的数据库用户Oracle

select username, default_tablespace, temporary_tablespace from dba_users;

ORACLE扩展数据空间

(2)查询用户的对应的数据文件,以及数据文件大小

selecttablespace_name, file_id, file_name,round(bytes/(1024*1024),0) total_space from dba_data_files

order bytablespace_name;

ORACLE扩展数据空间
(3)根据1.2 用户对应的表空间,以及表空间的大小,可以在通过下述语句查看目前使用百分比,如果所用空间不再下述查询范围内,则证明此空间已经满了,没有剩余量的空间在下面的SQL中没有展示,我们可以看到有一个空间已经到了95%

SELECT a.tablespace_name "表空间名",total "表空间大小",free "表空间剩余大小",(total - free) "表空间使用大小",

total / (1024 * 1024 * 1024) "表空间大小(G)",free / (1024 * 1024 * 1024) "表空间剩余大小(G)",

(total - free) / (1024 * 1024 * 1024) "表空间使用大小(G)",round((total - free) / total, 4) * 100 "使用率 %"

FROM (SELECT tablespace_name, SUM(bytes) free FROM dba_free_space GROUP BY tablespace_name) a,

(SELECT tablespace_name, SUM(bytes) total FROM dba_data_files GROUP BY tablespace_name) b

WHERE a.tablespace_name = b.tablespace_name ;

ORACLE扩展数据空间

(4)此时我们执行空间扩增语句。把刚才使用率95%空间从1800M扩增到3000M

alter database datafile '/u2/oracle/PLM_SD_data' resize 3000m

其中“/u2/oracle/PLM_SD_data”修改为(2)中表空间路径即可,但需要在system下运行语句。

转自百度经验https://jingyan.baidu.com/article/414eccf6530b826b431f0ae0.html





相关文章:

  • 2021-04-13
  • 2021-12-29
  • 2022-12-23
  • 2021-05-21
猜你喜欢
  • 2022-12-23
  • 2021-11-10
  • 2021-06-10
  • 2022-12-23
  • 2021-04-25
相关资源
相似解决方案