oracle怎样查询用户的表空间

oracle怎样查询用户的表空间,第1张

oracle怎样查询用户的表空间

oracle中,可以利用“default_tablespace”查询用户的表空间,语法为“select default_tablespace from dba_users where username='用户名'”,其中用户名需使用大写。

本教程 *** 作环境:Windows10系统、Oracle 11g版、Dell G3电脑。

oracle怎样查询用户的表空间

1)查询当前用户表空间

 select default_tablespace from dba_users where username='TMS21';

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怎样查询用户的表空间的详细内容,

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/705335.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-23
下一篇 2022-04-23

发表评论

登录后才能评论

评论列表(0条)

保存