Replication for local and global databases - sql

I have a server which is running a large database. Many computers and laptops will connect to my server and download this large database to run in localhost. They will create, modify or delete this local database. When everything is done, these databases need to be synchronized to the main database on the server.
I am using PostgreSQL, by the way.
Here I come up with a solution using replication. rubyrep is my choice. However, rubyrep requires every local database to have a global IP. I cannot find a way for my server to connect to those local databases. How can I solve that problem?

Related

SQL Server local instance that transparently points to remote server? Like a named instance remote proxy

We have a purchased commercial app that accesses a named, locally installed SQL server instance.
Is there any way for us to transparently move the DB to a remote shared SQL Server host, but still have things configured within SQL Server so that the local software can access as it it were a local instance?
Keep in mind, since it's a purchased software package, I don't have the ability to modify the queries it's running, so if tables have to change into fully qualified, or other special T-SQL syntax to make this work, it's not an option.
Effectively, we need to "trick" the app to use a remote database, but access as if it's a local instance (though configuration, some sort of proxy, or perhaps dark magic).
The total extent of the application DB configuration settings is to select the name of the local instance to connect, as shown in this image: .
SQL server is installed on the local machine (Win2012R2x64), and has a couple instances running. I have complete control of both local & remote SQL servers, so can make unrestricted config changes to them. Current DB version is SQL2014, but could upgrade to newer if newer version features are needed to do this.
You can try creating an alias to the remote sqlserver from the local sql server. (Via Sql Server Configuration Manager | Aliases | Add a new Alias name)
Your local instance alias should be the name server name that the connection string is using to connect.
I've used this method in the past to change the sql instance that I was connecting to without changing any connection string info.
More info here
It depends what sort of access the commercial app needs in the locally installed database once the app has set up and created its database.
You will probably invalidate any support agreements in the attempt. Worse still, if a commercial app insists on a local instance then I dread to think what security horrors it will insist upon in your shared instance.
You need to profile the database while the functionality of the application is used to find out what it does and how it does it. Even if you determine that the security permissions could be greatly restricted you may find that the app checks to see if it has a higher permission level.
I've no way to hand of testing this approach but....
Install the app as usual which will be on your local instance
Back up the DB on your local instance and restore the DB to your remote instance. Remember to set up what logins are necessary.
Set up a linked server to on your local instance to your remote instance.
Delete all objects in your local DB instance
Create sysnonyms for all objects pointing at the remote instance.
If it is an application that simply requires direct table access this might work. It is however an ABOMINATION.

How to share sql server 2008R2 database

I want to share my SQL Server 2008 R2 database between some computers on the same network without using a Server. How can I do so? I mean i just want two users access the same Database through A network or LAN. Both can use database,update database,delete data from database
is it possible ?
The file: mdf MS SQL can not be shared directly.
Although, once installed MS SQL any user with privileges on the database can access it.
It is not necessary to share the MDF file. MS SQL is responsible "sharing" the users enter data accessing it.
Greetings.
SQL Server can only be installed on a Windows Server system (except for the Developer's edition, and SQL Express).
However, all versions (except CE) can be shared among multiple clients. Just start up the server, make sure that the TCP protocol is enabled (using the SQL Server Configuration Tool), and that your Windows Firewall is not blocking port 1433.
A server just happens to be a term used for otherwise a "normal" computer. The designation server usually means that it is dedicated for a certain task. Technically speaking, any computer can be a server--even your own workstation while you are using it for other tasks. So, just put the database on one of the user computers which is on the network (hence accessible to desired users on the network) and go for it.... Good luck!

Synchronizing two SQL Server Instances

I have two network segments and both are connected using the internet, say one as corporate server and another as remote production. I have an Intranet application running in both environments using the single SQL instance, everything works fine. But my production environment internet disconnects frequently, so my application unable to reach corporate SQL Instance and production stops for a while. Now I'm thinking of placing a server in remote production, and I want to sync up(automatically) once the internet is connected. I'm new to this area please help me.
If you need to sync database objects then you can use Replication.
Read more on MSDN at http://msdn.microsoft.com/en-us/library/ms151198(v=sql.100).aspx

Can SQL Server Express LocalDB be connected to remotely?

I am looking into using the new SQL Server Express LocalDB (I think it is code named "Denali") for a desktop application.
It is currently running with SQL Compact, but the user is wanting to share the database between multiple PCs on a network. Unfortunately this is not something that SQL Compact can do, so I am investigating other solutions.
The client requires the ability to send database files easily to other sites or to back them up to a flash disk, so I am avoiding going to SQL Express because there is quite a bit of "administrator" knowledge required to backup and restore.
So, my questions is, does the new SQL Express LocalDB support remote connections to the database over a network and/or through a shared network folder with the mdf file in it?
LocalDB does support supplying a path for an attached local DB in it's connect string (AttachDbFileName) hence the shared network folder option.
NOTE: This question pertains to "LocalDB" the new version of SQL Express 'Denali' and not to SQL Server Express 2008 or prior.
See article here announcing LocalDB's release: http://blogs.msdn.com/b/sqlexpress/archive/2011/07/12/introducing-localdb-a-better-sql-express.aspx
No, SQL Server Express LocalDB doesn't accept remote connections.
The idea with shared network folder might work, but only if you are able to make sure the LocalDB instance is shutdown before you try to copy the file. Also keep in mind that only one LocalDB instance can have any given database file open at the same time. and don't forget about the log files!
Additional security warning: unlike SQL Server Compact databases, SQL Server Express databases (including LocalDB ones) are not designed as secure data exchange format. For instance, they can contain malicious code in .NET assemblies embedded in them. So you should never open databases from untrusted source.
Maybe providing the customer with a simple tool that automates the backup process would be a better idea?
This isn't a fresh thread, but I would like to share my experience with SQL Server Express database LocalDB.
I have a WPF C# project using SQL database with LocalDb Engine. It is working fine no problem, I can use the database with the WPF app. I wanted this app to work on network with more PCs.
On the network another PC can use the database from my PC using UNC path in the connection string.
It seemed to me the remote connection is working. However when the remote PC is connected, I am not able to use the database with my local WPF app. If I run my app first the remote PC could not connect. So this tells me that the remote connection is working, but the multiple connection is not allowed.
OK, I didn't give up and I run the app from my PC twice and I saw it is working which tells me that the same SQL LocalDB engine can handle multiple connections locally only.
I hope this experience will help someone. Thanks.
In short, yes it can. Here is a tutorial on how to configure it.
Also, here is another post with a potential issue that might occur.
Both explain how to configure SQL Server Express to accept Remote Connections.

How to automatically backup a SQL Server database on my ISP's location from my own pc?

I have very limited access to the SQL Server at my ISP.
I have a very simple tool to create databases and execute SQL (which is enough most of the time) but now I also want to backup (and in the case of an accident, restore) a database from my own PC (or via a web application, if that's possible, both are ok)
Is there a tool which can do that auotmatically?
It's a SQL Server 2008 database.
I guess I can do it from my SQL Server Management Studio, but I'd prefer a tool that can do it scheduled.
Kind regards,
Michel
You can only backup (and restore) your database from local drives on the SQL Server machine - e.g. the machine at your ISP's location.
You cannot backup SQL Server and store the *.bak file on your local system, over the internet.
So what you need to do is create some kind of a process that stores the BAK file on the server machine at your ISP's location, and then copies or moves it to your home machine. For that, you need to have write access to some physical drive at your ISP on their SQL Server.