Showing posts with label detach. Show all posts
Showing posts with label detach. Show all posts

Tuesday, March 27, 2012

Error 9003 : fail to attach a database

Hi,
I sucessful attached a database, but deleted it without detach. When I tried
to attach again got this error 9003: The LSN(12:32:1) passed to log scan in
database "Contacts" is invalid.
I tried to detach it, but I can't find the database in system, so it fails t
oo.
Please help, thanks in advance!
IreneIrene,
Do you have the .mdf and .ldf files for Contacts?
Did you use the Enterprise Manager or issue the sp_attach_db and sp_detach_d
b from the Query Analyzer?
...but deleted it without detach...
What does this mean? How was this accomplished? Explain...
Does Contacts show up when you run this...
SELECT * FROM master..sysdatabases
Norman|||Hi, Norman
I used the Enterprise Manager to attach the Contact.mdf and Contact.ldf.
After attached it, I found the new database "Contact" was readonly. I
made a mistake to del the database "Contact" directly in the Enterprise
Manager explorer.
When I tried to attach the file again in the Enterprise Manager
explorer, it shows the error 9003. Then I tried sp_detach_db "Contact",
it fails.
When I run "SELECT * FROM sysdatabases", no "Contact" database record
in.
I guest it still has some reference files exist in database server, but
I don't know how to restore it.
Thanks again.
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!|||Hi, Norman
I used the Enterprise Manager to attach the Contact.mdf and Contact.ldf.
After attached it, I found the new database "Contact" was readonly. I made a
mistake to del the database "Contact" directly in the Enterprise Manager ex
plorer.
When I tried to attach the file again in the Enterprise Manager explorer, it
shows the error 9003. Then I tried sp_detach_db "Contact", it fails.
When I run "SELECT * FROM sysdatabases", no "Contact" database record in.
I guest it still has some reference files exist in database server, but I do
n't know how to restore it.

Error 9003 : fail to attach a database

Hi
I sucessful attached a database, but deleted it without detach. When I tried to attach again got this error 9003: The LSN(12:32:1) passed to log scan in database "Contacts" is invalid
I tried to detach it, but I can't find the database in system, so it fails too
Please help, thanks in advance
IreneIrene
Do you have the .mdf and .ldf files for Contacts
Did you use the Enterprise Manager or issue the sp_attach_db and sp_detach_db from the Query Analyzer
...but deleted it without detach..
What does this mean? How was this accomplished? Explain..
Does Contacts show up when you run this..
SELECT * FROM master..sysdatabase
Norman|||Hi, Norma
I used the Enterprise Manager to attach the Contact.mdf and Contact.ldf
After attached it, I found the new database "Contact" was readonly. I made a mistake to del the database "Contact" directly in the Enterprise Manager explorer
When I tried to attach the file again in the Enterprise Manager explorer, it shows the error 9003. Then I tried sp_detach_db "Contact", it fails.
When I run "SELECT * FROM sysdatabases", no "Contact" database record in
I guest it still has some reference files exist in database server, but I don't know how to restore it.

Sunday, March 11, 2012

error 6107

I tried to run detach on a database, I get an error message error 6107, "only user processes can be killed" I also tried to rename and delete the database but would not allow me to do either, it was coming up with the same error message. I sometimes get error 3701 as well " cannot detach databse because it is in use" I found out this error is also because of this system user in the databse. I looked in the processes and I can see spid 6 used by system user in the database, I cannot kill the user. Option to kill is greyed out. Running stope procedure did not also help. I did not create this system user, it was self generated or maybe as a result of fuction added to the databse, I have no problem killing all the users in the database except this system user which I did not know how it got there.
This database is in a cluster and I have over 40 databases that serves as backend to a lot of websites, so stopping and starting sqlserver is not an option, also as this is a cluster, I am not sure of what will happen if I try to stop and start sql server on the active node.
I am running clustered sql server 2000 ent edition on windows 2000Your problem is that you may have a user or a process using that DataBase.
Try to kill all the SPID ID for that DataBase.

______________
Paulo Gonalves|||You MAY need to reqd microsoft article 275661 reproduced below - I know its for SQL 7 but you never know, might be useful to you

FIX: Error Message 6107 Occurs with Transact-SQL KILL Command After Pooled Connection is Reset
The information in this article applies to:
Microsoft SQL Server 7.0

This article was previously published under Q275661
BUG #: 58170 (SQLBUG_70)

SYMPTOMS: When SQL Server performs a remote stored procedure call (RPC) or a linked server query to another SQL Server server, after the query completes, a request is submitted to the remote server to reset the connection before the connection is put back into a connection pool for a period of time. An ODBC or OLE DB-based application that is using the driver or provider shipped with Microsoft SQL Server 2000 may also reset the connection when using connection or session pooling.

After the connection has been reset, an attempt to terminate a system process ID (SPID) with the Transact-SQL KILL command causes the following error message to occur:

Server: Msg 6107, Level 14, State 1, Line 1 Only user processes can be killed.
STATUS
Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 3 for Microsoft SQL Server 7.0. For information about how to download and install the latest SQL Server Service Pack, see the following Microsoft Web site:
http://support.microsoft.com/highlights/sql.asp

For more information, contact your primary support provider.

MORE INFORMATION
After the connection has been reset, the SPID indicates that it is in a "dormant" state in the sysprocesses system table. If you do not use the connection for a period of time a background process closes the connection. Such a SPID should not be holding on to any locks or resources that would affect other users.

However, if the pooled connection is reused and starts a command that ties up resources or that causes blocking that needs to be terminated (with the KILL command), you are unable to terminate the SPID with the KILL command.

Error 6107

I tried to detach my database (using enterprise manager).
I got an error when I tried to clear users ( Error 6107 --Only user
procesess can be killed)
I checked sp_who and realized that autoshrink is running.Is there anyway to
kill it.
When I tried kill <pid> from query Anz. same error -- Only user procesess
can be killed
ThanksI would recommend you wait for it to complete.
Another route would be shutting down sqlserver service. This is quite
drastic and error prone.
-oj
http://www.rac4sql.net
"Abraham" <binu_ca@.yahoo.com> wrote in message
news:uDz1gYe4DHA.1804@.TK2MSFTNGP12.phx.gbl...
quote:

> I tried to detach my database (using enterprise manager).
> I got an error when I tried to clear users ( Error 6107 --Only user
> procesess can be killed)
> I checked sp_who and realized that autoshrink is running.Is there anyway

to
quote:

> kill it.
> When I tried kill <pid> from query Anz. same error -- Only user procesess
> can be killed
> Thanks
>

Error 6107

I tried to detach my database (using enterprise manager).
I got an error when I tried to clear users ( Error 6107 --Only user
procesess can be killed)
I checked sp_who and realized that autoshrink is running.Is there anyway to
kill it.
When I tried kill <pid> from query Anz. same error -- Only user procesess
can be killed
ThanksI would recommend you wait for it to complete.
Another route would be shutting down sqlserver service. This is quite
drastic and error prone.
--
-oj
http://www.rac4sql.net
"Abraham" <binu_ca@.yahoo.com> wrote in message
news:uDz1gYe4DHA.1804@.TK2MSFTNGP12.phx.gbl...
> I tried to detach my database (using enterprise manager).
> I got an error when I tried to clear users ( Error 6107 --Only user
> procesess can be killed)
> I checked sp_who and realized that autoshrink is running.Is there anyway
to
> kill it.
> When I tried kill <pid> from query Anz. same error -- Only user procesess
> can be killed
> Thanks
>

Friday, March 9, 2012

ERROR 5120

I tried attach/detach approach to migrate sql server 2000 databases to sql 2005. I installed a fresh copy of sql server 2005 on windows 2003 server. I could move most of my databases except one. While attaching the database to the sql 2005 I got the following error:

Unable to oen "c:\program files\microsoftSQL server \MSSQL.1\MSSQL\DATA\mydb_log.ldf". operating system error 32:" 32(the process cannot access the file because it is being used by another process)". microsoft SQL server, error:5120)

You must be attaching the wrong file (one being used by another database).|||

I have a similar problem with the same error:

1) Detached MyDb.mdf (and .ldf) (Auto close = True)

2) copied MyDb.mdf and MyDb.ldf to a different folder

3) Re-attached MyDb from original location

4) Renamed copy to MyDbX.mdf and MyDbX.ldf

5) Attach copy (MyDbX.mdf), and in attach dialog change "Attach As" column to MyDbX

= Error 5120

Problem was the rename at step 4. Without this step the attach works OK, with step 5 renaming the database.

Without going back to check, I think step 4 was ok in SQL 2000 EM.