第1个回答 2017-03-17
--Oracle查询用户表空间
select * from user_all_tables; select * from user_source; select * from all_users;
select * from dba_users select * from v$Session; SELECT * FROM USER_ROLE_PRIVS; select * from session_privs; SELECT * FROM DBA_ROLE_PRIVS; select * from dba_roles;
SELECT NAME FROM V$DATABASE; select a.file_id "FileNo",
a.tablespace_name "Tablespace_name",
a.bytes "Bytes",
a.bytes - sum(nvl(b.bytes, 0)) "Used",
sum(nvl(b.bytes, 0)) "Free",
sum(nvl(b.bytes, 0)) / a.bytes * 100 "%free"
from dba_data_files a, dba_free_space b
where a.file_id = b.file_id(+)
group by a.tablespace_name, a.file_id, a.bytes
order by a.tablespace_name;本回答被提问者采纳