轉: Oracle資料表空間查詢

來源:互聯網
上載者:User

標籤:

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資料表空間查詢

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.