Showing posts with label group. Show all posts
Showing posts with label group. Show all posts

Tuesday, March 27, 2012

A curious case of data corruption

Dear group,

if someone could give me an idea what is going on in one of our
databases, this would really really be helpful.

We have two tables with around 2 / 3 million rows. These tables have no
key and no ID. (This major design flaw will be overcome in some later
version of the application-software working on this DB but right now i
have to live with this).

Now for the funny bit

1) I open one window in the Query-Analyzer and write some code like
Begin transaction INSERT INTO TABLE COMMIT
2) in another window i write "SELECT COUNT(*) from TABLE"

If I perform the insert then afterwards select count(*) the row-count
is incremented by two whereas the Insert-Statement said "1 row(s)
modified.

DBCC gives no errors.
DBCC gives amount of rows 2 million rows
Select count(*) on the same table gives 3 million rows

Exporting the data, truncating the table re-importing data gives no
result, right now the DTS-status is 203 and the machine is "thinking".

Is there any possibility to check the "integrity" of the table?

This problem is on the production machine, but right now i am working
on a copy so it was propagated with backup / restore-mechanism.

Any hint would be very helpful

Thanks and Greetings

Uli(uli2003wien@.lycos.at) writes:
> We have two tables with around 2 / 3 million rows. These tables have no
> key and no ID. (This major design flaw will be overcome in some later
> version of the application-software working on this DB but right now i
> have to live with this).
> Now for the funny bit
> 1) I open one window in the Query-Analyzer and write some code like
> Begin transaction INSERT INTO TABLE COMMIT
> 2) in another window i write "SELECT COUNT(*) from TABLE"
> If I perform the insert then afterwards select count(*) the row-count
> is incremented by two whereas the Insert-Statement said "1 row(s)
> modified.
> DBCC gives no errors.
> DBCC gives amount of rows 2 million rows
> Select count(*) on the same table gives 3 million rows

Well, I would definitely add a non-unique clustered index on the
table. It does not really matter which column, but if you add the
index, the entire table will be reorganized.

I recognize the symptom; other people have recommended similar observations.
Although they usually had a WHERE clause, and maybe even some indexes
on the table. I vaguely recall that a clustered index was a workaround
out of the problem.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||(uli2003wien@.lycos.at) writes:
> We have two tables with around 2 / 3 million rows. These tables have no
> key and no ID. (This major design flaw will be overcome in some later
> version of the application-software working on this DB but right now i
> have to live with this).
> Now for the funny bit
> 1) I open one window in the Query-Analyzer and write some code like
> Begin transaction INSERT INTO TABLE COMMIT
> 2) in another window i write "SELECT COUNT(*) from TABLE"
> If I perform the insert then afterwards select count(*) the row-count
> is incremented by two whereas the Insert-Statement said "1 row(s)
> modified.
> DBCC gives no errors.
> DBCC gives amount of rows 2 million rows
> Select count(*) on the same table gives 3 million rows

Well, I would definitely add a non-unique clustered index on the
table. It does not really matter which column, but if you add the
index, the entire table will be reorganized.

I recognize the symptom; other people have recommended similar observations.
Although they usually had a WHERE clause, and maybe even some indexes
on the table. I vaguely recall that a clustered index was a workaround
out of the problem.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||
Erland Sommarskog schrieb:
> (uli2003wien@.lycos.at) writes:
> > We have two tables with around 2 / 3 million rows. These tables have no
> > key and no ID. (This major design flaw will be overcome in some later
> > version of the application-software working on this DB but right now i
> > have to live with this).
> > Now for the funny bit
> > 1) I open one window in the Query-Analyzer and write some code like
> > Begin transaction INSERT INTO TABLE COMMIT
> > 2) in another window i write "SELECT COUNT(*) from TABLE"
> > If I perform the insert then afterwards select count(*) the row-count
> > is incremented by two whereas the Insert-Statement said "1 row(s)
> > modified.
> > DBCC gives no errors.
> > DBCC gives amount of rows 2 million rows
> > Select count(*) on the same table gives 3 million rows
> Well, I would definitely add a non-unique clustered index on the
> table. It does not really matter which column, but if you add the
> index, the entire table will be reorganized.
> I recognize the symptom; other people have recommended similar observations.
> Although they usually had a WHERE clause, and maybe even some indexes
> on the table. I vaguely recall that a clustered index was a workaround
> out of the problem.

Thank you Erland,

as always a great help and a hint for the right direction. Actually
this table had already a clustered index but dropping the index and
recreating the index did the job for me (and much faster than
exporting, dropping and importing the table)

Regards

Uli|||
Erland Sommarskog schrieb:
> (uli2003wien@.lycos.at) writes:
> > We have two tables with around 2 / 3 million rows. These tables have no
> > key and no ID. (This major design flaw will be overcome in some later
> > version of the application-software working on this DB but right now i
> > have to live with this).
> > Now for the funny bit
> > 1) I open one window in the Query-Analyzer and write some code like
> > Begin transaction INSERT INTO TABLE COMMIT
> > 2) in another window i write "SELECT COUNT(*) from TABLE"
> > If I perform the insert then afterwards select count(*) the row-count
> > is incremented by two whereas the Insert-Statement said "1 row(s)
> > modified.
> > DBCC gives no errors.
> > DBCC gives amount of rows 2 million rows
> > Select count(*) on the same table gives 3 million rows
> Well, I would definitely add a non-unique clustered index on the
> table. It does not really matter which column, but if you add the
> index, the entire table will be reorganized.
> I recognize the symptom; other people have recommended similar observations.
> Although they usually had a WHERE clause, and maybe even some indexes
> on the table. I vaguely recall that a clustered index was a workaround
> out of the problem.

Thank you Erland,

as always a great help and a hint for the right direction. Actually
this table had already a clustered index but dropping the index and
recreating the index did the job for me (and much faster than
exporting, dropping and importing the table)

Regards

Uli|||(uli2003wien@.lycos.at) writes:
> as always a great help and a hint for the right direction. Actually
> this table had already a clustered index but dropping the index and
> recreating the index did the job for me (and much faster than
> exporting, dropping and importing the table)

That's good to hear. I would keep an eye on the table, in case the
problem would reappear.

By the way, rather than dropping and recreating, DBCC DBREINDEX can
be somewhat quicker. You can also use WITH DROP_EXISTING on CREATE INDEX.

This is particularly important if you have non-clustered indexes on the
table as well, as they will have to be rebuilt if you drop the clustered
index. This is because the NC indexes use the clustered index keys as
their row locator.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Monday, March 19, 2012

8198 error

sql2k sp3
win2k sp4
Im trying to create a Pull Subscription for replication and get "Error 8198:
Could not obtain information about Windows NT group/ user 'domain/ user'".
I read this:
http://support.microsoft.com/?kbid=834124
But both boxes are in the same domain and the same subnet. Both use the same
domain admin account for SQL Server and the Agent accounts.
I also read this:
http://support.microsoft.com/?kbid=838460
But Im not about to install sp4 Beta on anything. SA is the owner of all the
jobs.
Is there anything else I can do?
TIA, ChrisR
we are receiving these all over the place where I work. They are normally
solved by changing the job owner to sa and restarting the job. It seems that
a recent update has caused this problem/behavior.
"ChrisR" <noemail@.bla.com> wrote in message
news:%237FEr0PTFHA.3696@.TK2MSFTNGP15.phx.gbl...
> sql2k sp3
> win2k sp4
> Im trying to create a Pull Subscription for replication and get "Error
> 8198:
> Could not obtain information about Windows NT group/ user 'domain/ user'".
> I read this:
> http://support.microsoft.com/?kbid=834124
> But both boxes are in the same domain and the same subnet. Both use the
> same
> domain admin account for SQL Server and the Agent accounts.
> I also read this:
> http://support.microsoft.com/?kbid=838460
> But Im not about to install sp4 Beta on anything. SA is the owner of all
> the jobs.
> Is there anything else I can do?
> TIA, ChrisR
>
|||It would have been easier if that had been it. I didnt realize that these
two boxes are in they're own little world, and that connections to them can
be rather difficult.
Thanks Hillary.
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:%23B19ZdQTFHA.3464@.tk2msftngp13.phx.gbl...
> we are receiving these all over the place where I work. They are normally
> solved by changing the job owner to sa and restarting the job. It seems
> that a recent update has caused this problem/behavior.
> "ChrisR" <noemail@.bla.com> wrote in message
> news:%237FEr0PTFHA.3696@.TK2MSFTNGP15.phx.gbl...
>

Sunday, February 19, 2012

6.5 Group/User Permissions

Is there a way to easily disable Group/User access to a database without
having to either reset the permissions for the User and/or Group or drop the
User/Group.
In effect I want to selectively stop groups of users accessing a database
temporarily without the need to do major surgery on the object/user
permissions. Just switch them off for a short time, so to speak, and then
switch them back on again.
Please reply to newsgroup or DBA.SDC@.DIAL.PIPEX.COM
PLEASE do not crosspost to so many different sections. One, or at most two,
is enough.
Kalen Delaney
MCSE, SQL Server MCT, MVP
ukndf wrote in message <73bvgs$4k5$1@.plug.news.pipex.net>...
>Is there a way to easily disable Group/User access to a database without
>having to either reset the permissions for the User and/or Group or drop
the
>User/Group.
>In effect I want to selectively stop groups of users accessing a database
>temporarily without the need to do major surgery on the object/user
>permissions. Just switch them off for a short time, so to speak, and then
>switch them back on again.
>Please reply to newsgroup or DBA.SDC@.DIAL.PIPEX.COM
>
|||If you need to run SQL Server alone you can always start it with the single
user switch (check the docs)
If you are looking to disable users and all your security is handled via
groups you could write a short proc to move them to a group with no rights
and once you finished what you wanted to do, move them back in their groups.
Doing this would no require setting all the rights on the objects.

6.5 Group/User Permissions

Is there a way to easily disable Group/User access to a database without
having to either reset the permissions for the User and/or Group or drop the
User/Group.
In effect I want to selectively stop groups of users accessing a database
temporarily without the need to do major surgery on the object/user
permissions. Just switch them off for a short time, so to speak, and then
switch them back on again.
Please reply to newsgroup or DBA.SDC@.DIAL.PIPEX.COM
PLEASE do not crosspost to so many different sections. One, or at most two,
is enough.
Kalen Delaney
MCSE, SQL Server MCT, MVP
ukndf wrote in message <73bvgs$4k5$1@.plug.news.pipex.net>...
>Is there a way to easily disable Group/User access to a database without
>having to either reset the permissions for the User and/or Group or drop
the
>User/Group.
>In effect I want to selectively stop groups of users accessing a database
>temporarily without the need to do major surgery on the object/user
>permissions. Just switch them off for a short time, so to speak, and then
>switch them back on again.
>Please reply to newsgroup or DBA.SDC@.DIAL.PIPEX.COM
>
|||If you need to run SQL Server alone you can always start it with the single
user switch (check the docs)
If you are looking to disable users and all your security is handled via
groups you could write a short proc to move them to a group with no rights
and once you finished what you wanted to do, move them back in their groups.
Doing this would no require setting all the rights on the objects.

6.5 Group/User Permissions

Is there a way to easily disable Group/User access to a database without
having to either reset the permissions for the User and/or Group or drop the
User/Group.
In effect I want to selectively stop groups of users accessing a database
temporarily without the need to do major surgery on the object/user
permissions. Just switch them off for a short time, so to speak, and then
switch them back on again.
Please reply to newsgroup or DBA.SDC@.DIAL.PIPEX.COM
PLEASE do not crosspost to so many different sections. One, or at most two,
is enough.
Kalen Delaney
MCSE, SQL Server MCT, MVP
ukndf wrote in message <73bvgs$4k5$1@.plug.news.pipex.net>...
>Is there a way to easily disable Group/User access to a database without
>having to either reset the permissions for the User and/or Group or drop
the
>User/Group.
>In effect I want to selectively stop groups of users accessing a database
>temporarily without the need to do major surgery on the object/user
>permissions. Just switch them off for a short time, so to speak, and then
>switch them back on again.
>Please reply to newsgroup or DBA.SDC@.DIAL.PIPEX.COM
>
|||If you need to run SQL Server alone you can always start it with the single
user switch (check the docs)
If you are looking to disable users and all your security is handled via
groups you could write a short proc to move them to a group with no rights
and once you finished what you wanted to do, move them back in their groups.
Doing this would no require setting all the rights on the objects.