Showing posts with label connecting. Show all posts
Showing posts with label connecting. Show all posts

Wednesday, March 28, 2012

Named Pipes problem on Clustered SQL Server

We recently have had issues connecting to clustered SQL Server
instances and have been working with PSS. I was unable to find any
useful information to assist in the troubleshooting process, so I have
decided to post this here in case anyone else searches on this like I
did.
Our Configuration:
2 Nodes, Windows 2003 Enterprise SP1, 5 SQL Server Named Instances
(SP4) in active/active configuration.
Our Initial Problem:
We were receiving GNE (General Network Error) when running some jobs or
connecting remotely to any of the named instances via Named Pipes.
When we looked in the SQL Server logs for each instance, we saw that
all instances reported "Listening on TCP, Shared Memory, Named Pipes"
During the troubleshooting we eventually found that we were unable to
connect to any of the instances using named pipes that were owned by of
the cluster nodes unless an alias was created.
Troubleshooting steps that helped us:
Try to connect to each instance using Query Analyzer. In the "Connect
to SQL Server"s "Connect to:" field try the following for each
instance:
Examples use a server called: SQLSERVER1\INSTANCE running on 1433.
After each successful connect, you should verify the connection's net
library using the following query:
select net_library from sysprocesses where spid = @.@.spid
1.) tcp:192.168.1.1,1433
2.) tcp:SQLSERVER1,1433
3.) tcp:SQLSERVER1\INSTANCE
4.) np:\\SQLSERVER1\pipe\MSSQL$INSTANCE\sql\query
5.) np:SQLSERVER1\INSTANCE
Here's the rundown of how each one is testing connectivity:
Number 1 is basic TCP connectivity. If this fails, look at TCP,
cluster VIP for that instance, port blocking on firewalls, etc. This
method does NOT use SSRP (SQL Server Resolution Protocol/Service).
Number 2 is like #1 except now DNS and/or WINS resolution is involved.
If #1 works and #2 doesn't, look at name resolution over TCP/IP. #3
uses the same name resolution as #2, however now you are using SSRP to
get the port number of the instance. (More on SSRP below). #4 uses
TCP name resolution and then connects to the SQL Server Name on the
cluster using the exact pipe name of the instance. If #4 fails, try
number 2 to test name resolution and also ensure that there is a log
entry in the SQL Server log that says "Listening on Named Pipes". #4
Uses Name Resolution and SSRP to query the pipe name.
What is SSRP?
This is the million dollar question, especially in a SQL Server
Clustered Environment. Good luck finding a nice whitepaper by
Microsoft about it, because I was unable to. After piecing together a
bunch of different posts, articles and other resources I was able to
glean the following (please note, this is my interpretation, not
absolute fact)
SSRP listens on each instance of SQL Server installed in the cluster
environment using UDP Port 1434. When a request is made for a named
pipes instance of SQL Server, the client request first queries UDP 1434
using a hex packet of 0x3. The request is handed to the SSRP Active
Server (which is the first SQL Server instance on each node that was
brought online) The SSRP Active Server then enumerates the instances
from the registry key:
HKLM\Software\Microsoft\MicrosoftSQLServer\InstalledInstances
and then SSRP Enumerates the connection information for each instance
using the key(s):
HKLM\Software\Microsoft\MicrosoftSQLServer\(instance
name)\MSSQLServer\SuperSocketNetLib\
SSRP then returns on UDP1434 to the client is a list of listening
instances and their configuration information.
You can actually see this in action using PortQry or a tool called UDP
Port Tool by http://www.simplecomtools.com/
I was unable to get PortQry to work in my environment, so I used the
UDP Port Tool. You will need to bind 1434 on your local machine (right
side of window) then enter the connection information (IP address of
SQL Server IP and port 1434 (left side of window) and enter "03"
without the quotes and set the data type to hex. This will return the
information provided by SSRP.
Now, the meat of the problem....
We found that on one of our nodes NONE of the instances would connect
using method 5 (above). However, method 4 would work. When we queried
SSRP on any of these instances, no data was returned. By logging on to
that node and executing:
netstat -an -b -p UDP
We were able to see that 0.0.0.0,1434 UDP was bound to PID xxxx. This
SHOULD have been the PID of the FIRST SQL Instance to be brought online
to that node. When we looked at both Task Manager Processes (selecting
the column for PID) there was no PID running with the number xxxx.
After looking in the historical logs, we found that there was an
instance at one point that was running on that node with PID xxxx,
however it had crashed and restarted under a new PID, however the
1434UDP bind was never released, therefore it did not thing it needed
to be the Active SSRP Server. A full cluster reboot is the Microsoft
PSS recommendation for this situation.
I hope this helps someone. We banged our heads against the wall for a
while on this, and if this only helps one person out there, hopefully
my newsgroup karma gets better. Please feel free to reply to this
with technical corrections or comments. Like I mentioned above, this
is what I found and is my interpretation.
ThanksOne other interesting note regarding SSRP that I came across while
reserching this did not apply to us, but may apply is registry
permissions while enumerating. There is a technet article on this:
http://support.microsoft.com/default.aspx?scid=kb;en-us;922131&sd=rss&spid=2852|||Wrong article!! This is the article regarding registry permissions:
http://support.microsoft.com/kb/888529
The other article has to do with SQL2005 installed over SQL2000 and
then removed.
wuteva wrote:
> One other interesting note regarding SSRP that I came across while
> reserching this did not apply to us, but may apply is registry
> permissions while enumerating. There is a technet article on this:
> http://support.microsoft.com/default.aspx?scid=kb;en-us;922131&sd=rss&spid=2852

Named Pipes problem on Clustered SQL Server

We recently have had issues connecting to clustered SQL Server
instances and have been working with PSS. I was unable to find any
useful information to assist in the troubleshooting process, so I have
decided to post this here in case anyone else searches on this like I
did.
Our Configuration:
2 Nodes, Windows 2003 Enterprise SP1, 5 SQL Server Named Instances
(SP4) in active/active configuration.
Our Initial Problem:
We were receiving GNE (General Network Error) when running some jobs or
connecting remotely to any of the named instances via Named Pipes.
When we looked in the SQL Server logs for each instance, we saw that
all instances reported "Listening on TCP, Shared Memory, Named Pipes"
During the troubleshooting we eventually found that we were unable to
connect to any of the instances using named pipes that were owned by of
the cluster nodes unless an alias was created.
Troubleshooting steps that helped us:
Try to connect to each instance using Query Analyzer. In the "Connect
to SQL Server"s "Connect to:" field try the following for each
instance:
Examples use a server called: SQLSERVER1\INSTANCE running on 1433.
After each successful connect, you should verify the connection's net
library using the following query:
select net_library from sysprocesses where spid = @.@.spid
1.) tcp:192.168.1.1,1433
2.) tcp:SQLSERVER1,1433
3.) tcp:SQLSERVER1\INSTANCE
4.) np:\\SQLSERVER1\pipe\MSSQL$INSTANCE\sql\
query
5.) np:SQLSERVER1\INSTANCE
Here's the rundown of how each one is testing connectivity:
Number 1 is basic TCP connectivity. If this fails, look at TCP,
cluster VIP for that instance, port blocking on firewalls, etc. This
method does NOT use SSRP (SQL Server Resolution Protocol/Service).
Number 2 is like #1 except now DNS and/or WINS resolution is involved.
If #1 works and #2 doesn't, look at name resolution over TCP/IP. #3
uses the same name resolution as #2, however now you are using SSRP to
get the port number of the instance. (More on SSRP below). #4 uses
TCP name resolution and then connects to the SQL Server Name on the
cluster using the exact pipe name of the instance. If #4 fails, try
number 2 to test name resolution and also ensure that there is a log
entry in the SQL Server log that says "Listening on Named Pipes". #4
Uses Name Resolution and SSRP to query the pipe name.
What is SSRP?
This is the million dollar question, especially in a SQL Server
Clustered Environment. Good luck finding a nice whitepaper by
Microsoft about it, because I was unable to. After piecing together a
bunch of different posts, articles and other resources I was able to
glean the following (please note, this is my interpretation, not
absolute fact)
SSRP listens on each instance of SQL Server installed in the cluster
environment using UDP Port 1434. When a request is made for a named
pipes instance of SQL Server, the client request first queries UDP 1434
using a hex packet of 0x3. The request is handed to the SSRP Active
Server (which is the first SQL Server instance on each node that was
brought online) The SSRP Active Server then enumerates the instances
from the registry key:
HKLM\Software\Microsoft\MicrosoftSQLServ
er\InstalledInstances
and then SSRP Enumerates the connection information for each instance
using the key(s):
HKLM\Software\Microsoft\MicrosoftSQLServ
er\(instance
name)\MSSQLServer\SuperSocketNetLib\
SSRP then returns on UDP1434 to the client is a list of listening
instances and their configuration information.
You can actually see this in action using PortQry or a tool called UDP
Port Tool by http://www.simplecomtools.com/
I was unable to get PortQry to work in my environment, so I used the
UDP Port Tool. You will need to bind 1434 on your local machine (right
side of window) then enter the connection information (IP address of
SQL Server IP and port 1434 (left side of window) and enter "03"
without the quotes and set the data type to hex. This will return the
information provided by SSRP.
Now, the meat of the problem....
We found that on one of our nodes NONE of the instances would connect
using method 5 (above). However, method 4 would work. When we queried
SSRP on any of these instances, no data was returned. By logging on to
that node and executing:
netstat -an -b -p UDP
We were able to see that 0.0.0.0,1434 UDP was bound to PID xxxx. This
SHOULD have been the PID of the FIRST SQL Instance to be brought online
to that node. When we looked at both Task Manager Processes (selecting
the column for PID) there was no PID running with the number xxxx.
After looking in the historical logs, we found that there was an
instance at one point that was running on that node with PID xxxx,
however it had crashed and restarted under a new PID, however the
1434UDP bind was never released, therefore it did not thing it needed
to be the Active SSRP Server. A full cluster reboot is the Microsoft
PSS recommendation for this situation.
I hope this helps someone. We banged our heads against the wall for a
while on this, and if this only helps one person out there, hopefully
my newsgroup karma gets better. Please feel free to reply to this
with technical corrections or comments. Like I mentioned above, this
is what I found and is my interpretation.
ThanksOne other interesting note regarding SSRP that I came across while
reserching this did not apply to us, but may apply is registry
permissions while enumerating. There is a technet article on this:
[url]http://support.microsoft.com/default.aspx?scid=kb;en-us;922131&sd=rss&spid=2852[/u
rl]|||Wrong article!! This is the article regarding registry permissions:
http://support.microsoft.com/kb/888529
The other article has to do with SQL2005 installed over SQL2000 and
then removed.
wuteva wrote:[vbcol=seagreen]
> One other interesting note regarding SSRP that I came across while
> reserching this did not apply to us, but may apply is registry
> permissions while enumerating. There is a technet article on this:
> http://support.microsoft.com/defaul...d=rss&spid=2852[/v
bcol]

Wednesday, March 21, 2012

n00b question: Connecting to SQL Server at ISP?

Hey all, sorry for asking such a grunt question, and thanks in advance
for any help...

My hosting ISP offers access to their MS-SQL database, and my
understanding is that it's generally simplest to use some sort of
client app to do stuff like adding tables and whatnot.

SQL Server includes Enterprise Manager, but since my ISP is running the
server, I don't need my own copy of SQL Server, just the client.

Any tips? I couldn't seem to find an appropriate download on the
Microsoft site...

thanks again, -Scottturnstyle (scott@.turnstyle.com) writes:
> Hey all, sorry for asking such a grunt question, and thanks in advance
> for any help...
> My hosting ISP offers access to their MS-SQL database, and my
> understanding is that it's generally simplest to use some sort of
> client app to do stuff like adding tables and whatnot.
> SQL Server includes Enterprise Manager, but since my ISP is running the
> server, I don't need my own copy of SQL Server, just the client.
> Any tips? I couldn't seem to find an appropriate download on the
> Microsoft site...

You could download Evaluation Edition. I believe that the tools don't
expire. But you may violate some license that way.

Developer Edition is 49 dollars only. Then again, if this is a production
database, I don't know if the license permits use.

As for creating tables, the best is to run T-SQL script. Then
again, the best tool for this is Query Analyzer, which is among
the SQL Server Tools you are looking for.

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

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||So there isn't an authorized way to simply download the client tools in
order to connect to a properly licensed server?

1) Does anybody here know if Evaluation Edition tools expire?

2) Another option seems to be Aqua Data Studio
(http://www.aquafold.com) -- should I use something like that, or stick
with Enterprise Manager and its Query Tool?

3) I think I have a copy of SQL-7 somewhere, I suppose I could use that
client, but are the client tools now much better with 2000?

4) Sorry, one last question -- I actually *tried* to purchase an
upgrade from SQL-7 to SQL-2000 but I couldn't figure out what I was
supposed to get -- any tips on how to actually do that?

thanks again & sorry for so many questions...
-Scott|||turnstyle (scott@.turnstyle.com) writes:
> So there isn't an authorized way to simply download the client tools in
> order to connect to a properly licensed server?

No, I don't think so. But I've directed a question on my Microsoft contacts
to see what the exact status is.

> 2) Another option seems to be Aqua Data Studio
> (http://www.aquafold.com) -- should I use something like that, or stick
> with Enterprise Manager and its Query Tool?

I can comment on any third party tools, as I have not use them. But
indeed that may be the only option.

> 3) I think I have a copy of SQL-7 somewhere, I suppose I could use that
> client, but are the client tools now much better with 2000?

I would expect Query Analyzer from SQL 7 to be able to connect, although
it would be able to handle bigint and sql_variant columns correctly. As
I recall QA in SQL 7 was quite a bleak tool; had I at the time had reason to
work with SQL 7, I would probably have stuck to the 6.5 tools. (As it
turned out, we went directly to SQL 2000.)

EM 7 may be barred from access altogether, but you could always try.
Again, bigint and sql_variant, will not make a huge success. I
can't comment on how much better EM 2000 is than EM 7, but I can't
say I'm overly excited over EM 2000.

> 4) Sorry, one last question -- I actually *tried* to purchase an
> upgrade from SQL-7 to SQL-2000 but I couldn't figure out what I was
> supposed to get -- any tips on how to actually do that?

I guess you would get the edition of SQL 2000 that matches your SQL 7
license. If that's a developer license, I would not expect that there
are any special upgrades available today, since DevEdition been slashed
to 50 USD.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Am 29 Jul 2005 03:28:11 -0700 schrieb turnstyle:

> So there isn't an authorized way to simply download the client tools in
> order to connect to a properly licensed server?
> 1) Does anybody here know if Evaluation Edition tools expire?
> 2) Another option seems to be Aqua Data Studio
> (http://www.aquafold.com) -- should I use something like that, or stick
> with Enterprise Manager and its Query Tool?
For managing SQL-Server there is a nice free Tool here:
http://sqlmanager.net/products/mssql/manager/
look for the Lite version.

bye,
Helmut

Friday, March 9, 2012

MYSQL and Reporting Server

Hi All,
Not sure if this is the best place to ask this, but how can I use
parameters in a report connecting to a MYSQL database.
Thanks
Michael
Use ? as the parameter marker e.g.
select * from mysqlcode.categories where ID = ?
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
"Michael van der Veeke" <michaelvanderveeke@.borderexpress.com.au> wrote in
message news:41e36ad1$0$96867$c30e37c6@.ken-reader.news.telstra.net...
> Hi All,
> Not sure if this is the best place to ask this, but how can I use
> parameters in a report connecting to a MYSQL database.
> Thanks
> Michael
|||Thank you very much.
Jasper Smith wrote:
> Use ? as the parameter marker e.g.
> select * from mysqlcode.categories where ID = ?
>

Saturday, February 25, 2012

My SQL Provider

Hello to all,
I have a problem in connecting in a MySQL database. I can create some ODBC
connection, but I can't use it to manipulate data.
I like Know if Existe a MySQL Provider for SQL Server 2005 that alow me to
create connections and manipulate date withe this connections.
Thank you in advance.
It's not clear but I would guess you are trying to connect
from SQL Server and query MySQL?
First - what do you mean you can create an odbc connection
but can't manipulate data? Where did you create the
connection - linked server or what?
What errors did you get trying to do this? Can you execute
any selects?
To download MySQL drivers and providers, try the drivers and
connectors section at following site:
http://www.mysql.org/downloads/
-Sue
On Wed, 25 Apr 2007 07:08:01 -0700, malek_che
<malekche@.discussions.microsoft.com> wrote:

>Hello to all,
>I have a problem in connecting in a MySQL database. I can create some ODBC
>connection, but I can't use it to manipulate data.
>I like Know if Existe a MySQL Provider for SQL Server 2005 that alow me to
>create connections and manipulate date withe this connections.
>Thank you in advance.

My SQL Provider

Hello to all,
I have a problem in connecting in a mysql database. I can create some ODBC
connection, but I can't use it to manipulate data.
I like Know if Existe a mysql Provider for SQL Server 2005 that alow me to
create connections and manipulate date withe this connections.
Thank you in advance.It's not clear but I would guess you are trying to connect
from SQL Server and query MySQL?
First - what do you mean you can create an odbc connection
but can't manipulate data? Where did you create the
connection - linked server or what?
What errors did you get trying to do this? Can you execute
any selects?
To download mysql drivers and providers, try the drivers and
connectors section at following site:
http://www.mysql.org/downloads/
-Sue
On Wed, 25 Apr 2007 07:08:01 -0700, malek_che
<malekche@.discussions.microsoft.com> wrote:

>Hello to all,
>I have a problem in connecting in a mysql database. I can create some ODBC
>connection, but I can't use it to manipulate data.
>I like Know if Existe a mysql Provider for SQL Server 2005 that alow me to
>create connections and manipulate date withe this connections.
>Thank you in advance.