Questions tagged [dblink]

An object or module that enables access to a remote database.

In Oracle a database link is a schema-level object that enables users to access objects on a remote database. It is possible to create a database link to access a non-Oracle database.

In PostgreSQL dblink is a module, which enables connections to other PostgreSQL databases, from within a session.

Questions tagged should also be tagged with the appropriate RDBMS.

523 questions
2
votes
3 answers

Scheduling a job in oracle to drop and create table

I am trying to DROP and CREATE a table using a scheduled job. How to do it please? DROP TABLE REGISTRATION; CREATE TABLE REGISTRATION AS SELECT * FROM REGISTRATION_MV@D3PROD_KMDW
FatherofFaris
  • 41
  • 1
  • 5
2
votes
1 answer

How do I use a dblink?

I'm a user on two databases, database1 and database2. In database1, there is a public dblink OWNER: PUBLIC DB_LINK: DBLINKNAME USERNAME: CURRENT_USER HOST: DATABASE2 CREATED:... What is the syntax for using this dblink to do a select on…
dwjohnston
  • 11,163
  • 32
  • 99
  • 194
2
votes
0 answers

mysql and oracle issue using dblink

My issue is between mysql and oracle communication: Step 1 (Creating a view in mysql for corresponding table) E.g: CREATE VIEW piwik_log_link_view ( idvis, cusk ) AS SELECT CAST( CONV( HEX( idvisitor ), 16, 10 ) AS CHAR(1000) ) ,…
user3112954
  • 155
  • 1
  • 2
  • 7
2
votes
1 answer

Is it possible to access a DB link through a DB link

I have 3 databases A, B, C. I can only access DB A and really want to avoid creating objects there like views, synonyms, etc. I can't create objects on B or C. I have a DB link A -> B and a DB link B -> C. User and password are the same for all…
Armunin
  • 986
  • 7
  • 18
2
votes
1 answer

When does a database link connection is established?

I have a DB link between 2 Oracle databases, and I have a procedure which in some cases it can query the remote database. Now the docs say that a connection is opened per session when it appears in an SP, and my question is will it establish the…
eric.itzhak
  • 15,752
  • 26
  • 89
  • 142
2
votes
1 answer

Avoiding distributed transaction with db link

I am working at a Spring Java EE application that has to deal with two different datasources, A and B. As the application needs to update A and B in a consistent way. If one update fails, the whole process fails and a rollback must take place. I…
Ameba Spugnosa
  • 1,204
  • 2
  • 11
  • 25
2
votes
1 answer

Accessing cursor over db link in Oracle

I have to write a stored procedure which invokes a remote procedure via db link. This procedure returns a cursor. When I try to iterate over this cursor I get ORA-01001: invalid cursor Error. I read on some forums that simply it's not allowed to…
czajek
  • 714
  • 1
  • 9
  • 23
2
votes
0 answers

Procedure hangs querying tables in dblink

I'm trying to call a procedure from a shell script, that procedure makes a massive insert into my database with data of a remote database. So, what i'm doing here is querying tables through a dblink and inserting that information in my local…
joeygs
  • 83
  • 5
2
votes
1 answer

Improving performance of CLOB insert across a DBLINK in Oracle

I am seeing poor performance in Oracle (11g) when trying to copy CLOBs from one database to another. I have tried several things, but haven't been able to improve this. The CLOBs are used for gathering report data. This can be quite large on a…
Brent.Billups
  • 21
  • 1
  • 3
2
votes
1 answer

Insert data from remote table takes too long to finish

When i execute this query Select * from remote_tabe@my_db_Link where Update_Date >= to_Date( sysdate - 1/24 ) it returns around 4000 rows by 30 secs but when i execute the insert statement Insert into my_table select * from…
Maen
  • 21
  • 1
1
vote
2 answers

Sync transactions between databases in PostgreSQL using dblink

I would like to sync a set of tables between two databases, transparently without application code chages. My idea is to create triggers on insert, update and delete, in the source database tables to replicate the data using dblink to the dest.…
Gonçalo Marrafa
  • 2,013
  • 4
  • 27
  • 34
1
vote
1 answer

Pushing records produced by dblink out of the calling stored procedure

Is it possible to simply pass the resulting records generated by dblink() up, as a result of the calling function, something like: create function execute_generic_sql_on_remote_databases(_sql text) return set of record language plpgsql as…
valgog
  • 2,738
  • 1
  • 20
  • 16
1
vote
1 answer

Nested loop in query over dblink (Oracle 11g)

I have a SQL query of the form SELECT ... FROM A@DB1 a, B@DB1 b, C@DB2 c WHERE A.x = B.x and B.y = C.y where the first two tables are dblinks to one database, and the last is on a second database. No local tables are accessed. Explain Plan is…
wrschneider
  • 17,913
  • 16
  • 96
  • 176
1
vote
1 answer

Can you create dblink for the same database you are connected?

I know this is kind of weird but I would just like to know how this was being setup. There are two database and they are the same (one is mirror from the other). The first db is named "reportsdw" and the other one is "reportsdwx". I tried to…
mysticfalls
  • 445
  • 5
  • 17
  • 28
1
vote
1 answer

How to create a table from remote database using dblink

How to create a table from remote database using dblink create table MYTABLE@DBLINK (name varchar2(20))); *Cause: An attempt was made to use a DDL operation on a remote database. For example, "CREATE TABLE tablename@remotedbname ...". *Action: …
coder11 b
  • 99
  • 5