Replication - Is it possible to publish to different servers? - sql-server

I use mssqlserver08 with ssms, and want to publish tables to two different servers.
One server is used to run my application, the other is used to backup data, and the tables' schema are the same.
1.Is it possible to publish same tables to different servers?
2.Is there any better way to backup data Immediately?

Related

Copying tables from databases to a database in AWS in simplest and most reliable way

I have some tables from three databases that I want to copy their data to another database in an automated way and these data are quite large. My servers are running on AWS. What is the simplest and most reliable way to do so?
Edit
I want them to stay on-sync (automation process as DevOps engineer)
The databases are all MySQL and all moved between AWS EC2. The data is in range between 100GiB and 200GiB
Currently, Maxwell to take the data from the tables then moved to Kafka and then a script written in Java to feed the other database.
I believe you can use AWS Database Migration Service (DMS) to replicate tables from each source into a single target. You would have a single target endpoint and three source endpoints. You would have three replication tasks that would take data from each source and put it into your target. DMS can keep data in sync via ongoing replication. Be sure to read up on the documentation before proceeding as it isn't the most intuitive service to use, but it should be able to do what you are asking.
https://docs.aws.amazon.com/dms/latest/userguide/Welcome.html

Copying tables for reporting purposes to a separate database

I have a transactional database (SQL Server 2014) with around 60 tables, and there is a requirement to create a separate reporting database for reporting purposes.
This will only need to run every 24 hours - however I will be needing to move the data into a different, more query-friendly schema!
Because of this I would hope I could just create some Views on the Transactional Db and then create a table based on that view in the Reporting db and copy across the data.
I originally thought of writing a scheduled Windows Service that somehow extracts data from the tables and inserts into the new one, but then thought if the schema changes it has to update in two places, and also thought surely an enterprise SQL Server license must have some tricks.
I then looked into 'database mirroring' on specific tables but this looks to soon be deprecated.
'Log shipping' looks like more of a disaster recovery solution!
Is there an industry 'best' approach to this problem?
You will need to devise an ETL process to extract data from your source database, transform it and load it into your reporting database. There are many tools available to you to make this easier. You can use SSIS, Azure Data Factory for Azure SQL, and there are many other options. You can use the SQL Agent to schedule stored procedures to run your ETL process.
Your target database will look much different than your source database. There is really no quick way (quick as in scheduling a backup) to accomplish this. There is a lot of information on data warehouse and ETL design available to you to assist you in deciding how to proceed.

Continuous Deployment in Cloud

I am assinged for the task of Continuous deployment from development server to production server.
In my development server all the database objects will be created under the 'DBO' Schema. But in Production server based on every Tenants company list differenet SCHEMAS will be there.
for E.g in my development server if a tablename is created like
dbo.ABC
dbo.XYZ
And while i creating a tenant(Omkar---db) (Sarkur,Mathur--- schemas), the database objects will be like
Sarkur.ABC, sarkur.XYZ
Mathur.ABC, Mathur.XYZ
Now, i have to compare these two databases to check whether any changes in structure of the database objects, addition / deletion of database objects. If so that changes has tobe synchronized in the production database.
If anyone know that how to compare these two different schemas object, pls let me know..
1 option that I know is looking suitable
Flyway :
It is Easy to setup, simple to master. Flyway let's you regain control of your database migrations with pleasure and plain sql.
Solves only one problem and solves it well. Flyway migrates your database, so you don't have to worry about it anymore.
Made for continuous delivery. Let Flyway migrate your database on application startup. Releases have never been this easy.
Big Plus It's Open Source framework!
http://flywaydb.org/

Moving and merging reporting server instances

I have a machine where we have SSRS and SQL Server running, Currently we use SSRS and configured it to use localhost SQL Server hosted ReportServer and ReportServertempdb.
Now we need decomission this machine and move the reports to a brand new machine. Now the brand new machine does not have SQL Server, but we have another SQL Server which has 2 pre-existing databases: ReportServer and ReportServertempdb which are already being used by another SSRS instance. Now we are planning to use them for our to-be-moved SSRS instance as well.
Is it possible for multiple SSRS instance to use same ReportServer and ReportServertempdb? If yes how do you merge these? There are certain conflicting values. For example in the ReportServer DB in the table "ConfigurationInfo", SystemReportTimeout is 1800 for my current instance, but on my proposed instance value is -1. How to tackle this during a merge? I have many conflicting records in both ReportServer databases.
You can create several databases on your machine, each DB + TempDB for one instance. But it is not possible to share DB + TempDB for two different instances.
Even if this would work in theory, you will get a lot of problems with sync. caches tables, security tokens, etc.
Edit: So imho backup your databases and restore on a different name. Then you SSRS configration manager to connect to a existing database.
If you use security tokens for those DB's, make sure your have the .snk file.
Though you can share RS databases across multiple instances, you cannot merge two different ones to the same one. Unfortunately we cannot even rename RS databases as they are considered system databases. Your best bet would be to see if you can host your databases on another SQL instance on the same server or redeploy your reports on the new server.
For additional information you can refer to the following links:
Scaleout deployment: http://msdn.microsoft.com/en-us/library/ms157293(v=SQL.90).aspx
Managing RS DBs:http://msdn.microsoft.com/en-us/library/ms156421%28v=SQL.90%29.aspx
http://msdn.microsoft.com/en-us/library/ms159093.aspx

How to automatically synchronize tables in different databases

Little background: I'm working in a large company with a lot of branches. We have several applications with separated databases sometimes on different servers. But every database contains a table with a list of branches and their relationships. I want to automatically synchronize these tables when one of them changed.
My question is: what are the best practices of automatic synchronization of tables in different databases (Microsoft SQL Server 2008)?
Are there sql server features for that purpose? Or external tool is a good way? Or it's better to write a small application and run it as a service or use the scheduler?
You can use replication (a SQL server built-in feature) to synchronize different databases.
You can also use triggers or log shipping to sync your tables as records are added ,updated or deleted:
Here are some links about replication.
Here are some links about log shipping.

Resources