Oracle SQL Developer 如何默认为其他用户表?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1692728/
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
Oracle SQL Developer How To Default To Other Users Tables?
提问by Clive
In order to see all of the tables in our companies DB I have to go find the main sys account. Is there a way to default my connection so that it shows the other users tables?
为了查看我们公司数据库中的所有表,我必须找到主系统帐户。有没有办法默认我的连接,以便它显示其他用户表?
回答by dpbradley
Any table that your connecting account has at least SELECT privileges on will show up in the "Other Users" node of the navigation tree. If the table does not show up there then it is a database permissions issue, not a SQL Developer configuration issue.
您的连接帐户至少具有 SELECT 权限的任何表都将显示在导航树的“其他用户”节点中。如果该表没有出现在那里,那么它是一个数据库权限问题,而不是一个 SQL Developer 配置问题。
回答by Ram
Think you don't want to repeated type otheruser.tablename in all your queries. If that is the case you want to run this
认为您不想在所有查询中重复键入 otheruser.tablename。如果是这种情况,您想运行它
alter session set current_schema = otheruser;
回答by Jordi M.
As Ram, I also do it with
作为拉姆,我也这样做
alter session set current_schema = otheruser;
alter session set current_schema = otheruser;
It works if you want to access to the tables of a particular user
如果您想访问特定用户的表,它会起作用
回答by René Nyffenegger
What do you mean by "see all of the tables"? Are you happy if you know they're there, or do you need to see their content. In the former case dba_tables should do. In the latter case it's a matter of the privileges assigned to you.
“查看所有表格”是什么意思?如果您知道他们在那里,您是否高兴,或者您是否需要查看他们的内容。在前一种情况下 dba_tables 应该做。在后一种情况下,这是分配给您的特权的问题。
回答by Doug Porter
Change your connect to login as the main Sys user. Otherwise like dpbradley says you will have to go find them under the Other Users node.
将您的连接更改为以主要 Sys 用户身份登录。否则就像 dpbradley 说的那样,您必须在其他用户节点下找到它们。
回答by xarx
If you connect to (e.g.) DB2 using JDBC driver, you can use this syntax:
如果您使用 JDBC 驱动程序连接到(例如)DB2,您可以使用以下语法:
jdbc:db2://localhost:50000/WESBDB:currentSchema=WESB;
Not only that the schema WESB
will be your current schema, but it will be also the default schema in the tree on the Connections tab.
该架构不仅WESB
将是您当前的架构,而且还将是“连接”选项卡上树中的默认架构。
Note: It seems that it works for DB2 only.
注意:它似乎只适用于 DB2。