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

Friday, March 30, 2012

how to determine which process is ballooning tempdb

Help!
We have an exceptionally busy server with many databases used by many applic
ations. One or more processes is causing tempdb to grow very rapidly and eat
up the disk.
I need suggestions on how to figure out which of the hundreds of processes m
ight be doing this. It's like trying to find a needle in a haystack. Is ther
e some way to filter a Profiler trace which might help me identify who the c
ulprit might be?
Thanks.Good question,
I don't think there is a direct way to do that in Profiler, but... if you
add some of hte AutoGrow events in database event class... and you're
tracking stmt:completed events... and looking at writes... you should be
able to see some type of correlation. Haven't messed around to look for the
particular model you need... but it's interesting. I'll take a look at see
if I find a nice way to do it...
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Marie Ramos" <RamosMar@.saccounty.net> wrote in message
news:D4061B10-528B-42BE-A58F-BA6331F4D5F4@.microsoft.com...
quote:

> Help!
> We have an exceptionally busy server with many databases used by many

applications. One or more processes is causing tempdb to grow very rapidly
and eat up the disk.
quote:

> I need suggestions on how to figure out which of the hundreds of processes

might be doing this. It's like trying to find a needle in a haystack. Is
there some way to filter a Profiler trace which might help me identify who
the culprit might be?
quote:

> Thanks.
>
|||also... I'm not sure where the waittype would be... but I'm sure the spid's
waiting on the autogrow to complete must be showing some sort of
distinguishing waittype in master..sysprocesses...
a little bit of testing should be able to help you figure out the waittype
while the spid is waiting for an autogrow to complete.... and that would
give you another way to narrow it down...
Brian
"Brian Moran" <brian@.solidqualitylearning.com> wrote in message news:...
quote:

> Good question,
> I don't think there is a direct way to do that in Profiler, but... if you
> add some of hte AutoGrow events in database event class... and you're
> tracking stmt:completed events... and looking at writes... you should be
> able to see some type of correlation. Haven't messed around to look for

the
quote:

> particular model you need... but it's interesting. I'll take a look at

see
quote:

> if I find a nice way to do it...
> --
> Brian Moran
> Principal Mentor
> Solid Quality Learning
> SQL Server MVP
> http://www.solidqualitylearning.com
>
> "Marie Ramos" <RamosMar@.saccounty.net> wrote in message
> news:D4061B10-528B-42BE-A58F-BA6331F4D5F4@.microsoft.com...
> applications. One or more processes is causing tempdb to grow very rapidly
> and eat up the disk.
processes[QUOTE]
> might be doing this. It's like trying to find a needle in a haystack. Is
> there some way to filter a Profiler trace which might help me identify who
> the culprit might be?
>
|||Hi Marie.
I don't actually know of a conclusive set of profiler filters, perfmon
settings or sysprocesses columns that would give you what you're after per
se (hopefully someone does), but have you tried looking at the output of
sp_who2's DiskIO column?
This isn't going to give you precisely the answer you're after but if you
identify which processes are consuming large amounts of disk io & perhaps
relatively less cpu, you may be able to quickly eliminate many of the other
processes & concentrate on those with these crude characteristics.
Hopefully someone else can produce a more scientific method but this might
help you get started.
Microsoft runs a program called sqlwish for sql server which allows you to
submit requests for features. Your request for a feature to track which
process is causing tempdb to grow sounds a good one imo, as many would
benefit from such a feature - sqlwish@.microsoft.com.
Regards,
Greg Linwood
"Marie Ramos" <RamosMar@.saccounty.net> wrote in message
news:D4061B10-528B-42BE-A58F-BA6331F4D5F4@.microsoft.com...
quote:

> Help!
> We have an exceptionally busy server with many databases used by many

applications. One or more processes is causing tempdb to grow very rapidly
and eat up the disk.
quote:

> I need suggestions on how to figure out which of the hundreds of processes

might be doing this. It's like trying to find a needle in a haystack. Is
there some way to filter a Profiler trace which might help me identify who
the culprit might be?
quote:

> Thanks.
>
|||Thanks for the sp_who2 tip. I think this may be helpful.
Do you know what the number in the Diskio column represents? If it's
zero, does that mean no disk io?
Marie
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!|||Hi Marie.
Yep - eg select statements that are satisfied entirely by rows cached in
memory, therefore not needing to access the disk.
Regards,
Greg Linwood
"Marie Ramos" <ramosmar@.saccounty.net> wrote in message
news:O4MBKHc5DHA.2740@.TK2MSFTNGP09.phx.gbl...
quote:

> Thanks for the sp_who2 tip. I think this may be helpful.
> Do you know what the number in the Diskio column represents? If it's
> zero, does that mean no disk io?
> Marie
>
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!

how to determine which process is ballooning tempdb

Help!
We have an exceptionally busy server with many databases used by many applications. One or more processes is causing tempdb to grow very rapidly and eat up the disk.
I need suggestions on how to figure out which of the hundreds of processes might be doing this. It's like trying to find a needle in a haystack. Is there some way to filter a Profiler trace which might help me identify who the culprit might be?
Thanks.Good question,
I don't think there is a direct way to do that in Profiler, but... if you
add some of hte AutoGrow events in database event class... and you're
tracking stmt:completed events... and looking at writes... you should be
able to see some type of correlation. Haven't messed around to look for the
particular model you need... but it's interesting. I'll take a look at see
if I find a nice way to do it...
--
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Marie Ramos" <RamosMar@.saccounty.net> wrote in message
news:D4061B10-528B-42BE-A58F-BA6331F4D5F4@.microsoft.com...
> Help!
> We have an exceptionally busy server with many databases used by many
applications. One or more processes is causing tempdb to grow very rapidly
and eat up the disk.
> I need suggestions on how to figure out which of the hundreds of processes
might be doing this. It's like trying to find a needle in a haystack. Is
there some way to filter a Profiler trace which might help me identify who
the culprit might be?
> Thanks.
>|||Hi Marie.
I don't actually know of a conclusive set of profiler filters, perfmon
settings or sysprocesses columns that would give you what you're after per
se (hopefully someone does), but have you tried looking at the output of
sp_who2's DiskIO column?
This isn't going to give you precisely the answer you're after but if you
identify which processes are consuming large amounts of disk io & perhaps
relatively less cpu, you may be able to quickly eliminate many of the other
processes & concentrate on those with these crude characteristics.
Hopefully someone else can produce a more scientific method but this might
help you get started.
Microsoft runs a program called sqlwish for sql server which allows you to
submit requests for features. Your request for a feature to track which
process is causing tempdb to grow sounds a good one imo, as many would
benefit from such a feature - sqlwish@.microsoft.com.
Regards,
Greg Linwood
"Marie Ramos" <RamosMar@.saccounty.net> wrote in message
news:D4061B10-528B-42BE-A58F-BA6331F4D5F4@.microsoft.com...
> Help!
> We have an exceptionally busy server with many databases used by many
applications. One or more processes is causing tempdb to grow very rapidly
and eat up the disk.
> I need suggestions on how to figure out which of the hundreds of processes
might be doing this. It's like trying to find a needle in a haystack. Is
there some way to filter a Profiler trace which might help me identify who
the culprit might be?
> Thanks.
>sql

Monday, March 26, 2012

How to determine sql process responsible for system load

Hi
I administer sql databases at a local hospital and would occasionally like
to determine which sql server process/task is responsible for the load on
the system (cpu, memory etc) at a particular time.
The server hosts a largish number of databases for various 3rd party systems
and some in house systems primarily accessed in an interactive
(non-transactional) manner. I monitor system performance regularly and have
been noticing sustained periods (~5 mins) of high cpu usage (>50%) and disk
activity, which is not consistent with the normal pattern. I would like to
work out which database/application is responsible. At the same time SQL
compilations are low and the Buffer Manager looks healthy (ie Page life
expectancy, Cache Hits and Lizy Writes all good). Task Manager reports that
SQL Server is the application using the cpu time and the server does not run
any other applications.
The Current Activity in Enterprise Manager shows me all active connections
and processes but not their relative system load. The Profiler will show me
which processes are running and what they are doing, which is very useful,
however it does not show me what is running at the time I start the profile
log, which would typically be _after_ I have discovered that the system is
excessively loaded.
Is there any other way to get a snapshot of all active sql server processes
and their relative load/queryplan cost/size of returned recordset etc that
could give me a clue?
InterBase, for instance, has a Performance Monitor which gives a real-time
display of memory use, records fetched and much more per database and per
running query/procedure.
Thanks & Regards
Bas
========================================
==
Bas Groeneveld
Benchmark Design System and Software Engineering
PO Box 165N, Ballarat North, VIC 3350
Phone: +61 3 5333 5441 Mob: 0409 954 501Forgot to mention that we are running SQL Server 2000 SP3
Bas
"Bas Groeneveld" <nospam@.nospam.com.au> wrote in message
news:1aReg.252$ap3.32@.news-server.bigpond.net.au...
> Hi
> I administer sql databases at a local hospital and would occasionally like
> to determine which sql server process/task is responsible for the load on
> the system (cpu, memory etc) at a particular time.
> The server hosts a largish number of databases for various 3rd party
systems
> and some in house systems primarily accessed in an interactive
> (non-transactional) manner. I monitor system performance regularly and
have
> been noticing sustained periods (~5 mins) of high cpu usage (>50%) and
disk
> activity, which is not consistent with the normal pattern. I would like to
> work out which database/application is responsible. At the same time SQL
> compilations are low and the Buffer Manager looks healthy (ie Page life
> expectancy, Cache Hits and Lizy Writes all good). Task Manager reports
that
> SQL Server is the application using the cpu time and the server does not
run
> any other applications.
> The Current Activity in Enterprise Manager shows me all active connections
> and processes but not their relative system load. The Profiler will show
me
> which processes are running and what they are doing, which is very useful,
> however it does not show me what is running at the time I start the
profile
> log, which would typically be _after_ I have discovered that the system is
> excessively loaded.
> Is there any other way to get a snapshot of all active sql server
processes
> and their relative load/queryplan cost/size of returned recordset etc that
> could give me a clue?
> InterBase, for instance, has a Performance Monitor which gives a real-time
> display of memory use, records fetched and much more per database and per
> running query/procedure.
> Thanks & Regards
> Bas
> --
> ========================================
==
> Bas Groeneveld
> Benchmark Design System and Software Engineering
> PO Box 165N, Ballarat North, VIC 3350
> Phone: +61 3 5333 5441 Mob: 0409 954 501
>
>|||Hi Bas,
You best bet is probably running profiler. You should be able to get a
pretty good overview of what's going on within SQL Server during your busy
times. You will be able to identify any long running queries and there's eve
n
a column for CPU usage per event.
Ray
"Bas Groeneveld" wrote:

> Forgot to mention that we are running SQL Server 2000 SP3
> Bas
> "Bas Groeneveld" <nospam@.nospam.com.au> wrote in message
> news:1aReg.252$ap3.32@.news-server.bigpond.net.au...
> systems
> have
> disk
> that
> run
> me
> profile
> processes
>
>|||Hi Bas,
You best bet is probably running profiler. You should be able to get a
pretty good overview of what's going on within SQL Server during your busy
times. You will be able to identify any long running queries and there's eve
n
a column for CPU usage per event.
Ray
"Bas Groeneveld" wrote:

> Forgot to mention that we are running SQL Server 2000 SP3
> Bas
> "Bas Groeneveld" <nospam@.nospam.com.au> wrote in message
> news:1aReg.252$ap3.32@.news-server.bigpond.net.au...
> systems
> have
> disk
> that
> run
> me
> profile
> processes
>
>|||Thanks for the reply Ray.
My only problem is how to determine which queries are already running when I
start the profiler (as I usually start it _after_ I realise that there is an
excessive load). Is there a way to do this?
If there is no way to do that I would need to run both profiler and
performance monitor logging to files for a period of time and then work it
out from the log files. This is possible of course, I was just wondering if
there was another way.
Cheers
Bas
"rb" <rb@.discussions.microsoft.com> wrote in message
news:C94751DD-9ECE-46DA-A288-47086356B167@.microsoft.com...
> Hi Bas,
> You best bet is probably running profiler. You should be able to get a
> pretty good overview of what's going on within SQL Server during your busy
> times. You will be able to identify any long running queries and there's
even[vbcol=seagreen]
> a column for CPU usage per event.
> Ray
> "Bas Groeneveld" wrote:
>
like[vbcol=seagreen]
on[vbcol=seagreen]
like to[vbcol=seagreen]
SQL[vbcol=seagreen]
life[vbcol=seagreen]
not[vbcol=seagreen]
connections[vbcol=seagreen]
show[vbcol=seagreen]
useful,[vbcol=seagreen]
system is[vbcol=seagreen]
that[vbcol=seagreen]
real-time[vbcol=seagreen]
per[vbcol=seagreen]|||Thanks for the reply Ray.
My only problem is how to determine which queries are already running when I
start the profiler (as I usually start it _after_ I realise that there is an
excessive load). Is there a way to do this?
If there is no way to do that I would need to run both profiler and
performance monitor logging to files for a period of time and then work it
out from the log files. This is possible of course, I was just wondering if
there was another way.
Cheers
Bas
"rb" <rb@.discussions.microsoft.com> wrote in message
news:C94751DD-9ECE-46DA-A288-47086356B167@.microsoft.com...
> Hi Bas,
> You best bet is probably running profiler. You should be able to get a
> pretty good overview of what's going on within SQL Server during your busy
> times. You will be able to identify any long running queries and there's
even[vbcol=seagreen]
> a column for CPU usage per event.
> Ray
> "Bas Groeneveld" wrote:
>
like[vbcol=seagreen]
on[vbcol=seagreen]
like to[vbcol=seagreen]
SQL[vbcol=seagreen]
life[vbcol=seagreen]
not[vbcol=seagreen]
connections[vbcol=seagreen]
show[vbcol=seagreen]
useful,[vbcol=seagreen]
system is[vbcol=seagreen]
that[vbcol=seagreen]
real-time[vbcol=seagreen]
per[vbcol=seagreen]|||Hi Bas,
You could run DBCC Inputbuffer to check what query is being run (if you have
identified the spid first), you could also run sp_who2 for more info on the
queries being executed by all users. If you suspect locking/dead locks you
could enable trace flags 1204 (and 1205 I think) and get info posted to the
SQL error log.
You could run profiler and only filter out long running queries but as you
say you need to run this prior to the problem occuring to gather useful
information. You would get I/O and cpu stats from profiler so it may we wort
h
running if this problem occurs often.
Ray
"Bas Groeneveld" wrote:

> Thanks for the reply Ray.
> My only problem is how to determine which queries are already running when
I
> start the profiler (as I usually start it _after_ I realise that there is
an
> excessive load). Is there a way to do this?
> If there is no way to do that I would need to run both profiler and
> performance monitor logging to files for a period of time and then work it
> out from the log files. This is possible of course, I was just wondering i
f
> there was another way.
> Cheers
> Bas
>
> "rb" <rb@.discussions.microsoft.com> wrote in message
> news:C94751DD-9ECE-46DA-A288-47086356B167@.microsoft.com...
> even
> like
> on
> like to
> SQL
> life
> not
> connections
> show
> useful,
> system is
> that
> real-time
> per
>
>|||Hi Bas,
You could run DBCC Inputbuffer to check what query is being run (if you have
identified the spid first), you could also run sp_who2 for more info on the
queries being executed by all users. If you suspect locking/dead locks you
could enable trace flags 1204 (and 1205 I think) and get info posted to the
SQL error log.
You could run profiler and only filter out long running queries but as you
say you need to run this prior to the problem occuring to gather useful
information. You would get I/O and cpu stats from profiler so it may we wort
h
running if this problem occurs often.
Ray
"Bas Groeneveld" wrote:

> Thanks for the reply Ray.
> My only problem is how to determine which queries are already running when
I
> start the profiler (as I usually start it _after_ I realise that there is
an
> excessive load). Is there a way to do this?
> If there is no way to do that I would need to run both profiler and
> performance monitor logging to files for a period of time and then work it
> out from the log files. This is possible of course, I was just wondering i
f
> there was another way.
> Cheers
> Bas
>
> "rb" <rb@.discussions.microsoft.com> wrote in message
> news:C94751DD-9ECE-46DA-A288-47086356B167@.microsoft.com...
> even
> like
> on
> like to
> SQL
> life
> not
> connections
> show
> useful,
> system is
> that
> real-time
> per
>
>

How to determine sql process responsible for system load

Hi
I administer sql databases at a local hospital and would occasionally like
to determine which sql server process/task is responsible for the load on
the system (cpu, memory etc) at a particular time.
The server hosts a largish number of databases for various 3rd party systems
and some in house systems primarily accessed in an interactive
(non-transactional) manner. I monitor system performance regularly and have
been noticing sustained periods (~5 mins) of high cpu usage (>50%) and disk
activity, which is not consistent with the normal pattern. I would like to
work out which database/application is responsible. At the same time SQL
compilations are low and the Buffer Manager looks healthy (ie Page life
expectancy, Cache Hits and Lizy Writes all good). Task Manager reports that
SQL Server is the application using the cpu time and the server does not run
any other applications.
The Current Activity in Enterprise Manager shows me all active connections
and processes but not their relative system load. The Profiler will show me
which processes are running and what they are doing, which is very useful,
however it does not show me what is running at the time I start the profile
log, which would typically be _after_ I have discovered that the system is
excessively loaded.
Is there any other way to get a snapshot of all active sql server processes
and their relative load/queryplan cost/size of returned recordset etc that
could give me a clue?
InterBase, for instance, has a Performance Monitor which gives a real-time
display of memory use, records fetched and much more per database and per
running query/procedure.
Thanks & Regards
Bas
--
========================================== Bas Groeneveld
Benchmark Design System and Software Engineering
PO Box 165N, Ballarat North, VIC 3350
Phone: +61 3 5333 5441 Mob: 0409 954 501Forgot to mention that we are running SQL Server 2000 SP3
Bas
"Bas Groeneveld" <nospam@.nospam.com.au> wrote in message
news:1aReg.252$ap3.32@.news-server.bigpond.net.au...
> Hi
> I administer sql databases at a local hospital and would occasionally like
> to determine which sql server process/task is responsible for the load on
> the system (cpu, memory etc) at a particular time.
> The server hosts a largish number of databases for various 3rd party
systems
> and some in house systems primarily accessed in an interactive
> (non-transactional) manner. I monitor system performance regularly and
have
> been noticing sustained periods (~5 mins) of high cpu usage (>50%) and
disk
> activity, which is not consistent with the normal pattern. I would like to
> work out which database/application is responsible. At the same time SQL
> compilations are low and the Buffer Manager looks healthy (ie Page life
> expectancy, Cache Hits and Lizy Writes all good). Task Manager reports
that
> SQL Server is the application using the cpu time and the server does not
run
> any other applications.
> The Current Activity in Enterprise Manager shows me all active connections
> and processes but not their relative system load. The Profiler will show
me
> which processes are running and what they are doing, which is very useful,
> however it does not show me what is running at the time I start the
profile
> log, which would typically be _after_ I have discovered that the system is
> excessively loaded.
> Is there any other way to get a snapshot of all active sql server
processes
> and their relative load/queryplan cost/size of returned recordset etc that
> could give me a clue?
> InterBase, for instance, has a Performance Monitor which gives a real-time
> display of memory use, records fetched and much more per database and per
> running query/procedure.
> Thanks & Regards
> Bas
> --
> ==========================================> Bas Groeneveld
> Benchmark Design System and Software Engineering
> PO Box 165N, Ballarat North, VIC 3350
> Phone: +61 3 5333 5441 Mob: 0409 954 501
>
>|||Hi Bas,
You best bet is probably running profiler. You should be able to get a
pretty good overview of what's going on within SQL Server during your busy
times. You will be able to identify any long running queries and there's even
a column for CPU usage per event.
Ray
"Bas Groeneveld" wrote:
> Forgot to mention that we are running SQL Server 2000 SP3
> Bas
> "Bas Groeneveld" <nospam@.nospam.com.au> wrote in message
> news:1aReg.252$ap3.32@.news-server.bigpond.net.au...
> > Hi
> >
> > I administer sql databases at a local hospital and would occasionally like
> > to determine which sql server process/task is responsible for the load on
> > the system (cpu, memory etc) at a particular time.
> >
> > The server hosts a largish number of databases for various 3rd party
> systems
> > and some in house systems primarily accessed in an interactive
> > (non-transactional) manner. I monitor system performance regularly and
> have
> > been noticing sustained periods (~5 mins) of high cpu usage (>50%) and
> disk
> > activity, which is not consistent with the normal pattern. I would like to
> > work out which database/application is responsible. At the same time SQL
> > compilations are low and the Buffer Manager looks healthy (ie Page life
> > expectancy, Cache Hits and Lizy Writes all good). Task Manager reports
> that
> > SQL Server is the application using the cpu time and the server does not
> run
> > any other applications.
> >
> > The Current Activity in Enterprise Manager shows me all active connections
> > and processes but not their relative system load. The Profiler will show
> me
> > which processes are running and what they are doing, which is very useful,
> > however it does not show me what is running at the time I start the
> profile
> > log, which would typically be _after_ I have discovered that the system is
> > excessively loaded.
> >
> > Is there any other way to get a snapshot of all active sql server
> processes
> > and their relative load/queryplan cost/size of returned recordset etc that
> > could give me a clue?
> >
> > InterBase, for instance, has a Performance Monitor which gives a real-time
> > display of memory use, records fetched and much more per database and per
> > running query/procedure.
> >
> > Thanks & Regards
> > Bas
> >
> > --
> >
> > ==========================================> > Bas Groeneveld
> > Benchmark Design System and Software Engineering
> > PO Box 165N, Ballarat North, VIC 3350
> > Phone: +61 3 5333 5441 Mob: 0409 954 501
> >
> >
> >
>
>|||Thanks for the reply Ray.
My only problem is how to determine which queries are already running when I
start the profiler (as I usually start it _after_ I realise that there is an
excessive load). Is there a way to do this?
If there is no way to do that I would need to run both profiler and
performance monitor logging to files for a period of time and then work it
out from the log files. This is possible of course, I was just wondering if
there was another way.
Cheers
Bas
"rb" <rb@.discussions.microsoft.com> wrote in message
news:C94751DD-9ECE-46DA-A288-47086356B167@.microsoft.com...
> Hi Bas,
> You best bet is probably running profiler. You should be able to get a
> pretty good overview of what's going on within SQL Server during your busy
> times. You will be able to identify any long running queries and there's
even
> a column for CPU usage per event.
> Ray
> "Bas Groeneveld" wrote:
> > Forgot to mention that we are running SQL Server 2000 SP3
> >
> > Bas
> >
> > "Bas Groeneveld" <nospam@.nospam.com.au> wrote in message
> > news:1aReg.252$ap3.32@.news-server.bigpond.net.au...
> > > Hi
> > >
> > > I administer sql databases at a local hospital and would occasionally
like
> > > to determine which sql server process/task is responsible for the load
on
> > > the system (cpu, memory etc) at a particular time.
> > >
> > > The server hosts a largish number of databases for various 3rd party
> > systems
> > > and some in house systems primarily accessed in an interactive
> > > (non-transactional) manner. I monitor system performance regularly and
> > have
> > > been noticing sustained periods (~5 mins) of high cpu usage (>50%) and
> > disk
> > > activity, which is not consistent with the normal pattern. I would
like to
> > > work out which database/application is responsible. At the same time
SQL
> > > compilations are low and the Buffer Manager looks healthy (ie Page
life
> > > expectancy, Cache Hits and Lizy Writes all good). Task Manager reports
> > that
> > > SQL Server is the application using the cpu time and the server does
not
> > run
> > > any other applications.
> > >
> > > The Current Activity in Enterprise Manager shows me all active
connections
> > > and processes but not their relative system load. The Profiler will
show
> > me
> > > which processes are running and what they are doing, which is very
useful,
> > > however it does not show me what is running at the time I start the
> > profile
> > > log, which would typically be _after_ I have discovered that the
system is
> > > excessively loaded.
> > >
> > > Is there any other way to get a snapshot of all active sql server
> > processes
> > > and their relative load/queryplan cost/size of returned recordset etc
that
> > > could give me a clue?
> > >
> > > InterBase, for instance, has a Performance Monitor which gives a
real-time
> > > display of memory use, records fetched and much more per database and
per
> > > running query/procedure.
> > >
> > > Thanks & Regards
> > > Bas
> > >
> > > --
> > >
> > > ==========================================> > > Bas Groeneveld
> > > Benchmark Design System and Software Engineering
> > > PO Box 165N, Ballarat North, VIC 3350
> > > Phone: +61 3 5333 5441 Mob: 0409 954 501
> > >
> > >
> > >
> >
> >
> >|||Hi Bas,
You could run DBCC Inputbuffer to check what query is being run (if you have
identified the spid first), you could also run sp_who2 for more info on the
queries being executed by all users. If you suspect locking/dead locks you
could enable trace flags 1204 (and 1205 I think) and get info posted to the
SQL error log.
You could run profiler and only filter out long running queries but as you
say you need to run this prior to the problem occuring to gather useful
information. You would get I/O and cpu stats from profiler so it may we worth
running if this problem occurs often.
Ray
"Bas Groeneveld" wrote:
> Thanks for the reply Ray.
> My only problem is how to determine which queries are already running when I
> start the profiler (as I usually start it _after_ I realise that there is an
> excessive load). Is there a way to do this?
> If there is no way to do that I would need to run both profiler and
> performance monitor logging to files for a period of time and then work it
> out from the log files. This is possible of course, I was just wondering if
> there was another way.
> Cheers
> Bas
>
> "rb" <rb@.discussions.microsoft.com> wrote in message
> news:C94751DD-9ECE-46DA-A288-47086356B167@.microsoft.com...
> > Hi Bas,
> >
> > You best bet is probably running profiler. You should be able to get a
> > pretty good overview of what's going on within SQL Server during your busy
> > times. You will be able to identify any long running queries and there's
> even
> > a column for CPU usage per event.
> >
> > Ray
> >
> > "Bas Groeneveld" wrote:
> >
> > > Forgot to mention that we are running SQL Server 2000 SP3
> > >
> > > Bas
> > >
> > > "Bas Groeneveld" <nospam@.nospam.com.au> wrote in message
> > > news:1aReg.252$ap3.32@.news-server.bigpond.net.au...
> > > > Hi
> > > >
> > > > I administer sql databases at a local hospital and would occasionally
> like
> > > > to determine which sql server process/task is responsible for the load
> on
> > > > the system (cpu, memory etc) at a particular time.
> > > >
> > > > The server hosts a largish number of databases for various 3rd party
> > > systems
> > > > and some in house systems primarily accessed in an interactive
> > > > (non-transactional) manner. I monitor system performance regularly and
> > > have
> > > > been noticing sustained periods (~5 mins) of high cpu usage (>50%) and
> > > disk
> > > > activity, which is not consistent with the normal pattern. I would
> like to
> > > > work out which database/application is responsible. At the same time
> SQL
> > > > compilations are low and the Buffer Manager looks healthy (ie Page
> life
> > > > expectancy, Cache Hits and Lizy Writes all good). Task Manager reports
> > > that
> > > > SQL Server is the application using the cpu time and the server does
> not
> > > run
> > > > any other applications.
> > > >
> > > > The Current Activity in Enterprise Manager shows me all active
> connections
> > > > and processes but not their relative system load. The Profiler will
> show
> > > me
> > > > which processes are running and what they are doing, which is very
> useful,
> > > > however it does not show me what is running at the time I start the
> > > profile
> > > > log, which would typically be _after_ I have discovered that the
> system is
> > > > excessively loaded.
> > > >
> > > > Is there any other way to get a snapshot of all active sql server
> > > processes
> > > > and their relative load/queryplan cost/size of returned recordset etc
> that
> > > > could give me a clue?
> > > >
> > > > InterBase, for instance, has a Performance Monitor which gives a
> real-time
> > > > display of memory use, records fetched and much more per database and
> per
> > > > running query/procedure.
> > > >
> > > > Thanks & Regards
> > > > Bas
> > > >
> > > > --
> > > >
> > > > ==========================================> > > > Bas Groeneveld
> > > > Benchmark Design System and Software Engineering
> > > > PO Box 165N, Ballarat North, VIC 3350
> > > > Phone: +61 3 5333 5441 Mob: 0409 954 501
> > > >
> > > >
> > > >
> > >
> > >
> > >
>
>sql

Wednesday, March 21, 2012

How to detect diferences between 2 databases

I have a database B on server S and a database B1 o server S1
Is there any tool to give me the diferences between the two databases, new
tables, new fields...
JLobo
www.red-gate.com
Andrew J. Kelly SQL MVP
"JLobo" <JLobo@.discussions.microsoft.com> wrote in message
news:A5AFEF9E-64C0-4CB8-89B4-A56D1E8F4928@.microsoft.com...
>I have a database B on server S and a database B1 o server S1
> Is there any tool to give me the diferences between the two databases, new
> tables, new fields...
> --
> JLobo
|||There are many companies that make tools that do database comparison.
Red Gate is one such company. Their tool - SQL Compare - works very well.
http://www.red-gate.com/
Imceda used to offer Speed Change Manager. http://www.imceda.com Quest
http://www.quest.com/ purchased Imceda a while ago. Quest seems to have
several tools that perform database comparison including CompareRocket for
Visual Studio and Toad for SQL Server.
Keith Kratochvil
"JLobo" <JLobo@.discussions.microsoft.com> wrote in message
news:A5AFEF9E-64C0-4CB8-89B4-A56D1E8F4928@.microsoft.com...
>I have a database B on server S and a database B1 o server S1
> Is there any tool to give me the diferences between the two databases, new
> tables, new fields...
> --
> JLobo

How to detect changes to the structure of databases, tables and even SP

HI,

Any help here is appreciated, I work in a large software company that has many small teams. I am faced with the issue of some of the other teams are changing the structure of tables and views and even SPs and functions without letting the rest know of these changes.

My question is, is there a way of tracking these changes through a job to alert everyone else in case this situation happens.

regards

You could write some TSQL code that will monitor or snapshot system table information, compare it to the database and find the differences. You can also go the 3rd party route and look at tools like Redgate's SQLCompare to do this for you. Your best bet however is to use your source code control system to track the changes and maintain them (I am assuming you already have such system in place). Apart from these, there are no built-in methods that are easy enough to detect differences out of the box.|||

That is what i thought, but I was hopping for an easy solution. Currently we are tracking it with source control although not all developers adhere to the rules.

thanks anyways for your quick response.

emad

|||

Yeah, RedGate has a nice snapshot feature that you can use to keep a version around of a server. I use SQLCompare when I am migrating changes just to make sure nothing has changed that hasn't been done quite right.

In 2005, you might also consider using a DDL trigger to capture changes (I do this to make sure no one makes any unkown changes. You could then check this table for who has made changes (of course if the changer has dbo rights they could disable this trigger before making changes, but if you have malicious programmers (rather than those who ar just too lazy to do things right :) then you have way more problems than any of us can help you with :)

|||I understand that the DML trigger can be used to find a one or many changes that happen to data in a user table purposely or otherwise. I did that using deleted, inserted, and updated tables. I do not know how to get the user name or id that changed it. Where can I get this information from?. Also, is it possible to get the column names in these three tables? Please advise. Thanks.|||DML trigger is for tracking data changes. You can use SYSTEM_USER to track login information for example. But the relevance of this information depends on your application architecture and how the interaction with the database happens from the end-user. DDL triggers (new in SQL Server 2005) on the other hand can be used to track schema changes for example and that is more closer to what you want.sql

Monday, March 19, 2012

How to detach System Databases...

We have C:, D: and E: drives on our server box. C: drive is
partitioned and is big enough only to hold Operating system files. D:
and E: drives are what were supposed to be used by developers / dba's
to store / create SQL Server (system and user databases).

Well, some developers installed the entire SQL Server named instance
and their system and user defined databases on the C: drive. Is there
any way to move the system databases (master, msdb, distribution
etc.,) from the C: to the D: / E: drives?

Appreciate any feedback.

Thanks
Jagannathan SanthanamThe master, model, and tempdb databases cannot be detached/attached.

--
-- Anith
( Please reply to newsgroups only )|||Hi

Check out http://support.microsoft.com/defaul...kb;EN-US;304692

John

"Jagannathan Santhanam" <jags_32@.yahoo.com> wrote in message
news:605df08e.0310271102.e5deab7@.posting.google.co m...
> We have C:, D: and E: drives on our server box. C: drive is
> partitioned and is big enough only to hold Operating system files. D:
> and E: drives are what were supposed to be used by developers / dba's
> to store / create SQL Server (system and user databases).
> Well, some developers installed the entire SQL Server named instance
> and their system and user defined databases on the C: drive. Is there
> any way to move the system databases (master, msdb, distribution
> etc.,) from the C: to the D: / E: drives?
> Appreciate any feedback.
> Thanks
> Jagannathan Santhanam|||Hi

Check out http://support.microsoft.com/defaul...kb;EN-US;304692

John

"Jagannathan Santhanam" <jags_32@.yahoo.com> wrote in message
news:605df08e.0310271102.e5deab7@.posting.google.co m...
> We have C:, D: and E: drives on our server box. C: drive is
> partitioned and is big enough only to hold Operating system files. D:
> and E: drives are what were supposed to be used by developers / dba's
> to store / create SQL Server (system and user databases).
> Well, some developers installed the entire SQL Server named instance
> and their system and user defined databases on the C: drive. Is there
> any way to move the system databases (master, msdb, distribution
> etc.,) from the C: to the D: / E: drives?
> Appreciate any feedback.
> Thanks
> Jagannathan Santhanam

How to detach replication dbs?

There are two databases on two web servers, db01 is on server01, db01_replica is on server02, db02 is on server02, db02_replica is on server01. db01 and db02 are both for one system. Each time after doing performance test, I have to recover databses. I copy the data files in a folder, try to use detach and attach to recover databases. But with two replication dbs, I don't know how to do it. The replication db should also be recovered.

Detach/attach is breaking the link between replication and these databases.

Depending on some specifics, there may be several ways to get what you want to do.

First, knowing what version and edition will tell us what tools we have to work with.

Off the top of my head, you could tear down your replication setup, detach/attach, and recreate the replication config. Not pretty, but you could automate it with scripts.

You can use backup/restore instead of detach/attach.

You could possibly create database snapshots of all the databases, and then to reset use RESTORE DATABASE <dbname> FROM DATABASE_SNAPSHOT=<snapshot name> to limit the amount of data being moved.

|||The situation is: my project is partitioned in two db servers, which all use SQL Server 2005. db01 is on server01 and has replication in server02, db02 is on server02 and has replication in server01. Each time there is a new build of the project, I have to do performance test for it. Unluckily, prepare for the performance test data need 2 days, each time do deployment for the new build, the db will be re-deployed, so all data will lose. I have keep the old build database and data, the most important thing is how to resotore data into new build. I ever used "bcp" to export and import data. But I don't know when replication will end up. So I think maybe detach/attach can help.

How to detach deleted databases?

I asked this question in the Tools General forum but received no response. Does anybody is this forum know how to resolve this problem? Here it is again with a bit more info:

When I ran sseutil -l, I discovered several databases that were still attached. However, they were old test projects that had previously been deleted. How do I detach them if they no longer exist? Using the detach command will not work because it just gives me a message: No valid database name matches the value specified.

Apparently, this question is too difficult. Doesn't anybody have a clue on how to do this?|||Did you try using
sseutil.exe -d<nameofthedatabase>
?
HTH, Jens Suessmeyer.|||Yes, of course. That's the problem. The test databases no longer exist so sseutil can't find them. So it won't detach them.

How to detach a database with replication db?

There are two databases on two web servers, db01 is on server01, db01_replica is on server02, db02 is on server02, db02_replica is on server01. db01 and db02 are both for one system. Each time after doing performance test, I have to recover databses. I copy the data files in a folder, try to use detach and attach to recover databases. But with two replication dbs, I don't know how to do it. The replication db should also be recovered.you cannot detach a replicated database. You could do backup/restore instead.

Wednesday, March 7, 2012

How to delete Guest user, via group membership

Dear all
In my databases I can see the user Guest, via group membership, but I
can not delete it by any way. Is there any way to delete it?
RegardsHi
What does it mean via group membership?
Do you have permissions to drop logins?
<shahdharti@.gmail.com> wrote in message
news:1134650134.830481.233610@.z14g2000cwz.googlegroups.com...
> Dear all
> In my databases I can see the user Guest, via group membership, but I
> can not delete it by any way. Is there any way to delete it?
> Regards
>|||delete the row from sysusers table.
shahdharti@.gmail.com wrote:
> Dear all
> In my databases I can see the user Guest, via group membership, but I
> can not delete it by any way. Is there any way to delete it?
> Regards|||ch
It is really deprecate to edit system tables
"ch" <ch@.dontemailme.com> wrote in message
news:43A16AB2.932AD7A0@.dontemailme.com...
> delete the row from sysusers table.
>
> shahdharti@.gmail.com wrote:
>> Dear all
>> In my databases I can see the user Guest, via group membership, but I
>> can not delete it by any way. Is there any way to delete it?
>> Regards|||In Enterprise manager when I see users list I see the Guest user and in
status column I see 'via group membership'.
In sysusers system table I can found guest user.
sp_helpuser does not show guest user.
When I try to delete I get error :15008 user Guest does not exist in
the current database.
Regards|||Hi
Why would you want to delete a rows from system table?
<shahdharti@.gmail.com> wrote in message
news:1134653831.421300.138100@.z14g2000cwz.googlegroups.com...
> In Enterprise manager when I see users list I see the Guest user and in
> status column I see 'via group membership'.
> In sysusers system table I can found guest user.
> sp_helpuser does not show guest user.
> When I try to delete I get error :15008 user Guest does not exist in
> the current database.
> Regards
>|||What version? 2000 or 2005?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
<shahdharti@.gmail.com> wrote in message
news:1134650134.830481.233610@.z14g2000cwz.googlegroups.com...
> Dear all
> In my databases I can see the user Guest, via group membership, but I
> can not delete it by any way. Is there any way to delete it?
> Regards
>|||SQL Server 2000, SP3.
One more strange matter , when I register server in my coleagues PC ,
it is not showing Guest user there.
On my pc all servers which are registered I am seeing Guest user,
having status via group memeber ship.
I want to remove this guest for all servers from my PC.
Regards|||The user doesn't really exists in the real sense. Try
SELECT * FROM sysusers WHERE name = 'guest'
You will see that the column hasdbaccess is 0.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
<shahdharti@.gmail.com> wrote in message
news:1134653831.421300.138100@.z14g2000cwz.googlegroups.com...
> In Enterprise manager when I see users list I see the Guest user and in
> status column I see 'via group membership'.
> In sysusers system table I can found guest user.
> sp_helpuser does not show guest user.
> When I try to delete I get error :15008 user Guest does not exist in
> the current database.
> Regards
>|||Have you got the SQL2005 tools installed? The version of SQLDMO installed by
the SQL2005 tools issues a slightly different query to enumerate database
users than the SQL2000 versions. This has the side effect of the guest user
showing up in all databases when viewed via Enterprise Manager. If you open
EM on the server itself (assuming there are no SQL2005 components installed)
you should see that it doesn't show up (the default SQL2000 behaviour). This
is just a UI issue and nothing has actually changed on the server - it's
nothing to worry about.
--
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
<shahdharti@.gmail.com> wrote in message
news:1134650134.830481.233610@.z14g2000cwz.googlegroups.com...
> Dear all
> In my databases I can see the user Guest, via group membership, but I
> can not delete it by any way. Is there any way to delete it?
> Regards
>|||Hi Jasper!
Thanks for that! I thought I was going crazy when looking at this (for this posts sake) and noticed
that guest show up in each database even if it "doesn't exist". I was close to dead certain that
this isn't the normal behavior... :-)
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:%23wGk9QaAGHA.3872@.TK2MSFTNGP12.phx.gbl...
> Have you got the SQL2005 tools installed? The version of SQLDMO installed by the SQL2005 tools
> issues a slightly different query to enumerate database users than the SQL2000 versions. This has
> the side effect of the guest user showing up in all databases when viewed via Enterprise Manager.
> If you open EM on the server itself (assuming there are no SQL2005 components installed) you
> should see that it doesn't show up (the default SQL2000 behaviour). This is just a UI issue and
> nothing has actually changed on the server - it's nothing to worry about.
> --
> HTH
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> <shahdharti@.gmail.com> wrote in message
> news:1134650134.830481.233610@.z14g2000cwz.googlegroups.com...
>> Dear all
>> In my databases I can see the user Guest, via group membership, but I
>> can not delete it by any way. Is there any way to delete it?
>> Regards
>|||Thanks Jasper
You are right. Its a relief for me.
Regards|||jasper, you should have also posted this response in my thread titled
"how did guest get back into all of my databases?" ;)
thanks for the info.
Jasper Smith wrote:
> Have you got the SQL2005 tools installed? The version of SQLDMO installed by
> the SQL2005 tools issues a slightly different query to enumerate database
> users than the SQL2000 versions. This has the side effect of the guest user
> showing up in all databases when viewed via Enterprise Manager. If you open
> EM on the server itself (assuming there are no SQL2005 components installed)
> you should see that it doesn't show up (the default SQL2000 behaviour). This
> is just a UI issue and nothing has actually changed on the server - it's
> nothing to worry about.
> --
> HTH
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> <shahdharti@.gmail.com> wrote in message
> news:1134650134.830481.233610@.z14g2000cwz.googlegroups.com...
> > Dear all
> >
> > In my databases I can see the user Guest, via group membership, but I
> > can not delete it by any way. Is there any way to delete it?
> >
> > Regards
> >

How to delete Guest user, via group membership

Dear all
In my databases I can see the user Guest, via group membership, but I
can not delete it by any way. Is there any way to delete it?
RegardsHi
What does it mean via group membership?
Do you have permissions to drop logins?
<shahdharti@.gmail.com> wrote in message
news:1134650134.830481.233610@.z14g2000cwz.googlegroups.com...
> Dear all
> In my databases I can see the user Guest, via group membership, but I
> can not delete it by any way. Is there any way to delete it?
> Regards
>|||delete the row from sysusers table.
shahdharti@.gmail.com wrote:
> Dear all
> In my databases I can see the user Guest, via group membership, but I
> can not delete it by any way. Is there any way to delete it?
> Regards|||ch
It is really deprecate to edit system tables
"ch" <ch@.dontemailme.com> wrote in message
news:43A16AB2.932AD7A0@.dontemailme.com...[vbcol=seagreen]
> delete the row from sysusers table.
>
> shahdharti@.gmail.com wrote:|||In Enterprise manager when I see users list I see the Guest user and in
status column I see 'via group membership'.
In sysusers system table I can found guest user.
sp_helpuser does not show guest user.
When I try to delete I get error :15008 user Guest does not exist in
the current database.
Regards|||Hi
Why would you want to delete a rows from system table?
<shahdharti@.gmail.com> wrote in message
news:1134653831.421300.138100@.z14g2000cwz.googlegroups.com...
> In Enterprise manager when I see users list I see the Guest user and in
> status column I see 'via group membership'.
> In sysusers system table I can found guest user.
> sp_helpuser does not show guest user.
> When I try to delete I get error :15008 user Guest does not exist in
> the current database.
> Regards
>|||What version? 2000 or 2005?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
<shahdharti@.gmail.com> wrote in message
news:1134650134.830481.233610@.z14g2000cwz.googlegroups.com...
> Dear all
> In my databases I can see the user Guest, via group membership, but I
> can not delete it by any way. Is there any way to delete it?
> Regards
>|||SQL Server 2000, SP3.
One more strange matter , when I register server in my coleagues PC ,
it is not showing Guest user there.
On my pc all servers which are registered I am seeing Guest user,
having status via group memeber ship.
I want to remove this guest for all servers from my PC.
Regards|||The user doesn't really exists in the real sense. Try
SELECT * FROM sysusers WHERE name = 'guest'
You will see that the column hasdbaccess is 0.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
<shahdharti@.gmail.com> wrote in message
news:1134653831.421300.138100@.z14g2000cwz.googlegroups.com...
> In Enterprise manager when I see users list I see the Guest user and in
> status column I see 'via group membership'.
> In sysusers system table I can found guest user.
> sp_helpuser does not show guest user.
> When I try to delete I get error :15008 user Guest does not exist in
> the current database.
> Regards
>|||Have you got the SQL2005 tools installed? The version of SQLDMO installed by
the SQL2005 tools issues a slightly different query to enumerate database
users than the SQL2000 versions. This has the side effect of the guest user
showing up in all databases when viewed via Enterprise Manager. If you open
EM on the server itself (assuming there are no SQL2005 components installed)
you should see that it doesn't show up (the default SQL2000 behaviour). This
is just a UI issue and nothing has actually changed on the server - it's
nothing to worry about.
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
<shahdharti@.gmail.com> wrote in message
news:1134650134.830481.233610@.z14g2000cwz.googlegroups.com...
> Dear all
> In my databases I can see the user Guest, via group membership, but I
> can not delete it by any way. Is there any way to delete it?
> Regards
>

How to delete Guest user, via group membership

Dear all
In my databases I can see the user Guest, via group membership, but I
can not delete it by any way. Is there any way to delete it?
Regards
Hi
What does it mean via group membership?
Do you have permissions to drop logins?
<shahdharti@.gmail.com> wrote in message
news:1134650134.830481.233610@.z14g2000cwz.googlegr oups.com...
> Dear all
> In my databases I can see the user Guest, via group membership, but I
> can not delete it by any way. Is there any way to delete it?
> Regards
>
|||delete the row from sysusers table.
shahdharti@.gmail.com wrote:
> Dear all
> In my databases I can see the user Guest, via group membership, but I
> can not delete it by any way. Is there any way to delete it?
> Regards
|||ch
It is really deprecate to edit system tables
"ch" <ch@.dontemailme.com> wrote in message
news:43A16AB2.932AD7A0@.dontemailme.com...[vbcol=seagreen]
> delete the row from sysusers table.
>
> shahdharti@.gmail.com wrote:
|||In Enterprise manager when I see users list I see the Guest user and in
status column I see 'via group membership'.
In sysusers system table I can found guest user.
sp_helpuser does not show guest user.
When I try to delete I get error :15008 user Guest does not exist in
the current database.
Regards
|||Hi
Why would you want to delete a rows from system table?
<shahdharti@.gmail.com> wrote in message
news:1134653831.421300.138100@.z14g2000cwz.googlegr oups.com...
> In Enterprise manager when I see users list I see the Guest user and in
> status column I see 'via group membership'.
> In sysusers system table I can found guest user.
> sp_helpuser does not show guest user.
> When I try to delete I get error :15008 user Guest does not exist in
> the current database.
> Regards
>
|||What version? 2000 or 2005?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
<shahdharti@.gmail.com> wrote in message
news:1134650134.830481.233610@.z14g2000cwz.googlegr oups.com...
> Dear all
> In my databases I can see the user Guest, via group membership, but I
> can not delete it by any way. Is there any way to delete it?
> Regards
>
|||SQL Server 2000, SP3.
One more strange matter , when I register server in my coleagues PC ,
it is not showing Guest user there.
On my pc all servers which are registered I am seeing Guest user,
having status via group memeber ship.
I want to remove this guest for all servers from my PC.
Regards
|||The user doesn't really exists in the real sense. Try
SELECT * FROM sysusers WHERE name = 'guest'
You will see that the column hasdbaccess is 0.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
<shahdharti@.gmail.com> wrote in message
news:1134653831.421300.138100@.z14g2000cwz.googlegr oups.com...
> In Enterprise manager when I see users list I see the Guest user and in
> status column I see 'via group membership'.
> In sysusers system table I can found guest user.
> sp_helpuser does not show guest user.
> When I try to delete I get error :15008 user Guest does not exist in
> the current database.
> Regards
>
|||Have you got the SQL2005 tools installed? The version of SQLDMO installed by
the SQL2005 tools issues a slightly different query to enumerate database
users than the SQL2000 versions. This has the side effect of the guest user
showing up in all databases when viewed via Enterprise Manager. If you open
EM on the server itself (assuming there are no SQL2005 components installed)
you should see that it doesn't show up (the default SQL2000 behaviour). This
is just a UI issue and nothing has actually changed on the server - it's
nothing to worry about.
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
<shahdharti@.gmail.com> wrote in message
news:1134650134.830481.233610@.z14g2000cwz.googlegr oups.com...
> Dear all
> In my databases I can see the user Guest, via group membership, but I
> can not delete it by any way. Is there any way to delete it?
> Regards
>

Friday, February 24, 2012

How to delete a database without name

Hi,
In my databases list there is one database with an empty name. I don't know
how it got there, but I want to get rid of it. My whole SQL Server is
messed up now, I cannot even add a table or something like that.
I cannot drop it from Enterprise manager.
I cannot drop it with SQL, because I don't have a database name.
I tried with SQLDMO :
Public Sub DropDb()
Dim ss As New SQLDMO.SQLServer
Dim db As New SQLDMO.Database
Dim i As Integer
ss.Connect , "sa", "sa"
For i = 1 To ss.Databases.Count
Debug.Print ss.Databases(i).Name, i
Next
ss.Databases(1).Remove
End Sub
But that gave me an error: Excepion_Access_Violation
How can I delete this database?
Any help will be greatly appreciated.
Thanks,
Edgar
Hi,
In Query Analyzer query the Sysdatabases table in Master database and see
the contents for the empty database.
select * from master..sysdatabases
Thanks
Hari
MCDBA
"Edgar Walther" <EdgarW@.metrixbv.nl> wrote in message
news:411c9232$0$10528$e4fe514c@.news.xs4all.nl...
> Hi,
> In my databases list there is one database with an empty name. I don't
know
> how it got there, but I want to get rid of it. My whole SQL Server is
> messed up now, I cannot even add a table or something like that.
> I cannot drop it from Enterprise manager.
> I cannot drop it with SQL, because I don't have a database name.
> I tried with SQLDMO :
> Public Sub DropDb()
> Dim ss As New SQLDMO.SQLServer
> Dim db As New SQLDMO.Database
> Dim i As Integer
> ss.Connect , "sa", "sa"
> For i = 1 To ss.Databases.Count
> Debug.Print ss.Databases(i).Name, i
> Next
> ss.Databases(1).Remove
> End Sub
> But that gave me an error: Excepion_Access_Violation
> How can I delete this database?
> Any help will be greatly appreciated.
> Thanks,
> Edgar
>
|||Are you sure the database name is empty? It can be a space, for example:
CREATE DATABASE [ ]
GO
DROP DATABASE [ ]
works fine.
You can confirm if the database name is really empty with:
SELECT name, LEN(name)
FROM master.dbo.sysdatabases
The name could be non-space white space though, and in that case you have to
use the ASCII function to find out what it is.
Jacco Schalkwijk
SQL Server MVP
"Edgar Walther" <EdgarW@.metrixbv.nl> wrote in message
news:411c9232$0$10528$e4fe514c@.news.xs4all.nl...
> Hi,
> In my databases list there is one database with an empty name. I don't
> know
> how it got there, but I want to get rid of it. My whole SQL Server is
> messed up now, I cannot even add a table or something like that.
> I cannot drop it from Enterprise manager.
> I cannot drop it with SQL, because I don't have a database name.
> I tried with SQLDMO :
> Public Sub DropDb()
> Dim ss As New SQLDMO.SQLServer
> Dim db As New SQLDMO.Database
> Dim i As Integer
> ss.Connect , "sa", "sa"
> For i = 1 To ss.Databases.Count
> Debug.Print ss.Databases(i).Name, i
> Next
> ss.Databases(1).Remove
> End Sub
> But that gave me an error: Excepion_Access_Violation
> How can I delete this database?
> Any help will be greatly appreciated.
> Thanks,
> Edgar
>
|||Hi,
Deleting the record from master..sysdatabases fixed the problem.
Thanks for your help.
Edgar
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:OiI2E9RgEHA.2984@.tk2msftngp13.phx.gbl...
> Hi,
> In Query Analyzer query the Sysdatabases table in Master database and see
> the contents for the empty database.
> select * from master..sysdatabases
> Thanks
> Hari
> MCDBA
>
> "Edgar Walther" <EdgarW@.metrixbv.nl> wrote in message
> news:411c9232$0$10528$e4fe514c@.news.xs4all.nl...
> know
>
|||If you actually did a DELETE against sysdatabases, you probably have some other stuff referring to this
database. I.e., you might just have an inconsistent master database. Two tables that comes to mind are
sysaltfiles (some DBCC CHECK... command might find that) and the backup history tables in msdb (which are OK
to have rows for non-existing databases in).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Edgar Walther" <EdgarW@.metrixbv.nl> wrote in message news:411c9a6e$0$49711$e4fe514c@.news.xs4all.nl...
> Hi,
> Deleting the record from master..sysdatabases fixed the problem.
> Thanks for your help.
> Edgar
>
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:OiI2E9RgEHA.2984@.tk2msftngp13.phx.gbl...
>
|||You should be careful using len() function - it returns the number of
characters excluding trailing blanks.
Leonid.
"Jacco Schalkwijk" <jacco.please.reply@.to.newsgroups.mvps.org.invalid > wrote in message news:<OXHCmDSgEHA.3264@.tk2msftngp13.phx.gbl>...[vbcol=seagreen]
> Are you sure the database name is empty? It can be a space, for example:
> CREATE DATABASE [ ]
> GO
> DROP DATABASE [ ]
> works fine.
> You can confirm if the database name is really empty with:
> SELECT name, LEN(name)
> FROM master.dbo.sysdatabases
> The name could be non-space white space though, and in that case you have to
> use the ASCII function to find out what it is.
>
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "Edgar Walther" <EdgarW@.metrixbv.nl> wrote in message
> news:411c9232$0$10528$e4fe514c@.news.xs4all.nl...

How to delete a database without name

Hi,
In my databases list there is one database with an empty name. I don't know
how it got there, but I want to get rid of it. My whole SQL Server is
messed up now, I cannot even add a table or something like that.
I cannot drop it from Enterprise manager.
I cannot drop it with SQL, because I don't have a database name.
I tried with SQLDMO :
Public Sub DropDb()
Dim ss As New SQLDMO.SQLServer
Dim db As New SQLDMO.Database
Dim i As Integer
ss.Connect , "sa", "sa"
For i = 1 To ss.Databases.Count
Debug.Print ss.Databases(i).Name, i
Next
ss.Databases(1).Remove
End Sub
But that gave me an error: Excepion_Access_Violation
How can I delete this database?
Any help will be greatly appreciated.
Thanks,
EdgarHi,
In Query Analyzer query the Sysdatabases table in Master database and see
the contents for the empty database.
select * from master..sysdatabases
Thanks
Hari
MCDBA
"Edgar Walther" <EdgarW@.metrixbv.nl> wrote in message
news:411c9232$0$10528$e4fe514c@.news.xs4all.nl...
> Hi,
> In my databases list there is one database with an empty name. I don't
know
> how it got there, but I want to get rid of it. My whole SQL Server is
> messed up now, I cannot even add a table or something like that.
> I cannot drop it from Enterprise manager.
> I cannot drop it with SQL, because I don't have a database name.
> I tried with SQLDMO :
> Public Sub DropDb()
> Dim ss As New SQLDMO.SQLServer
> Dim db As New SQLDMO.Database
> Dim i As Integer
> ss.Connect , "sa", "sa"
> For i = 1 To ss.Databases.Count
> Debug.Print ss.Databases(i).Name, i
> Next
> ss.Databases(1).Remove
> End Sub
> But that gave me an error: Excepion_Access_Violation
> How can I delete this database?
> Any help will be greatly appreciated.
> Thanks,
> Edgar
>|||Are you sure the database name is empty? It can be a space, for example:
CREATE DATABASE [ ]
GO
DROP DATABASE [ ]
works fine.
You can confirm if the database name is really empty with:
SELECT name, LEN(name)
FROM master.dbo.sysdatabases
The name could be non-space white space though, and in that case you have to
use the ASCII function to find out what it is.
Jacco Schalkwijk
SQL Server MVP
"Edgar Walther" <EdgarW@.metrixbv.nl> wrote in message
news:411c9232$0$10528$e4fe514c@.news.xs4all.nl...
> Hi,
> In my databases list there is one database with an empty name. I don't
> know
> how it got there, but I want to get rid of it. My whole SQL Server is
> messed up now, I cannot even add a table or something like that.
> I cannot drop it from Enterprise manager.
> I cannot drop it with SQL, because I don't have a database name.
> I tried with SQLDMO :
> Public Sub DropDb()
> Dim ss As New SQLDMO.SQLServer
> Dim db As New SQLDMO.Database
> Dim i As Integer
> ss.Connect , "sa", "sa"
> For i = 1 To ss.Databases.Count
> Debug.Print ss.Databases(i).Name, i
> Next
> ss.Databases(1).Remove
> End Sub
> But that gave me an error: Excepion_Access_Violation
> How can I delete this database?
> Any help will be greatly appreciated.
> Thanks,
> Edgar
>|||Hi,
Deleting the record from master..sysdatabases fixed the problem.
Thanks for your help.
Edgar
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:OiI2E9RgEHA.2984@.tk2msftngp13.phx.gbl...
> Hi,
> In Query Analyzer query the Sysdatabases table in Master database and see
> the contents for the empty database.
> select * from master..sysdatabases
> Thanks
> Hari
> MCDBA
>
> "Edgar Walther" <EdgarW@.metrixbv.nl> wrote in message
> news:411c9232$0$10528$e4fe514c@.news.xs4all.nl...
> know
>|||If you actually did a DELETE against sysdatabases, you probably have some ot
her stuff referring to this
database. I.e., you might just have an inconsistent master database. Two tab
les that comes to mind are
sysaltfiles (some DBCC CHECK... command might find that) and the backup hist
ory tables in msdb (which are OK
to have rows for non-existing databases in).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Edgar Walther" <EdgarW@.metrixbv.nl> wrote in message news:411c9a6e$0$49711$e4fe514c@.news.xs
4all.nl...
> Hi,
> Deleting the record from master..sysdatabases fixed the problem.
> Thanks for your help.
> Edgar
>
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:OiI2E9RgEHA.2984@.tk2msftngp13.phx.gbl...
>|||You should be careful using len() function - it returns the number of
characters excluding trailing blanks.
Leonid.
"Jacco Schalkwijk" <jacco.please.reply@.to.newsgroups.mvps.org.invalid> wrote in message news
:<OXHCmDSgEHA.3264@.tk2msftngp13.phx.gbl>...[vbcol=seagreen]
> Are you sure the database name is empty? It can be a space, for example:
> CREATE DATABASE [ ]
> GO
> DROP DATABASE [ ]
> works fine.
> You can confirm if the database name is really empty with:
> SELECT name, LEN(name)
> FROM master.dbo.sysdatabases
> The name could be non-space white space though, and in that case you have
to
> use the ASCII function to find out what it is.
>
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "Edgar Walther" <EdgarW@.metrixbv.nl> wrote in message
> news:411c9232$0$10528$e4fe514c@.news.xs4all.nl...

How to delete a database without name

Hi,
In my databases list there is one database with an empty name. I don't know
how it got there, but I want to get rid of it. My whole SQL Server is
messed up now, I cannot even add a table or something like that.
I cannot drop it from Enterprise manager.
I cannot drop it with SQL, because I don't have a database name.
I tried with SQLDMO :
Public Sub DropDb()
Dim ss As New SQLDMO.SQLServer
Dim db As New SQLDMO.Database
Dim i As Integer
ss.Connect , "sa", "sa"
For i = 1 To ss.Databases.Count
Debug.Print ss.Databases(i).Name, i
Next
ss.Databases(1).Remove
End Sub
But that gave me an error: Excepion_Access_Violation
How can I delete this database?
Any help will be greatly appreciated.
Thanks,
EdgarHi,
In Query Analyzer query the Sysdatabases table in Master database and see
the contents for the empty database.
select * from master..sysdatabases
Thanks
Hari
MCDBA
"Edgar Walther" <EdgarW@.metrixbv.nl> wrote in message
news:411c9232$0$10528$e4fe514c@.news.xs4all.nl...
> Hi,
> In my databases list there is one database with an empty name. I don't
know
> how it got there, but I want to get rid of it. My whole SQL Server is
> messed up now, I cannot even add a table or something like that.
> I cannot drop it from Enterprise manager.
> I cannot drop it with SQL, because I don't have a database name.
> I tried with SQLDMO :
> Public Sub DropDb()
> Dim ss As New SQLDMO.SQLServer
> Dim db As New SQLDMO.Database
> Dim i As Integer
> ss.Connect , "sa", "sa"
> For i = 1 To ss.Databases.Count
> Debug.Print ss.Databases(i).Name, i
> Next
> ss.Databases(1).Remove
> End Sub
> But that gave me an error: Excepion_Access_Violation
> How can I delete this database?
> Any help will be greatly appreciated.
> Thanks,
> Edgar
>|||Are you sure the database name is empty? It can be a space, for example:
CREATE DATABASE [ ]
GO
DROP DATABASE [ ]
works fine.
You can confirm if the database name is really empty with:
SELECT name, LEN(name)
FROM master.dbo.sysdatabases
The name could be non-space white space though, and in that case you have to
use the ASCII function to find out what it is.
Jacco Schalkwijk
SQL Server MVP
"Edgar Walther" <EdgarW@.metrixbv.nl> wrote in message
news:411c9232$0$10528$e4fe514c@.news.xs4all.nl...
> Hi,
> In my databases list there is one database with an empty name. I don't
> know
> how it got there, but I want to get rid of it. My whole SQL Server is
> messed up now, I cannot even add a table or something like that.
> I cannot drop it from Enterprise manager.
> I cannot drop it with SQL, because I don't have a database name.
> I tried with SQLDMO :
> Public Sub DropDb()
> Dim ss As New SQLDMO.SQLServer
> Dim db As New SQLDMO.Database
> Dim i As Integer
> ss.Connect , "sa", "sa"
> For i = 1 To ss.Databases.Count
> Debug.Print ss.Databases(i).Name, i
> Next
> ss.Databases(1).Remove
> End Sub
> But that gave me an error: Excepion_Access_Violation
> How can I delete this database?
> Any help will be greatly appreciated.
> Thanks,
> Edgar
>|||Hi,
Deleting the record from master..sysdatabases fixed the problem.
Thanks for your help.
Edgar
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:OiI2E9RgEHA.2984@.tk2msftngp13.phx.gbl...
> Hi,
> In Query Analyzer query the Sysdatabases table in Master database and see
> the contents for the empty database.
> select * from master..sysdatabases
> Thanks
> Hari
> MCDBA
>
> "Edgar Walther" <EdgarW@.metrixbv.nl> wrote in message
> news:411c9232$0$10528$e4fe514c@.news.xs4all.nl...
> > Hi,
> >
> > In my databases list there is one database with an empty name. I don't
> know
> > how it got there, but I want to get rid of it. My whole SQL Server is
> > messed up now, I cannot even add a table or something like that.
> >
> > I cannot drop it from Enterprise manager.
> >
> > I cannot drop it with SQL, because I don't have a database name.
> >
> > I tried with SQLDMO :
> >
> > Public Sub DropDb()
> > Dim ss As New SQLDMO.SQLServer
> > Dim db As New SQLDMO.Database
> > Dim i As Integer
> > ss.Connect , "sa", "sa"
> > For i = 1 To ss.Databases.Count
> > Debug.Print ss.Databases(i).Name, i
> > Next
> > ss.Databases(1).Remove
> > End Sub
> >
> > But that gave me an error: Excepion_Access_Violation
> >
> > How can I delete this database?
> >
> > Any help will be greatly appreciated.
> >
> > Thanks,
> >
> > Edgar
> >
> >
>|||If you actually did a DELETE against sysdatabases, you probably have some other stuff referring to this
database. I.e., you might just have an inconsistent master database. Two tables that comes to mind are
sysaltfiles (some DBCC CHECK... command might find that) and the backup history tables in msdb (which are OK
to have rows for non-existing databases in).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Edgar Walther" <EdgarW@.metrixbv.nl> wrote in message news:411c9a6e$0$49711$e4fe514c@.news.xs4all.nl...
> Hi,
> Deleting the record from master..sysdatabases fixed the problem.
> Thanks for your help.
> Edgar
>
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:OiI2E9RgEHA.2984@.tk2msftngp13.phx.gbl...
> > Hi,
> >
> > In Query Analyzer query the Sysdatabases table in Master database and see
> > the contents for the empty database.
> >
> > select * from master..sysdatabases
> >
> > Thanks
> > Hari
> > MCDBA
> >
> >
> >
> > "Edgar Walther" <EdgarW@.metrixbv.nl> wrote in message
> > news:411c9232$0$10528$e4fe514c@.news.xs4all.nl...
> > > Hi,
> > >
> > > In my databases list there is one database with an empty name. I don't
> > know
> > > how it got there, but I want to get rid of it. My whole SQL Server is
> > > messed up now, I cannot even add a table or something like that.
> > >
> > > I cannot drop it from Enterprise manager.
> > >
> > > I cannot drop it with SQL, because I don't have a database name.
> > >
> > > I tried with SQLDMO :
> > >
> > > Public Sub DropDb()
> > > Dim ss As New SQLDMO.SQLServer
> > > Dim db As New SQLDMO.Database
> > > Dim i As Integer
> > > ss.Connect , "sa", "sa"
> > > For i = 1 To ss.Databases.Count
> > > Debug.Print ss.Databases(i).Name, i
> > > Next
> > > ss.Databases(1).Remove
> > > End Sub
> > >
> > > But that gave me an error: Excepion_Access_Violation
> > >
> > > How can I delete this database?
> > >
> > > Any help will be greatly appreciated.
> > >
> > > Thanks,
> > >
> > > Edgar
> > >
> > >
> >
> >
>|||You should be careful using len() function - it returns the number of
characters excluding trailing blanks.
Leonid.
"Jacco Schalkwijk" <jacco.please.reply@.to.newsgroups.mvps.org.invalid> wrote in message news:<OXHCmDSgEHA.3264@.tk2msftngp13.phx.gbl>...
> Are you sure the database name is empty? It can be a space, for example:
> CREATE DATABASE [ ]
> GO
> DROP DATABASE [ ]
> works fine.
> You can confirm if the database name is really empty with:
> SELECT name, LEN(name)
> FROM master.dbo.sysdatabases
> The name could be non-space white space though, and in that case you have to
> use the ASCII function to find out what it is.
>
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "Edgar Walther" <EdgarW@.metrixbv.nl> wrote in message
> news:411c9232$0$10528$e4fe514c@.news.xs4all.nl...
> > Hi,
> >
> > In my databases list there is one database with an empty name. I don't
> > know
> > how it got there, but I want to get rid of it. My whole SQL Server is
> > messed up now, I cannot even add a table or something like that.
> >
> > I cannot drop it from Enterprise manager.
> >
> > I cannot drop it with SQL, because I don't have a database name.
> >
> > I tried with SQLDMO :
> >
> > Public Sub DropDb()
> > Dim ss As New SQLDMO.SQLServer
> > Dim db As New SQLDMO.Database
> > Dim i As Integer
> > ss.Connect , "sa", "sa"
> > For i = 1 To ss.Databases.Count
> > Debug.Print ss.Databases(i).Name, i
> > Next
> > ss.Databases(1).Remove
> > End Sub
> >
> > But that gave me an error: Excepion_Access_Violation
> >
> > How can I delete this database?
> >
> > Any help will be greatly appreciated.
> >
> > Thanks,
> >
> > Edgar
> >
> >