dbTalk Databases Forums  

querying over multiple database links

comp.databases.oracle.server comp.databases.oracle.server


Discuss querying over multiple database links in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Krzysztof Cierpisz
 
Posts: n/a

Default querying over multiple database links - 07-05-2011 , 10:12 AM






on database remote1 is a table I want to access => table1
I have a very limited schema/user created on remote2.

remote2 has public database link to remote1, so I can access
table1@dblink_to_remote1

I have another local database db1 with database link to remote2 =>
@dblink_to_remote2

I would like to create a table from remote1 on my local db1.
I can achieve that with export/import (giving remote2 credentials).

Is there a better solution for that task?

thanks,
chris

Reply With Quote
  #2  
Old   
joel garry
 
Posts: n/a

Default Re: querying over multiple database links - 07-06-2011 , 12:35 PM






On Jul 5, 9:20*am, Krzysztof Cierpisz <ciape... (AT) gmail (DOT) com> wrote:
Quote:
On Jul 5, 6:01*pm, gazzag <justif... (AT) jamms (DOT) org> wrote:



On Jul 5, 4:01*pm, Krzysztof Cierpisz <ciape... (AT) gmail (DOT) com> wrote:

on database remote1 is a table I want to access => table1
I have a very limited schema/user created on remote2.

remote2 has public database link to remote1, so I can access
table1@dblink_to_remote1

I have another local database db1 with database link to remote2 =
@dblink_to_remote2

I would like to create a table from remote1 on my local db1.
I can achieve that with export/import *(giving remote2 credentials)..

Is there a better solution for that task?

thanks,
chris

CREATE TABLE <table_name
AS SELECT * FROM <table_name>@<remote_database>;

HTH
-g

the table is not on <remote_database> -> I have no direct access to
remote_database
I have only indirect access over a db_link from "another" database to
remote_database>. I have a very limited access on this "another"
database so I cannot create any objects there.
It's been too long since I've done this, but I think what you want to
do is desc <yourpublicsynonym>@<remove_database2> (or select * from
user_db_links@<remote_database2>, then if you can see that, you have
to make some bizarro usage with quotes and @ signs like desc
'table_name@<remote_database>'@<remote_database2>

But there is some other consideration I can't remember, you have to
very carefully follow the syntax for dblinks. Something about the
definition of the @ sign varies depending on its position in the
redirect string. If I even got your dblinks straight.

I know I did something like this back in the 7.3/8.x days, but not
without object creation access to the middle db. Performance is
likely to be bad.

jg
--
@home.com is bogus.
http://www.signonsandiego.com/news/2...ors-out-of-1m/

Reply With Quote
  #3  
Old   
Krzysztof Cierpisz
 
Posts: n/a

Default Re: querying over multiple database links - 07-06-2011 , 03:01 PM



On Jul 6, 7:35*pm, joel garry <joel-ga... (AT) home (DOT) com> wrote:

Quote:
It's been too long since I've done this, but I think what you want to
do is desc <yourpublicsynonym>@<remove_database2> (or select * from
user_db_links@<remote_database2>, then if you can see that, you have
to make some bizarro usage with quotes and @ signs like desc
'table_name@<remote_database>'@<remote_database2
I tried but cannot get it working, I googled but cannot find anything.
Are you sure it's possible?

--
chris

Reply With Quote
  #4  
Old   
joel garry
 
Posts: n/a

Default Re: querying over multiple database links - 07-06-2011 , 04:37 PM



On Jul 6, 1:01*pm, Krzysztof Cierpisz <ciape... (AT) gmail (DOT) com> wrote:
Quote:
On Jul 6, 7:35*pm, joel garry <joel-ga... (AT) home (DOT) com> wrote:

It's been too long since I've done this, but I think what you want to
do is desc <yourpublicsynonym>@<remove_database2> (or select * from
user_db_links@<remote_database2>, then if you can see that, you have
to make some bizarro usage with quotes and @ signs like desc
'table_name@<remote_database>'@<remote_database2

I tried but cannot get it working, I googled but cannot find anything.
Are you sure it's possible?

--
chris
Not sure, I'd have to play with it, don't have time. But it should
be. What versions did you say?

jg
--
@home.com is bogus.
http://www.wired.com/dangerroom/2011...aring-warship/

Reply With Quote
  #5  
Old   
Krzysztof Cierpisz
 
Posts: n/a

Default Re: querying over multiple database links - 07-07-2011 , 03:07 AM



On Jul 6, 11:37*pm, joel garry <joel-ga... (AT) home (DOT) com> wrote:
Quote:
On Jul 6, 1:01*pm, Krzysztof Cierpisz <ciape... (AT) gmail (DOT) com> wrote:

On Jul 6, 7:35*pm, joel garry <joel-ga... (AT) home (DOT) com> wrote:

It's been too long since I've done this, but I think what you want to
do is desc <yourpublicsynonym>@<remove_database2> (or select * from
user_db_links@<remote_database2>, then if you can see that, you have
to make some bizarro usage with quotes and @ signs like desc
'table_name@<remote_database>'@<remote_database2

I tried but cannot get it working, I googled but cannot find anything.
Are you sure it's possible?

--
chris

Not sure, I'd have to play with it, don't have time. *But it should
be. *What versions did you say?

jg
--
@home.com is bogus.http://www.wired.com/dangerroom/2011...-to-go-around-...
I am on 11g

--
chris

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.