查看Oracle表空間以及用戶與其默認表空間狀況

Oracle中一個表空間多是多個用戶的默認表空間,下面語句統計了用戶及其默認表空間狀況,若是用戶多個,用戶之間經過逗號分隔。spa

select t.default_tablespace,
       to_char(wmsys.wm_concat(username)) all_users
  from dba_users t
 group by t.default_tablespace;

顯示結果以下:3d

image

能夠對結果根據用戶建立的時間排序(若是多用戶取第一個用戶建立時間),語句以下:code

select t.default_tablespace,
       to_char(wmsys.wm_concat(username)) all_users,
       min(t.created) minCreateTime
  from dba_users t
 group by t.default_tablespace
 order by minCreateTime;

顯示結果以下:blog

image

相關文章
相關標籤/搜索