1. 程式人生 > >『ORACLE』 對永久表空間進行DDL操作(11g)

『ORACLE』 對永久表空間進行DDL操作(11g)

進行 bsp per ble style data 用戶 order 大小

查看數據庫默認表空間
SQL> select property_value from database_properties where property_name = ‘DEFAULT_PERMANENT_TABLESPACE‘;

PROPERTY_VALUE
--------------------------------------------------------------------------------
USERS

查看用戶所使用的表空間

SQL> select owner,tablespace_name,round(sum(bytes) / 1024 / 1024,2) "used(M)"


2 from dba_segments
3 where owner = ‘SCOTT‘
4 group by owner,tablespace_name
5 order by sum(bytes) desc;

OWNER TABLESPACE_NAME used(M)
-------- --------------- ----------
SCOTT USERS .31

查看用戶中所有對象所占用空間大小

SQL> select owner,tablespace_name,segment_name,round(sum(bytes) /1024/1024) "USERD(M)"
2 from dba_segments


3 where owner = ‘SCOTT‘
4 group by owner,tablespace_name,segment_name,segment_type
5 order by sum(bytes) desc;

OWNER TABLESPACE_NAME SEGMENT_NA USERD(M)
-------- --------------- ---------- ----------
SCOTT USERS EMP 0
SCOTT USERS PK_EMP 0


SCOTT USERS PK_DEPT 0
SCOTT USERS DEPT 0
SCOTT USERS SALGRADE 0

查看表空間剩余空間大小

SQL> select tablespace_name, sum(bytes) / (1024*1024) free_space from dba_free_space group by tablespace_name;

TABLESPACE_NAME FREE_SPACE
--------------- ----------
SYSAUX 34.1875
UNDOTBS1 98
USERS .8125
SYSTEM 9.75
EXAMPLE 2.9375

『ORACLE』 對永久表空間進行DDL操作(11g)