oracle常用查询
oracle常用查询
SELECT * FROM Dba_Users --查看所有用户
SELECT * FROM user_all_tables --查询当前用户表空间
SELECT * FROM user_source --查询所有函数和存储过程
SELECT * FROM v$session --查看当前用户连接
SELECT * FROM session_privs --查看当前用户的权限
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; --查询表空间使用情况