Read Oracle database from Azure Elastic Database Job - sql-server

In onprem SQL Server you could add a remote database server such as Oracle as a Linked Server, and use in a SQL Server Job Agent job.
Is this possible in Azure SQL Database using Elastic Database Jobs? How?

On Azure SQL Database (PaaS) a concept like a linked server does not exist, however on Azure Managed Instance (PaaS) you can have linked servers but they support limited number of targets. Supported targets: SQL Server and Azure SQL Database. Not supported targets: files, Analysis Services, and other RDBMS (including Oracle).
You may want to consider creating a SQL Server VM on Azure (IaaS) or using Azure Data Factory.

Related

Is it possible to query the Active Directory from Azure SQL

I am migrating from an older version of Microsoft SQL to Azure SQL. The existing SQL Server stored procedures use OPENQUERY and a linked ADSI server to retrieve user information directly from the Active Directory.
Is this possible in Azure SQL?
Azure SQL Database only allows to query another Azure SQL Database (remote) or Azure Synapse Analytics databases using elastic queries. All other SQL and non-SQL sources are not allowed.
Azure Managed Instance uses a private VNET and supports linked servers to a limited number of targets. Supported targets: SQL Server and SQL Database. Not supported targets: Active Directory, files, Excel, Oracle, MySQL, Analysis Services, and other RDBMS.
Azure SQL Database would have no way to communicate with your on-premises servers since it does not uses private VNETs as Managed Instance does.
If you rely heavily on this you should discard all Azure SQL (PaaS) options and go for a SQL Server Azure VM.

How to query on-premises SQL Server database from Azure SQL database?

I'm trying to query an on-premises SQL Server database from an Azure SQL database. I understand that the elastic query feature allows you to query across multiple databases in Azure SQL Database. But, it doesn't work with querying an on-premises database. Is there any way to do this?
Elastic database queries work between Azure SQL Databases and to query Azure SQL Data Warehouse only. From an architecture point of view on the scenario you describe, Azure would be relying on a server outside of its infrastructure to satisfy a query, if elastic queries were allowing creating external data sources to on-premises SQL Server instances. A better architecture may be replicating the on-premises database to a hub database on Azure SQL using SQL Data Sync and then create elastic queries using that hub database. Even from a performance point of view makes more sense, since queries won't be executing against your on-premises databases and latency will be less a factor.
Another option you have is to consider using Azure Managed Instance with allows you to create Linked Servers that can connect to on-premises databases as you can read here. Azure Managed Instance supports running on a private VNet, from which it's reasonable to connect to on-premises SQL Server instances. Azure SQL Database would have no way to communicate with your on-premises servers.

Any options to connect from Azure SQL Server database to an Azure Data Warehouse instance

We want to be able to query the Data Warehouse database from the SQL Server database both with the same server name in Azure. Select statements including the database name (e.g. select * from server.dbo.product) returns with error that a reference to the database and/or server name isn't supported in this version of SQL Server. There are articles on creating an external data source in the SQL Server database but we get error that the credentials don't have permission to perform this action.
Azure SQL (as of Azure SQL V12 in late-2016) does not support cross-database queries the same way that they do with a normal on-premises SQL Server (e.g. using the DatabaseName.schemaName.TableName syntax).
Given that Azure SQL and Azure Data Warehouse databases each reside in different physical servers it wouldn't work anyway, as the above syntax is intended for databases that all reside in the same server.
Azure SQL does support cross-database calls via the EXTERNAL DATA SOURCE feature, which we have in normal on-premises SQL Server already. This is documented here: https://azure.microsoft.com/en-us/blog/querying-remote-databases-in-azure-sql-db/
Note that performance won't be that great and you might be better-off doing the querying in your application code. For example complex JOINs which reduce data will run suboptimally.

What is best practise to migrate On-premises SQL Server to Azure VM - Dynamic SQL Agent Jobs in AlwaysOn offering

I am trying to migrate On-premises SQL Server to Azure VM.
I am writing in reference to below link
https://azure.microsoft.com/en-in/documentation/articles/virtual-machines-migrate-onpremises-database/#azure-vm-deployment-wizard-tutorial
I am having multiple applications in which few are hosted in Azure and few are On-premises.
All these applications contact on-premise SQL Server for data manipulations.
In some scenario these applications creates dynamic SQL Agent Jobs!
Now my requirement is to move on-premise SQL Server to Azure cloud. I would like to know how can I manage these dynamic SQL Agents in Azure?
In short, My question is: how can I migrate below items?
SSIS packages associated with these databases
SQL Agent Jobs scheduled in server (created dynamically)
File Stream associated with server databases
Also I am planning to use SQL Server "AlwaysOn" offering. So how to synch these SQL Agent Jobs in these shared Virtual Machines?
I was referring https://azure.microsoft.com/en-us/documentation/articles/sql-database-general-limitations/ and it says as follow
Microsoft Azure SQL Database does not support SQL Server Agent or
jobs. You can, however, run SQL Server Agent on your on-premises SQL
Server and connect to Microsoft Azure SQL Database.
SQL Agents can be dynamically created as shown here https://www.mssqltips.com/sqlservertip/3052/simple-way-to-create-a-sql-server-job-using-tsql/ My question is, will these stored procedures run in azure cloud?
Update
It’s challenge but can be done. We need to setup new Job, which constantly monitors and pull the current role of the replica, based on PRIMARY role, we run the job needs to do if it is the primary.
Below link gives me hint
https://dba.stackexchange.com/questions/45137/sql-server-agent-jobs-and-availability-groups but I am looking for step by step blog/article to achieve this.

Do you need to migrate SQL server 2008 to Azure SQL?

I am currently learning Azure. In terms of data store, I see Azure SQL and the migration tool. If you have SQL server 2008 or Oracle, would you be required to migrate in order to use Azure?
I know you can access/query the Azure datastore via web browser or azure tools. Is there anything equivalent to working locally (or setting up local azure sql db)?
Azure is a platform with various components. you can opt to migrate your database to Azure SQL Database, run a Azure VM with either Oracle or SQL Server, or retain your current databases on-premise and make use of VPNs to connect your on-premise databases and your Azure-based application.
There is no emulator for Azure SQL Database. for local development, you can point it to as SQL Express, LocalDB or SQL Server.

Resources