Oracle 有的表查不到归属表空间


--查看一个用户下有哪些表属于哪个表空间
select * from all_tables where owner = '用户名大写';

问题:
有时一些表查不到属于哪个表空间,在 all_tables 中 tablespace_name 字段为空

原因:
dba_tables/all_tables 表中 tablespace_name 列,当某表为分区表,临时表或索引组织表的时候,该列值为空(官方文档解释)。
查看该表是否为分区表或临时表,可以通过 dba_tables 表中的 temporary ,partitioned 字段查看。

--查看用户下哪些表是分区表或临时表
select * from dba_tables where temporary='YES' or partitioned ='YES' and owner='用户名大写';
--查看一个表是否是分区表或临时表
select owner,table_name,temporary,partitioned from dba_tables where temporary='YES' or partitioned ='YES'and table_name ='表名大写';

查看是否为索引组织表的步骤:
select dbms_metadata.get_ddl('TABLE','COUNTRIES','HR') from dual;
如果该表的DDL语句中有 ORGANIZATION INDEX 关键字,说明该表为索引组织表。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM