Showing posts with label message. Show all posts
Showing posts with label message. Show all posts

Tuesday, March 27, 2012

DBCC SHRINKDATABASE

SQL Server 2000 on Windows 2003
I want to shrink the Transaction Log file .
I run DBCC SHRINKDATABASE and I got the following message: Cannot shrink log
file 2 (IRIS_Log) because all logical log files are in use.
What should I do?
Thanks,
Dan
Hi,
You should backup the tranasction log before doing the DBCC SHRINK command.
Incase if you do not
need the transaction log backup then you can truncate the transaction log
using
Backup log <dbname> with Truncate_only
After doing eithe log backup or teuncate you could try Shrink. I recommend
you to DBCC SHRINKFILE to shrink the database files
Thanks
Hari
SQL Server MVP
"danA" <dea@.deamon.com> wrote in message
news:%23E8gYBZmFHA.1048@.tk2msftngp13.phx.gbl...
> SQL Server 2000 on Windows 2003
> I want to shrink the Transaction Log file .
> I run DBCC SHRINKDATABASE and I got the following message: Cannot shrink
> log file 2 (IRIS_Log) because all logical log files are in use.
> What should I do?
> Thanks,
> Dan
>
>
|||Many thanks Hari, it worked. Dan
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:OgaKWGZmFHA.2472@.TK2MSFTNGP15.phx.gbl...
> Hi,
> You should backup the transaction log before doing the DBCC SHRINK
> command. Incase if you do not
> need the transaction log backup then you can truncate the transaction log
> using
> Backup log <dbname> with Truncate_only
> After doing eithe log backup or teuncate you could try Shrink. I recommend
> you to DBCC SHRINKFILE to shrink the database files
> Thanks
> Hari
> SQL Server MVP
>
> "danA" <dea@.deamon.com> wrote in message
> news:%23E8gYBZmFHA.1048@.tk2msftngp13.phx.gbl...
>

DBCC SHRINKDATABASE

SQL Server 2000 on Windows 2003
I want to shrink the Transaction Log file .
I run DBCC SHRINKDATABASE and I got the following message: Cannot shrink log
file 2 (IRIS_Log) because all logical log files are in use.
What should I do?
Thanks,
DanHi,
You should backup the tranasction log before doing the DBCC SHRINK command.
Incase if you do not
need the transaction log backup then you can truncate the transaction log
using
Backup log <dbname> with Truncate_only
After doing eithe log backup or teuncate you could try Shrink. I recommend
you to DBCC SHRINKFILE to shrink the database files
Thanks
Hari
SQL Server MVP
"danA" <dea@.deamon.com> wrote in message
news:%23E8gYBZmFHA.1048@.tk2msftngp13.phx.gbl...
> SQL Server 2000 on Windows 2003
> I want to shrink the Transaction Log file .
> I run DBCC SHRINKDATABASE and I got the following message: Cannot shrink
> log file 2 (IRIS_Log) because all logical log files are in use.
> What should I do?
> Thanks,
> Dan
>
>|||Many thanks Hari, it worked. Dan
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:OgaKWGZmFHA.2472@.TK2MSFTNGP15.phx.gbl...
> Hi,
> You should backup the transaction log before doing the DBCC SHRINK
> command. Incase if you do not
> need the transaction log backup then you can truncate the transaction log
> using
> Backup log <dbname> with Truncate_only
> After doing eithe log backup or teuncate you could try Shrink. I recommend
> you to DBCC SHRINKFILE to shrink the database files
> Thanks
> Hari
> SQL Server MVP
>
> "danA" <dea@.deamon.com> wrote in message
> news:%23E8gYBZmFHA.1048@.tk2msftngp13.phx.gbl...
>> SQL Server 2000 on Windows 2003
>> I want to shrink the Transaction Log file .
>> I run DBCC SHRINKDATABASE and I got the following message: Cannot shrink
>> log file 2 (IRIS_Log) because all logical log files are in use.
>> What should I do?
>> Thanks,
>> Dan
>>
>

DBCC SHRINKDATABASE

SQL Server 2000 on Windows 2003
I want to shrink the Transaction Log file .
I run DBCC SHRINKDATABASE and I got the following message: Cannot shrink log
file 2 (IRIS_Log) because all logical log files are in use.
What should I do?
Thanks,
DanHi,
You should backup the tranasction log before doing the DBCC SHRINK command.
Incase if you do not
need the transaction log backup then you can truncate the transaction log
using
Backup log <dbname> with Truncate_only
After doing eithe log backup or teuncate you could try Shrink. I recommend
you to DBCC SHRINKFILE to shrink the database files
Thanks
Hari
SQL Server MVP
"danA" <dea@.deamon.com> wrote in message
news:%23E8gYBZmFHA.1048@.tk2msftngp13.phx.gbl...
> SQL Server 2000 on Windows 2003
> I want to shrink the Transaction Log file .
> I run DBCC SHRINKDATABASE and I got the following message: Cannot shrink
> log file 2 (IRIS_Log) because all logical log files are in use.
> What should I do?
> Thanks,
> Dan
>
>|||Many thanks Hari, it worked. Dan
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:OgaKWGZmFHA.2472@.TK2MSFTNGP15.phx.gbl...
> Hi,
> You should backup the transaction log before doing the DBCC SHRINK
> command. Incase if you do not
> need the transaction log backup then you can truncate the transaction log
> using
> Backup log <dbname> with Truncate_only
> After doing eithe log backup or teuncate you could try Shrink. I recommend
> you to DBCC SHRINKFILE to shrink the database files
> Thanks
> Hari
> SQL Server MVP
>
> "danA" <dea@.deamon.com> wrote in message
> news:%23E8gYBZmFHA.1048@.tk2msftngp13.phx.gbl...
>

Friday, February 24, 2012

dbcc checktable(sysindexes)

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.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!

Hi,
Could someone please tell me if there's a way to suppress the message sent to the sql error log after running the 'DBCC CHECKTABLE' command?
Thanks.Yes, there is a way to suppress it, but I don't remember the details off the top of my head. What are you trying to accomplish?

-PatP|||Well, instead of using checkdb, I'd like to run checktable in my script to avoid checking historical tables. However, running checktable keeps adding unnecessary entries to the sql log since I already have a log to hold the information. I don't need additional ones in the sql log.|||Running WITH NO_INFOMSGS for any DBCC statement will suppress all informational messages.|||Running with NO_INFOMSGS won't suppress the message in the sql server log.|||I'm just curious as to why you want to do this?|||What is the Audit level setting on SQL Server --> Security tab?|||The reason of using checktable is that there's a decision to keep the historical data in the same db but to a different table. Checktable is used in order to shorten the run time.

How does the Audit level in the Security affect the result in this circumstance?

DBCC CHECKTABLE on a View

I'm trying to run the following statement:
DBCC CHECKTABLE([vLostSaleCount], REPAIR_REBUILD) WITH NO_INFOMSGS
But I get this error message:
Server: Msg 2501, Level 16, State 1, Line 1
Could not find a table or object named 'vLostSaleCount'. Check sysobjects.
So I run this statement:
SELECT * FROM sysobjects WHERE id=OBJECT_ID(N'vLostSaleCount')
And get this result:
name id xtype uid info status base_schema_ver replinfo parent_obj crdate
ftcatid schema_ver stats_schema_ver type userstat sysstat indexdel refdate
version deltrig instrig updtrig seltrig category cache
vLostSaleCount 830626002 V 1 2 1610612736 16 0 0 2004-05-03 13:19:14.993 0
16 0 V 0 2 0 2004-05-03 13:19:14.993 0 0 0 0 0 0 0
(1 row(s) affected)
What is going on here? TIA!CHECKTABLE is checking physical consistency of the data. A view doesn't store any data so there is
nothing to check. Run CHECKTABLE on the tables that the view is querying instead.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Ron Hinds" <__ron__dontspamme@.wedontlikespam_garageiq.com> wrote in message
news:OK8fPsVPGHA.812@.TK2MSFTNGP10.phx.gbl...
> I'm trying to run the following statement:
> DBCC CHECKTABLE([vLostSaleCount], REPAIR_REBUILD) WITH NO_INFOMSGS
> But I get this error message:
> Server: Msg 2501, Level 16, State 1, Line 1
> Could not find a table or object named 'vLostSaleCount'. Check sysobjects.
> So I run this statement:
> SELECT * FROM sysobjects WHERE id=OBJECT_ID(N'vLostSaleCount')
> And get this result:
> name id xtype uid info status base_schema_ver replinfo parent_obj crdate
> ftcatid schema_ver stats_schema_ver type userstat sysstat indexdel refdate
> version deltrig instrig updtrig seltrig category cache
> vLostSaleCount 830626002 V 1 2 1610612736 16 0 0 2004-05-03 13:19:14.993 0
> 16 0 V 0 2 0 2004-05-03 13:19:14.993 0 0 0 0 0 0 0
> (1 row(s) affected)
> What is going on here? TIA!
>|||Thanks! I'm taking your word for it, but that seems to be in conflict with
what BOL says. Is BOL in error? Here is DBCC CHECKTABLE from BOL:
DBCC CHECKTABLE
Checks the integrity of the data, index, text, ntext, and image pages for
the specified table or indexed view.
Syntax
DBCC CHECKTABLE
( 'table_name' | 'view_name'
[ , NOINDEX
| index_id
| { REPAIR_ALLOW_DATA_LOSS
| REPAIR_FAST
| REPAIR_REBUILD }
]
) [ WITH { [ ALL_ERRORMSGS | NO_INFOMSGS ]
[ , [ TABLOCK ] ]
[ , [ ESTIMATEONLY ] ]
[ , [ PHYSICAL_ONLY ] ]
}
]
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uMAHDuVPGHA.648@.TK2MSFTNGP14.phx.gbl...
> CHECKTABLE is checking physical consistency of the data. A view doesn't
store any data so there is
> nothing to check. Run CHECKTABLE on the tables that the view is querying
instead.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Ron Hinds" <__ron__dontspamme@.wedontlikespam_garageiq.com> wrote in
message
> news:OK8fPsVPGHA.812@.TK2MSFTNGP10.phx.gbl...
> > I'm trying to run the following statement:
> >
> > DBCC CHECKTABLE([vLostSaleCount], REPAIR_REBUILD) WITH NO_INFOMSGS
> >
> > But I get this error message:
> >
> > Server: Msg 2501, Level 16, State 1, Line 1
> > Could not find a table or object named 'vLostSaleCount'. Check
sysobjects.
> >
> > So I run this statement:
> >
> > SELECT * FROM sysobjects WHERE id=OBJECT_ID(N'vLostSaleCount')
> >
> > And get this result:
> >
> > name id xtype uid info status base_schema_ver replinfo parent_obj crdate
> > ftcatid schema_ver stats_schema_ver type userstat sysstat indexdel
refdate
> > version deltrig instrig updtrig seltrig category cache
> > vLostSaleCount 830626002 V 1 2 1610612736 16 0 0 2004-05-03
13:19:14.993 0
> > 16 0 V 0 2 0 2004-05-03 13:19:14.993 0 0 0 0 0 0 0
> >
> > (1 row(s) affected)
> >
> > What is going on here? TIA!
> >
> >
>|||Is the view qualified with a name other than DBO?
"Ron Hinds" wrote:
> I'm trying to run the following statement:
> DBCC CHECKTABLE([vLostSaleCount], REPAIR_REBUILD) WITH NO_INFOMSGS
> But I get this error message:
> Server: Msg 2501, Level 16, State 1, Line 1
> Could not find a table or object named 'vLostSaleCount'. Check sysobjects.
> So I run this statement:
> SELECT * FROM sysobjects WHERE id=OBJECT_ID(N'vLostSaleCount')
> And get this result:
> name id xtype uid info status base_schema_ver replinfo parent_obj crdate
> ftcatid schema_ver stats_schema_ver type userstat sysstat indexdel refdate
> version deltrig instrig updtrig seltrig category cache
> vLostSaleCount 830626002 V 1 2 1610612736 16 0 0 2004-05-03 13:19:14.993 0
> 16 0 V 0 2 0 2004-05-03 13:19:14.993 0 0 0 0 0 0 0
> (1 row(s) affected)
> What is going on here? TIA!
>
>|||No - I even tried qualifying it with dbo and still got the error.
"Jeffrey K. Ericson" <JeffreyKEricson@.discussions.microsoft.com> wrote in
message news:0309BF46-E4A8-4F84-8B12-68B767AE40B6@.microsoft.com...
> Is the view qualified with a name other than DBO?
> "Ron Hinds" wrote:
> > I'm trying to run the following statement:
> >
> > DBCC CHECKTABLE([vLostSaleCount], REPAIR_REBUILD) WITH NO_INFOMSGS
> >
> > But I get this error message:
> >
> > Server: Msg 2501, Level 16, State 1, Line 1
> > Could not find a table or object named 'vLostSaleCount'. Check
sysobjects.
> >
> > So I run this statement:
> >
> > SELECT * FROM sysobjects WHERE id=OBJECT_ID(N'vLostSaleCount')
> >
> > And get this result:
> >
> > name id xtype uid info status base_schema_ver replinfo parent_obj crdate
> > ftcatid schema_ver stats_schema_ver type userstat sysstat indexdel
refdate
> > version deltrig instrig updtrig seltrig category cache
> > vLostSaleCount 830626002 V 1 2 1610612736 16 0 0 2004-05-03
13:19:14.993 0
> > 16 0 V 0 2 0 2004-05-03 13:19:14.993 0 0 0 0 0 0 0
> >
> > (1 row(s) affected)
> >
> > What is going on here? TIA!
> >
> >
> >|||BOL is talking about indexed views.
An indexed view is not a 'normal' view and use database storage.
Ben Nevarez, MCDBA, OCP
Database Administrator
"Ron Hinds" wrote:
> Thanks! I'm taking your word for it, but that seems to be in conflict with
> what BOL says. Is BOL in error? Here is DBCC CHECKTABLE from BOL:
> DBCC CHECKTABLE
> Checks the integrity of the data, index, text, ntext, and image pages for
> the specified table or indexed view.
> Syntax
> DBCC CHECKTABLE
> ( 'table_name' | 'view_name'
> [ , NOINDEX
> | index_id
> | { REPAIR_ALLOW_DATA_LOSS
> | REPAIR_FAST
> | REPAIR_REBUILD }
> ]
> ) [ WITH { [ ALL_ERRORMSGS | NO_INFOMSGS ]
> [ , [ TABLOCK ] ]
> [ , [ ESTIMATEONLY ] ]
> [ , [ PHYSICAL_ONLY ] ]
> }
> ]
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:uMAHDuVPGHA.648@.TK2MSFTNGP14.phx.gbl...
> > CHECKTABLE is checking physical consistency of the data. A view doesn't
> store any data so there is
> > nothing to check. Run CHECKTABLE on the tables that the view is querying
> instead.
> >
> > --
> > Tibor Karaszi, SQL Server MVP
> > http://www.karaszi.com/sqlserver/default.asp
> > http://www.solidqualitylearning.com/
> > Blog: http://solidqualitylearning.com/blogs/tibor/
> >
> >
> > "Ron Hinds" <__ron__dontspamme@.wedontlikespam_garageiq.com> wrote in
> message
> > news:OK8fPsVPGHA.812@.TK2MSFTNGP10.phx.gbl...
> > > I'm trying to run the following statement:
> > >
> > > DBCC CHECKTABLE([vLostSaleCount], REPAIR_REBUILD) WITH NO_INFOMSGS
> > >
> > > But I get this error message:
> > >
> > > Server: Msg 2501, Level 16, State 1, Line 1
> > > Could not find a table or object named 'vLostSaleCount'. Check
> sysobjects.
> > >
> > > So I run this statement:
> > >
> > > SELECT * FROM sysobjects WHERE id=OBJECT_ID(N'vLostSaleCount')
> > >
> > > And get this result:
> > >
> > > name id xtype uid info status base_schema_ver replinfo parent_obj crdate
> > > ftcatid schema_ver stats_schema_ver type userstat sysstat indexdel
> refdate
> > > version deltrig instrig updtrig seltrig category cache
> > > vLostSaleCount 830626002 V 1 2 1610612736 16 0 0 2004-05-03
> 13:19:14.993 0
> > > 16 0 V 0 2 0 2004-05-03 13:19:14.993 0 0 0 0 0 0 0
> > >
> > > (1 row(s) affected)
> > >
> > > What is going on here? TIA!
> > >
> > >
> >
>
>|||Note "*indexed* view". Do you have an index on that view?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Ron Hinds" <__ron__dontspamme@.wedontlikespam_garageiq.com> wrote in message
news:%23I6bXxVPGHA.2236@.TK2MSFTNGP15.phx.gbl...
> Thanks! I'm taking your word for it, but that seems to be in conflict with
> what BOL says. Is BOL in error? Here is DBCC CHECKTABLE from BOL:
> DBCC CHECKTABLE
> Checks the integrity of the data, index, text, ntext, and image pages for
> the specified table or indexed view.
> Syntax
> DBCC CHECKTABLE
> ( 'table_name' | 'view_name'
> [ , NOINDEX
> | index_id
> | { REPAIR_ALLOW_DATA_LOSS
> | REPAIR_FAST
> | REPAIR_REBUILD }
> ]
> ) [ WITH { [ ALL_ERRORMSGS | NO_INFOMSGS ]
> [ , [ TABLOCK ] ]
> [ , [ ESTIMATEONLY ] ]
> [ , [ PHYSICAL_ONLY ] ]
> }
> ]
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:uMAHDuVPGHA.648@.TK2MSFTNGP14.phx.gbl...
>> CHECKTABLE is checking physical consistency of the data. A view doesn't
> store any data so there is
>> nothing to check. Run CHECKTABLE on the tables that the view is querying
> instead.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> Blog: http://solidqualitylearning.com/blogs/tibor/
>>
>> "Ron Hinds" <__ron__dontspamme@.wedontlikespam_garageiq.com> wrote in
> message
>> news:OK8fPsVPGHA.812@.TK2MSFTNGP10.phx.gbl...
>> > I'm trying to run the following statement:
>> >
>> > DBCC CHECKTABLE([vLostSaleCount], REPAIR_REBUILD) WITH NO_INFOMSGS
>> >
>> > But I get this error message:
>> >
>> > Server: Msg 2501, Level 16, State 1, Line 1
>> > Could not find a table or object named 'vLostSaleCount'. Check
> sysobjects.
>> >
>> > So I run this statement:
>> >
>> > SELECT * FROM sysobjects WHERE id=OBJECT_ID(N'vLostSaleCount')
>> >
>> > And get this result:
>> >
>> > name id xtype uid info status base_schema_ver replinfo parent_obj crdate
>> > ftcatid schema_ver stats_schema_ver type userstat sysstat indexdel
> refdate
>> > version deltrig instrig updtrig seltrig category cache
>> > vLostSaleCount 830626002 V 1 2 1610612736 16 0 0 2004-05-03
> 13:19:14.993 0
>> > 16 0 V 0 2 0 2004-05-03 13:19:14.993 0 0 0 0 0 0 0
>> >
>> > (1 row(s) affected)
>> >
>> > What is going on here? TIA!
>> >
>> >
>|||I see. Thanks guys!
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uA5Qo$VPGHA.720@.TK2MSFTNGP14.phx.gbl...
> Note "*indexed* view". Do you have an index on that view?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Ron Hinds" <__ron__dontspamme@.wedontlikespam_garageiq.com> wrote in
message
> news:%23I6bXxVPGHA.2236@.TK2MSFTNGP15.phx.gbl...
> > Thanks! I'm taking your word for it, but that seems to be in conflict
with
> > what BOL says. Is BOL in error? Here is DBCC CHECKTABLE from BOL:
> >
> > DBCC CHECKTABLE
> > Checks the integrity of the data, index, text, ntext, and image pages
for
> > the specified table or indexed view.
> >
> > Syntax
> > DBCC CHECKTABLE
> > ( 'table_name' | 'view_name'
> > [ , NOINDEX
> > | index_id
> > | { REPAIR_ALLOW_DATA_LOSS
> > | REPAIR_FAST
> > | REPAIR_REBUILD }
> > ]
> > ) [ WITH { [ ALL_ERRORMSGS | NO_INFOMSGS ]
> > [ , [ TABLOCK ] ]
> > [ , [ ESTIMATEONLY ] ]
> > [ , [ PHYSICAL_ONLY ] ]
> > }
> > ]
> >
> >
> > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> > message news:uMAHDuVPGHA.648@.TK2MSFTNGP14.phx.gbl...
> >> CHECKTABLE is checking physical consistency of the data. A view doesn't
> > store any data so there is
> >> nothing to check. Run CHECKTABLE on the tables that the view is
querying
> > instead.
> >>
> >> --
> >> Tibor Karaszi, SQL Server MVP
> >> http://www.karaszi.com/sqlserver/default.asp
> >> http://www.solidqualitylearning.com/
> >> Blog: http://solidqualitylearning.com/blogs/tibor/
> >>
> >>
> >> "Ron Hinds" <__ron__dontspamme@.wedontlikespam_garageiq.com> wrote in
> > message
> >> news:OK8fPsVPGHA.812@.TK2MSFTNGP10.phx.gbl...
> >> > I'm trying to run the following statement:
> >> >
> >> > DBCC CHECKTABLE([vLostSaleCount], REPAIR_REBUILD) WITH NO_INFOMSGS
> >> >
> >> > But I get this error message:
> >> >
> >> > Server: Msg 2501, Level 16, State 1, Line 1
> >> > Could not find a table or object named 'vLostSaleCount'. Check
> > sysobjects.
> >> >
> >> > So I run this statement:
> >> >
> >> > SELECT * FROM sysobjects WHERE id=OBJECT_ID(N'vLostSaleCount')
> >> >
> >> > And get this result:
> >> >
> >> > name id xtype uid info status base_schema_ver replinfo parent_obj
crdate
> >> > ftcatid schema_ver stats_schema_ver type userstat sysstat indexdel
> > refdate
> >> > version deltrig instrig updtrig seltrig category cache
> >> > vLostSaleCount 830626002 V 1 2 1610612736 16 0 0 2004-05-03
> > 13:19:14.993 0
> >> > 16 0 V 0 2 0 2004-05-03 13:19:14.993 0 0 0 0 0 0 0
> >> >
> >> > (1 row(s) affected)
> >> >
> >> > What is going on here? TIA!
> >> >
> >> >
> >>
> >
> >
>

DBCC CheckIdent message value to application

Hi,
I'm trying to get the value that DBCC CheckIdent is returning, I could
see the message in the query analizer, but I'm unable to get this value into
my application since its not a results set or return value its just a
message, is there a way to accomplish it?, I want to give a way in my
application for the end user to view the next "Identity value" and they
should be able to change it, but I can't get that value.
Thanks in advance
Shloma Baum| I'm trying to get the value that DBCC CheckIdent is returning, I could
| see the message in the query analizer, but I'm unable to get this value
into
| my application since its not a results set or return value its just a
| message, is there a way to accomplish it?, I want to give a way in my
| application for the end user to view the next "Identity value" and they
| should be able to change it, but I can't get that value.
--
A workaround would be to use OSQL to pipe the result of DBCC CheckIdent
into a textfile and then get the application to read that file.
Another workaround is to select the @.@.identity into a variable immediately
after an insert operation.
But what you're trying to accomplish does not scale too well. In a busy
data entry environment, there's a high probability that you will insert
duplicate values.
Hope this helps,
--
Eric Cárdenas
SQL Server support

Sunday, February 19, 2012

DBCC CHECKDB returns error, sys.sysobjvalues

Hello,
Just starting to work with sql 2005.
Run DBCC CHECKDB on user database and received this message:
Incorrect PFS free space information for page (1:224) in object ID 60, index
ID 1, partition ID 281474980642816, alloc unit ID 71776119065149440 (type LOB
data). Expected value 0_PCT_FULL, actual value 100_PCT_FULL.
CHECKDB found 0 allocation errors and 2 consistency errors in table
'sys.sysobjvalues' (object ID 60).
The thing is I can't find sys.sysobjvalues table anywhere.
What is it?
Thanks.Hi Jan
If you run sp_help, or select * from sys.objects, you should see object, and
see the fact that it is a system table.
By default, you cannot access the system tables in SQL Server 2005; metadata
is accessed through catalog views (such as sys.objects)
If you use the Dedicated Administrator Connection, you can select from
sys.sysobjvalues, but it wouldn't enlighten you much as it is very cryptic
information.
--
HTH
Kalen Delaney, SQL Server MVP
http://sqlblog.com
"Jan" <Jan@.discussions.microsoft.com> wrote in message
news:79ED5E8D-0BAC-4E1B-8109-A8659F78513C@.microsoft.com...
> Hello,
> Just starting to work with sql 2005.
> Run DBCC CHECKDB on user database and received this message:
> Incorrect PFS free space information for page (1:224) in object ID 60,
> index
> ID 1, partition ID 281474980642816, alloc unit ID 71776119065149440 (type
> LOB
> data). Expected value 0_PCT_FULL, actual value 100_PCT_FULL.
> CHECKDB found 0 allocation errors and 2 consistency errors in table
> 'sys.sysobjvalues' (object ID 60).
> The thing is I can't find sys.sysobjvalues table anywhere.
> What is it?
> Thanks.

Friday, February 17, 2012

DBCC CHECKDB explanation

Hello All,
I ran DBCC CHECKDB('myDatabase'). After
scanning all the tables it finally gave this message:
CHECKDB found 0 allocation errors and 0 consistency errors
in database 'myDatabase'.
DBCC execution completed. If DBCC printed error messages,
contact your system administrator.
Can anyone tell me what does it mean by allocation errors
and consistency errors? Actually I am preparing for MCDBA
exams and I wanted to understand the concepts fully.
Thanks in advance
AnandExample of allocation error:
The allocation structure (IAM page) states that object X uses page Y. SQL Server goes to page Y and
the page header states that page Y is owned by object Z!
Example of consistency error:
SQL Server follows a linked list for an index and when coming to a page it sees that the previous
page in that page header is not the same as the page where it came from.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver
"Anand" <anand_r@.linuxmail.org> wrote in message news:118201c39237$75ab6810$a101280a@.phx.gbl...
> Hello All,
> I ran DBCC CHECKDB('myDatabase'). After
> scanning all the tables it finally gave this message:
> CHECKDB found 0 allocation errors and 0 consistency errors
> in database 'myDatabase'.
> DBCC execution completed. If DBCC printed error messages,
> contact your system administrator.
>
> Can anyone tell me what does it mean by allocation errors
> and consistency errors? Actually I am preparing for MCDBA
> exams and I wanted to understand the concepts fully.
> Thanks in advance
> Anand
>|||Thanks Tibor,
By the way when does this happen?
Regards
Anand
>--Original Message--
>Example of allocation error:
>The allocation structure (IAM page) states that object X
uses page Y. SQL Server goes to page Y and
>the page header states that page Y is owned by object Z!
>
>Example of consistency error:
>SQL Server follows a linked list for an index and when
coming to a page it sees that the previous
>page in that page header is not the same as the page
where it came from.
>--
>Tibor Karaszi, SQL Server MVP
>Archive at: http://groups.google.com/groups?oi=djq&as
ugroup=microsoft.public.sqlserver
>
>"Anand" <anand_r@.linuxmail.org> wrote in message
news:118201c39237$75ab6810$a101280a@.phx.gbl...
>> Hello All,
>> I ran DBCC CHECKDB('myDatabase'). After
>> scanning all the tables it finally gave this message:
>> CHECKDB found 0 allocation errors and 0 consistency
errors
>> in database 'myDatabase'.
>> DBCC execution completed. If DBCC printed error
messages,
>> contact your system administrator.
>>
>> Can anyone tell me what does it mean by allocation
errors
>> and consistency errors? Actually I am preparing for
MCDBA
>> exams and I wanted to understand the concepts fully.
>> Thanks in advance
>> Anand
>>
>
>.
>|||Theoretically it can be bug in SQL Server, writing the incorrect bits to disk. I don't know if any
such problems has appeared since 6.5. So, in practice, we are talking about HW problems, HW write
caching without battery backup and such things.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver
"Anand" <anand_r@.linuxmail.org> wrote in message news:2a51e01c3923c$54b99f50$a601280a@.phx.gbl...
> Thanks Tibor,
> By the way when does this happen?
> Regards
> Anand
>
> >--Original Message--
> >Example of allocation error:
> >
> >The allocation structure (IAM page) states that object X
> uses page Y. SQL Server goes to page Y and
> >the page header states that page Y is owned by object Z!
> >
> >
> >Example of consistency error:
> >SQL Server follows a linked list for an index and when
> coming to a page it sees that the previous
> >page in that page header is not the same as the page
> where it came from.
> >
> >--
> >Tibor Karaszi, SQL Server MVP
> >Archive at: http://groups.google.com/groups?oi=djq&as
> ugroup=microsoft.public.sqlserver
> >
> >
> >"Anand" <anand_r@.linuxmail.org> wrote in message
> news:118201c39237$75ab6810$a101280a@.phx.gbl...
> >> Hello All,
> >> I ran DBCC CHECKDB('myDatabase'). After
> >> scanning all the tables it finally gave this message:
> >>
> >> CHECKDB found 0 allocation errors and 0 consistency
> errors
> >> in database 'myDatabase'.
> >> DBCC execution completed. If DBCC printed error
> messages,
> >> contact your system administrator.
> >>
> >>
> >> Can anyone tell me what does it mean by allocation
> errors
> >> and consistency errors? Actually I am preparing for
> MCDBA
> >> exams and I wanted to understand the concepts fully.
> >>
> >> Thanks in advance
> >> Anand
> >>
> >>
> >
> >
> >.
> >|||Thanks Tibor,
Do you have any reference url which can throw more
light on such things.
Regards
Anand
>--Original Message--
>Theoretically it can be bug in SQL Server, writing the
incorrect bits to disk. I don't know if any
>such problems has appeared since 6.5. So, in practice, we
are talking about HW problems, HW write
>caching without battery backup and such things.
>--
>Tibor Karaszi, SQL Server MVP
>Archive at: http://groups.google.com/groups?oi=djq&as
ugroup=microsoft.public.sqlserver
>
>"Anand" <anand_r@.linuxmail.org> wrote in message
news:2a51e01c3923c$54b99f50$a601280a@.phx.gbl...
>> Thanks Tibor,
>> By the way when does this happen?
>> Regards
>> Anand
>>
>> >--Original Message--
>> >Example of allocation error:
>> >
>> >The allocation structure (IAM page) states that object
X
>> uses page Y. SQL Server goes to page Y and
>> >the page header states that page Y is owned by object
Z!
>> >
>> >
>> >Example of consistency error:
>> >SQL Server follows a linked list for an index and when
>> coming to a page it sees that the previous
>> >page in that page header is not the same as the page
>> where it came from.
>> >
>> >--
>> >Tibor Karaszi, SQL Server MVP
>> >Archive at: http://groups.google.com/groups?oi=djq&as
>> ugroup=microsoft.public.sqlserver
>> >
>> >
>> >"Anand" <anand_r@.linuxmail.org> wrote in message
>> news:118201c39237$75ab6810$a101280a@.phx.gbl...
>> >> Hello All,
>> >> I ran DBCC CHECKDB('myDatabase'). After
>> >> scanning all the tables it finally gave this message:
>> >>
>> >> CHECKDB found 0 allocation errors and 0 consistency
>> errors
>> >> in database 'myDatabase'.
>> >> DBCC execution completed. If DBCC printed error
>> messages,
>> >> contact your system administrator.
>> >>
>> >>
>> >> Can anyone tell me what does it mean by allocation
>> errors
>> >> and consistency errors? Actually I am preparing for
>> MCDBA
>> >> exams and I wanted to understand the concepts fully.
>> >>
>> >> Thanks in advance
>> >> Anand
>> >>
>> >>
>> >
>> >
>> >.
>> >
>
>.
>|||I'm sure that there exists web sites with such info, but I haven't searched for such myself. I'm
sure that you find such by doing a bit of web-searching.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver
"Anand" <anand_r@.linuxmail.org> wrote in message news:0f6301c3923e$aeacbe50$a301280a@.phx.gbl...
> Thanks Tibor,
> Do you have any reference url which can throw more
> light on such things.
> Regards
> Anand
> >--Original Message--
> >Theoretically it can be bug in SQL Server, writing the
> incorrect bits to disk. I don't know if any
> >such problems has appeared since 6.5. So, in practice, we
> are talking about HW problems, HW write
> >caching without battery backup and such things.
> >
> >--
> >Tibor Karaszi, SQL Server MVP
> >Archive at: http://groups.google.com/groups?oi=djq&as
> ugroup=microsoft.public.sqlserver
> >
> >
> >"Anand" <anand_r@.linuxmail.org> wrote in message
> news:2a51e01c3923c$54b99f50$a601280a@.phx.gbl...
> >> Thanks Tibor,
> >> By the way when does this happen?
> >>
> >> Regards
> >> Anand
> >>
> >>
> >> >--Original Message--
> >> >Example of allocation error:
> >> >
> >> >The allocation structure (IAM page) states that object
> X
> >> uses page Y. SQL Server goes to page Y and
> >> >the page header states that page Y is owned by object
> Z!
> >> >
> >> >
> >> >Example of consistency error:
> >> >SQL Server follows a linked list for an index and when
> >> coming to a page it sees that the previous
> >> >page in that page header is not the same as the page
> >> where it came from.
> >> >
> >> >--
> >> >Tibor Karaszi, SQL Server MVP
> >> >Archive at: http://groups.google.com/groups?oi=djq&as
> >> ugroup=microsoft.public.sqlserver
> >> >
> >> >
> >> >"Anand" <anand_r@.linuxmail.org> wrote in message
> >> news:118201c39237$75ab6810$a101280a@.phx.gbl...
> >> >> Hello All,
> >> >> I ran DBCC CHECKDB('myDatabase'). After
> >> >> scanning all the tables it finally gave this message:
> >> >>
> >> >> CHECKDB found 0 allocation errors and 0 consistency
> >> errors
> >> >> in database 'myDatabase'.
> >> >> DBCC execution completed. If DBCC printed error
> >> messages,
> >> >> contact your system administrator.
> >> >>
> >> >>
> >> >> Can anyone tell me what does it mean by allocation
> >> errors
> >> >> and consistency errors? Actually I am preparing for
> >> MCDBA
> >> >> exams and I wanted to understand the concepts fully.
> >> >>
> >> >> Thanks in advance
> >> >> Anand
> >> >>
> >> >>
> >> >
> >> >
> >> >.
> >> >
> >
> >
> >.
> >

Tuesday, February 14, 2012

DBCC CHECKCONSTRAINTS

Hi all,
I run a
DBCC CHECKCONSTRAINTS WITH ALL_CONSTRAINTS
on my database, and i am prompted this message :
Server: Msg 8170, Level 16, State 2, Line 1
Insufficient result space to convert uniqueidentifier value to char.
The statement has been terminated.
I have tried to specify a table, and it seems to be caused by a
non-validating foreign key in the uniqueidentifier type.
I have found (on the web and this newsgroup) several posts about this
problem, but nobody gave (or found ?) the explaination/solution.
Can anybody tell me how to solve this problem ?
Thanks
PS :
Hope my frenchy english is clear enough ...
I need this DBCC, so don't explain me how to prevent FK violation ;o).
We have fixed this bug in SP4 for SQL 2000. Have you tried the beta yet? You can sign up at http://support.microsoft.com/default...;en-us;290211. Please let us know if you still have problems.
Thanks,
Ryan Stonecipher
Microsoft SQL Server Storage Engine, DBCC
"SFauvel" <sylvainfauvel@.free.fr> wrote in message news:7a9148e7.0501210833.be22e21@.posting.google.co m...
> Hi all,
> I run a
> DBCC CHECKCONSTRAINTS WITH ALL_CONSTRAINTS
> on my database, and i am prompted this message :
> Server: Msg 8170, Level 16, State 2, Line 1
> Insufficient result space to convert uniqueidentifier value to char.
> The statement has been terminated.
> I have tried to specify a table, and it seems to be caused by a
> non-validating foreign key in the uniqueidentifier type.
> I have found (on the web and this newsgroup) several posts about this
> problem, but nobody gave (or found ?) the explaination/solution.
> Can anybody tell me how to solve this problem ?
> Thanks
> PS :
> Hope my frenchy english is clear enough ...
> I need this DBCC, so don't explain me how to prevent FK violation ;o).

DBCC CHECKCONSTRAINTS

Hi all,
I run a
DBCC CHECKCONSTRAINTS WITH ALL_CONSTRAINTS
on my database, and i am prompted this message :
Server: Msg 8170, Level 16, State 2, Line 1
Insufficient result space to convert uniqueidentifier value to char.
The statement has been terminated.
I have tried to specify a table, and it seems to be caused by a
non-validating foreign key in the uniqueidentifier type.
I have found (on the web and this newsgroup) several posts about this
problem, but nobody gave (or found ') the explaination/solution.
Can anybody tell me how to solve this problem ?
Thanks
PS :
Hope my frenchy english is clear enough ...
I need this DBCC, so don't explain me how to prevent FK violation ;o).This is a multi-part message in MIME format.
--=_NextPart_000_007F_01C4FFB4.8F43D500
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
We have fixed this bug in SP4 for SQL 2000. Have you tried the beta =yet? You can sign up at =http://support.microsoft.com/default.aspx?scid=3Dkb;en-us;290211. =Please let us know if you still have problems.
Thanks,
Ryan Stonecipher
Microsoft SQL Server Storage Engine, DBCC
"SFauvel" <sylvainfauvel@.free.fr> wrote in message =news:7a9148e7.0501210833.be22e21@.posting.google.com...
> Hi all,
> > I run a > DBCC CHECKCONSTRAINTS WITH ALL_CONSTRAINTS
> on my database, and i am prompted this message :
> > Server: Msg 8170, Level 16, State 2, Line 1
> Insufficient result space to convert uniqueidentifier value to char.
> The statement has been terminated.
> > I have tried to specify a table, and it seems to be caused by a
> non-validating foreign key in the uniqueidentifier type.
> > I have found (on the web and this newsgroup) several posts about this
> problem, but nobody gave (or found ') the explaination/solution.
> Can anybody tell me how to solve this problem ? > > Thanks
> > PS : > Hope my frenchy english is clear enough ...
> I need this DBCC, so don't explain me how to prevent FK violation ;o).
--=_NextPart_000_007F_01C4FFB4.8F43D500
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

We have fixed this bug in SP4 for SQL 2000. =Have you tried the beta yet? You can sign up at http://support.microsoft.com/default.aspx?scid=3Dkb;en-us;290211.&nb=sp; Please let us know if you still have problems.
Thanks,
Ryan StonecipherMicrosoft SQL Server Storage =Engine, DBCC
"SFauvel" wrote in message news:7a9148e7.0501210833.be22e21@.posting.google.com...> =Hi all,> > I run a > DBCC CHECKCONSTRAINTS WITH =ALL_CONSTRAINTS> on my database, and i am prompted this message :> > Server: =Msg 8170, Level 16, State 2, Line 1> Insufficient result space to convert uniqueidentifier value to char.> The statement has been terminated.> > I have tried to specify a table, and it =seems to be caused by a> non-validating foreign key in the uniqueidentifier type.> > I have found (on the web and this newsgroup) =several posts about this> problem, but nobody gave (or found ') the explaination/solution.> Can anybody tell me how to solve this =problem ? > > Thanks> > PS : > Hope my frenchy =english is clear enough ...> I need this DBCC, so don't explain me how to =prevent FK violation ;o).

--=_NextPart_000_007F_01C4FFB4.8F43D500--

DBCC CHECKCONSTRAINTS

Hi all,
I run a
DBCC CHECKCONSTRAINTS WITH ALL_CONSTRAINTS
on my database, and i am prompted this message :
Server: Msg 8170, Level 16, State 2, Line 1
Insufficient result space to convert uniqueidentifier value to char.
The statement has been terminated.
I have tried to specify a table, and it seems to be caused by a
non-validating foreign key in the uniqueidentifier type.
I have found (on the web and this newsgroup) several posts about this
problem, but nobody gave (or found ') the explaination/solution.
Can anybody tell me how to solve this problem ?
Thanks
PS :
Hope my frenchy english is clear enough ...
I need this DBCC, so don't explain me how to prevent FK violation ;o).We have fixed this bug in SP4 for SQL 2000. Have you tried the beta yet? You can sign
up at http://support.microsoft.com/defaul...b;en-us;290211. Plea
se let us know if you still have problems.
Thanks,
Ryan Stonecipher
Microsoft SQL Server Storage Engine, DBCC
"SFauvel" <sylvainfauvel@.free.fr> wrote in message news:7a9148e7.0501210833.be22e21@.posting.
google.com...
> Hi all,
>
> I run a
> DBCC CHECKCONSTRAINTS WITH ALL_CONSTRAINTS
> on my database, and i am prompted this message :
>
> Server: Msg 8170, Level 16, State 2, Line 1
> Insufficient result space to convert uniqueidentifier value to char.
> The statement has been terminated.
>
> I have tried to specify a table, and it seems to be caused by a
> non-validating foreign key in the uniqueidentifier type.
>
> I have found (on the web and this newsgroup) several posts about this
> problem, but nobody gave (or found ') the explaination/solution.
> Can anybody tell me how to solve this problem ?
>
> Thanks
>
> PS :
> Hope my frenchy english is clear enough ...
> I need this DBCC, so don't explain me how to prevent FK violation ;o).