oracle 如何识别所有全局临时表

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/40992122/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 03:20:35  来源:igfitidea点击:

How to identify all global temporary tables

oracledatabase-administration

提问by Michal Hru?ka

I need to identify which tables in my schema are Global Temporary Tables. Following script returns names of all my tables, but I am not able to identify which of these are GTTs and which are not.

我需要确定模式中的哪些表是 Global Temporary Tables。以下脚本返回我所有表的名称,但我无法确定哪些是 GTT,哪些不是

SELECT OBJECT_NAME
FROM ALL_OBJECTS 
WHERE OBJECT_TYPE IN ('TABLE')
AND OWNER='owner_name';

Thank you!

谢谢!

回答by Praveen

You can use ALL_TABLES

您可以使用 ALL_TABLES

select table_name
from all_tables
where TEMPORARY = 'Y'
AND OWNER='owner_name';

Temporarycolumn indicates whether the table is temporary (Y) or not (N)

Temporary列表示该表是否是临时表 ( Y) 或不是 ( N)