Hi all,
Here's to hoping that a SQL Server guru is hiding among the ranks of DaniWeb members.
I have two servers, DB01 - the production database server and BKP01 - the backup server, that are in two different geographical locations. Since some queries on DB01 are accessing BKP01 there exists a link in DB01 and it works perfectly. Now I would like to know how I can verify the availability of BKP01 from DB01? If the physical link is cut, for any reason, I want to be able to switch all the backups to DB01 automatically.
I have tried by shutting down the SQL Server instance on BKP01 and then trying queries like these:
IF EXISTS (SELECT @@version FROM BKP01.master.sys.databases )
PRINT 'DBName available.'
ELSE
PRINT 'DBName not available.'
and
BEGIN TRY
SELECT @@version FROM BKP01.master.sys.databases
print @@error
PRINT 'DBName available.'
END TRY
BEGIN CATCH
PRINT 'DBName not available.'
END CATCH
print @@error
but SQL Server never gets past the 'SELECT @@version ..." part of these queries and then fails horribly spewing the following error messages:
OLE DB provider "SQLNCLI10" for linked server "BKP01" returned message "Login timeout expired".
OLE DB provider "SQLNCLI10" for linked server "BKP01" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.".
Msg 53, Level 16, State 1, Line 0
Named Pipes Provider: Could not open a connection to SQL Server. (53)
I hope that some kind soul on Daniweb will help me in the right direction.
Thanks
Yomet