首頁 > 資料庫 > Oracle > 主體

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

WBOY
發布: 2022-01-06 15:20:04
原創
23233 人瀏覽過

在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中文網其他相關文章!

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!