首頁  >  文章  >  資料庫  >  oracle怎麼查詢使用者的表空間

oracle怎麼查詢使用者的表空間

WBOY
WBOY原創
2022-01-06 15:20:0423336瀏覽

在oracle中,可以利用“default_tablespace”查詢使用者的表空間,語法為“select default_tablespace from dba_users where username='使用者名稱'”,其中使用者名稱需使用大寫。

oracle怎麼查詢使用者的表空間

本教學操作環境:Windows10系統、Oracle 11g版、Dell G3電腦。

oracle怎麼查詢使用者的表空間

1)查詢目前使用者表空間

 select default_tablespace from dba_users where username='TMS21';

oracle怎麼查詢使用者的表空間

2)查詢所有表空間

   -- 1 )方式1:dba_tablespaces --
   select * from dba_tablespaces;
    --2 )方式2:v$tablespace --
   select * from v$tablespace;

3)查詢使用者下所有表格

  /* 查看用户下面的所有的表 */ 
  -- 1 )方式1:user_tables --
   select * from user_tables;
   --2 )方式2: dba_tables --
   select * from dba_tables where owner='TMS21';

4)查詢表空間下的使用者

  /*查看表空间下有多少用户,tablespace_name表空间 的名字一定要大写 */
   select distinct s.owner from dba_segments s where s.tablespace_name ='TMS21';

推薦教學:《 Oracle教學

以上是oracle怎麼查詢使用者的表空間的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn