Copy table from On premises SQL server to AWS RDS - sql-server

I need to copy a SQL server table from an on prem DB to AWS RDS(sql server). I'm trying to think of the simplest way to do that. I was thinking of using a link server to access AWS sql from the on prem DB but not sure how to create one. Or should I go with other option like SSIS or bulk copy.

Fortunately, there are various ways of doing this on prem to RDS migration!
Linked Servers can be used for only EC2 SQL Server instance to RDS SQL Server instance for now I think. The detailed information is here: https://aws.amazon.com/blogs/database/implement-linked-servers-with-amazon-rds-for-microsoft-sql-server/
DMS can be used to migrate from on prem to RDS:
https://aws.amazon.com/blogs/database/introducing-ongoing-replication-from-amazon-rds-for-sql-server-using-aws-database-migration-service/
Another solution is to do a periodic native SQL Server backup from on prem and restore the db onto SQL Server instances: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/SQLServer.Procedural.Importing.html
Or you can migrate by using transaction logs: https://aws.amazon.com/blogs/database/how-to-migrate-to-amazon-rds-for-sql-server-using-transactional-replication/

Related

Online replication/Mirroring/Migrating Oracle and SQL Server Database to Azure

I am trying to replicate the source database (Oracle 11g and MS SQL Server 201x) to Azure SQL Database. Initially I thought of using Azure DMS(Database Migration Service) to do a full load + Change Data Capture for changes. After started to work on this, I learnt that the DMS requires Control Server privileges on the SQL Server Database and DBA Role on Oracle. We might not get these permissions on the source databases as they are managed by third party company (SaaS model). However, we have read permissions on the source database/tables.
We have to achieve the following :
Replicate data from Oracle Source System to Azure SQL Database and
Replicate data from SQL Server 201x to Azure SQL Database.
What should be the approach?
Azure SQL Data Sync? I read on the forum that it actually writes/creates tables in the source database. This won't be acceptable.
Transactional replication for SQL Server? - Has any one tried? Can you please share your experience?
Third option I thought was to use Attunity Replicate (however, not sure about the licensing costs)
Can someone please help with approaching this business problem?
Regards,
JE
You said, you have read permissions on the source database/tables(Oracle and SQL Server). I suppose that you just have the read-only permission.
Then the answer is no, we can not copy the data or migrate the database(Oracle and SQL Server) to Azure SQL database without the CONTROL SERVER permission.
Data sync can help you sync the data from SQL server to Azure SQL database, but you need have permission to Azure SQL too. Create the table with same schema and so.
If you don't the permission on SQL server, the Transactional replication also doesn't work.
For Attunity Replicate, I don't know much it, sorry that I can't answer you.
For your questions:
1.Replicate data from Oracle Source System to Azure SQL Database
Please reference this Azure Database Migration Guide: Migrate Oracle to Azure SQL Database.
This scenario describes how to migrate an Oracle instance to Azure SQL Database.
2.Replicate data from SQL Server 201x to Azure SQL Database.
Reference: Azure Database Migration Guide:Migrate SQL Server to Azure SQL Database.
This scenario describes how to migrate a SQL Server instance to Azure SQL Database.
We also could use bellow way to migrate the database with SSMS:
Create a dacpac file and import to Azure SQL.
SSMS Deploy database to Microsof Azure SQL database.
For details, please see: Learn how to Migrate a SQL Server database to SQL Azure server.
Hope this helps.

Azure SQL Management instance - restore db different version

Actually we have Azure SQL Management instance I got a backup but I cannot restore our VM SQL Server owing this has a SQL Server version less SQL Azure (Azure Team updated SQL Server a couples week ago), so We cannot update QA Server to last SQL Server Version and we need to recovery the backup a soon a possible.
Do you know any way to recover this backup from SQL Azure to this server getting a less version?
Thank you!
You can also use bcp to export the data from Azure SQL Database and then use bcp again or Import/Export Wizard or SSIS to import the data on the SQL Server VM.
You can use Azure Data Factory (ADF) to export tables to your SQL Server VM. ADF will create those tables and copy the data.

Read Oracle database from Azure Elastic Database Job

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.

Azure SQL get data from another non-Azure sql server using Linked Server

We have two SQL Server Database (EG: DB1 & DB2) that are hosted in NON-Azure environment (dedicated server). We are planning to migrate DB1 to Azure SQL.
Is there way the Azure SQL DB1 can talk to non-azure DB2 using Linked Server approach? I want to query in my Azure SQL (DB1) and get the data of DB2.
If I understand correctly you are trying to connect your Azure-db (DB1) from an on-premise db (DB2). From on-premises SQL Server, you can use linked servers and 4-part names to point to a database in Azure SQL DB using a datasource which would look like this -
[YourAzureServerName#database.windows.net].[YourDatabaseName].[YourSchemaName].[YourTableName]
For more details please check this link.
Yes you can certainly do that.
This atricle explains all the details that you need to do to accomplish that:
https://www.mssqltips.com/sqlservertip/3630/connect-an-azure-sql-database-to-an-onpremises-sql-server/
Note that your SQL Azure instance needs to be in "Standard" service tier to be able to do that.
If you want to add your SQL Azure server as a linked server to your on-prem SQL you can use ODBC connection.
Bellow MSDN article will help you with that:
https://blogs.msdn.microsoft.com/sqlcat/2011/03/07/linked-servers-to-sql-azure/

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.

Resources