Solved

Application not connecting to SQL database after disaster restore.

Posted on 2016-09-30
7
30 Views
Last Modified: 2016-10-06
This is probably something simple except my complete lack of knowledge of SQL etc prohibits me to solve it.

I have a client with "custom application" that was written for them over a decade ago. This application was connecting to SQL database that was hosted on it's own server. This server recently stopped to exist. Server is dead, drives are dead - the only thing that I have is the good backup of database.

I have build (as virtual machine) a Server 2008 R2 with SQL 2008 R2 installed and I managed to restore database from backup.
I gave the server the same name (and same IP) as the machine that died. This new server is build with windows authentication (and I was told that this is how it was previously)
I have setup SQL port exceptions on firewall and tested the connectivity to database on the SQL server itself and from the workstation successfully (I created text file and renamed it .udl and this gave me Database connection tool)

Regardless all this the "Custom App" is not connecting to database - it gives error: "The application is unable to connect to the database server."

I have found that this "Custom app" has a config file that mentions some kind of account and password.

Do I have to do something else to the restored database - recreate/relink accounts?
0
Comment
Question by:pyotrek
7 Comments
 
LVL 28

Assisted Solution

by:Pawan Kumar
Pawan Kumar earned 167 total points
ID: 41824687
Are you able to connect to DB using SSMS.

Can you share the config file (Connection string). ?


In few cases we may need to create accounts.
0
 
LVL 12

Assisted Solution

by:Nakul Vachhrajani
Nakul Vachhrajani earned 167 total points
ID: 41824730
If it uses some account and a password, then it is not using Windows authentication. A username + password would be required in case of SQL authentication. So, you probably need to enable SQL authentication on your server and create the necessary account with the given password.

The second probability would be the DB name - is it same as that on the original server?

The underlying error code and error state information are the only pieces which would tell for sure what the problem is. You are probably getting a 18456 error which has a lot of possible configuration related root causes - each of which would have a different value for error state.
0
 
LVL 77

Assisted Solution

by:arnold
arnold earned 166 total points
ID: 41824976
To identify whether it was using sql login, look at the security section under the database not under the database server, if you have logins other than sa, that us the user and credentials needed.

You may gave to capture logins to identify the username/password if they were hard coded.

Does the db backups include the system db backup. Master, msdb, model?

SQL trace ro capture the login attempt, might or using a network ....
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 1

Accepted Solution

by:
pyotrek earned 0 total points
ID: 41825032
OK  - got it going - i had to use following to reestablish database account login:

use {DatabaseName}
GO
 
EXEC sp_change_users_login 'Auto_Fix', {UserName}, null, {UserName}{Password}'
GO

and had to enable Mixed Authentication as i installed it with Windows Authentication only.

Thanks for the help.
0
 
LVL 1

Author Comment

by:pyotrek
ID: 41825033
Thanks for the effort
0
 
LVL 28

Expert Comment

by:Pawan Kumar
ID: 41825035
@Author - Great to know that it helped. Could you please choose one or more answer as accepted solution and close the question. Thank you !
0
 
LVL 1

Author Closing Comment

by:pyotrek
ID: 41831402
Thanks for the effort
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
best counters for cpu high usage 3 30
sql server concatenate fields 10 33
TSQL - How to declare table name 26 29
T-SQL: "HAVING CASE" Clause 1 23
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question