connect PostgreSql to Oracle live - oracle

I have a PostgreSql database and I need to connect it to read data from oracle view and store that data in custom table
The PostgreSql database will connect to oracle everyday automatically to read the latest updates from oracle view
How to create it?

It sounds like you probably want a SQL/MED foreign data wrapper. Check out oracle_fdw. You could also use the generic odbc_fdw or jdbc_fdw wrappers via Oracle's ODBC or JDBC drivers.
Another option is DBI-Link.
Combine these with a cron job if you want to copy to a local view.

Related

How to migrate(convert) database(or just tables) from PostgreSQL to Oracle using only Oracle tools?

Data was sent to our company with PostgreSQL, but we are prohibited to use the tools of PostgreSQL , permitted the use of only Oracle.
How to migrate data from PostgreSQL to Oracle without using a third party application(they are also prohibited)? You can only use the tools of Oracle.
I found this article https://support.oracle.com/knowledge/Oracle%20Database%20Products/2220826_1.html but we don't have Support Identifier
We have one .sql file. It weighs 8 Gigabytes.
It looks like you have so many impediments in your company. Regarding Oracle's SQL Developer Migration Workbench, unfortunately it does not support the migration of PostgreSQL databases. However, the following 3rd-party software tools are available and may assist in migration, but I am afraid you cannot use them as you said that those products are forbidden:
http://www.easyfrom.net/download/?gclid=CNPntY36vsQCFUoqjgodHnsA0w#.VRBHKGPVuRQ
http://www.sqlines.com/postgresql-to-oracle
Other options will only move the data from your Postgresql database to Oracle database, it means that you must have the DDLs of the tables before to run the import:
To move data only, you can generate a flat file of the the
PostgreSQL data and use Oracle SQL*Loader.
Another option to migrate data only is to use Oracle Database
Gateway for ODBC which requires an ODBC driver to connect to the
PostreSQL database, and copy each table over the network using
sqlplus "COPY" or "CREATE TABLE AS SELECT" commands via oracle
database link.
Also, Oracle has discussion forum for migrating non-oracle databases to Oracle.
http://www.oracle.com/technetwork/database/migration/third-party-093040.html
But, if you have only a sql file, you should look at it to see whether you have both DDLs ( create tables and indexes, etc ) and the data itself as insert statements. If so, you need to split it and treat the DDLs to convert the original data types to Oracle datatypes.

Can I use a dblink connecting DB2 and Oracle be used for DML operations on DB2?

I have a database link that connects a DB2 database and an ORACLE database. My prime intention is to migrate data from the source (DB2) to the target (ORACLE). Now, after the migration, the discrepant records on my target needs to be sent back to the source for further actions. Can this be done using the same DBLINK??
Of course you can do that, unless you want to insert, update, delete data in an readonly object. But take care at the types differences between tve two (https://docs.oracle.com/cd/E39885_01/doc.40/e18460/oracle_db2_compared.htm#RPTID114).
You could also federate Db2 to Oracle and pull the data back again...
https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.data.fluidquery.doc/topics/tlsorc01.html

How to migrate from DB2 or Oracle to TiDB?

I want to try TiDB and I am working on data migration. Is there any way of migrating data from DB2 or Oracle to TiDB?
If using OGG to sync data to TiDB, you should set global tidb_constraint_check_in_place = 1 to disable the lazy-constraint-check in TiDB.
To migrate all the data or migrate incrementally from DB2 or Oracle to TiDB, you can use one of the following solutions:
Use the official migration tool of Oracle, such as OGG, Gateway, CDC (Change Data Capture).
Develop a program for importing and exporting data.
Export Spool as text file, and import data using Load infile.
Use a third-party data migration tool.
Currently, it is recommended to use OGG.
Oracle SQL Developer will capture and convert your LUW DB2 database and create it in an existing Oracle Database as new schema(s). It will move the data for you too.
Here's where you can go to learn more

Transfer data from an ORACLE View to greenplum DB table

I have an Oracle view containing very large amount of data in it and I want to migrate this data in a table in Greenplum database. Is there any way I can write any query in Postgresql to fetch that Oracle view's data?
If not possible by query in Postgresql, kindly suggest me some way to access Oracle view from Linux server, so that I can create data file from that Oracle view to my Linux server and load that file via gpfdist to a Greenplum table.
NOTE: an Oracle view is from third party, I only have an access to view that data (I have all the connection info) I can access that view via SQL Developer
NOTE: Exporting data from SQL Developer to my local machine is not feasible here as the data is very large
Thanks,
Sunny
The last time I used Greenplum (3 years ago) I don't think there were any untrusted languages like plperlu, so fetching directly from Oracle from within Greenplum might not be possible. If the data has a primary key, are you able to fetch in batches, compress it, then ship it to Greenplum?
Do you have a Greenplum support contract? If so, you could also try them if you haven't already: https://sso.emc.com/sso/login.htm
I recall that gpfdist can be configured to fetch from remote servers with a bit of fiddling, so if you are able to copy out the Oracle data to disk, you could fetch it using gpfdist without any intermediary steps.

cannot query SQL Server system tables over db link created using DG4MSQL

I am trying to create db link from Oracle 11g to SQL Server 2005 using DG4MSQL gateway.
After creating db link I am not able to query SQL Server system views (sys.services or sys.objects) using JDBC driver, but I am able to query all user tables using JDBC driver.
If I use sqlplus, I am able to query all tables including system tables. Since my project is Java project, I am bound to use JDBC driver.
One more observation I made is that, if I use DG4ODBC instead of DG4MSQL gateway, then I am able to query all SQL Server tables including system tables using JDBC driver.
Please let me know if there are any ways I can query SQL Server system tables using DG4MSQL and JDBC driver?
this one is a little bit tricky to explain
An Oracle Gateway performs 3 types of operations:
SQL translations (when you query regular tables, views etc)
Data Dictionary translations (when you query system views)
Data Type transformations (for example Microsoft's date to Oracle's date)
In case of JDBC, the JDBC-ODBC bridge makes the JDBC driver perfectly compatible with the drivers included in DG4ODBC. Therefore, JDBC plus DG4ODBC allows you to perform all the transformations above.
The problem is that DG4MSQL uses a proprietary driver and only SQL translations can be bridged to JDBC.
As a solution to your issue, you could try to create local views on your Oracle schema, based on the remote SQL server system views. Depending on your requirements, you can even create them as materialized views.
CREATE OR REPLACE VIEW sys_services
AS SELECT *
FROM sys.services#dblink;
and then query sys_services instead of directly querying sys.services#dblink

Resources