cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot open user default database on SQL Server 2008

0 Kudos

We have installed ECC 6.0 with EHP4 Ready.

Recently we have upgraded our system to EHP4.

After rebooting our windows server, we are not able to connect to

database.

We are getting the below error.

=======================================================================

TITLE: Connect to Server

-


Cannot connect to MHEPL-ECCDEV.

-


ADDITIONAL INFORMATION:

Cannot open user default database. Login failed. Login failed for

user 'MHEPL-ECCDEV\medadm'. (Microsoft SQL Server, Error: 4064)

For help, click: http://go.microsoft.com/fwlink?

ProdName=MicrosoftSQLServer&EvtSrc=MSSQLServer&EvtID=4064&LinkId=20476

-


BUTTONS:

OK

-


=======================================================================

Already default database of SAPService<SID> and <sid>adm is set to

<SID>.

I have already gone through SAP Note 806925 - SQL Error 4064: Cannot

open user default database, but it did not help.

Here by I am attaching the screen shots also.

Request you to kindly look into this and suggest us.

Regards,

Raj

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Experts

I'm facing similar kind of issue with SQL database server while installing SAP NetWeaver Gateway in distributed environment. Can you please check below thread and let me know your expert advice/views:

SQL server doesn't exist or access denied || SA... | SCN

Regards

Hardeep

Former Member
0 Kudos

Are you facing problem like SQL error 4064 while login in SQL default database then try SQL password recovery software and remove it easily :- http://sqlrecoverysoftware.net/blog/sql-error-4064.html

Former Member
0 Kudos

Hello,

Did you check the microsoft link provided in that note ?

http://support.microsoft.com/kb/307864

After windows reboot, are sql services up now ? If not then this might be the reason as well.

Thanks

0 Kudos

Hi,

After reboot all the SQL services are up and running.

I have already check the http://support.microsoft.com/kb/307864 link.

when i tried to execute the below command, it says invalid option -E.

sqlcmd u2013E -S InstanceName u2013d master

and the link is for SQL Server 2005, 2000. But ours is SQL Server 2008 R2.

Regards,

Raj

Former Member
0 Kudos

Raj,

Was there any change in ms sql server settings or any db upgrade you might have performed during ehp4 upgrade ?

I would say, try and recreate sql server logins - Note 1294762 - SCHEMA4SAP.VBS

Thanks

Former Member
0 Kudos

Hello,

I don't really get the idea how a non-running SQL Server instance service could ever be the reason for a "Cannot open user default database" error.

It seems that the basic concept is not understood at all. The SQL Server instance service represents the SQL Server instance. When it's up, the instance is up and (if no other problems) will accept requests and reply to them. The error message "cannot open user default database" comes from the instance. It's a reply from the instance. If the instance was down you would get completely different errors, e.g. "SQL Server doesn't exist or access denied"

You encounter this error for the <sid>adm user - if you're database setup follows the SAP standard the default database of this user should be the <SID> database. As it cannot be opened there must be either something wrong with the <SID> database and it's currently not open or the default database setting of the <sid>adm user is incorrect and is point to a non-existing database.

To find out which of these applies you need to look into the most current errorlog of the database. Does it say that the DB could be started up properly? If no, check why and resolve the root cause.

To your second question: why does your osql command not work? Simply answer -> because it's incorrect

Not incorrect for SQL Server 2008 or any specific release, but simply incorrect in general.

When using osql commands you do not use spaces between the option character and the option value. Assuming my instance is called DETEST\PRD and I want to log on to it with Windows Authentication and osql:

osql -E -S DETEST\PRD <<<< is WRONG

osql -E -SDETEST\PRD <<<< is CORRECT

This applies for all option flags you used so your command failed because it was written with incorrect syntax.

regards,

beate