dblink

Cross database query using dblink

Deadly 提交于 2021-02-10 17:44:38
问题 I'd like to use dblink in postgres to copy data from a local database to a remote one. This what I came up with: SELECT * FROM dblink('archive', 'INSERT INTO data SELECT * FROM local.data') It wont work and I think I understand why. I get the error relation "local.data" does not exist , If possible, Id like to run this inside a stored procedure on the local database, in other words I want to push the data to the 'archive' server, rather than pull it to the 'archive'. How can I tell postgres

How to check if a database link is valid in Oracle?

点点圈 提交于 2021-02-07 03:29:00
问题 I have a main database with only setup data at the headquarter and several databases at different branches.I created a database link for each branch server. In some case I would like to query all the valid links (as some links could be invalid due to connection problems or anything else),so my question is How to check if the database link is valid without getting in Connection timeout problems. Is there a SQL statement to let the oracle main server do that check and return only the valid

How to check if a database link is valid in Oracle?

a 夏天 提交于 2021-02-07 03:26:31
问题 I have a main database with only setup data at the headquarter and several databases at different branches.I created a database link for each branch server. In some case I would like to query all the valid links (as some links could be invalid due to connection problems or anything else),so my question is How to check if the database link is valid without getting in Connection timeout problems. Is there a SQL statement to let the oracle main server do that check and return only the valid

oracle - commit over dblink?

南楼画角 提交于 2020-12-08 06:04:58
问题 If I connect to an oracle database as user smith, and issue the following 3 commands: update smith.tablea set col_name = 'florence' where col_id = 8; insert into bob.other_table@mylink values ('blah',2,'uncle','new'); commit; Does this mean that the update to the local table (smith.tablea) and the insert to the remote db table (bob.other_table) have both been committed or that just the update to the local table has been committed? Note: that 'mylink' represents a dblink to a remote database.

oracle - commit over dblink?

梦想与她 提交于 2020-12-08 06:03:25
问题 If I connect to an oracle database as user smith, and issue the following 3 commands: update smith.tablea set col_name = 'florence' where col_id = 8; insert into bob.other_table@mylink values ('blah',2,'uncle','new'); commit; Does this mean that the update to the local table (smith.tablea) and the insert to the remote db table (bob.other_table) have both been committed or that just the update to the local table has been committed? Note: that 'mylink' represents a dblink to a remote database.

How can I close Oracle DbLinks in JDBC with XA datasources and transactions to avoid ORA-02020 errors?

浪子不回头ぞ 提交于 2020-05-15 03:40:05
问题 I have a JDBC-based application which uses XA datasources and transactions which span multiple connections, connected to an Oracle database. The app sometimes needs to make some queries using join with a table from another (Oracle) server using a shared DbLink. The request works if I don't do it too often, but after 4 or 5 requests in rapid succession I get an error (ORA-02020 - too many links in use). I did some research, and the suggested remedy is to call "ALTER SESSION CLOSE DATABASE LINK

DB link not working in DBaaS but working in On premise Database

百般思念 提交于 2020-03-04 19:34:12
问题 I am using below command to create DB link CREATE DATABASE LINK Dblink_test2 CONNECT TO apps IDENTIFIED BY xyzabc USING '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=awss007.us.dell.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=xxxmm122de)))'; The DB link got created successfully and it is returning data when I am creating it in on premise database. But when I am doing same in my Dbaas , DB link is getting created but when I am running query I am getting below error. select * from emp@Dblink_test2

Select and Insert across dblink

主宰稳场 提交于 2020-01-13 08:43:11
问题 I am having a bit of trouble with a select into insert across a dblink in oracle 10. I am using the following statement: INSERT INTO LOCAL.TABLE_1 ( COL1, COL2) SELECT COL1, COL2 FROM REMOTE.TABLE1@dblink s WHERE COL1 IN ( SELECT COL1 FROM WORKING_TABLE) When I run the statement the following is what gets run against the remote server on the DB Link: SELECT /*+ OPAQUE_TRANSFORM */ "COL1", "COL2" FROM "REMOTE"."TABLE1" "S" If I run the select only and do not do the insert into the following is

How to link MySQL DB to Oracle DB

房东的猫 提交于 2020-01-06 03:45:11
问题 Is it possible to execute queries joining a MySQL DB table and an Oracle DB table? I previously worked on MS SQL Server and I linked external DB servers inside SQL Server instance to create procedures and views integrating different DB tables. Is something similar available on MySQL or Oracle DBMSs? 回答1: As far as I know, DG4ODBC allows you to connect with the MySQL ODBC driver from an Oracle database to the MySQL database. Since you have not mentioned the OS details, I would suggest you to

Hibernate with oracle dblink implementation

守給你的承諾、 提交于 2020-01-03 15:32:14
问题 Just new with hibernate, is there a way to implement oracle dblink on hibernate? e.g. select * from tablename@dblink to be used in hql? 回答1: Creating a SYNONYM in Oracle for tablename@dblink and configuring your Hibernate entity to map this synonym should do the trick. 来源: https://stackoverflow.com/questions/22017108/hibernate-with-oracle-dblink-implementation