当前位置:Gxlcms > 数据库问题 > ORACLE常用语句合集

ORACLE常用语句合集

时间:2021-07-01 10:21:17 帮助过:15人阅读

select tablespace_name from dba_tablespaces;
select tablespace_name from user_tablespaces;

查询使用过的表空间:

select distinct tablespace_name from dba_all_tables;
select distinct tablespace_name from user_all_tables;

查询表空间中所有表名:

select table_name from dba_all_tables where tablespace_name = tablespacename;

查询系统用户:

select * from all_users
select * from dba_users

查询当前连接的用户:

select * from v$session

查询当前用户权限:

select * from session_privs

查看所有的函数和存储过程:

select * from user_source

查看表空间使用情况:
select a.file_id "FileNo",
a.tablespace_name "表空间",
a.bytes "Bytes",
a.bytes - sum(nvl(b.bytes, 0)) "已用",
sum(nvl(b.bytes, 0)) "空闲",
sum(nvl(b.bytes, 0)) / a.bytes * 100 "空闲百分率"
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;

 

ORACLE常用语句合集

标签:存储过程   blog   sele   user   users   用户   使用情况   表空间   查询系统   

人气教程排行