Showing posts with label databases. Show all posts
Showing posts with label databases. Show all posts

Friday, March 30, 2012

knowledge about SQL Server Express

I don't have any knowledge about SQL Server at all... I wanna know:

1. What is SQL Server?
2. Have SQL Server something to do with databases and Microsoft Access to do?
3. What is the link between Visual C++ Express Edition and SQL Server Express Edition?
4. Where on the web can I learn (tutorials) how to use SQL Server Express Edition?

1. What is SQL Server?

SQL Server is a DataBaseManagementSystem used to store and manipulate data.

2. Have SQL Server something to do with databases and Microsoft Access to do?

SQL Server and Access are both DBMS. SQL Server is just a much or advanced DBMS.

3. What is the link between Visual C++ Express Edition and SQL Server Express Edition?

No direct link, except that u can use Visual C++ Express to connect to SQL Server Expess for data manipulation. Both are free to download on MS site.

4. Where on the web can I learn (tutorials) how to use SQL Server Express Edition?

http://msdn.microsoft.com/vstudio/express/

|||Thank you very much for your helpful information!

Friday, March 23, 2012

Kill Old Sessions

I've got a few databases which users access using Terminal Server. I
noticed today I had several (20+) sessions which had a Last Batch date
which were days even weeks old.
I want to kill these old sessions if the Last Batch date is greater
than 5 hours.
I also noticed there are several background sessions being run by the
sa account on master db and they are several days old. I don't believe
I should kill these sessions.
Does anyone have a script they currently use to manage these old
sessions?
Izzy
I forgot to list, I'm using SQL Server 2000.
Thanks,
Izzy wrote:
> I've got a few databases which users access using Terminal Server. I
> noticed today I had several (20+) sessions which had a Last Batch date
> which were days even weeks old.
> I want to kill these old sessions if the Last Batch date is greater
> than 5 hours.
> I also noticed there are several background sessions being run by the
> sa account on master db and they are several days old. I don't believe
> I should kill these sessions.
> Does anyone have a script they currently use to manage these old
> sessions?
> Izzy
|||It is just a matter of writing a cursor on the sysprocesses table. You can use
http://www.dbmaint.com/download/util...kill_users.sql as a starter for your script.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Izzy" <israel.richner@.gmail.com> wrote in message
news:1160062917.135174.41640@.h48g2000cwc.googlegro ups.com...
>I forgot to list, I'm using SQL Server 2000.
> Thanks,
>
> Izzy wrote:
>
|||Execellent!
Thanks a bunch.
Izzy
Tibor Karaszi wrote:[vbcol=seagreen]
> It is just a matter of writing a cursor on the sysprocesses table. You can use
> http://www.dbmaint.com/download/util...kill_users.sql as a starter for your script.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Izzy" <israel.richner@.gmail.com> wrote in message
> news:1160062917.135174.41640@.h48g2000cwc.googlegro ups.com...
|||It seems to me that you are treating the symptop, not the problem.
The symptom is the old sessions.
The problem is that people do not exit Terminal Server correctly. Can you
encourage users to log out of the Terminal Server correctly? Can you
remotely log the users out (and end their database connection in the
process)?
Keith Kratochvil
"Izzy" <israel.richner@.gmail.com> wrote in message
news:1160061806.706762.53740@.m7g2000cwm.googlegrou ps.com...
> I've got a few databases which users access using Terminal Server. I
> noticed today I had several (20+) sessions which had a Last Batch date
> which were days even weeks old.
> I want to kill these old sessions if the Last Batch date is greater
> than 5 hours.
> I also noticed there are several background sessions being run by the
> sa account on master db and they are several days old. I don't believe
> I should kill these sessions.
> Does anyone have a script they currently use to manage these old
> sessions?
> Izzy
>
|||That is exactly the problem, most users are set up to be logged out of
terminal server at midnight if they are not already logged out.
BUT, I have users who work in our shop on 3rd shift who use the same
account as users on first shift.
I've explained too them they need to log out correctly, but of course
users do whatever they want anyway, and just give you lip service while
your in front of them.
Question:
In the example you sent, your query does not eliminate some sessions
from being killed. For instance, I have 4 which have this listed in the
"cmd" line:
LAZY WRITER
LOG WRITER
LOCK MONITOR
CHECKPOINT SLEEP
Is there going to be any negative or unexpected behavior if these get
killed?
Is there something I should query on to eliminate system processes?
Izzy
Keith Kratochvil wrote:[vbcol=seagreen]
> It seems to me that you are treating the symptop, not the problem.
> The symptom is the old sessions.
> The problem is that people do not exit Terminal Server correctly. Can you
> encourage users to log out of the Terminal Server correctly? Can you
> remotely log the users out (and end their database connection in the
> process)?
> --
> Keith Kratochvil
>
> "Izzy" <israel.richner@.gmail.com> wrote in message
> news:1160061806.706762.53740@.m7g2000cwm.googlegrou ps.com...
|||> In the example you sent, your query does not eliminate some sessions
> from being killed. For instance, I have 4 which have this listed in the
> "cmd" line:
> LAZY WRITER
> LOG WRITER
> LOCK MONITOR
> CHECKPOINT SLEEP
> Is there going to be any negative or unexpected behavior if these get
> killed?
These are system connections, and I'm pretty certain they can't be killed even if you try to (else
MS wouldn't done a good job protecting the system processes). You should add a filter to the SELECT
statement, like spid > 50.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Izzy" <israel.richner@.gmail.com> wrote in message
news:1160066738.477635.116660@.h48g2000cwc.googlegr oups.com...
> That is exactly the problem, most users are set up to be logged out of
> terminal server at midnight if they are not already logged out.
> BUT, I have users who work in our shop on 3rd shift who use the same
> account as users on first shift.
> I've explained too them they need to log out correctly, but of course
> users do whatever they want anyway, and just give you lip service while
> your in front of them.
> Question:
> In the example you sent, your query does not eliminate some sessions
> from being killed. For instance, I have 4 which have this listed in the
> "cmd" line:
> LAZY WRITER
> LOG WRITER
> LOCK MONITOR
> CHECKPOINT SLEEP
> Is there going to be any negative or unexpected behavior if these get
> killed?
> Is there something I should query on to eliminate system processes?
> Izzy
>
> Keith Kratochvil wrote:
>
|||You've been very helpful Tibor, many thanks!
Izzy
Tibor Karaszi wrote:[vbcol=seagreen]
> These are system connections, and I'm pretty certain they can't be killed even if you try to (else
> MS wouldn't done a good job protecting the system processes). You should add a filter to the SELECT
> statement, like spid > 50.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Izzy" <israel.richner@.gmail.com> wrote in message
> news:1160066738.477635.116660@.h48g2000cwc.googlegr oups.com...

Kill Old Sessions

I've got a few databases which users access using Terminal Server. I
noticed today I had several (20+) sessions which had a Last Batch date
which were days even weeks old.
I want to kill these old sessions if the Last Batch date is greater
than 5 hours.
I also noticed there are several background sessions being run by the
sa account on master db and they are several days old. I don't believe
I should kill these sessions.
Does anyone have a script they currently use to manage these old
sessions?
IzzyI forgot to list, I'm using SQL Server 2000.
Thanks,
Izzy wrote:
> I've got a few databases which users access using Terminal Server. I
> noticed today I had several (20+) sessions which had a Last Batch date
> which were days even weeks old.
> I want to kill these old sessions if the Last Batch date is greater
> than 5 hours.
> I also noticed there are several background sessions being run by the
> sa account on master db and they are several days old. I don't believe
> I should kill these sessions.
> Does anyone have a script they currently use to manage these old
> sessions?
> Izzy|||It is just a matter of writing a cursor on the sysprocesses table. You can u
se
http://www.dbmaint.com/download/uti..._kill_users.sql as a starter
for your script.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Izzy" <israel.richner@.gmail.com> wrote in message
news:1160062917.135174.41640@.h48g2000cwc.googlegroups.com...
>I forgot to list, I'm using SQL Server 2000.
> Thanks,
>
> Izzy wrote:
>|||Execellent!
Thanks a bunch.
Izzy
Tibor Karaszi wrote:[vbcol=seagreen]
> It is just a matter of writing a cursor on the sysprocesses table. You can
use
> http://www.dbmaint.com/download/uti..._kill_users.sql as a start
er for your script.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Izzy" <israel.richner@.gmail.com> wrote in message
> news:1160062917.135174.41640@.h48g2000cwc.googlegroups.com...|||It seems to me that you are treating the symptop, not the problem.
The symptom is the old sessions.
The problem is that people do not exit Terminal Server correctly. Can you
encourage users to log out of the Terminal Server correctly? Can you
remotely log the users out (and end their database connection in the
process)?
Keith Kratochvil
"Izzy" <israel.richner@.gmail.com> wrote in message
news:1160061806.706762.53740@.m7g2000cwm.googlegroups.com...
> I've got a few databases which users access using Terminal Server. I
> noticed today I had several (20+) sessions which had a Last Batch date
> which were days even weeks old.
> I want to kill these old sessions if the Last Batch date is greater
> than 5 hours.
> I also noticed there are several background sessions being run by the
> sa account on master db and they are several days old. I don't believe
> I should kill these sessions.
> Does anyone have a script they currently use to manage these old
> sessions?
> Izzy
>|||That is exactly the problem, most users are set up to be logged out of
terminal server at midnight if they are not already logged out.
BUT, I have users who work in our shop on 3rd shift who use the same
account as users on first shift.
I've explained too them they need to log out correctly, but of course
users do whatever they want anyway, and just give you lip service while
your in front of them.
Question:
In the example you sent, your query does not eliminate some sessions
from being killed. For instance, I have 4 which have this listed in the
"cmd" line:
LAZY WRITER
LOG WRITER
LOCK MONITOR
CHECKPOINT SLEEP
Is there going to be any negative or unexpected behavior if these get
killed?
Is there something I should query on to eliminate system processes?
Izzy
Keith Kratochvil wrote:[vbcol=seagreen]
> It seems to me that you are treating the symptop, not the problem.
> The symptom is the old sessions.
> The problem is that people do not exit Terminal Server correctly. Can you
> encourage users to log out of the Terminal Server correctly? Can you
> remotely log the users out (and end their database connection in the
> process)?
> --
> Keith Kratochvil
>
> "Izzy" <israel.richner@.gmail.com> wrote in message
> news:1160061806.706762.53740@.m7g2000cwm.googlegroups.com...|||> In the example you sent, your query does not eliminate some sessions
> from being killed. For instance, I have 4 which have this listed in the
> "cmd" line:
> LAZY WRITER
> LOG WRITER
> LOCK MONITOR
> CHECKPOINT SLEEP
> Is there going to be any negative or unexpected behavior if these get
> killed?
These are system connections, and I'm pretty certain they can't be killed ev
en if you try to (else
MS wouldn't done a good job protecting the system processes). You should add
a filter to the SELECT
statement, like spid > 50.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Izzy" <israel.richner@.gmail.com> wrote in message
news:1160066738.477635.116660@.h48g2000cwc.googlegroups.com...
> That is exactly the problem, most users are set up to be logged out of
> terminal server at midnight if they are not already logged out.
> BUT, I have users who work in our shop on 3rd shift who use the same
> account as users on first shift.
> I've explained too them they need to log out correctly, but of course
> users do whatever they want anyway, and just give you lip service while
> your in front of them.
> Question:
> In the example you sent, your query does not eliminate some sessions
> from being killed. For instance, I have 4 which have this listed in the
> "cmd" line:
> LAZY WRITER
> LOG WRITER
> LOCK MONITOR
> CHECKPOINT SLEEP
> Is there going to be any negative or unexpected behavior if these get
> killed?
> Is there something I should query on to eliminate system processes?
> Izzy
>
> Keith Kratochvil wrote:
>|||You've been very helpful Tibor, many thanks!
Izzy
Tibor Karaszi wrote:[vbcol=seagreen]
> These are system connections, and I'm pretty certain they can't be killed
even if you try to (else
> MS wouldn't done a good job protecting the system processes). You should a
dd a filter to the SELECT
> statement, like spid > 50.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Izzy" <israel.richner@.gmail.com> wrote in message
> news:1160066738.477635.116660@.h48g2000cwc.googlegroups.com...

Kill Old Sessions

I've got a few databases which users access using Terminal Server. I
noticed today I had several (20+) sessions which had a Last Batch date
which were days even weeks old.
I want to kill these old sessions if the Last Batch date is greater
than 5 hours.
I also noticed there are several background sessions being run by the
sa account on master db and they are several days old. I don't believe
I should kill these sessions.
Does anyone have a script they currently use to manage these old
sessions?
IzzyI forgot to list, I'm using SQL Server 2000.
Thanks,
Izzy wrote:
> I've got a few databases which users access using Terminal Server. I
> noticed today I had several (20+) sessions which had a Last Batch date
> which were days even weeks old.
> I want to kill these old sessions if the Last Batch date is greater
> than 5 hours.
> I also noticed there are several background sessions being run by the
> sa account on master db and they are several days old. I don't believe
> I should kill these sessions.
> Does anyone have a script they currently use to manage these old
> sessions?
> Izzy|||It is just a matter of writing a cursor on the sysprocesses table. You can use
http://www.dbmaint.com/download/util_proc/sp_dbm_kill_users.sql as a starter for your script.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Izzy" <israel.richner@.gmail.com> wrote in message
news:1160062917.135174.41640@.h48g2000cwc.googlegroups.com...
>I forgot to list, I'm using SQL Server 2000.
> Thanks,
>
> Izzy wrote:
>> I've got a few databases which users access using Terminal Server. I
>> noticed today I had several (20+) sessions which had a Last Batch date
>> which were days even weeks old.
>> I want to kill these old sessions if the Last Batch date is greater
>> than 5 hours.
>> I also noticed there are several background sessions being run by the
>> sa account on master db and they are several days old. I don't believe
>> I should kill these sessions.
>> Does anyone have a script they currently use to manage these old
>> sessions?
>> Izzy
>|||Execellent!
Thanks a bunch.
Izzy
Tibor Karaszi wrote:
> It is just a matter of writing a cursor on the sysprocesses table. You can use
> http://www.dbmaint.com/download/util_proc/sp_dbm_kill_users.sql as a starter for your script.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Izzy" <israel.richner@.gmail.com> wrote in message
> news:1160062917.135174.41640@.h48g2000cwc.googlegroups.com...
> >I forgot to list, I'm using SQL Server 2000.
> >
> > Thanks,
> >
> >
> > Izzy wrote:
> >> I've got a few databases which users access using Terminal Server. I
> >> noticed today I had several (20+) sessions which had a Last Batch date
> >> which were days even weeks old.
> >>
> >> I want to kill these old sessions if the Last Batch date is greater
> >> than 5 hours.
> >>
> >> I also noticed there are several background sessions being run by the
> >> sa account on master db and they are several days old. I don't believe
> >> I should kill these sessions.
> >>
> >> Does anyone have a script they currently use to manage these old
> >> sessions?
> >>
> >> Izzy
> >|||It seems to me that you are treating the symptop, not the problem.
The symptom is the old sessions.
The problem is that people do not exit Terminal Server correctly. Can you
encourage users to log out of the Terminal Server correctly? Can you
remotely log the users out (and end their database connection in the
process)?
--
Keith Kratochvil
"Izzy" <israel.richner@.gmail.com> wrote in message
news:1160061806.706762.53740@.m7g2000cwm.googlegroups.com...
> I've got a few databases which users access using Terminal Server. I
> noticed today I had several (20+) sessions which had a Last Batch date
> which were days even weeks old.
> I want to kill these old sessions if the Last Batch date is greater
> than 5 hours.
> I also noticed there are several background sessions being run by the
> sa account on master db and they are several days old. I don't believe
> I should kill these sessions.
> Does anyone have a script they currently use to manage these old
> sessions?
> Izzy
>|||That is exactly the problem, most users are set up to be logged out of
terminal server at midnight if they are not already logged out.
BUT, I have users who work in our shop on 3rd shift who use the same
account as users on first shift.
I've explained too them they need to log out correctly, but of course
users do whatever they want anyway, and just give you lip service while
your in front of them.
Question:
In the example you sent, your query does not eliminate some sessions
from being killed. For instance, I have 4 which have this listed in the
"cmd" line:
LAZY WRITER
LOG WRITER
LOCK MONITOR
CHECKPOINT SLEEP
Is there going to be any negative or unexpected behavior if these get
killed?
Is there something I should query on to eliminate system processes?
Izzy
Keith Kratochvil wrote:
> It seems to me that you are treating the symptop, not the problem.
> The symptom is the old sessions.
> The problem is that people do not exit Terminal Server correctly. Can you
> encourage users to log out of the Terminal Server correctly? Can you
> remotely log the users out (and end their database connection in the
> process)?
> --
> Keith Kratochvil
>
> "Izzy" <israel.richner@.gmail.com> wrote in message
> news:1160061806.706762.53740@.m7g2000cwm.googlegroups.com...
> > I've got a few databases which users access using Terminal Server. I
> > noticed today I had several (20+) sessions which had a Last Batch date
> > which were days even weeks old.
> >
> > I want to kill these old sessions if the Last Batch date is greater
> > than 5 hours.
> >
> > I also noticed there are several background sessions being run by the
> > sa account on master db and they are several days old. I don't believe
> > I should kill these sessions.
> >
> > Does anyone have a script they currently use to manage these old
> > sessions?
> >
> > Izzy
> >|||> In the example you sent, your query does not eliminate some sessions
> from being killed. For instance, I have 4 which have this listed in the
> "cmd" line:
> LAZY WRITER
> LOG WRITER
> LOCK MONITOR
> CHECKPOINT SLEEP
> Is there going to be any negative or unexpected behavior if these get
> killed?
These are system connections, and I'm pretty certain they can't be killed even if you try to (else
MS wouldn't done a good job protecting the system processes). You should add a filter to the SELECT
statement, like spid > 50.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Izzy" <israel.richner@.gmail.com> wrote in message
news:1160066738.477635.116660@.h48g2000cwc.googlegroups.com...
> That is exactly the problem, most users are set up to be logged out of
> terminal server at midnight if they are not already logged out.
> BUT, I have users who work in our shop on 3rd shift who use the same
> account as users on first shift.
> I've explained too them they need to log out correctly, but of course
> users do whatever they want anyway, and just give you lip service while
> your in front of them.
> Question:
> In the example you sent, your query does not eliminate some sessions
> from being killed. For instance, I have 4 which have this listed in the
> "cmd" line:
> LAZY WRITER
> LOG WRITER
> LOCK MONITOR
> CHECKPOINT SLEEP
> Is there going to be any negative or unexpected behavior if these get
> killed?
> Is there something I should query on to eliminate system processes?
> Izzy
>
> Keith Kratochvil wrote:
>> It seems to me that you are treating the symptop, not the problem.
>> The symptom is the old sessions.
>> The problem is that people do not exit Terminal Server correctly. Can you
>> encourage users to log out of the Terminal Server correctly? Can you
>> remotely log the users out (and end their database connection in the
>> process)?
>> --
>> Keith Kratochvil
>>
>> "Izzy" <israel.richner@.gmail.com> wrote in message
>> news:1160061806.706762.53740@.m7g2000cwm.googlegroups.com...
>> > I've got a few databases which users access using Terminal Server. I
>> > noticed today I had several (20+) sessions which had a Last Batch date
>> > which were days even weeks old.
>> >
>> > I want to kill these old sessions if the Last Batch date is greater
>> > than 5 hours.
>> >
>> > I also noticed there are several background sessions being run by the
>> > sa account on master db and they are several days old. I don't believe
>> > I should kill these sessions.
>> >
>> > Does anyone have a script they currently use to manage these old
>> > sessions?
>> >
>> > Izzy
>> >
>|||You've been very helpful Tibor, many thanks!
Izzy
Tibor Karaszi wrote:
> > In the example you sent, your query does not eliminate some sessions
> > from being killed. For instance, I have 4 which have this listed in the
> > "cmd" line:
> >
> > LAZY WRITER
> > LOG WRITER
> > LOCK MONITOR
> > CHECKPOINT SLEEP
> >
> > Is there going to be any negative or unexpected behavior if these get
> > killed?
> These are system connections, and I'm pretty certain they can't be killed even if you try to (else
> MS wouldn't done a good job protecting the system processes). You should add a filter to the SELECT
> statement, like spid > 50.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Izzy" <israel.richner@.gmail.com> wrote in message
> news:1160066738.477635.116660@.h48g2000cwc.googlegroups.com...
> > That is exactly the problem, most users are set up to be logged out of
> > terminal server at midnight if they are not already logged out.
> >
> > BUT, I have users who work in our shop on 3rd shift who use the same
> > account as users on first shift.
> >
> > I've explained too them they need to log out correctly, but of course
> > users do whatever they want anyway, and just give you lip service while
> > your in front of them.
> >
> > Question:
> >
> > In the example you sent, your query does not eliminate some sessions
> > from being killed. For instance, I have 4 which have this listed in the
> > "cmd" line:
> >
> > LAZY WRITER
> > LOG WRITER
> > LOCK MONITOR
> > CHECKPOINT SLEEP
> >
> > Is there going to be any negative or unexpected behavior if these get
> > killed?
> >
> > Is there something I should query on to eliminate system processes?
> >
> > Izzy
> >
> >
> > Keith Kratochvil wrote:
> >> It seems to me that you are treating the symptop, not the problem.
> >>
> >> The symptom is the old sessions.
> >> The problem is that people do not exit Terminal Server correctly. Can you
> >> encourage users to log out of the Terminal Server correctly? Can you
> >> remotely log the users out (and end their database connection in the
> >> process)?
> >>
> >> --
> >> Keith Kratochvil
> >>
> >>
> >> "Izzy" <israel.richner@.gmail.com> wrote in message
> >> news:1160061806.706762.53740@.m7g2000cwm.googlegroups.com...
> >> > I've got a few databases which users access using Terminal Server. I
> >> > noticed today I had several (20+) sessions which had a Last Batch date
> >> > which were days even weeks old.
> >> >
> >> > I want to kill these old sessions if the Last Batch date is greater
> >> > than 5 hours.
> >> >
> >> > I also noticed there are several background sessions being run by the
> >> > sa account on master db and they are several days old. I don't believe
> >> > I should kill these sessions.
> >> >
> >> > Does anyone have a script they currently use to manage these old
> >> > sessions?
> >> >
> >> > Izzy
> >> >
> >sql

Wednesday, March 21, 2012

Kill autoshrink process

On one of our databases the autoshrink process is locking a lot of users.
I want to stop the autoshrink process but I'm not able to kill the system
process.
How can I stop this process?Well, wait till is finished and turn this off
"Zekske" <Zekske@.discussions.microsoft.com> wrote in message
news:A4400A93-6471-42B4-A4C4-9F1324E0674C@.microsoft.com...
> On one of our databases the autoshrink process is locking a lot of users.
> I want to stop the autoshrink process but I'm not able to kill the system
> process.
> How can I stop this process?

Kill autoshrink process

On one of our databases the autoshrink process is locking a lot of users.
I want to stop the autoshrink process but I'm not able to kill the system
process.
How can I stop this process?Well, wait till is finished and turn this off
"Zekske" <Zekske@.discussions.microsoft.com> wrote in message
news:A4400A93-6471-42B4-A4C4-9F1324E0674C@.microsoft.com...
> On one of our databases the autoshrink process is locking a lot of users.
> I want to stop the autoshrink process but I'm not able to kill the system
> process.
> How can I stop this process?sql

Monday, March 19, 2012

Key/Index Questions

I have some simple questions about database design in MSSQL2005. My background
is primarily writing code, but I do understand databases, however I'm (fairly)
new to MSSQL.
My database is to be a single primary table (we`ll call it P) with other tables
(say, about 10-15) being related like this: P <-->> X
Every table has an Identity column which is also the defined Primary Key for
that table.
It's possible that Table P could have up to a million rows, and each Table X
could have up to between 3-10 rows each related to a single row in Table P.
It's a simple database really, but could get large in scope.
My question has to do with Keys and Indexes on these tables, and I guess I'm
having difficulty (in MSSQL terms) understanding what is a "rule" of the
database and what is a "part" of the database. I'm confused when declaring a
KEY (CONSTRAINT) - does that actually creates a "key/index"?
It seems when I declare a Primary Key constraint, then an Index gets created
automatically. But I'm not sure about declaring a Foreign Key on a child table
- does that create an Index or not?
I also want to design it best for performance too<g>. Each and every row will
be INSERTed and/or UPDATEd individually and very few (if any) DELETES will take
place.
Do I absolutely need to specify a FOREIGN KEY on every child table? My
understanding is that if I do have a FOREGN KEY, then any UPDATE on a child row
will cause a referential check to be made on the parent...maybe causing a
performance issue if the tables were large. Will the database perform well, evn
if I do not specify Foreign Keys?
Whether or not, I specify FOREIGN KEYS on tables X, do I need INDEXes on the
columns that relate to the parent table P? I am pretty sure I do, especially if
I execute a SELECT statement like this:
SELECT columns FROM TableX where FK_Column = 'value'
Thanks BrianBrian, see inline
Brian Staff wrote:
> I have some simple questions about database design in MSSQL2005. My background
> is primarily writing code, but I do understand databases, however I'm (fairly)
> new to MSSQL.
> My database is to be a single primary table (we`ll call it P) with other tables
> (say, about 10-15) being related like this: P <-->> X
> Every table has an Identity column which is also the defined Primary Key for
> that table.
Yuck. Different people have different opinions about this. My opinion is
that an Identity column should not be added out of convention. IMO, it
should be added if no other (proper) key is available, which is highly
unlikely to be the case for all your 10-15 tables...
> It's possible that Table P could have up to a million rows, and each Table X
> could have up to between 3-10 rows each related to a single row in Table P.
> It's a simple database really, but could get large in scope.
> My question has to do with Keys and Indexes on these tables, and I guess I'm
> having difficulty (in MSSQL terms) understanding what is a "rule" of the
> database and what is a "part" of the database. I'm confused when declaring a
> KEY (CONSTRAINT) - does that actually creates a "key/index"?
A "rule" is a type of generic check constraint that can be tagged to any
table. Rules are deprecated and in my experience nobody uses them
(because they are a hassle). Best to forget about them.
I have no idea what "part" refers to. I don't think there is an MSSQL
concept called "part".
> It seems when I declare a Primary Key constraint, then an Index gets created
> automatically. But I'm not sure about declaring a Foreign Key on a child table
> - does that create an Index or not?
Only a Primary Key constraint and a Unique constraint will automatically
create a corresponding (unique) index. If you want your Foreign Key
indexed, then you have to add such an index yourself.
> I also want to design it best for performance too<g>. Each and every row will
> be INSERTed and/or UPDATEd individually and very few (if any) DELETES will take
> place.
> Do I absolutely need to specify a FOREIGN KEY on every child table?
I don't know. If you want to ensure data integrity, then you need it. If
you don't care, or think all data modifications will be done through
your application, and you handle the data integrity in your application,
then you can choose to omit the foreign key constraint - at your own
risk.
> My
> understanding is that if I do have a FOREGN KEY, then any UPDATE on a child row
> will cause a referential check to be made on the parent...
Correct.
> maybe causing a performance issue if the tables were large.
Possible, but unlikely. Although you will see more reads (and therefore
potential I/O) and more locking/blocking.
> Will the database perform well, evn if I do not specify Foreign Keys?
Foreign Keys are not primarily for performance. In most cases they don't
help SELECT performance, but they never hinder either. They mostly
affect the performance of data modifications (negatively).
> Whether or not, I specify FOREIGN KEYS on tables X, do I need INDEXes on the
> columns that relate to the parent table P? I am pretty sure I do, especially if
> I execute a SELECT statement like this:
> SELECT columns FROM TableX where FK_Column = 'value'
If this FK_Column is not the first column of the Primary Key, then such
a query would definitely benefit from an index.
Also, such an index helps if you have the Foreign Key in place, and you
delete a row from the referenced table (in your case table P).
HTH,
Gert-Jan
> Thanks Brian
>|||Nice reply Gert-Jan, after reading yours, I deleted mine.
One note: DOUBLE & TRIPLE YUCK on making all PK's IDENTITY.
Besides what Gert-Jan said (which I agree with), if you ever decide to use
Distributed Partition Views across multiple nodes of a cluster, you won't be
able to select all relevant data in a select from a single server - and
performance will suck.
The only time I even consider IDENTITY for a PK on something other than a
parent table is when I'm getting into many part compound PK's - and even
then I look real hard for something better.
Jay
PS. Sorry, pet peeve.
"Gert-Jan Strik" <sorry@.toomuchspamalready.nl> wrote in message
news:46C9ECDD.A2606551@.toomuchspamalready.nl...
> Brian, see inline
> Brian Staff wrote:
>> I have some simple questions about database design in MSSQL2005. My
>> background
>> is primarily writing code, but I do understand databases, however I'm
>> (fairly)
>> new to MSSQL.
>> My database is to be a single primary table (we`ll call it P) with other
>> tables
>> (say, about 10-15) being related like this: P <-->> X
>> Every table has an Identity column which is also the defined Primary Key
>> for
>> that table.
> Yuck. Different people have different opinions about this. My opinion is
> that an Identity column should not be added out of convention. IMO, it
> should be added if no other (proper) key is available, which is highly
> unlikely to be the case for all your 10-15 tables...
>> It's possible that Table P could have up to a million rows, and each
>> Table X
>> could have up to between 3-10 rows each related to a single row in Table
>> P.
>> It's a simple database really, but could get large in scope.
>> My question has to do with Keys and Indexes on these tables, and I guess
>> I'm
>> having difficulty (in MSSQL terms) understanding what is a "rule" of the
>> database and what is a "part" of the database. I'm confused when
>> declaring a
>> KEY (CONSTRAINT) - does that actually creates a "key/index"?
> A "rule" is a type of generic check constraint that can be tagged to any
> table. Rules are deprecated and in my experience nobody uses them
> (because they are a hassle). Best to forget about them.
> I have no idea what "part" refers to. I don't think there is an MSSQL
> concept called "part".
>> It seems when I declare a Primary Key constraint, then an Index gets
>> created
>> automatically. But I'm not sure about declaring a Foreign Key on a child
>> table
>> - does that create an Index or not?
> Only a Primary Key constraint and a Unique constraint will automatically
> create a corresponding (unique) index. If you want your Foreign Key
> indexed, then you have to add such an index yourself.
>> I also want to design it best for performance too<g>. Each and every row
>> will
>> be INSERTed and/or UPDATEd individually and very few (if any) DELETES
>> will take
>> place.
>> Do I absolutely need to specify a FOREIGN KEY on every child table?
> I don't know. If you want to ensure data integrity, then you need it. If
> you don't care, or think all data modifications will be done through
> your application, and you handle the data integrity in your application,
> then you can choose to omit the foreign key constraint - at your own
> risk.
>> My
>> understanding is that if I do have a FOREGN KEY, then any UPDATE on a
>> child row
>> will cause a referential check to be made on the parent...
> Correct.
>> maybe causing a performance issue if the tables were large.
> Possible, but unlikely. Although you will see more reads (and therefore
> potential I/O) and more locking/blocking.
>> Will the database perform well, evn if I do not specify Foreign Keys?
> Foreign Keys are not primarily for performance. In most cases they don't
> help SELECT performance, but they never hinder either. They mostly
> affect the performance of data modifications (negatively).
>> Whether or not, I specify FOREIGN KEYS on tables X, do I need INDEXes on
>> the
>> columns that relate to the parent table P? I am pretty sure I do,
>> especially if
>> I execute a SELECT statement like this:
>> SELECT columns FROM TableX where FK_Column = 'value'
> If this FK_Column is not the first column of the Primary Key, then such
> a query would definitely benefit from an index.
> Also, such an index helps if you have the Foreign Key in place, and you
> delete a row from the referenced table (in your case table P).
> HTH,
> Gert-Jan
>> Thanks Brian|||> Yuck. Different people have different opinions about this. My opinion is
> that an Identity column should not be added out of convention. IMO, it
> should be added if no other (proper) key is available, which is highly
> unlikely to be the case for all your 10-15 tables...
Hmmm! I see your YUCK was "raised"...twice by Jay
That's taken the wind out of my sails. I thought I was doing well in my design
especially with that part<g>. My theory on Primary Keys is that they should be
preferably be one column and numeric, since searching by alpha and/or multiple
columns would undoubtedly be slower.
Obviously a PK needs to be unique, so I'll re-examine all of the child tables
again, but I have to say that advice does not sit well with my understanding of how
databases work. One question...why is having the identity column be the PK such a
bad idea? - apart from just "yuck!"
BTW - thanks on all of the other advice - that helps a lot.
Brian|||Brian Staff wrote:
> > Yuck. Different people have different opinions about this. My opinion is
> > that an Identity column should not be added out of convention. IMO, it
> > should be added if no other (proper) key is available, which is highly
> > unlikely to be the case for all your 10-15 tables...
> Hmmm! I see your YUCK was "raised"...twice by Jay
> That's taken the wind out of my sails. I thought I was doing well in my design
> especially with that part<g>. My theory on Primary Keys is that they should be
> preferably be one column and numeric, since searching by alpha and/or multiple
> columns would undoubtedly be slower.
> Obviously a PK needs to be unique, so I'll re-examine all of the child tables
> again, but I have to say that advice does not sit well with my understanding of how
> databases work. One question...why is having the identity column be the PK such a
> bad idea? - apart from just "yuck!"
> BTW - thanks on all of the other advice - that helps a lot.
> Brian
There are reasons why many (including me) prefer a natural key over a
surrogate key. IMO, an Identity is a good choice for a surrogate key. If
you google natural vs surrogate key you will probably find a whole lot
of information on that debate.
So I am not saying that having an Identity column as the Primary Key is
not bad per se. However, a table with a foreign key very often has the
meaning of a relation table. If you take the classic example of the
table that describes which book was written by which author. This table
would have a foreign key to the Authors table, and a foreign key to the
Books table. You want the combination of author-book to be unique, so
what simpler choice that to make (author, book) the primary key of this
table? No need to add a surrogate key, very useful index on the primary
key, no need to add another constraint to make the combination
author-book unique, etc.
Now you might argue that in the example above, the primary key of the
BookAuthors table might have been an Identity column and that that key
is narrower and therefore better for performance. But in practice that
is not the case. Because you would join to this table most of the time
(or rather: almost all of the time), and the join requires access to
either/both column author_id and/or book_id. In this example, the
Identity primary key would only perform better if you were to query the
exact Primary Key value.
So if you are going to join a lot of your 10-15 tables to your table P,
then the choice of your primary key and/or the indexes on your foreign
keys is very important.
Gert-Jan|||Gert-Jan,
Thanks for your explanation. I will look carefully at my table data and
re-evaluate the PK choice.
Brian|||> There are reasons why many (including me) prefer a natural key over a
> surrogate key. IMO, an Identity is a good choice for a surrogate key. If
> you google natural vs surrogate key you will probably find a whole lot
> of information on that debate.
> So I am not saying that having an Identity column as the Primary Key is
> not bad per se. However, a table with a foreign key very often has the
> meaning of a relation table. If you take the classic example of the
> table that describes which book was written by which author. This table
> would have a foreign key to the Authors table, and a foreign key to the
> Books table. You want the combination of author-book to be unique, so
> what simpler choice that to make (author, book) the primary key of this
> table? No need to add a surrogate key, very useful index on the primary
> key, no need to add another constraint to make the combination
> author-book unique, etc.
> Now you might argue that in the example above, the primary key of the
> BookAuthors table might have been an Identity column and that that key
> is narrower and therefore better for performance. But in practice that
> is not the case. Because you would join to this table most of the time
> (or rather: almost all of the time), and the join requires access to
> either/both column author_id and/or book_id. In this example, the
> Identity primary key would only perform better if you were to query the
> exact Primary Key value.
> So if you are going to join a lot of your 10-15 tables to your table P,
> then the choice of your primary key and/or the indexes on your foreign
> keys is very important.
> Gert-Jan
My primary objection is that an IDENTITY PK usually does not describe the
data in the column, that function is taken up by indexes and non-identifying
FK's. In Gert-Jan's example a row in BookAuthors is described by the
combination of book_id and author_id, not some arbitrary IDENTITY column.
This BTW, is in large part, the definition of 3NF.
For a good description on database normilaztion:
http://www.datamodel.org/NormalizationRules.html
Jay|||This model that I was working on, as well as another one that I work
on daily, are the reasons that I have come to be wary of the surrogate
key.
create table dbo.items (
item_num varchar(16) not null,
item_desc varchar(32) not null,
constraint pk_items
primary key(item_num),
constraint u_nc_item_desc
unique(item_desc))
create table dbo.customers (
cust_name varchar(32) not null,
constraint pk_customers
primary key(cust_name))
create table dbo.cust_items (
cust_item_num varchar(16) not null,
cust_name varchar(32) not null,
constraint pk_cust_items
primary key(cust_item_num, cust_name),
constraint fk_cust_items_customers
foreign key(cust_name)
references customers(cust_name)
on update cascade)
create table dbo.cust_item_cross_ref (
cust_item_num varchar(16) not null,
cust_name varchar(32) not null,
item_num varchar(16) not null,
constraint pk_cust_item_cross_ref
primary key(cust_name, cust_item_num),
constraint u_nc_item_customer
unique(cust_name, item_num),
constraint fk_cust_item_cross_ref_items
foreign key(item_num)
references dbo.items(item_num)
on update cascade,
constraint fk_cust_item_cross_ref_cust_items
foreign key(cust_item_num, cust_name)
references dbo.cust_items(cust_item_num, cust_name)
on update cascade)
The cust_item_cross_ref table was the source of my difficulty.
The business rules surrounding this table are simply this:
1. Each of our items can be referenced by a customer once.
- covered by u_nc_item_customer
2. Each customer_item can be referenced once.
- covered by pk_cust_item_cross_ref
3. Each item can be referenced to multiple customer_items
If I had used a surrogate key in the cust_items table then I would
have a very interesting time in trying to enforce my business rules at
the cross_ref table. Example below:
create table dbo.cust_items_id (
cust_item_id int identity(1,1),
cust_item_num varchar(16) not null,
cust_name varchar(32) not null,
constraint pk_cust_items
primary key (cust_item_id),
constraint nk_cust_items
primary key(cust_item_num, cust_name),
constraint fk_cust_items_customers
foreign key(cust_name)
references dbo.customers(cust_name)
on update cascade)
create table dbo.cust_item_cross_ref_id (
cust_item_id int not null,
item_num varchar(16) not null,
constraint pk_cust_item_cross_ref
primary key(cust_item_id),
constraint fk_cust_item_cross_ref_items
foreign key(item_num)
references dbo.items(item_num)
on update cascade,
constraint fk_cust_item_cross_ref_cust_items
foreign key(cust_item_id)
references dbo.cust_items(cust_item_id)
on update cascade)
This does not allow me to enforce my second requirement. See the
sample data.
insert into items (item_num, item_desc) values ('Item A', 'Item A')
insert into items (item_num, item_desc) values ('Item B', 'Item B')
insert into customers (cust_name) values ('Cust A')
insert into cust_items (cust_item_num, cust_name) values ('AA', 'Cust
A')
insert into cust_items (cust_item_num, cust_name) values ('AB', 'Cust
A')
insert into cust_items_id (cust_item_num, cust_name) values ('AA',
'Cust A') -- id = 1
insert into cust_items_id (cust_item_num, cust_name) values ('AB',
'Cust A') -- id = 2
In this example I have two items and one customer who has two items.
Both methods prevent me from assigning a customer item to two of my
items. That rule is well enforced. However, in the surrogate key
method, I cannot enforce the other rule. I can freely assign 'Item A'
to cust_id = 1 and to cust_id = 2.
The method that I came up with to solve the problem was either a
trigger (bad...) or to create an indexed view.
create view dbo.bandaid_view with schemabinding
as
select
ci.cust_name,
cr.item_num
from
dbo.cust_item_cross_ref_id as cr
inner join dbo.cust_items_id as ci
on cr.cust_item_id = ci.cust_item_id
go
create unique clustered index u_bandaid on dbo.bandaid_view(cust_name,
item_num)
That solution worked, and would could be used in future. Since I'm
not sold on the performance issue of natural keys vs surrogate keys,
I'll have to stick with the natural keys for now. That may change in
the future, but it will stay this way for now.
Cheers,
Jason Lepack
On Aug 20, 9:34 pm, "JayKon" <s...@.nospam.org> wrote:
> > There are reasons why many (including me) prefer a natural key over a
> > surrogate key. IMO, an Identity is a good choice for a surrogate key. If
> > you google natural vs surrogate key you will probably find a whole lot
> > of information on that debate.
> > So I am not saying that having an Identity column as the Primary Key is
> > not bad per se. However, a table with a foreign key very often has the
> > meaning of a relation table. If you take the classic example of the
> > table that describes which book was written by which author. This table
> > would have a foreign key to the Authors table, and a foreign key to the
> > Books table. You want the combination of author-book to be unique, so
> > what simpler choice that to make (author, book) the primary key of this
> > table? No need to add a surrogate key, very useful index on the primary
> > key, no need to add another constraint to make the combination
> > author-book unique, etc.
> > Now you might argue that in the example above, the primary key of the
> > BookAuthors table might have been an Identity column and that that key
> > is narrower and therefore better for performance. But in practice that
> > is not the case. Because you would join to this table most of the time
> > (or rather: almost all of the time), and the join requires access to
> > either/both column author_id and/or book_id. In this example, the
> > Identity primary key would only perform better if you were to query the
> > exact Primary Key value.
> > So if you are going to join a lot of your 10-15 tables to your table P,
> > then the choice of your primary key and/or the indexes on your foreign
> > keys is very important.
> > Gert-Jan
> My primary objection is that an IDENTITY PK usually does not describe the
> data in the column, that function is taken up by indexes and non-identifying
> FK's. In Gert-Jan's example a row in BookAuthors is described by the
> combination of book_id and author_id, not some arbitrary IDENTITY column.
> This BTW, is in large part, the definition of 3NF.
> For a good description on database normilaztion:
> http://www.datamodel.org/NormalizationRules.html
> Jay- Hide quoted text -
> - Show quoted text -

Friday, March 9, 2012

Keeping SQL 2000 databases in synch after restore.

We have 4 different databases, running on sql server 2000. I scheduled
the database to be backed up at 5:00, and every hour for the trans
log.
If we have a hardware failure and have to restore from backup. how do
I make sure that the database are all starting at the same time. (if
database common takes 2 min to back up and database customer takes 30
min to back up) how do I make sure these 2 database are at the same
point in time.
Is there anything I can do in my sql backup job to have the backup's
end at the same time?
Currently all of the backup are different jobs.
Nicholas.GadaczSo you're saying there are transactional integrity reasons why the DB's all
need to be restored to the exact same point in time?
RESTORE LOG allows you to specify STOPAT for point in time recovery, but
RESTORE DATABASE doesn't.
I can't think of a clean way to do that for a full database without using
tran log restores...
--
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"First Tracks Research" <info@.ftresearch.com> wrote in message
news:4d02a84e.0401061017.1db0b24d@.posting.google.com...
> We have 4 different databases, running on sql server 2000. I scheduled
> the database to be backed up at 5:00, and every hour for the trans
> log.
> If we have a hardware failure and have to restore from backup. how do
> I make sure that the database are all starting at the same time. (if
> database common takes 2 min to back up and database customer takes 30
> min to back up) how do I make sure these 2 database are at the same
> point in time.
> Is there anything I can do in my sql backup job to have the backup's
> end at the same time?
> Currently all of the backup are different jobs.
> Nicholas.Gadacz|||I really don't mean to be a smart ass here. I realize it may not be the
answer you are looking for. But this is kind of a design issue. If there
are transactional integrity issues, the easiest and cleanest way is to put
those objects in the same database. You may have name conflicts, but those
will be much easier to resolve now than the issues you have started to run
into now. What if tomorrow you want to send a snapshot replication of five
related tables? You will have the same issue.
If you do take my advice and put your databases into one, a good way to
avoid naming conflicts in your code, is to script one of the databases in
its entirety, do a search and replace and change all occurences of
conflicting names at the object definition as well as the references in code
simultaneously. Then you can put the two together without conflict. Again,
if you decide to do that, I can be made available for assistance remotely.
Pls remove NO_SPAM(s) from my email if you need to reach me.
--
Ata R
Parvan Consulting Inc
NO_SPAMar_alias001@.NO_SPAMparvan.net
"First Tracks Research" <info@.ftresearch.com> wrote in message
news:4d02a84e.0401061017.1db0b24d@.posting.google.com...
> We have 4 different databases, running on sql server 2000. I scheduled
> the database to be backed up at 5:00, and every hour for the trans
> log.
> If we have a hardware failure and have to restore from backup. how do
> I make sure that the database are all starting at the same time. (if
> database common takes 2 min to back up and database customer takes 30
> min to back up) how do I make sure these 2 database are at the same
> point in time.
> Is there anything I can do in my sql backup job to have the backup's
> end at the same time?
> Currently all of the backup are different jobs.
> Nicholas.Gadacz

Wednesday, March 7, 2012

Keeping disconnected servers in sync

Hello all.
Because I work at home quite often, I keep updated copies of the databases I
normally work on in the office on my servers at home. This is accomplished
by backing up databases to DAT and restoring when I get home.
These databases have gotten quite large, as databases are wont to do and
while I can still get them on a tape, the backup and restore time is too
much to live with.
Does anyone know of a method to keep these two disconnected servers and/or
databases in sync without a lengthy backup and restore?
Thanks.
David
--
ROT13 my email address to reply directly: qnircra@.gpd.argDavid
Perhaps you want to compress your backup with WINZIP or WINRAR.
"David Pendleton" <qnircra@.gpd.arg> wrote in message
news:#G4Cb6TjDHA.1696@.TK2MSFTNGP12.phx.gbl...
> Hello all.
> Because I work at home quite often, I keep updated copies of the databases
I
> normally work on in the office on my servers at home. This is accomplished
> by backing up databases to DAT and restoring when I get home.
> These databases have gotten quite large, as databases are wont to do and
> while I can still get them on a tape, the backup and restore time is too
> much to live with.
> Does anyone know of a method to keep these two disconnected servers and/or
> databases in sync without a lengthy backup and restore?
> Thanks.
> David
> --
> ROT13 my email address to reply directly: qnircra@.gpd.arg
>|||I'm using SQL Backup, so compression is not an option. Backing up 18GB to a
disk device, compressing, and backing up to tape takes longer still.
Thanks anyway.
--
ROT13 my email address to reply: qnircra@.gpd.arg
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:#iAGMSWjDHA.2500@.TK2MSFTNGP10.phx.gbl...
> David
> Perhaps you want to compress your backup with WINZIP or WINRAR.
>
>
> "David Pendleton" <qnircra@.gpd.arg> wrote in message
> news:#G4Cb6TjDHA.1696@.TK2MSFTNGP12.phx.gbl...
> > Hello all.
> >
> > Because I work at home quite often, I keep updated copies of the
databases
> I
> > normally work on in the office on my servers at home. This is
accomplished
> > by backing up databases to DAT and restoring when I get home.
> >
> > These databases have gotten quite large, as databases are wont to do and
> > while I can still get them on a tape, the backup and restore time is too
> > much to live with.
> >
> > Does anyone know of a method to keep these two disconnected servers
and/or
> > databases in sync without a lengthy backup and restore?
> >
> > Thanks.
> >
> > David
> > --
> > ROT13 my email address to reply directly: qnircra@.gpd.arg
> >
> >
>|||David
I don't agree.
> I'm using SQL Backup, so compression is not an option.
What did you mean?
I backup my 15 GB database with compression. You need to write batch file
and place it in system directory.
If you want I can show the example,let me know.
> Backing up 18GB to a
> disk device, compressing, and backing up to tape takes longer still.
After compression I delete .bak file ,so I keep on a device .RAR file of 2
MB.
Regarding to the time belive me it is almost the same.
"David Pendleton" <qnircra@.gpd.arg> wrote in message
news:e9DLmJhjDHA.688@.TK2MSFTNGP10.phx.gbl...
> I'm using SQL Backup, so compression is not an option. Backing up 18GB to
a
> disk device, compressing, and backing up to tape takes longer still.
> Thanks anyway.
> --
> ROT13 my email address to reply: qnircra@.gpd.arg
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:#iAGMSWjDHA.2500@.TK2MSFTNGP10.phx.gbl...
> > David
> > Perhaps you want to compress your backup with WINZIP or WINRAR.
> >
> >
> >
> >
> > "David Pendleton" <qnircra@.gpd.arg> wrote in message
> > news:#G4Cb6TjDHA.1696@.TK2MSFTNGP12.phx.gbl...
> > > Hello all.
> > >
> > > Because I work at home quite often, I keep updated copies of the
> databases
> > I
> > > normally work on in the office on my servers at home. This is
> accomplished
> > > by backing up databases to DAT and restoring when I get home.
> > >
> > > These databases have gotten quite large, as databases are wont to do
and
> > > while I can still get them on a tape, the backup and restore time is
too
> > > much to live with.
> > >
> > > Does anyone know of a method to keep these two disconnected servers
> and/or
> > > databases in sync without a lengthy backup and restore?
> > >
> > > Thanks.
> > >
> > > David
> > > --
> > > ROT13 my email address to reply directly: qnircra@.gpd.arg
> > >
> > >
> >
> >
>

Keeping an accurate count of events

<>I am newish to databases and would appreciate someadvise. I think I have a solution to myproblem but it is going to take me a lot of time to get it running. If there is a better way of doing it I wouldlike to know.

I have a table :-

"eventDates" withcolumns (id,date,eventID,eventCount)

<>The id auto increments as a Primary Key.
date holds the date of theevent.
EventIDreferences anothertable with info about the events
Up to 9eventIDs can be addedfor each date and I want eventCount to hold an integer (1 to 9) to allow me to "pivot"the data to the table below

"results" with columns (date,eventCount1, eventCount2 …..eventCount9) so each row will hold a date and nonto nineeventIDs occurring on that date.

Is there an easy way to keep eventCount accurate or do Ijust have to write a lot of code? Iwill need to be able to remove events as well as add them. I will use a mixture of stored proceduresand VB.Net I guess?

Many thanks for any advice.

Mike

If I understand correctly, you don't need the eventCount in your table at all. It can be generated on the fly through COUNT() for each eventID.

If you post a little bit of your test data and the result(whether pivot or not) you want, it should be able to find a soulution from database query. Of cource, there should be other solution from client end.

Let's see what I can help.

|||Hi thanks for the help.

I am not sure how best to "post data".

But for example :-

Table eventDates
id date eventID ??eventCount
1 20/06/06 21 1
2 21/06/06 21 1
3 22/06/06 21 1
4 20/06/06 22 2
5 24/06/06 23 1
6 25/06/06 23 1
7 22/06/06 24 2
8 23/06/06 24 1
9 24/06/06 24 2
10 21/06/06 23 2
11 22/06/06 23 3

Table callandar
date name
19/06/06 Fred
20/06/06 Richard
21/06/06 Richard
22/06/06 Richard
23/06/06 Andrew
24/06/06 Andrew
25/06/06 Andrew
26/06/06 Andrew
27/06/06 David
28/06/06 David

Table Result
date name event1 event2 event3 event4 .......event9
19/06/06 Fred
20/06/06 Richard 21 22
21/06/06 Richard 21 23
22/06/06 Richard 21 24 23
23/06/06 Andrew 24
24/06/06 Andrew 23 24
25/06/06 Andrew 23
26/06/06 Andrew
27/06/06 David
28/06/06 David

My webserver is running sql server 2000, so I know that I cannot usePIVOT as such but CASE I believe. However, I thought I would needthe ??eventCount column in any case.

Many thanks for any advise.

Regards

Mike Senior|||

SELECT

CONVERT(NVARCHAR(10),t2.cDate, 103)as cDate, t2.[Name],SUM(event1)as event1,SUM(event2)as event2,SUM(event3)as event3,SUM(event4)as event4,SUM(event5)as event5,SUM(event6)as event6,SUM(event7)as event7,SUM(event8)as event8,SUM(event9)as event9

FROM

(SELECT t.cDate, t.[Name],

CASE

WHEN t.eventCount= 1THEN t.eventIDELSENULLENDAS [event1],

CASE

WHEN t.eventCount= 2THEN t.eventIDELSENULLENDAS [event2],

CASE

WHEN t.eventCount= 3THEN t.eventIDELSENULLENDAS [event3],

CASE

WHEN t.eventCount= 4THEN t.eventIDELSENULLENDAS [event4],

CASE

WHEN t.eventCount= 5THEN t.eventIDELSENULLENDAS [event5],

CASE

WHEN t.eventCount= 6THEN t.eventIDELSENULLENDAS [event6],

CASE

WHEN t.eventCount= 7THEN t.eventIDELSENULLENDAS [event7],

CASE

WHEN t.eventCount= 8THEN t.eventIDELSENULLENDAS [event8],

CASE

WHEN t.eventCount= 9THEN t.eventIDELSENULLENDAS [event9]

FROM

(

SELECT Table_1_calendar.cDate, Table_1_calendar.[Name], Table_1event.eventID, Table_1event.eventCount

FROM

Table_1_calendarLeftJOIN

Table_1event

ON Table_1_calendar.cDate= Table_1event.date) t

)

t2

GROUP

BY t2.[cDate], t2.[Name]

ORDER

BY t2.[cDate]

Let me know if need more help.

|||Hi Limno

Sorry for the slow reply, work is busy and web pages are just a hobby.

Very many thanks for the SELECT statement which does return the tablestructure I need. It would have taken me ages to work out - and Iam slowly working through it so that I learn from it.

Thanks again.

Mike

Keep users from view other databases

Hi,
We are a small ISP that allows user to use Enterprise Manager to work with
their databases. We would like the users to only see that databases they hav
e
permissions for. The way SQL 200 is setup by default the users can see all
the databases on the server.
So the question is can we change something that would prevent users from
seeing the other databases on the server?
Thanks in advance,
BobNot with Enterprise Manager and SQL 2000. The users will be
able to see the other databases. They can't access them
without the appropriate permissions but they will be able to
see them.
-Sue
On Mon, 28 Feb 2005 16:57:03 -0800, "Bob Melani" <Bob
Melani@.discussions.microsoft.com> wrote:

>Hi,
>
>We are a small ISP that allows user to use Enterprise Manager to work with
>their databases. We would like the users to only see that databases they ha
ve
>permissions for. The way SQL 200 is setup by default the users can see all
>the databases on the server.
>So the question is can we change something that would prevent users from
>seeing the other databases on the server?
>Thanks in advance,
>Bob|||Bummer,
Thanks for the answer..
"Sue Hoegemeier" wrote:

> Not with Enterprise Manager and SQL 2000. The users will be
> able to see the other databases. They can't access them
> without the appropriate permissions but they will be able to
> see them.
> -Sue
> On Mon, 28 Feb 2005 16:57:03 -0800, "Bob Melani" <Bob
> Melani@.discussions.microsoft.com> wrote:
>
>

Monday, February 20, 2012

keep db's in sync

I have sql 2000 and sql 2005 on one test server while we test our apps
against SQL 2005. Is it possible to keep both version of the databases in
sync?
Since I can have more then one application hitting one database I want to
keep the databases having the same structure, data, etc on both the 2000
version and the 2005 server so if someone makes a table change on the 2000
database, I want that change to happen on the SQL 2005 server database as
well and without the developer going in and making the change and the same
with the data, if new data is entered in the 2000 db I want that data to be
inserted into the 2005 database.
How can I accomplish something like this?
On Jun 7, 10:10 pm, "Mike" <M...@.community.nospam> wrote:
> I have sql 2000 and sql 2005 on one test server while we test our apps
> against SQL 2005. Is it possible to keep both version of the databases in
> sync?
> Since I can have more then one application hitting one database I want to
> keep the databases having the same structure, data, etc on both the 2000
> version and the 2005 server so if someone makes a table change on the 2000
> database, I want that change to happen on the SQL 2005 server database as
> well and without the developer going in and making the change and the same
> with the data, if new data is entered in the 2000 db I want that data to be
> inserted into the 2005 database.
> How can I accomplish something like this?
Check Transactional Replication
|||ok, what is it?
I'm no DBA, I actually got this project thrown on my lap. I do .NET
development and never did anything with SQL Server such as this. This is all
greek to me
"M A Srinivas" <masri999@.gmail.com> wrote in message
news:1181281869.391901.72760@.g37g2000prf.googlegro ups.com...
> On Jun 7, 10:10 pm, "Mike" <M...@.community.nospam> wrote:
> Check Transactional Replication
>
|||Did you search for "Transactional Replication" in Books Online? There are good information there.
Basically, you have a publisher (source database) and a subscriber. A low reader process regenerates
the modifications performed in the source database by reading the transaction log and store them in
a distribution database. Then a distributor process reads the distribution database and based on
that applies those modifications on the subscriber database.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Mike" <Mike@.community.nospam> wrote in message news:OwxQi3cqHHA.484@.TK2MSFTNGP06.phx.gbl...
> ok, what is it?
> I'm no DBA, I actually got this project thrown on my lap. I do .NET development and never did
> anything with SQL Server such as this. This is all greek to me
> "M A Srinivas" <masri999@.gmail.com> wrote in message
> news:1181281869.391901.72760@.g37g2000prf.googlegro ups.com...
>
|||On Jun 8, 9:06 am, "Mike" <M...@.community.nospam> wrote:
> ok, what is it?
> I'm no DBA, I actually got this project thrown on my lap. I do .NET
> development and never did anything with SQL Server such as this. This is all
> greek to me
> "M A Srinivas" <masri...@.gmail.com> wrote in messagenews:1181281869.391901.72760@.g37g2000prf.go oglegroups.com...
>
>
>
> - Show quoted text -
Hi Mike,
the transactional replication that Srinivas suggested will help you
keep the data in sync but not the schema - that is if you change a
table, a view, a stored procedure etc. the transactional replication
won't help.
You can check out our tools xSQL Object for comparing and
synchronizing the database schemas and xSQL Data Compare for comparing
and synchronizing the data. We give away a fully functional lite
edition - you can get it from http://www.xsqlsoftware.com
Those tools will allow you to do periodic comparison and
synchronizations to keep the two databases in sync - you can actually
use the command line utilities included to schedule those operations
to run at certain times.
Hope this helps
JC
http://www.xsqlsoftware.com
|||You might want to try AlfaAlfa's SQL Server Comparison Tool (SCT)
http://www.sql-server-tool.com
- you can easily compare data and/or structures of tables, procedures,
functions, views, triggers and relationships.
Comparison "sessions" can be saved and re-played later without the
need of re-entering the parameters.
Command line parameter can be used to fully automate comparisons.
SCT works with SQL Server 2005, 2000 and 7.0 and between these
versions.
Dariusz Dziewialtowski.

keep db's in sync

I have sql 2000 and sql 2005 on one test server while we test our apps
against SQL 2005. Is it possible to keep both version of the databases in
sync?
Since I can have more then one application hitting one database I want to
keep the databases having the same structure, data, etc on both the 2000
version and the 2005 server so if someone makes a table change on the 2000
database, I want that change to happen on the SQL 2005 server database as
well and without the developer going in and making the change and the same
with the data, if new data is entered in the 2000 db I want that data to be
inserted into the 2005 database.
How can I accomplish something like this?On Jun 7, 10:10 pm, "Mike" <M...@.community.nospam> wrote:
> I have sql 2000 and sql 2005 on one test server while we test our apps
> against SQL 2005. Is it possible to keep both version of the databases in
> sync?
> Since I can have more then one application hitting one database I want to
> keep the databases having the same structure, data, etc on both the 2000
> version and the 2005 server so if someone makes a table change on the 2000
> database, I want that change to happen on the SQL 2005 server database as
> well and without the developer going in and making the change and the sam
e
> with the data, if new data is entered in the 2000 db I want that data to b
e
> inserted into the 2005 database.
> How can I accomplish something like this?
Check Transactional Replication|||ok, what is it?
I'm no DBA, I actually got this project thrown on my lap. I do .NET
development and never did anything with SQL Server such as this. This is all
greek to me
"M A Srinivas" <masri999@.gmail.com> wrote in message
news:1181281869.391901.72760@.g37g2000prf.googlegroups.com...
> On Jun 7, 10:10 pm, "Mike" <M...@.community.nospam> wrote:
> Check Transactional Replication
>|||Did you search for "Transactional Replication" in Books Online? There are go
od information there.
Basically, you have a publisher (source database) and a subscriber. A low re
ader process regenerates
the modifications performed in the source database by reading the transactio
n log and store them in
a distribution database. Then a distributor process reads the distribution d
atabase and based on
that applies those modifications on the subscriber database.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Mike" <Mike@.community.nospam> wrote in message news:OwxQi3cqHHA.484@.TK2MSFTNGP06.phx.gbl...

> ok, what is it?
> I'm no DBA, I actually got this project thrown on my lap. I do .NET develo
pment and never did
> anything with SQL Server such as this. This is all greek to me
> "M A Srinivas" <masri999@.gmail.com> wrote in message
> news:1181281869.391901.72760@.g37g2000prf.googlegroups.com...
>|||On Jun 8, 9:06 am, "Mike" <M...@.community.nospam> wrote:
> ok, what is it?
> I'm no DBA, I actually got this project thrown on my lap. I do .NET
> development and never did anything with SQL Server such as this. This is a
ll
> greek to me
> "M A Srinivas" <masri...@.gmail.com> wrote in messagenews:1181281869.391901
.72760@.g37g2000prf.googlegroups.com...
>
>
>
>
>
> - Show quoted text -
Hi Mike,
the transactional replication that Srinivas suggested will help you
keep the data in sync but not the schema - that is if you change a
table, a view, a stored procedure etc. the transactional replication
won't help.
You can check out our tools xSQL Object for comparing and
synchronizing the database schemas and xSQL Data Compare for comparing
and synchronizing the data. We give away a fully functional lite
edition - you can get it from http://www.xsqlsoftware.com
Those tools will allow you to do periodic comparison and
synchronizations to keep the two databases in sync - you can actually
use the command line utilities included to schedule those operations
to run at certain times.
Hope this helps
JC
http://www.xsqlsoftware.com|||You might want to try AlfaAlfa's SQL Server Comparison Tool (SCT)
http://www.sql-server-tool.com
- you can easily compare data and/or structures of tables, procedures,
functions, views, triggers and relationships.
Comparison "sessions" can be saved and re-played later without the
need of re-entering the parameters.
Command line parameter can be used to fully automate comparisons.
SCT works with SQL Server 2005, 2000 and 7.0 and between these
versions.
Dariusz Dziewialtowski.

keep db's in sync

I have sql 2000 and sql 2005 on one test server while we test our apps
against SQL 2005. Is it possible to keep both version of the databases in
sync?
Since I can have more then one application hitting one database I want to
keep the databases having the same structure, data, etc on both the 2000
version and the 2005 server so if someone makes a table change on the 2000
database, I want that change to happen on the SQL 2005 server database as
well and without the developer going in and making the change and the same
with the data, if new data is entered in the 2000 db I want that data to be
inserted into the 2005 database.
How can I accomplish something like this?On Jun 7, 10:10 pm, "Mike" <M...@.community.nospam> wrote:
> I have sql 2000 and sql 2005 on one test server while we test our apps
> against SQL 2005. Is it possible to keep both version of the databases in
> sync?
> Since I can have more then one application hitting one database I want to
> keep the databases having the same structure, data, etc on both the 2000
> version and the 2005 server so if someone makes a table change on the 2000
> database, I want that change to happen on the SQL 2005 server database as
> well and without the developer going in and making the change and the same
> with the data, if new data is entered in the 2000 db I want that data to be
> inserted into the 2005 database.
> How can I accomplish something like this?
Check Transactional Replication|||ok, what is it?
I'm no DBA, I actually got this project thrown on my lap. I do .NET
development and never did anything with SQL Server such as this. This is all
greek to me
"M A Srinivas" <masri999@.gmail.com> wrote in message
news:1181281869.391901.72760@.g37g2000prf.googlegroups.com...
> On Jun 7, 10:10 pm, "Mike" <M...@.community.nospam> wrote:
>> I have sql 2000 and sql 2005 on one test server while we test our apps
>> against SQL 2005. Is it possible to keep both version of the databases in
>> sync?
>> Since I can have more then one application hitting one database I want to
>> keep the databases having the same structure, data, etc on both the 2000
>> version and the 2005 server so if someone makes a table change on the
>> 2000
>> database, I want that change to happen on the SQL 2005 server database as
>> well and without the developer going in and making the change and the
>> same
>> with the data, if new data is entered in the 2000 db I want that data to
>> be
>> inserted into the 2005 database.
>> How can I accomplish something like this?
> Check Transactional Replication
>|||Did you search for "Transactional Replication" in Books Online? There are good information there.
Basically, you have a publisher (source database) and a subscriber. A low reader process regenerates
the modifications performed in the source database by reading the transaction log and store them in
a distribution database. Then a distributor process reads the distribution database and based on
that applies those modifications on the subscriber database.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Mike" <Mike@.community.nospam> wrote in message news:OwxQi3cqHHA.484@.TK2MSFTNGP06.phx.gbl...
> ok, what is it?
> I'm no DBA, I actually got this project thrown on my lap. I do .NET development and never did
> anything with SQL Server such as this. This is all greek to me
> "M A Srinivas" <masri999@.gmail.com> wrote in message
> news:1181281869.391901.72760@.g37g2000prf.googlegroups.com...
>> On Jun 7, 10:10 pm, "Mike" <M...@.community.nospam> wrote:
>> I have sql 2000 and sql 2005 on one test server while we test our apps
>> against SQL 2005. Is it possible to keep both version of the databases in
>> sync?
>> Since I can have more then one application hitting one database I want to
>> keep the databases having the same structure, data, etc on both the 2000
>> version and the 2005 server so if someone makes a table change on the 2000
>> database, I want that change to happen on the SQL 2005 server database as
>> well and without the developer going in and making the change and the same
>> with the data, if new data is entered in the 2000 db I want that data to be
>> inserted into the 2005 database.
>> How can I accomplish something like this?
>> Check Transactional Replication
>|||On Jun 8, 9:06 am, "Mike" <M...@.community.nospam> wrote:
> ok, what is it?
> I'm no DBA, I actually got this project thrown on my lap. I do .NET
> development and never did anything with SQL Server such as this. This is all
> greek to me
> "M A Srinivas" <masri...@.gmail.com> wrote in messagenews:1181281869.391901.72760@.g37g2000prf.googlegroups.com...
>
> > On Jun 7, 10:10 pm, "Mike" <M...@.community.nospam> wrote:
> >> I have sql 2000 and sql 2005 on one test server while we test our apps
> >> against SQL 2005. Is it possible to keep both version of the databases in
> >> sync?
> >> Since I can have more then one application hitting one database I want to
> >> keep the databases having the same structure, data, etc on both the 2000
> >> version and the 2005 server so if someone makes a table change on the
> >> 2000
> >> database, I want that change to happen on the SQL 2005 server database as
> >> well and without the developer going in and making the change and the
> >> same
> >> with the data, if new data is entered in the 2000 db I want that data to
> >> be
> >> inserted into the 2005 database.
> >> How can I accomplish something like this?
> > Check Transactional Replication- Hide quoted text -
> - Show quoted text -
Hi Mike,
the transactional replication that Srinivas suggested will help you
keep the data in sync but not the schema - that is if you change a
table, a view, a stored procedure etc. the transactional replication
won't help.
You can check out our tools xSQL Object for comparing and
synchronizing the database schemas and xSQL Data Compare for comparing
and synchronizing the data. We give away a fully functional lite
edition - you can get it from http://www.xsqlsoftware.com
Those tools will allow you to do periodic comparison and
synchronizations to keep the two databases in sync - you can actually
use the command line utilities included to schedule those operations
to run at certain times.
Hope this helps
JC
http://www.xsqlsoftware.com|||You might want to try AlfaAlfa's SQL Server Comparison Tool (SCT)
http://www.sql-server-tool.com
- you can easily compare data and/or structures of tables, procedures,
functions, views, triggers and relationships.
Comparison "sessions" can be saved and re-played later without the
need of re-entering the parameters.
Command line parameter can be used to fully automate comparisons.
SCT works with SQL Server 2005, 2000 and 7.0 and between these
versions.
Dariusz Dziewialtowski.

KB913580 related problem

I hope this is posted in the correct forum.

I have Linked Servers that are used to query Access databases that reside on a file server.This has been working for a long time, until I applied KB913580 which references the Distributed Transaction Controller. I am running SQL Server 2000 on the same desktop (development environment) from which I am accessing the Linked Server.The file server is on the same LAN segment – there is no firewall involved.

I uninstalled the update and rebooted but still getting the error:

OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.

[OLE/DB provider returned message: The Microsoft Jet database engine cannot open the file '\\tacir2k3\Infrastructure\Databases\July 2003 Databases\General\GenDb2004_TR_Db.mdb'.It is already opened exclusively by another user, or you need permission to view its data.]

OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005:].

The SQL Server log contains the following (see bolded item):

2006-05-12 07:58:29.79 serverMicrosoft SQL Server2000 - 8.00.760 (Intel X86)

Dec 17 2002 14:22:05

Copyright (c) 1988-2003 Microsoft Corporation

Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 2)

2006-05-12 07:58:29.79 serverCopyright (C) 1988-2002 Microsoft Corporation.

2006-05-12 07:58:29.79 serverAll rights reserved.

2006-05-12 07:58:29.79 serverServer Process ID is 1720.

2006-05-12 07:58:29.79 serverLogging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL\log\ERRORLOG'.

2006-05-12 07:58:29.98 serverSQL Server is starting at priority class 'normal'(1 CPU detected).

2006-05-12 07:58:31.85 serverSQL Server configured for thread mode processing.

2006-05-12 07:58:31.95 serverUsing dynamic lock allocation. [2500] Lock Blocks, [5000] Lock Owner Blocks.

2006-05-12 07:58:32.18 serverAttempting to initialize Distributed Transaction Coordinator.

2006-05-12 07:58:32.37 serverFailed to obtain TransactionDispenserInterface: Result Code = 0x8004d01b

2006-05-12 07:58:32.46 spid3Starting up database 'master'.

The Distributed Transaction Coordinator service is started. The settings are all set to OFF (0).

A query to a table in the linked server returns:

OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.

[OLE/DB provider returned message: The Microsoft Jet database engine cannot open the file '\\tacir2k3\Infrastructure\Databases\July 2003 Databases\General\GenDb2004_TR_Db.mdb'.It is already opened exclusively by another user, or you need permission to view its data.]

OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005:].

(It is not in use by any other user).

exec xp_cmdshell 'type \\TACIR2K3\infrastructure\Databases\July 2004 Databases\General\GenDb2005_TR_Db.mdb'

This returns” “access is denied”

Is there any way to resolve this problem?

Hi,

I am not sure if the issue is related to the patch or not.

Most probably uninstalling the patch won't help. I have experienced few issues after installing this patch on Windows 2000 server.

Even uninstalling didn't help.

Solution which worked:

Uninstall the patch, reboot.

Install the patch manually from Microsoft website and not from windows update site, reboot and the issue should be fixed if it's related to the patch.

The patch if installed from windows update is not updating few core files in Windows 2000 server. Manual install is able to update the files.

|||

I installed KB913580 on a Windows 2000 server hosting our Exchange Server (5.5). This sits on an internal IP and receives traffic from a TrimMail (mail filtering device). The TrimMail gets an internal IP NATted from a Cisco Pix firewall. The firewall is connected directly to a cable modem (the router is a Cisco "router on a stick" handled through a trunked vlan on a Cisco Catalyst 6600 switch).

The way it is designed, the TrimMail device receives mail, filters, forwards to the Exchange server. If the Exchange server is unavailable, TrimMail holds the mail for up to five days.

After the installation of KB913580, incoming mail from outside our network stopped. Some of the incoming mail bounced, some was acquired by TrimMail and held but not delivered to Exchange. Every "ping" from inside the network to any outside address failed. Browser traffic worked fine without any delays, so the connection was all right.

When KB913580 was uninstalled, "ping" worked, mail came through fine.

I hate to think we are exposed to the security vulnerability this patch is designed to fix, but until I figure out what happened and why, I cannot re-install it.

Any ideas?

|||

Yes, there's no doubt in my mind that this patch caused these problems and the problems I have encountered.

I applied the Microsoft patch MS06-018 (KB913580) Vulnerability in Microsoft Distributed Transaction Coordinator Could Allow Denial of Service on the 13th (4 days after it was issued) to my dedicated server (at a hosting site) running SQL2K SP4. Since then, on two occasions, I needed to reboot my server (Win 2K Server SP4) and the server took exceptionally long to boot and then when I finally gained access to the server SQL Server EM could not find my server (my databases were gone), I couldn't access Internet sites with IE (although I could ping remote sites), and I couldn't even open the Control Panel to look at network services. In the Services menu, it just said mssql.exe "Starting...". When that service was stopped, the network stuff all happened so I could access sites, and I could restart SQL Server.

Excerpts from the SQL Server Log:

Microsoft SQL Server 2000 - 8.00.2039 (Intel X86)
May 3 2005 23:18:38
Copyright (c) 1988-2003 Microsoft Corporation
Standard Edition on Windows NT 5.0 (Build 2195: Service Pack 4)

Attempting to initialize Distributed Transaction Coordinator.
(12 -30 minutes later)
Failed to obtain TransactionDispenserInterface: Result Code = 0x8004d01b
Could not set up Net-Library 'SSNETLIB'..
Unable to load any netlibs.
SQL Server could not spawn FRunCM thread.

Does anyone know SPECIFICALLY the issue here? This is all on a production server where I cannot experiment with uninstalling/rebooting/installing/rebooting etc.

Thanks for any help.

|||

I did as you suggested and rebooted.

The SQL Server log errors related to the Distributed Transaction Coordinator are gone and I can reference the linked database.

Thank you many times!!! I would never have come to this solution.

|||

Well I spoke too soon about this solving my problem. Got one good SQL Server start and now I am back to the same problem.

I also noticed a couple of other problems that started occurring after KB900485 was applied on 4/28/2006. I tried the suggestion regarding reinstalling this patch from the MS site and keep getting the automatic updates notice for it when I reboot. It displays on the Add/Remove programs list.

I get about 21 messages " Error 15457. Configuration option 'allow updates' changed from 0 to 1. Run the RECONFIGURE statement to install." These started on 5/1/2006 after KB900485 was applied. On the last test these occurred at the time I executed SQL to access the linked database.

I looked closer at the Events log and notice that I also started getting the following error related to MSSQLServer after KB900485 was applied. "SuperSocket into: (SpnRegister): Error 1355.

GRRRRR. Anyone with any other suggestions.

|||

I had issues with KB913580 and developed a bunch of strange problems on my server and it turned out to be a tape driver conflict.

Everything else that happened was a symptom of the problem and not the actual problem. I could not log out or shutdown the server, I could not browse the internet and some of the core services were not started or timed out etc which caused a series of problems overall.

So, if you have backup exec v10D installed on this server and have the veritas drivers installed try removing the veritas tape drivers and go to your native tape drivers from MS or the Manufacture and see if your other problems go away. It may take two reboots for the tape drives and veritas to work properly. Once to initially identify the tape drive and install the drivers and then a second reboot to actually load the drivers.

Let me know if you have this situation and if it corrects it.

|||

After a MONTH of PSS from MS, dozens of hours of emails and phone calls, and several PSS techs, it turns out that this was a SQL Server bug, that occasionally appears on some Windows 2000 SP4 machines when the KB913580 patch changes something about the order of startup services.

The fix can be found here:

http://support.microsoft.com/?kbid=917405

Note: Much of this time was wasted because the KB913580 patch could not be completely uninstalled (as expected) once it was manually installed (not from the update process).