標籤:
1、查詢資料庫中的資料表空間名稱
1)查詢所有資料表空間
select tablespace_name from dba_tablespaces;
select tablespace_name from user_tablespaces;
2)查詢使用過的資料表空間
select distinct tablespace_name from dba_all_tables;
select distinct tablespace_name from user_all_tables;
2、查詢資料表空間中所有表的名稱
select table_name from dba_all_tables where tablespace_name = tablespacename
3、查詢系統使用者
select * from all_users
select * from dba_users
4、查看當前串連使用者
select * from v$session
5、查看目前使用者許可權
select * from session_privs
6、查看所有的函數和預存程序
select * from user_source
其中TYPE包括:PROCEDURE、FUNCTION
7、查看錶空間使用方式
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資料表空間查詢