SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Problem in Enterprise Manager
 Forum Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

yasin
Yak Posting Veteran

India
68 Posts

Posted - 03/16/2005 :  09:29:49  Show Profile  Send yasin an AOL message
hello

I Detached the user default database from the server (Using EM) and when i was attaching the database,there is a problem. Enter prise Manager is working but In a servergroup, a particular server is not opened(Expand). It shows the error as cannot open user default database, Login failed, i entered in EM using sa login.

Please any one can help me in this regards.

thanx in advance.

by

yasi

Kristen
Test

United Kingdom
22403 Posts

Posted - 03/16/2005 :  09:40:40  Show Profile
Most likely thing is that the "broken" server is configured with a Default Database, for your user login, that no longer exists.

You'll need to log into that server with a different user ID (e.g. "sa") and change the default database for the User ID you normally connect with from E.M.

Kristen
Go to Top of Page

yasin
Yak Posting Veteran

India
68 Posts

Posted - 03/16/2005 :  09:48:28  Show Profile  Send yasin an AOL message



Mr. Kristen

If i need to enter different login id means how i can, Because that particular server is not drapping down in EM.

Then how i can change the userdefault database. But All user are working with that server smoothly.I entered in using sa login. but it shows the error like that. Then what i will do in this case.

thanx a lot

by
yasi
Go to Top of Page

yasin
Yak Posting Veteran

India
68 Posts

Posted - 03/16/2005 :  10:33:48  Show Profile  Send yasin an AOL message
Yes Mr. Kriston.

Now i got it. it enters inside the query analyzer, then how i can change default database. Please ...


Thanx lot ma . Thanx

by
yasi
Go to Top of Page

mr_mist
Grunnio

United Kingdom
1870 Posts

Posted - 03/16/2005 :  10:37:33  Show Profile  Visit mr_mist's Homepage
Use sp_defaultdb


-------
Moo. :)
Go to Top of Page

yasin
Yak Posting Veteran

India
68 Posts

Posted - 03/16/2005 :  11:19:27  Show Profile  Send yasin an AOL message
Hello Mr.Mist

i had run the query in the query analyzer(Under System as well as user db), but it shows the error as

Cannot change default database belonging to someone else

Thanx lot.

by
yasin
Go to Top of Page

mr_mist
Grunnio

United Kingdom
1870 Posts

Posted - 03/16/2005 :  11:43:21  Show Profile  Visit mr_mist's Homepage
You need to be logged in as a system administrator to change another user's default database.

-------
Moo. :)
Go to Top of Page

yasin
Yak Posting Veteran

India
68 Posts

Posted - 03/16/2005 :  11:51:38  Show Profile  Send yasin an AOL message


Mr.Mr_Mist

I entered as admin but not sa. If i use sa it will enter into query analyzer and it shows the error as Cannot open user default database, Login failed. That is the problem. Then help to solve this problem.

thanx in advance.

with warm regards
yasi
Go to Top of Page

yasin
Yak Posting Veteran

India
68 Posts

Posted - 03/16/2005 :  11:53:26  Show Profile  Send yasin an AOL message


Mr.Mr_Mist

I entered as admin but not sa. If i use system administrator it will not enter into query analyzer and it shows the error as
Cannot open user default database, Login failed.

That is the problem, how i can change the user default database. Then help to solve this problem.

thanx in advance.

with warm regards
yasi
Go to Top of Page

Kristen
Test

United Kingdom
22403 Posts

Posted - 03/16/2005 :  11:56:06  Show Profile
Create a new database with the name of the now-missing database?

Kristen
Go to Top of Page

yasin
Yak Posting Veteran

India
68 Posts

Posted - 03/16/2005 :  12:16:08  Show Profile  Send yasin an AOL message
Mr. Kristen
i execute the query in query analyzer for creating database.


USE master
GO
CREATE DATABASE Sales
ON
( NAME = Sales_dat,
FILENAME = 'c:\program files\microsoft sql server\mssql\data\saledat.mdf',
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5 )
LOG ON
( NAME = 'Sales_log',
FILENAME = 'c:\program files\microsoft sql server\mssql\data\salelog.ldf',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB )
GO

but it shows the error as

Server: Msg 262, Level 14, State 1, Line 1
CREATE DATABASE permission denied in database 'master'.

Go to Top of Page

Kristen
Test

United Kingdom
22403 Posts

Posted - 03/16/2005 :  12:21:26  Show Profile
Doesn't look like the account you logged on with has enough permissions to create a DB :-(

Note to self: Keep the default database for "sa" as MASTER !

Kristen
Go to Top of Page

yasin
Yak Posting Veteran

India
68 Posts

Posted - 03/16/2005 :  12:27:21  Show Profile  Send yasin an AOL message
Yes Mr. Kristen

If i use the sa account it will not enter inside(Query Analyzer) the login because it shows the error as i told before . Then how i can grant permission for sa.

Thanx a lot ma ... thanx in advance.

warm regards
yasi
Go to Top of Page

yasin
Yak Posting Veteran

India
68 Posts

Posted - 03/16/2005 :  12:31:40  Show Profile  Send yasin an AOL message
Mr. Kristen



In Enterprise manager i can't enter in a particular server in a server group without changing of the default database even if i use the system administrator account.

then how.

thanx a lot.

with regards
yasi.
Go to Top of Page

Kristen
Test

United Kingdom
22403 Posts

Posted - 03/16/2005 :  13:02:48  Show Profile
You need a user who has sysadmin permissions, and who is NOT sa, and who is NOT using the now-deleted-database as their default to create the missing DB.

Are you "sysadmin" or just a database owner ??

Failing that I'd paid the Microsoft PSS charge to get them to help you.

Or backup all the database, and re-install SQL Server and restore the DBs :-(

Kristen
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
36985 Posts

Posted - 03/16/2005 :  13:21:11  Show Profile  Visit tkizer's Homepage
If you haven't deleted the BUILTIN\Administrators group from SQL Server and it still has sysadmin fixed server role, then log onto the server using a Windows account and one that is a member of the local administrators group. Then, connect to Query Analyzer using Windows authentication. Next, run sp_defaultdb to change the default database for sa to master. Then you should be set.

If you have deleted the BUILTIN\Administrators group from SQL Server, then we'll have to get a little trickier to fix this. So let us know how this goes.

Tara
Go to Top of Page

Stoad
Freaky Yak Linguist

*
1983 Posts

Posted - 03/16/2005 :  13:54:27  Show Profile  Visit Stoad's Homepage
lol, people...

see OSQL utility in BOL or run QA from cmd window with -dxxx option.
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
36985 Posts

Posted - 03/16/2005 :  13:58:27  Show Profile  Visit tkizer's Homepage
Where do you set the -d option in Query Analyzer?

I figured osql.exe is too advanced for this poster.

Tara
Go to Top of Page

Stoad
Freaky Yak Linguist

*
1983 Posts

Posted - 03/16/2005 :  14:56:07  Show Profile  Visit Stoad's Homepage
C:\MSSQL7\Binn\isqlw.exe -dmaster
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
36985 Posts

Posted - 03/16/2005 :  15:01:28  Show Profile  Visit tkizer's Homepage
Command line options might be too advanced for this poster. Yasi, can you handle this?

Tara
Go to Top of Page

Stoad
Freaky Yak Linguist

*
1983 Posts

Posted - 03/16/2005 :  15:08:42  Show Profile  Visit Stoad's Homepage
it will be pity if he's already given up and doESn't read our replies...

Edited by - Stoad on 03/16/2005 15:12:25
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.23 seconds. Powered By: Snitz Forums 2000