- 使用Putty工具登录OMU服务器,Putty工具的使用方法请参见Putty工具操作。
- 执行su - oracle命令,输入“oracle”用户的密码,将当前用户切换为“oracle”用户。
- 执行命令sqlplus / as sysdba,以系统用户登录数据库。
屏幕输出如下:
SQL*Plus: Release 11.1.0.7.0 - Production on Mon Mar 30 18:40:13 2009 Copyright (c) 1982, 2008, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
- 执行命令 select b.file_id , b.TABLESPACE_NAME, b.bytes/1024/1024 "BYTES(M)", (b.bytes-sum(nvl(a.bytes,0)))/1024/1024 "USED(M)" , sum(nvl(a.bytes,0))/1024/1024 "AVAIL(M)", sum(nvl(a.bytes,0))/(b.bytes)*100 "AVAIL_PERCENT(%)" 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; ,查看各个表空间的数据空间使用情况:
系统输出结果根据实际情况有所不同,如下所示:
FILE_ID TABLESPACE_NAME BYTES(M) USED(M) AVAIL(M) AVAIL_PERCENT(%) ------- ----------------- ---------- ---------- ---------- ---------------- 1 SYSTEM 1080 1074.4375 5.5625 .515046296 2 SYSAUX 779.125 741.3125 37.8125 4.85320071 3 UNDOTBS1 1300 10.875 1289.125 99.1634615 4 USERS 297.875 42.4375 255.4375 85.7532522 5 COMMON 50 1.5 48.5 97 6 PDS 50 1.625 48.375 96.75 7 CGP_1 149.625 137.0625 12.5625 8.39598997 8 NE5_1 371.375 348.3125 23.0625 6.21003029 8 rows selected.
各个栏目解释如下:- “FILE_ID”:文件ID。
- “TABLESPACE_NAME”:数据库表空间名称。
- “BYTES”:当前表空间数据文件的大小。
- “USED”:已使用的空间大小。
- “AVAIL”:空闲大小。
- “AVAIL_PERCENT”:空闲百分比。
查询Oracle表空间信息
最新推荐文章于 2024-07-24 20:04:27 发布