0

An application needs to access various Oracle database. Some databases have tables in Schemas, some don't - there's no control over this.

If a database has a schema in use, the applicable won't work unless the user enters a schema. I'd like it to be able determine via a SQL query if a schema is required to access the tables so the user can be alerted to this.

I'm aware of the question - How do I obtain a list of schemas that an Oracle user has access to - but that only tells me what schema's can be accessed, not if use of the schema is required to access tables.

Is there an SQL query to one of the system tables that can do this with that user's rights?

Note: The application only has login credentials and doesn't know any table details.

Hope that's clear. Thanks.

4

1 回答 1

0

问题令人困惑。在 Oracle 中的大多数情况下,您可以考虑 LOGIN == USER == SCHEMA。当您使用您的用户登录数据库时,您可以查看和访问该用户架构中的所有对象。
SCHEMA2.TABLE1 可以访问其他模式中的对象(在同一数据库服务器上),如果连接的用户具有访问表的权限(有不同的权限......)。正如一些评论中已经说明的,如果存在同义词,则不需要为 table 添加前缀。
如果存在适当的数据库链接,您的用户甚至可以访问某个远程服务器上的表。

于 2013-02-05T13:31:46.347 回答