I deattached my default DB and crashed on reattaching it. I now get the above error. I am using MS SQL 200
Any suggestions or advice
Thank
ScottHi,
Can you please check whether the database is accessible.
1. Login as SA in query analyzer
2. execute the command
use dbname (replace database name with actual)
3. If you can open the database then no issues, otherwise send the error
you are getting after executing the command.
Thanks
Hari
MCDBA
"Scott Sheen" <anonymous@.discussions.microsoft.com> wrote in message
news:DA63BEEE-BF15-411E-89D1-654B42263897@.microsoft.com...
> I deattached my default DB and crashed on reattaching it. I now get the
above error. I am using MS SQL 2000
> Any suggestions or advice?
> Thanks
> Scott|||I can not login to query analyzer.
Unable to connect to server ...
Server: Msg 4064, Level 16 State 1
Cannot open user default database. Login failed.
This is similiar and related to the error I am getting in enterprise manager.
A connection could not be established to ...
Reason: Cannot open user default database. login failed..
...
I was coping over a DB file and when I started up the manage I had this error.
I forgot the log file. I restored to my original version of that DB file. I
then detached that db and tried to reattach the new version of the db (from a
different PC) which failed and logged me out of the server. I figured that was
because that DB was my default DB.
Thanks for your help.
Scott
"Hari" <hari_prasad_k@.hotmail.com> wrote:
>Hi,
>Can you please check whether the database is accessible.
>1. Login as SA in query analyzer
>2. execute the command
> use dbname (replace database name with actual)
>3. If you can open the database then no issues, otherwise send the error
>you are getting after executing the command.
>Thanks
>Hari
>MCDBA
>"Scott Sheen" <anonymous@.discussions.microsoft.com> wrote in message
>news:DA63BEEE-BF15-411E-89D1-654B42263897@.microsoft.com...
>> I deattached my default DB and crashed on reattaching it. I now get the
>above error. I am using MS SQL 2000
>> Any suggestions or advice?
>> Thanks
>> Scott
>|||I do not recommend changing the default database for sysadmins of the very reason you see now. The
default database for the user you are logging in as doesn't exist (for some reason), which mean that
you cannot login! Actually ISQL.EXE and I think OSQL.EXE will let you in, so use any of these tools
to login and then use sp_defaultdb to change the default database. Or, login as another login which
work and let that login change the default database for you (that login need to be sysadmin).
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Scott Sheen" <sasheen@.oanet.com> wrote in message news:OCbFYSu6DHA.3008@.TK2MSFTNGP09.phx.gbl...
> I can not login to query analyzer.
> Unable to connect to server ...
> Server: Msg 4064, Level 16 State 1
> Cannot open user default database. Login failed.
> This is similiar and related to the error I am getting in enterprise manager.
> A connection could not be established to ...
> Reason: Cannot open user default database. login failed..
> ...
> I was coping over a DB file and when I started up the manage I had this error.
> I forgot the log file. I restored to my original version of that DB file. I
> then detached that db and tried to reattach the new version of the db (from a
> different PC) which failed and logged me out of the server. I figured that was
> because that DB was my default DB.
> Thanks for your help.
> Scott
> "Hari" <hari_prasad_k@.hotmail.com> wrote:
> >Hi,
> >
> >Can you please check whether the database is accessible.
> >
> >1. Login as SA in query analyzer
> >2. execute the command
> >
> > use dbname (replace database name with actual)
> >
> >3. If you can open the database then no issues, otherwise send the error
> >you are getting after executing the command.
> >
> >Thanks
> >Hari
> >MCDBA
> >
> >"Scott Sheen" <anonymous@.discussions.microsoft.com> wrote in message
> >news:DA63BEEE-BF15-411E-89D1-654B42263897@.microsoft.com...
> >> I deattached my default DB and crashed on reattaching it. I now get the
> >above error. I am using MS SQL 2000
> >>
> >> Any suggestions or advice?
> >> Thanks
> >> Scott
> >
> >
>|||Scott
Try give permissions to the def database by using
sp_grantdbaccess [@.loginame =] 'login'
[,[@.name_in_db =] 'name_in_db' [OUTPUT]]
OR
Drop the login and by using sp_addlogin create a new one with default
database access.
For more details please refer to BOL
"Scott Sheen" <sasheen@.oanet.com> wrote in message
news:OCbFYSu6DHA.3008@.TK2MSFTNGP09.phx.gbl...
> I can not login to query analyzer.
> Unable to connect to server ...
> Server: Msg 4064, Level 16 State 1
> Cannot open user default database. Login failed.
> This is similiar and related to the error I am getting in enterprise
manager.
> A connection could not be established to ...
> Reason: Cannot open user default database. login failed..
> ...
> I was coping over a DB file and when I started up the manage I had this
error.
> I forgot the log file. I restored to my original version of that DB file.
I
> then detached that db and tried to reattach the new version of the db
(from a
> different PC) which failed and logged me out of the server. I figured
that was
> because that DB was my default DB.
> Thanks for your help.
> Scott
> "Hari" <hari_prasad_k@.hotmail.com> wrote:
> >Hi,
> >
> >Can you please check whether the database is accessible.
> >
> >1. Login as SA in query analyzer
> >2. execute the command
> >
> > use dbname (replace database name with actual)
> >
> >3. If you can open the database then no issues, otherwise send the error
> >you are getting after executing the command.
> >
> >Thanks
> >Hari
> >MCDBA
> >
> >"Scott Sheen" <anonymous@.discussions.microsoft.com> wrote in message
> >news:DA63BEEE-BF15-411E-89D1-654B42263897@.microsoft.com...
> >> I deattached my default DB and crashed on reattaching it. I now get
the
> >above error. I am using MS SQL 2000
> >>
> >> Any suggestions or advice?
> >> Thanks
> >> Scott
> >
> >
>|||ok, none of these suggestions are working, as I can not log on to isql or osql
either.
I can not seem to recreate a new server and DB either as I get the same error.
Anymore suggestions?
Best Regards,
Scott S.
"Uri Dimant" <urid@.iscar.co.il> wrote:
>Scott
>Try give permissions to the def database by using
>sp_grantdbaccess [@.loginame =] 'login'
> [,[@.name_in_db =] 'name_in_db' [OUTPUT]]
>OR
> Drop the login and by using sp_addlogin create a new one with default
>database access.
>For more details please refer to BOL
>
>"Scott Sheen" <sasheen@.oanet.com> wrote in message
>news:OCbFYSu6DHA.3008@.TK2MSFTNGP09.phx.gbl...
>> I can not login to query analyzer.
>> Unable to connect to server ...
>> Server: Msg 4064, Level 16 State 1
>> Cannot open user default database. Login failed.
>> This is similiar and related to the error I am getting in enterprise
>manager.
>> A connection could not be established to ...
>> Reason: Cannot open user default database. login failed..
>> ...
>> I was coping over a DB file and when I started up the manage I had this
>error.
>> I forgot the log file. I restored to my original version of that DB file.
>I
>> then detached that db and tried to reattach the new version of the db
>(from a
>> different PC) which failed and logged me out of the server. I figured
>that was
>> because that DB was my default DB.
>> Thanks for your help.
>> Scott
>> "Hari" <hari_prasad_k@.hotmail.com> wrote:
>> >Hi,
>> >
>> >Can you please check whether the database is accessible.
>> >
>> >1. Login as SA in query analyzer
>> >2. execute the command
>> >
>> > use dbname (replace database name with actual)
>> >
>> >3. If you can open the database then no issues, otherwise send the error
>> >you are getting after executing the command.
>> >
>> >Thanks
>> >Hari
>> >MCDBA
>> >
>> >"Scott Sheen" <anonymous@.discussions.microsoft.com> wrote in message
>> >news:DA63BEEE-BF15-411E-89D1-654B42263897@.microsoft.com...
>> >> I deattached my default DB and crashed on reattaching it. I now get
>the
>> >above error. I am using MS SQL 2000
>> >>
>> >> Any suggestions or advice?
>> >> Thanks
>> >> Scott
>> >
>> >
>|||Some partial good news.
isql -E
will get me into iSQL. sp_defaultdb ' ...', 'master' will change the default
DB.
However, in my confusion late night I removed all the dbs under the server to
start over.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote:
>I do not recommend changing the default database for sysadmins of the very
>reason you see now. The
>default database for the user you are logging in as doesn't exist (for some
>reason), which mean that
>you cannot login! Actually ISQL.EXE and I think OSQL.EXE will let you in, so
>use any of these tools
>to login and then use sp_defaultdb to change the default database. Or, login
>as another login which
>work and let that login change the default database for you (that login need
>to be sysadmin).
>--
>Tibor Karaszi, SQL Server MVP
>Archive at:
>http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
>
>"Scott Sheen" <sasheen@.oanet.com> wrote in message
>news:OCbFYSu6DHA.3008@.TK2MSFTNGP09.phx.gbl...
>> I can not login to query analyzer.
>> Unable to connect to server ...
>> Server: Msg 4064, Level 16 State 1
>> Cannot open user default database. Login failed.
>> This is similiar and related to the error I am getting in enterprise manager.
>> A connection could not be established to ...
>> Reason: Cannot open user default database. login failed..
>> ...
>> I was coping over a DB file and when I started up the manage I had this
>>error.
>> I forgot the log file. I restored to my original version of that DB file. I
>> then detached that db and tried to reattach the new version of the db (from a
>> different PC) which failed and logged me out of the server. I figured that
>>was
>> because that DB was my default DB.
>> Thanks for your help.
>> Scott
>> "Hari" <hari_prasad_k@.hotmail.com> wrote:
>> >Hi,
>> >
>> >Can you please check whether the database is accessible.
>> >
>> >1. Login as SA in query analyzer
>> >2. execute the command
>> >
>> > use dbname (replace database name with actual)
>> >
>> >3. If you can open the database then no issues, otherwise send the error
>> >you are getting after executing the command.
>> >
>> >Thanks
>> >Hari
>> >MCDBA
>> >
>> >"Scott Sheen" <anonymous@.discussions.microsoft.com> wrote in message
>> >news:DA63BEEE-BF15-411E-89D1-654B42263897@.microsoft.com...
>> >> I deattached my default DB and crashed on reattaching it. I now get the
>> >above error. I am using MS SQL 2000
>> >>
>> >> Any suggestions or advice?
>> >> Thanks
>> >> Scott
>> >
>> >
>|||I fixed the problem. I started isql via isql -E. That logged me on. I then
created a new DB, made that the default and all was good.
Scott
>I deattached my default DB and crashed on reattaching it. I now get the above
>error. I am using MS SQL 2000
>Any suggestions or advice?
>Thanks
>Scott
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment