Friday, February 24, 2012
dbcc checktable(sysindexes)
this, the attach fails due to an index problem. The error message
indicates that I should run:
dbcc checktable(sysindexes)
when I run this on the original server (where the database is attached)
I get a missing sysindexes object error.
However, I am able to run this:
select * from sysindexes
without any apparent problem.
What do I do now?
FYI: dbcc checkdb reports no problems.
TIA.Hi Karl
Did you try DBCC CHECKCATALOG?
--
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com
"Karl" <karlt@.nospam.nospame> wrote in message
news:O6WspeMbGHA.3740@.TK2MSFTNGP03.phx.gbl...
> I'm trying to attach a copy of a database to another server. When I do
> this, the attach fails due to an index problem. The error message
> indicates that I should run:
> dbcc checktable(sysindexes)
> when I run this on the original server (where the database is attached) I
> get a missing sysindexes object error.
> However, I am able to run this:
> select * from sysindexes
> without any apparent problem.
> What do I do now?
> FYI: dbcc checkdb reports no problems.
>
> TIA.|||Thanks for the reply.
DBCC CHECKCATALOG reports no errors. It also doesn't give any other
information other than that command completed successfully.
Now what?
Kalen Delaney wrote:
> Hi Karl
> Did you try DBCC CHECKCATALOG?
>|||Karl
So , you don't see the database since as you said the attach command is
failed, am I right?
Do you detach the database on the "source" server?
Can you perfom BACKUP DATABASE on the source server , then copy the .BAK
file to the "destination" server and run RESTORE DATABASE command? Do you
get the same error?
"Karl" <karlt@.nospam.nospame> wrote in message
news:%23iKyzWPbGHA.3376@.TK2MSFTNGP05.phx.gbl...
> Thanks for the reply.
> DBCC CHECKCATALOG reports no errors. It also doesn't give any other
> information other than that command completed successfully.
> Now what?
>
>
> Kalen Delaney wrote:
>> Hi Karl
>> Did you try DBCC CHECKCATALOG?
dbcc checktable(sysindexes)
this, the attach fails due to an index problem. The error message
indicates that I should run:
dbcc checktable(sysindexes)
when I run this on the original server (where the database is attached)
I get a missing sysindexes object error.
However, I am able to run this:
select * from sysindexes
without any apparent problem.
What do I do now?
FYI: dbcc checkdb reports no problems.
TIA.Hi Karl
Did you try DBCC CHECKCATALOG?
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com
"Karl" <karlt@.nospam.nospame> wrote in message
news:O6WspeMbGHA.3740@.TK2MSFTNGP03.phx.gbl...
> I'm trying to attach a copy of a database to another server. When I do
> this, the attach fails due to an index problem. The error message
> indicates that I should run:
> dbcc checktable(sysindexes)
> when I run this on the original server (where the database is attached) I
> get a missing sysindexes object error.
> However, I am able to run this:
> select * from sysindexes
> without any apparent problem.
> What do I do now?
> FYI: dbcc checkdb reports no problems.
>
> TIA.|||Thanks for the reply.
DBCC CHECKCATALOG reports no errors. It also doesn't give any other
information other than that command completed successfully.
Now what?
Kalen Delaney wrote:
> Hi Karl
> Did you try DBCC CHECKCATALOG?
>|||Karl
So , you don't see the database since as you said the attach command is
failed, am I right?
Do you detach the database on the "source" server?
Can you perfom BACKUP DATABASE on the source server , then copy the .BAK
file to the "destination" server and run RESTORE DATABASE command? Do you
get the same error?
"Karl" <karlt@.nospam.nospame> wrote in message
news:%23iKyzWPbGHA.3376@.TK2MSFTNGP05.phx.gbl...[vbcol=seagreen]
> Thanks for the reply.
> DBCC CHECKCATALOG reports no errors. It also doesn't give any other
> information other than that command completed successfully.
> Now what?
>
>
> Kalen Delaney wrote:
DBCC CHECKTABLE
Could not find row in sysindexes for database id 11, object id 1, index id 1.
Run DBCC CHECKTABLE on sysindexes
i dont know what dbcc checktable is or how to run.
pls help
This is fully documented in the Books Online.
You might even want to run a DBCC CHECKDB to make sure everything is alright.
WesleyB
Visit my SQL Server weblog @. http://dis4ea.blogspot.com
|||i ran DBCC CHECKDB on master and model and have no problemsI looked at bol for checktable and dont understand, i have not worked with SQL Srv or another db before. i dont know how to run on sysindexes as the msg states in the 1st post
how do i run it with REPAIR_ALLOW_DATA_LOSS , REPAIR_FAST or REPAIR_REBUILD
here is the whole msg:
TITLE: Microsoft SQL Server Management Studio
Attach database failed for Server 'BUSTED'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
Could not find row in sysindexes for database ID 11, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.
Could not open new database 'Asset5'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 602)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=602&LinkId=20476
BUTTONS:
OK
|||
i think you are trying to attach database from SQL Server 2005 to SQL Server 2000 which is not possible. Please check the version of source and target. If its from 2005 to 2000 then its not possible.
Madhu
|||For the source database that you are trying to attach, run DBCC CHECKDB on that database. You need to check and see if the database you are trying to attach is corrupted. You would do that by executing the DBCC on the source database, not on the server you are trying to attach to.
Log onto the server where the source database is and change the database context to that database. Then execute
DBCC CHECKDB
You don't want to run with repair options to start with - you just want to do a checkdb first with no repair options and go from there. Using the repair allow data loss option isn't something you generally want to do anyway. There are other options before going down that road that should be explored. It all depends on what messages are returned when you do the DBCC CHECKDB
-Sue
Tuesday, February 14, 2012
DBCC CheckDB
Thanks,
MitchSince DBCC CHECKDB by itself does not acquire a table lock, it suggests the
system tables are not necessarily updated. This is the same case with DBCC
CHECKTABLE we well.
Hoewever, if you use the REPAIR options associated with DBCC CHECKDB, it
will update the sysindexes table since it can include allocation and
deallocation of rows and pages for correcting allocation errors, structural
row or page errors, and deletion of corrupted text objects.
Anith