How to access table that holds the workspace groups information? I need a SQL method of accessing that table.
Look at APEX_WORKSPACE_GROUPS and APEX_WORKSPACE_GROUP_USERS. I believe these are only available from Apex 4.1 on though.
In older versions you need to (try to) access the tables wwv_flow_fnd_group_users and wwv_flow_fnd_user_groups. You would probably need to add grants on these tables to see them.
Related
I have access to that user in SQL Developer. How can I access this same user in Apex, to make any query?
Talk to your Apex admin. They should map that schema (i.e. user with all its objects) to your workspace.
Alternatively, you could create a database link from your current user (the one you already use in Apex) to the one that contains data you're interested in. Then you could access data over that database link, perhaps create synonyms in your schema (to make it simpler). Though, I'd probably go for the 1st option I suggested.
But, if you don't use Apex yet, then - back to Apex admin again; they should create a workspace for you, let you use schema you're talking about, create an Apex developer for you and - that should do it.
I've installed Oracle APEX 19.2, on database 12.2. And I don't know how to use tables which exist in database. For instance, I have table 'test' in database and I can't use this table in app builder. I searched in google, but I couldn't find appropriate answer.
Thanks in advance
When you create a workspace, you have to "pair" database users (schemas) with your workspace. It is done in administrative part of Apex (you have to log in as ADMIN).
Once you do that, you'll be able to see tables owned by that user.
The database I am using is Oracle 11g Express Edition release 2.
I created 2 schemas in the same instance xe. They all have the same tables names and sequences names and stored procedures and stored functions and views names. But the tables structures and views texts are different ( there is some modifications between them ).
The reason for the creation of these two schemas is because our project has two versions. So the first schema is used for the first version , and the second schema was created for the second version. The mechanism of our web application Spring project is that whenever a connection is made through the web application login page then a corresponding Oracle user is making a connection according to the login entered ; so there is no fixed credential connection , there are Oracle users corresponding to each web application login.
So in order for each user to work with each database objects then I created public synonyms for every objects , and granted permissions to them for each user. But the database objects are owned by the schema I mentioned at the beginning. Now my problem is this : our customer wants the two project versions to be run on a same instance ( same computer server ). So one of the project version cannot run because the public synonyms can only refer to a particular schema owner. So how to make the public synonyms work for each schema ?
In short, you can't. However, you can always use a distinct synonym name to identify the object.
Something similar to below:
create public synonym structures_v1 for schema1.structures;
create public synonym structures_v2 for schema2.structures;
Oracle provides 2 totally different technologies for this situation (which comes to my mind):
Editions (and Edition Based Redefinition)
PDBs
With Editions you can create the same Object once in each Edition - but there are limitations like tables are not editionable.
It's not a feature you just enable, you need to understand the concept and implement it properly.
PDBs enable consolidation of Databases with colliding namespace (such as your described synonyms) within the same CDB and therefore save SGA/memory. Basically they are totally separated - limited interference can be implemented when it's concept of object & data inheritance is understand.
What about creating a 3rd Schema and having Synonym and permission to query 1st and 2nd schema. Anyone tested this concept?
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.
Question is confusing. For most part in Oracle, you can consider LOGIN == USER == SCHEMA. When you login into your database with your user, you are able to see and access all objects in that user's schema.
Objects in other schemas (on same database server) can be accesed by SCHEMA2.TABLE1 if connected user has privileges to acces table (there are different privileges...). As already stated in some comments, you do not need to prefix table if synonym exists. Your user can access even tables on some remote server if exists appropriate database link.
We are using a SaaS provider at my company, who also offers direct read-only access to their back end Oracle database.
Our Oracle user does not own any of the tables, therefore the tables we want to read belong to other users. So the tables must be addressed as follows: OwnerUser.table1, OwnerUser.table2, etc.
When setting up a data source in LightSwitch, no tables are visible, because the Entity Data Model is mapping to tables owned by our user (the one which we connect with).
Does anyone know if I can tweak the data source somewhere to inject the owner prefix (e.g. OwnerUser) so that the LightSwitch Designer will show the tables owned by OwnerUser?
You might find that in this case it might be easier to create a custom RIA Service layer for the datasource that passes the user information and sets up the tables.