Dump ERP queries in informix - sql

We have a closed source application here, that connect to an informix database ( using odbc )
is there any way I can see the queries being executed by this application?

Turn on ODBC tracing. Some information can be found here.

Multiple possibilities :
those give all the statements
like mentioned above odbc tracing.
set explain on as pre sql (generates huge files with the sqls and query plans).
those the current running statements.
using onstat commands on the server running the database (onstat -g sql ).
connecting to the monitoring database (sysmonitor) and querying the session tables .

Related

How to copy one table data to another one between two Azure databases on the same server

I want to copy data from one database table into another database table on the same server in Azure SQL. I have done all of the Azure SQL Cross Database Query' steps that are written here https://www.mssqltips.com/sqlservertip/6445/azure-sql-cross-database-query/but still get the same error whenever I execute a query
'Reference to database and/or server name in 'db name' is not supported in this version of SQL Server.'
Can you pls help to figure out this?
Azure SQL database doesn't support across query directly.
We can not use USE statements and it not supported. That's why you get the error. We can not run statements like select * from [other_database].[schema].[table].
In Azure SQL database, only elastic query overview (preview) can achieve cross database query:
The elastic query feature (in preview) enables you to run a
Transact-SQL query that spans multiple databases in Azure SQL
Database. It allows you to perform cross-database queries to access
remote tables, and to connect Microsoft and third-party tools (Excel,
Power BI, Tableau, etc.) to query across data tiers with multiple
databases.
You could follow the tutorial and it may be more complex than on-premise SQL Server:
Get started with cross-database queries (vertical partitioning) (preview)

How to compare the data between two query results from SQL Server and DB2

As part of a migration project I need to test the data in the source database (in SQL Server) with the target database (in DB2).
Some of the columns from the source are mapped to the target tables. The source database has millions of rows and I need to confirm the data is properly migrated.
How can I compare the data resulting from SQL queries on both the source and target databases?
Please provide some solution.
In MS SQL Server you can link to DB2 using the Linked Server feature, then you can execute some queries against both servers or even joining them in a same query. Be aware of the cost (network, disks, memory...). You will have to perform some performance tests.
See how to link the servers:
Creating a linked server to DB2 using Microsoft OLE DB provider for DB2
As #Caffe said, you can link both databases. From DB2 you can do that by Federation. However, this option is not included in the basic installation, and you should use Information Integration (that is not the last name, it changed recently).

Run SQL script on multiple DB connections at same time in Oracle SQL Developer

I have 4 different database connections in Oracle SQL Developer. All of them have the exact same set of packages and procedures. Every time I change something in my scripts I have to run it on all of the connections one-by-one. Is there no way to run it on all the connections at the same time?
I'm afraid that you can only execute SQL developer queries on different connections using the GUI.
You should, however, be able to acheive what you want using SQLPlus instead.
You can use "create database link" function:
CREATE DATABASE LINK linkDB_1
CONNECT TO xxxx IDENTIFIED BY xxxx
USING 'xxxxx';
SELECT *
FROM tablename#linkDB_1;
DROP DATABASE LINK linkdb_1;
I tested on my SQL Navigator, and it works.

mysql query listener

Do you know a tool that i will be able to see what queries where run against the database .
Thanks for help
You can use the built in MySql Query Profiler.
The new profiler became available in the 5.0.37 version of the MySQL Community Server
And:
To begin profiling one or more SQL queries, simply issue the following command:
mysql> set profiling=1;
Query OK, 0 rows affected (0.00 sec)
Two things happen once you issue this command. First, any query you issue from this point on will be traced by the server with various performance diagnostics being created and attached to each distinct query. Second, a memory table named profiling is created in the INFORMATION_SCHEMA database for your particular session (not viewable by any other MySQL session) that stores all the SQL diagnostic results. This table remains persistent until you disconnect from MySQL at which point it is destroyed.

How can I post updates (commits) in oracle db to SQL Server 2005

We have an application (BaaN) on Oracle Database.
We also have an application that is on SQL Server 2005 which uses Oracle (BaaN) contents.
Currently we cache all contents of the Oracle DB to SQL Server nightly through linked server from SQL Server to Oracle.
Thought of using a trigger on Oracle db tables to write contents to Oracle table (DeltaCommits) as the commits occur, and then periodically look for entries in DeltaCommits from SQL Server using a scheduled job.
Or can you please suggest a better way to accomplish this ..
Thanks
It's possible to use replication to transfer data between Oracle and SQL server.
This guide looks like a useful starting point which may help you to decide whether this is a route you want to consider.