Re: MSDE not showing up in SQLDMO.ListAvailableServers
From: Andrea Montanari (andrea.sqlDMO_at_virgilio.it)
Date: 07/29/04
- Previous message: Michael C: "Re: MSDE not showing up in SQLDMO.ListAvailableServers"
- In reply to: Michael C: "Re: MSDE not showing up in SQLDMO.ListAvailableServers"
- Next in thread: Martijn Tonies: "Re: MSDE not showing up in SQLDMO.ListAvailableServers"
- Reply: Martijn Tonies: "Re: MSDE not showing up in SQLDMO.ListAvailableServers"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 29 Jul 2004 22:29:54 +0200
hi Michael,
"Michael C" <michaelc@nospam.org> ha scritto nel messaggio
news:oicOc.19466$oE1.1984378@news4.srv.hcvlny.cv.net...
> I had the same problem. SQL-DMO does two things when it enumerates SQL
> Servers:
>
> 1. It creates a list of SQL Servers using the Win32 API NetServerEnum
> function
> 2. It creates a list of SQL Servers that respond to a broadcast on Port
> 1433
> 3. It combines these two lists.
>
> If you're not connected to a network, NetServerEnum doesn't seem to return
> any SQL Servers. MSDE runs on Port 1434 instead of 1433, which means it
> won't pick up the broadcast. If you're just trying to enumerate the LOCAL
> MSDE instance(s), you can read the registry subkeys under
> HKLM\Software\Microsoft\MSSQLServer\MSSQLServer and
> HKLM\Software\Microsoft\Microsoft SQL Server.
>
> If anyone out there knows of a function that can be used to return named
> instances of MSDE, I'd appreciate the info.
SQL-DMO ListAvailableServer uses ODBC function SQLBrowseConnect() provided
by ODBC libraries installed by Mdac;
this is a mechanism working in broadcast calls, which result never are
conclusive and consistent, becouse results are influenced of various
servers's answer states, answer time, etc.
Until Mdac 2.5, SQLBrowseConnect function works based on a NetBIOS
broadcast, on which SQL Servers respond (Default protocol for SQL Server
7.0), while in SQL Server 2000 the rules changed, because the default client
protocol changed to TCP/IP and now a UDP broadcast is used, beside a NetBIOS
broadcast, listening on port 1434:
which is using a UDP broadcast on port 1434, if instance do not listen or
not respond on time they will not be part of the enumeration.
Some basic rules for 7.0 are:
- SQL Servers have to be running on Windows NT or Windows 2000 and have to
listen on Named Pipes, that is why in 7.0 Windows 9x SQL Servers will never
show up, because they do not listen on Named Pipes.
- The SQL Server has to be running in order to respond on the broadcast.
There is a gray window of 15 minutes after shutdown, where a browse master
in the domain may respond on the broadcast and answer.
- If you have routers in your network, that do not pass on NetBIOS
broadcasts, this might limit your scope of the broadcast.
- Only servers within the same NT domain (or trust) will get enumerated.
In SQL Server 2000 using MDAC 2.6 this changes a little, because now the
default protocol has been changed to be TCP/IP sockets and instead of a
NetBIOS broadcast, they use a TCP UDP to detect the servers. The same logic
still applies roughly.
- SQL Server that are running
- SQL Server that listening on TCP/IP
- Running on Windows NT or Windows 2000 or Windows 9x
- If you use routers and these are configured not to pass UDP broadcasts,
only machines within the same subnet show up.
Upgrading to Service Pack 2 of SQL Server 2000 is required in order to have
.ListAvailableServer method to work properly, becouse precding release of
Sql-DMO Components of Sql Server 2000 present a bug in this area.
The Service Pack 3a introduced some new amenity in order to prevent MSDE
2000 to be hit by Internet worms like Slammer and Saphire virus and to
increase security, so that Microsoft decided to default for disabling
SuperSockets Network Protocols on new MSDE 2000 installation.
Instances of SQL Server 2000 SP3a or MSDE 2000 SP3a will stop listening on
UDP port 1434 when they are configured to not listen on any network
protocols. This will stop enlisting these servers.
next problem will be WinXP sp 2 firewall, which will default closing all
ports so that single ports must be manually open by the user in order to
allow network connections... this will defeat dynamic TCP/IP allocation as
you should rely on static assignement for Named instances too...
further method to enlist SQL Server instances available on the LAN can be
found at http://www.sqldev.net/misc/EnumSQLSvr.htm ,
http://www.sqldev.net/misc/ListSQLSvr.htm and
http://www.sqldev.net/misc/OleDbEnum.htm
-- Andrea Montanari (Microsoft MVP - SQL Server) http://www.asql.biz/DbaMgr.shtm http://italy.mvps.org DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0 (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual interface) --------- remove DMO to reply
- Previous message: Michael C: "Re: MSDE not showing up in SQLDMO.ListAvailableServers"
- In reply to: Michael C: "Re: MSDE not showing up in SQLDMO.ListAvailableServers"
- Next in thread: Martijn Tonies: "Re: MSDE not showing up in SQLDMO.ListAvailableServers"
- Reply: Martijn Tonies: "Re: MSDE not showing up in SQLDMO.ListAvailableServers"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|