- 方法1:
根据指定用户名获得对应用户所拥有权限的表
select table_name, owner from all_tables where owner = 'scott';
- 方法2:
通过tab视图获得当前登录用户所有表和视图,通过tabletype过滤获得所有表
select * from tab where tabtype = 'table';
- 方法3:
根据user_tables表获得当前用户拥有所有表
select table_name from user_tables;
- 方法4:
根据sys表空间下all_object表获得指定用户指定类型对象(表)
select object_name from sys.all_objects where owner='scott' and object_type='table';

本文介绍在Oracle数据库中查询特定用户所有表的四种实用方法,包括直接查询所有者为指定用户的表、通过tab视图获取当前登录用户的所有表、从user_tables表中查找当前用户的所有表以及从sys表空间的all_objects表中筛选指定用户和类型的对象。
824

被折叠的 条评论
为什么被折叠?



