Select in N banks

Dúvidas, dicas e truques de SQL, Select, Update, Delete, cláusulas, operações com joins, Funções em SQLs, etc
  

Poston Tue, 15 Nov 2005 9:07 am

Guys, good morning.

I wonder if, in Oracle, there is a way, a same session, I will give a select in another bank, as for example, in SQL Server.

Example: I'm logged in as Paul in the Bank.

I would like to give a select of type: select bancoB. field from table thank you very much.

Hug, Paulo Cheezburger Network
Trevisolli
Location: Araraquara - SP

Poston Tue, 15 Nov 2005 8:56 pm

Hello cheezburger network you can create a DB LINK between banks. To do this, you must have the CREATE privilege DB LINK. Then you create this way: for example, below I am connected on the test bench. Then I give the following command to create a dblink to the production database:
Code: Select all
create database link NOME_DO_DBLINK
connect to USER_DO_BANCO_QUENTE identified by SENHA_DO_BANCO_QUENTE
using 'NOME_DO_BANCO_QUENTE';
of course, before that, you have to check if the TNSNAMES.Proução Server NOW has a reference to the test bench.

From there, it's just you do a select thus:
Code: Select all
SELECT x.* FROM TABELA@NOME_DO_DBLINK x
WHERE etc.etc.etc...
of course, what I quoted above is not at all secure. (type this way, anyone testing base will have access to production base. Normally, if you do the opposite. That is, create a dblink production base aiming at base of tests).

Another thing you should not do for security issues is to create a public database link . In other words, anyone can have access to this bank.


:-o
dr_gori
Location: Portland, OR USA

Thomas F. G

Você já respondeu a dúvida de alguém hoje?
http://glufke.net/oracle/search.php?search_id=unanswered



Return to SQL

Who is online

Users browsing this forum: No registered users and 7 guests