当前位置:数据库 > Oracle >>

oracle 查询表归属于哪个用户,怎么查询

答案:以 sys 或 system 或者其他具有 dba 权限(能够查询系统数据字典视图)的用户登录数据库,执行下面的查询: select owner from dba_tables where table_name='表名'; 注意 oracle 一般是不区分大小写的,所以表名在数据字典视图中一般是大写字母表示的。
其他:select owner from all_objects where object_type = 'TABLE' and object_name = '大写的表名字' select * from dba_tables; select owner,table_name from dba_tables where table_name='xx' select owner,object_name from all_objects where object_type=upper('&object_type') and object_name=upper('&object_name') ;

类型和名字都自己输入 khg@ORCL> select owner,table_name from dba_tables where table_name=UPPER('emp');
 
OWNER                          TABLE_NAME
------------------------------ ------------------------------
TEST                           EMP
KHG                            EMP
SCOTT                          EMP
 把emp换成你要查的表名就行了; 

上一个:oracle中遇到“监听程序未启动或数据库服务未注册到该监听程序”该怎么办 我的监听程序已经启动了
下一个:oracle 的存储过程问题 急急急!

Oracle
MySQL
Access
SQLServer
DB2
Excel
SQLite
SYBASE
Postgres
如果你遇到数据库难题:
请访问www.zzzyk.com 试试
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,