I want to make a query to two different data databases in ORACLE.
What I tried so far is:
select *
from puigmal_admin.dba.rf_md_sectors C
left join puigmal_cad_admin.dba.a3tsec5_plp A on A.cadena = C.codi_sect;
I want to make a query to two different data databases in ORACLE.
What I tried so far is:
select *
from puigmal_admin.dba.rf_md_sectors C
left join puigmal_cad_admin.dba.a3tsec5_plp A on A.cadena = C.codi_sect;
What do you call a "database"? I'm asking because people - whose background is not Oracle - tend to mix oracle "users" (schemas) with "databases".
If tables involved in query belong to users that reside in the same database, it is enough to grant (select) privilege from one user to another.
connect scott/tiger
grant select on emp to mike;
connect mike/lion
select d.dname, e.ename
from dept d join scott.emp e on e.deptno = d.deptno
^^^^^^^^^
this is a table that belongs to SCOTT who granted you SELECT privilege
If they belong to users that reside in different databases, then you need a database link.
connect mike/lion
create database link dbl_scott
connect to scott
identified by tiger
using 'orcl';
select d.dname, e.ename
from dept d join emp@dbl_scott e on e.deptno = d.deptno;
^^^^^^^^^^^^^
this is a table you're accessing over the database link
users that reside in different databases? Coz as far as i know users and databases are same in Oracle. Is there something else also?