Friday, March 23, 2012

Have Svr name, need DBs

Hello Folks!
I have a bunch of servers, actually there are about 340.
I have the names of the servers but what I'd like to do is loop through
the servers and return all the databases on those servers.
I'd also like to find out how busy the servers are.
Got any ideas?
Thanks-In-AdvanceI wrote an SMO application for that. If you are interested, I can send
this to you. Though this is not yet perfect, it evaluates from the
needs of the community Just write me an email and I will share it. It
will eb additionally available on http://www.SQLServer2005.de (When the
site will be relaunched) soon.
HTH, Jens Suessmeyer.|||Jens, please send me the file, my email address is Bob@.BobSweeney.Net
Also, what is an SMO application? Am I supposed to know what that
acronym is?|||Assuming that you have an account that has the appropriate login and
permissions, put the names of all the servers in a text file with one on eac
h
line and run
for /F "tokens=1" %i in (servers.txt) do osql -S %i -E -Q
"sp_helpdb">>output.txt
The file output.txt will have have the listing of all the DBs on all the
servers.
For seeing how busy they are, use Performance Monitor (I think it's just
called "Performance" now) logs, or tool like MRTG.
If you posted to this forum through TechNet, and you found my answers
helpful, please mark them as answers.
"Bob" wrote:

> Hello Folks!
> I have a bunch of servers, actually there are about 340.
> I have the names of the servers but what I'd like to do is loop through
> the servers and return all the databases on those servers.
> I'd also like to find out how busy the servers are.
> Got any ideas?
> Thanks-In-Advance
>|||Slightly cleaner output:
for /F "tokens=1" %i in (servers.txt) do osql -S %i -d "master" -E -Q
"select @.@.SERVERNAME UNION ALL select catalog_name from
information_schema.schemata"
"Mark Williams" wrote:
> Assuming that you have an account that has the appropriate login and
> permissions, put the names of all the servers in a text file with one on e
ach
> line and run
> for /F "tokens=1" %i in (servers.txt) do osql -S %i -E -Q
> "sp_helpdb">>output.txt
> The file output.txt will have have the listing of all the DBs on all the
> servers.
> For seeing how busy they are, use Performance Monitor (I think it's just
> called "Performance" now) logs, or tool like MRTG.
> --
> If you posted to this forum through TechNet, and you found my answers
> helpful, please mark them as answers.
>
> "Bob" wrote:
>sql

No comments:

Post a Comment