select username,default_tablespace from dba_users where username='用戶名';
select * from dba_tablespaces;--查看表空間
--查看表空間檔案路徑
select tablespace_name,file_id,bytes/1024/1024,file_name
from dba_data_files order by file_id;
--查看用戶和默認表空間的關系
select username,default_tablespace from dba_users
uj5u.com熱心網友回復:
查看用戶下的表空間的陳述句:select a.tablespace_name,
a.bytes / 1024 / 1024 "sum MB",
(a.bytes - b.bytes) / 1024 / 1024 "used MB",
b.bytes / 1024 / 1024 "free MB",
round(((a.bytes - b.bytes) / a.bytes) * 100, 2) "used%"
from (select tablespace_name, sum(bytes) bytes
from dba_data_files
group by tablespace_name) a,
(select tablespace_name, sum(bytes) bytes, max(bytes) largest
from dba_free_space
group by tablespace_name) b
where a.tablespace_name = b.tablespace_name
order by ((a.bytes - b.bytes) / a.bytes) desc;
uj5u.com熱心網友回復:
1、你這里理解可能有點問題,用戶不會屬于任何表空間,但可以授權用戶使用哪個表空間,oracle的表空間是公共資源,關鍵看用戶是否有權使用。因此,你只能查到用戶的默認表空間是哪個,用戶對哪個表空間有權限等。2、查詢用戶默認表空間:
select username,default_tablespace from dba_users where username='USER1';
3、查詢用戶的表空間權限:
select * from dba_sys_privs where username='USER1';
select * from dba_ts_quotas where username='USER1';
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/28161.html
標籤:非技術區
上一篇:weblogic部署專案報錯DeploymentService:290066 Underlying error is: "null"
下一篇:新手求指導,觸發器無法運行
