oracle怎样查询用户的表空间

oracle怎样查询用户的表空间

原创2022-01-06 15:20:0402635

https://www.php.cn/oracle/487124.html

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

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

oracle怎样查询用户的表空间

1)查询当前用户表空间

1

select default_tablespace from dba_users where username='TMS21';

27.png

2)查询所有表空间

1

2

3

4

-- 1 )方式1:dba_tablespaces --

select * from dba_tablespaces;

 --2 )方式2:v$tablespace --

select * from v$tablespace;

3)查询用户下所有表

1

2

3

4

5

/* 查看用户下面的所有的表 */

-- 1 )方式1:user_tables --

 select * from user_tables;

 --2 )方式2: dba_tables --

 select * from dba_tables where owner='TMS21';

4)查询表空间下的用户

1

2

/*查看表空间下有多少用户,tablespace_name表空间 的名字一定要大写 */

 select distinct s.owner from dba_segments s where s.tablespace_name ='TMS21';

推荐教程:《Oracle教程

以上就是oracle怎样查询用户的表空间的详细内容,更多请关注php中文网其它相关文章!

posted @   RedArmy  阅读(5669)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· 清华大学推出第四讲使用 DeepSeek + DeepResearch 让科研像聊天一样简单!
· 实操Deepseek接入个人知识库
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
点击右上角即可分享
微信分享提示