Configure schema user in Oracle R2dbc - oracle

I have two users DBOWNER & DBUSER.
DBOWNER will have right to all DDL commands and will create the tables in it.
DBUSER has CURD rights on DBOWNER tables.
From Oracle R2DBC I want to use DBUSER to perform data entry in tables inside DBOWNER.

Related

Parent(Customer) and Child(Order) entity tables are created in MySql database but can't see the records on those tables

I have created Parent(Customer) and Child(Order)entity tables in the MySql database using hibernate and I have created one customer and some orders in those tables I can see those tables data in MySQL using MySql 8.0 command-line client but can't see on the database.
Could you please help me with the query?

How to query tables and pull data into an Oracle APEX application from another schema?

I am working in an Oracle APEX application and am trying to query tables in another schema (that another Oracle APEX application sits on) to pull in data to my application.
The applications are hosted within the same APEX workspace and on the same Oracle 11g instance. Our application have tables that are structurally the same as the tables we're trying to query in the other schema.
Using the schema prefix (SELECT * FROM "SCHEMA2".TABLE1;) when querying is throwing an error that the tables do not exist (ORA-00942: table or view does not exist)
The second thing I tried is creating a database link between the two schemas, but when trying to establish the connection I'm getting the following error: ORA-01031: insufficient privileges
Can someone identify where I'm going wrong here / help me figure out how to query the other schema?
Database link is used when there are different databases involved; your schemas reside in the same database which means that the first attempt was correct: prefixing table name with its owner, e.g.
SELECT * FROM SCHEMA2.TABLE1
However, first connect as schema2 user and issue
grant select on table1 to schema1;
Otherwise, schema1 can't see the table. If schema1 is supposed to do something else with that table, you'll have to grant additional privileges, such as insert, update, delete, ....

How can I set a JBOSS data source to an Oracle database use a different schema to the one used for authentication

I have a Java webapp (WAR) that is to be run in JBOSS.
That webapp is to create connections to an Oracle database using a username/password for a user that is given read-only permissions.
The webapp queries tables belonging to a different schema. I do this by qualifying each table name in my SQL queries.
However, I would like to parameterise this in my datasource, since the schema names can be different in different environments.
Is there a way to define a JBOSS data source which logs in as User A for each connection, but uses Schema B for all queries?
One way to do it is to use the new-connection-sql or check-valid-connection-sql datasource properties to execute ALTER SESSION SET CURRENT_SCHEMA=yourschema, which will change the default schema for each connection.
Recommended way is to create synonyms in Oracle for your User A to access tables in schema owned by User B. This way you can even grant specific privileges to user A to select, update, insert on tables owned by the other UserB.

How to import oracle databse into postgres with dbLink

I have postgres database on server A & oracle database on server B.
I would like to import the data of oracle to postgres using dbLink.
I have achieved this for Postgres to Postgres database, but now I would like to do this with oracle.
So
I have achived postgres to postgres migration with following command.
SELECT realestate.address, realestate.parcel, s.sale_year, s.sale_amount,
FROM realestate INNER JOIN
dblink('dbname=dbdelv port=5432 host=someserver
user=user password=pwd',
'SELECT parcel_id, sale_year,
sale_amount FROM parcel_sales')
AS s(parcel_id char(10),sale_year int, sale_amount int)
ON realestate.parcel_id = s.parcel_id;
How can I do the same for oracle? and what will be db Link?
dblink is for PostgreSQL only, it won't be able to connect to Oracle.
But you can use something that is even simpler, oracle_fdw, which is a foreign data wrapper for Oracle.
Download the code and follow the README to compile and install oracle_fdw.
Once you have created a foreign server and a user mapping, you can create a foreign table that will look and feel just like a normal PostgreSQL table, but the data reside in Oracle. You can use it in queries with joins like the one you showed in your question.

Oracle vocabulary, what is the mysql/SQL Server equivalent of a database

I need some help with vocabulary, I don't use Oracle that often but I am familiar with MySQL and SQL Server.
I have an application I need to upgrade and migrate, and part of the procedure to do that involves exporting to an XML file, allowing the installer to create new database tables, then import to the new database tables from the XML file.
In Oracle, my database connection specifies a username, password, and an SID.
Let's call the SID, "COMPANY-APPS". This SID contains tables belonging to several applications, each of which connects with a different user ( "WIKIUSER", "BUGUSER", "TIMETRACKERUSER" ).
My question is:
Can I re-use the same user to create the new tables ( with the same names ).
In MySQL or SQL Server, I would create a new database and grant my user privileges to create tables in it.
OR, do I need to create a new database user for my upgraded tables?
The word you are looking for is Schema in Oracle. When you create a user they have a schema associated with them, so if I created the user 'Tim' and a table called 'data' then it can be found globally (in that database) as Tim.data

Resources