what is difference between MaterializedPostgreSQL Engine and PostgreSQL Engine in Clickhouse? - clickhouse

why we need this? since the docs say:
MaterializedPostgreSQL
Creates a ClickHouse database with tables from PostgreSQL database.
PostgreSQL
Allows to connect to databases on a remote PostgreSQL server.
I cannot see clearly the difference between them?
when to use each other?

MaterializedPostgreSQL will use replication slots and will physically replicate data from PostgreSQL to ClickHouse
PostgreSQL it's just a proxy table engine.
When you try SELECT FROM postgreqsql_table_engine then your clickhouse query will rewrite. GROUP BY, ORDER BY and HAVING BY sections will remove and query just proxy to remote PostgreSQL server, after it GROUP BY ORDER BY and HAVING BY clause will apply on clickhouse side.

Related

Accessing SAP Pool Table A016 from Sql Developer

We have two divisions in our company, one uses E1 on Oracle 11g the other uses SAP on Oracle 11g.
We also have a SQL Server system we use to data warehouse information once a night from both system to run our report server against.
The question I have is for pooled tables in SAP, such as A016, how would I get that information out of SAP?
Currently we have SSIS's setup with a linked server to the two Oracle servers which pull the data we need I just don't have the knowledge of SAP to find the Pooled tables.
if I can't pull the pooled tables because they don't physically exist is there a tool I can use in SAP to find out what tables the pooled table is getting it's information from? This way I can rebuild that table in SQL using a open query and some fun Joins.
Thanks
You have to access those tables using the application server. They can't be accessed directly from the database.
You'll probably want to write an ABAP program to extract the data you need go from there.

connect PostgreSql to Oracle live

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.

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.

SQL support cache with fallback to a database

Is there any product which can be queries using JDBC (normal SQL), it sees whether all the tables in the query are in CACHED tables, and use the cache, otherwise fallback to the back-end database.
I am aware of two products: Oracle In Memory Database (IMDB) Cache, and VMware SQLFire.
I'm not familiar with none of them, so I want to know is it possible to query IMDB cache on non-cached tables, so it falls-back to underlying database?
Is there any other products which support this feature?
With 11g you can use the JDBC OCI Client Result Cache:
Client result cache feature enables client-side caching of SQL query
result sets in client memory. In this way, OCI applications can use
client memory to take advantage of the client result cache to improve
response times of repetitive queries.
Note that the CACHE clause doesn't mean what the name implies:
For data that is accessed frequently, this clause indicates that the
blocks retrieved for this table are placed at the most recently used
end of the least recently used (LRU) list in the buffer cache when a
full table scan is performed. This attribute is useful for small
lookup tables.
Oracle In Memory Database (IMDB) Cache does support the feature that you ask about.
If the SQL statement that you use refers to IMDB cache tables, then the cache will be used. If the SQL statements that you use refers to non cache tables, then the Oracle database will be accessed.
IMDB Cache uses SQL or PLSQL to do read and/or write caching to Oracle databases.
You can use JDBC [or ODBC, OCI, ODP.Net, Node.js, Python, Go, Ruby etc] to talk to either an Oracle database or the IMDB Cache.
IMDB Cache also works with object relational mapping technologies such as Hibernate [eg JPA] for data access.
IMDB Cache uses the Oracle TimesTen In-Memory Database and is now called 'Oracle Application Tier Database Cache'.
I am a product manager for Oracle TimesTen.

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