Sqlserver does not support two instances using the same database files. With a SAN you can configure failover. But only one server can access the files at the same time.
How to access SQL 2014 database from common san storage
We are using windows 2012 in server A with SQL2014 in SAN Storage with "DATABASE1". For specific purpose we are using another windows 2012 server B on another network with SQL 2014 with "DATABASE2". Server A and Server B are connected with Fibre cables to SAN switch. Now we want to do both push and pull the SQL DATA from Server B to SQL Database in Server A and vice versa.
From server B I am attaching server A Database (Since the MDF and LDF files are stored in SAN storage). I am able to attached and insert some new DATA. But when i go to Server A and check the data, the inserted DATA has not updated.
Please suggest.
Windows for business Windows Server User experience Other
SQL Server Other
2 answers
Sort by: Most helpful
-
Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
2023-07-08T16:34:06.32+00:00 -
Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
2023-07-08T20:55:43.6566667+00:00 It seems that you are working with different copies of the database files. Because you from server B would try to access the files of server A, you would find them locked, and the whole operation would fail. (And if the SAN would permit you to ignore the locks, it would be even worse - you would have corruption galore, because as Bruce says, this is not supported.)
If you absolutely think this is a fantastic idea, you first need to set the database OFFLINE on server A, attach it to server B, detach, and then set them online on Server A again. But it is not the best of ideas, and I am not sure that it is even supported. (Then again, SQL 2014 is soon of up support itself...) Better to use one of the established methods: linked server, SSIS package etc.