Tuesday, March 27, 2012
Cluster server connection
I have recently installed a 2 node cluster server with SQL 2000 SP3 in my
network. and have found out that users connect to the Virtual cluster server
inorder to receive SQL services but they get the replay for the physical
node that holds the SQL.
I was wondering if this configuration can be changed so that the SQL servers
answers back with the IP address of the virtual server and not the physical
cluster.
the problem is that im working with a Firewall and we would like to restrict
the number of IP address that we expose to the world.
Thanks in advance
Oren Zippori
This is one of the wierd but unavoidable artifacts of clustering. You will
have to expose the host computer's IP addresses through the firewall.
Personally, I like to run my database servers on an restricted segment, just
to minimize the impact of stuff like this.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Oren Zippori" <orenzp@.hotmail.com> wrote in message
news:eu17pHbwFHA.3548@.tk2msftngp13.phx.gbl...
> Good day,
> I have recently installed a 2 node cluster server with SQL 2000 SP3 in my
> network. and have found out that users connect to the Virtual cluster
> server inorder to receive SQL services but they get the replay for the
> physical node that holds the SQL.
> I was wondering if this configuration can be changed so that the SQL
> servers answers back with the IP address of the virtual server and not the
> physical cluster.
> the problem is that im working with a Firewall and we would like to
> restrict the number of IP address that we expose to the world.
> Thanks in advance
> Oren Zippori
>
|||Thanks for the information on this Geoff.
"Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
news:uNRVXAgwFHA.664@.tk2msftngp13.phx.gbl...
> This is one of the wierd but unavoidable artifacts of clustering. You
> will have to expose the host computer's IP addresses through the firewall.
> Personally, I like to run my database servers on an restricted segment,
> just to minimize the impact of stuff like this.
> Geoff N. Hiten
> Senior Database Administrator
> Microsoft SQL Server MVP
>
> "Oren Zippori" <orenzp@.hotmail.com> wrote in message
> news:eu17pHbwFHA.3548@.tk2msftngp13.phx.gbl...
>
Monday, March 19, 2012
Clue - Who dun it? The Data Adapter, DataSet, SqlSelect etc...
Ok, I know my connection string and config file are good. Once the rest of the code is added I receive this error:
"SQL Server does not exist or access denied. "
I'm using the 1.1 framework and my hosting company provides MSSql 2005.
Thanks for your time,
Charlie
Here's the code in my cond behind file.
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
namespace blog
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected System.Data.SqlClient.SqlConnection sqlConnect;
protected System.Web.UI.WebControls.DataList dList;
protected System.Data.SqlClient.SqlDataAdapter DA;
protected System.Data.SqlClient.SqlCommand sqlSelectCommand1;
protected System.Web.UI.WebControls.LinkButton linkAdmin;
protected System.Web.UI.WebControls.Image header;
protected blog.DS ds1;
private void Page_Load(object sender, System.EventArgs e)
{
DA.Fill(ds1, "blogEntry");
dList.DataBind();
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.sqlConnect = new System.Data.SqlClient.SqlConnection();
this.DA = new System.Data.SqlClient.SqlDataAdapter();
this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
this.ds1 = new blog.DS();
((System.ComponentModel.ISupportInitialize)(this.ds1)).BeginInit();
this.linkAdmin.Click += new System.EventHandler(this.linkAdmin_Click);
//
// sqlConnection String
//////////////////webserver////////////////
this.sqlConnection1.ConnectionString = "Server=xxx.xxx.xxx.x;Database=myDataBase;User ID=myID;Password=myPass";
//////////////////local///////////////////
//this.sqlConnect.ConnectionString = "workstation id=HAL;packet size=4096;integrated security=SSPI;data source=HAL;pers" +
//"ist security info=False;initial catalog=blog";
//
// DA
//
this.DA.SelectCommand = this.sqlSelectCommand1;
this.DA.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "blogEntry", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("bodyID", "bodyID"),
new System.Data.Common.DataColumnMapping("linkID", "linkID")})});
//
// sqlSelectCommand1
//
this.sqlSelectCommand1.CommandText = "SELECT id, wxID, dateID, titleID, bodyID, linkID FROM blogEntry ORDER BY id DESC";
this.sqlSelectCommand1.Connection = this.sqlConnect;
//
// ds1
//
this.ds1.DataSetName = "DS";
this.ds1.Locale = new System.Globalization.CultureInfo("en-US");
this.Load += new System.EventHandler(this.Page_Load);
((System.ComponentModel.ISupportInitialize)(this.ds1)).EndInit();
}
#endregion
private void linkAdmin_Click(object sender, System.EventArgs e)
{
Server.Transfer("logOn.aspx",true);
}
}
}
fatthippo:
Ok, I know my connection string and config file are good. Once the rest of the code is added I receive this error:
"SQL Server does not exist or access denied. "
If you are receiving that error, it generally means that your connection string is NOT good. Check out this KB article:Potential causes of the "SQL Server does not exist or access denied" error message.
That string was pasted in from another page on the same host. It works fine there. Why should I not assume that it's good?
|||Hello,
Something I just noticed in the stack trace.
blog.WebForm1.Page_Load(Object sender, EventArgs e)in c:\inetpub\wwwroot\blog\index.aspx.cs:31
this is still referencing my local machine. How can I change this?
|||
Hi,
From your code, I can see your connection string is:
Server=xxx.xxx.xxx.x;Database=myDataBase;User ID=myID;Password=myPass
Please check if your server address is correct. Is the SQL server you're connecting to a default instance or a named instance. If a named instance, please try to use Server=xxx.xxx.xxx.xxx\InstanceName
also, please check the login name and password. You can try to create a .udl file for testing. Here are the steps:
1. Create a Text file.
2. Rename it to .udl
3. Double click on the file, and test in the Data Link Properties window.
HTH.
|||I believe I found the issue. This being my first attempt to host a .net web app on a ISP, it didn't occur to me that modifying the connection string in the provided online text editor wouldn't be sufficient. Simply put, I needed to recompile my app.
Thank-you all for your support.
Fatthippo
Wednesday, March 7, 2012
closing the database connection
sorry if this is in another post - I did a few searches and found nothing.
We have a custom asp .net ui and are rendering our reports directly to pdf.
We are running sql server stored procedures to populate our reports. What I
have noticed, however, during the course of testing the reports, is that if
you look in SQL Server EM the connections (listed as .Net SQL Client
Provider) seem to stay open for quite some time. This is a concern, and I am
trying to figure out if there is a way that we can close the connection(s) as
soon as the data has been retrieved and the report populated. I believe this
must be the connection from RS directly calling the SP to populate - has
anyone else seen this?
Thanks,Perhaps you can set some timers in the rsconfig.
I've noticed that my oracle connenctions stay open relatively long to;
although it has something to do with congestion on either de DB-server or the
RS-server. I notice that when I automticly rennder a number of reports (to
make chached-reports for all parameter values) the RS-jobs sometimes heap up
and the open connections do also (although there are never more than tree
reports rendered at the same time). The problem solves itself automaticly
thoug, everything slows down and apperantly RS gets time to clean it up.
"Myles" wrote:
> Hi all,
> sorry if this is in another post - I did a few searches and found nothing.
> We have a custom asp .net ui and are rendering our reports directly to pdf.
> We are running sql server stored procedures to populate our reports. What I
> have noticed, however, during the course of testing the reports, is that if
> you look in SQL Server EM the connections (listed as .Net SQL Client
> Provider) seem to stay open for quite some time. This is a concern, and I am
> trying to figure out if there is a way that we can close the connection(s) as
> soon as the data has been retrieved and the report populated. I believe this
> must be the connection from RS directly calling the SP to populate - has
> anyone else seen this?
> Thanks,
closing SQL Connection
hello to all
i am finding my self in confusing problem.
everyay log file of my application increase by 10 GB.
every time i found more than 100 connections open in SDQL Server 2005 under my database.
i an using SQLHELPER Class by microsoft.i ma not putting my code in try-catch block. example
of one of my frequently used function is as follows:
protected Int64 GetMemberID()
{
String SqlSelect = "SELECT * FROM MemberMaster WHERE MemberUserName= '" +
Session["UserName"].ToString() + "'";
SqlDataReader dr1 =
SqlHelper.ExecuteReader(ConfigurationManager.ConnectionStrings["CowcallConnectionString2"].T
oString(), CommandType.Text, SqlSelect);
while (dr1.Read())
{
CurrentMemberID = Int64.Parse(dr1["MemberID"].ToString().Trim());
}
return CurrentMemberID;
}
well i doubt i am opening connection and do not closing it. moreover i do not know how to close connection in above code when i am using sql helper class.
please give me yours suggestion regarding my code even if it is not solving above two problems.
Hi munishbhatia,
use theCommandBehavior to close the connection after use like: SqlHelper.ExecuteReader(CommandBehavior.CloseConnection);
closing connection problem
I have setup my loop to loop through textboxes and fill the according textboxes with data it retrives, if seems to work fine, but there is a problem with opening and closing the connection below is my code
int i = 0;for (i = 1; i <= 3; i++){
//This gets the stock ID from the textbox.
string stock_ID = ((TextBox)Panel1.FindControl("txtID" + i.ToString())).Text;//This is the sql statement.
string sql ="SELECT [n_or_sh], [title], [cost_price], [selling_price] FROM tbl_stock WHERE stock_ID = " + stock_ID;
//This creates a sql command which executes the sql statement.
SqlCommand sqlCmd =newSqlCommand(sql, myConn);
myConn.Open();
//This is a reader for the results to go in.
SqlDataReader dr = sqlCmd.ExecuteReader();//This reads the first result from the sqlReader
dr.Read();
//This sets the title label text to the value of the description column.
TextBox currentBox1 = (TextBox)Panel1.FindControl("txtDesc" + i);string strtxtDesc = currentBox1.Text;
strtxtDesc = dr["title"].ToString();
}// end of loop
myConn.Close();
}// end of button click
i have tried putting the myConn.Close() in different places but it dosnt seem to work!
any advice or tips ?
Regards
Jez
1. You should use SqlParameter object to pass your ID. This makes the sql query optimizer to keep your query optimized for future uses, and takes you out of the sql injection attack risk.
2. You should close the SqlDataReader before closing the connection. Try dr.Close() (or better, dr.Dispose() )
3. For best practice, you should also dispose your sql connection. Try myConn.Dispose() (after closing it)
Closing ADO objects
I know it's "best practice" to dispose ado.net objects, but does it make a big difference if just the connection is closed?
In other words, is the code below good enough or should the DataAdapter & Command be explicitly closed?
using (SqlConneciton cn = new SqlConnection(connstr))
{
SqlDataAdapter da = new SqlDataAdapter(sql,cn);
DataSet ds = new DataSet();
da.Fill(ds);
SqlCommand cmd = new SqlCommand(someOtherSql,cn);
cmd.ExecuteNonQuery();
}
Hi John,
Actually, you don't need to call dispose. The Dispose method is used to release unmanaged resources. Since Close has already been called, the connection will be put back to pool automatically.
IMO, just call Close. That's enough. If you're using "using" statement, it's better. It will call dispose automatically.
HTH. If this does not answer your question, please feel free to mark the post as Not Answered and reply. Thank you!
Closing a connection created from a SQLDataSource
I have a simple form containing a FormView control. The FormView uses a SQLDataSource. This works fine and in 30 seconds I have a working form without writing any code.
A form built this way causes problems with connection pooling because I am not closing the connection. What is the best method for me to remedy this?
Every resource I've found explains that I have to explicitly close the connection. How do I do that in this case? Dispose the SQLDataSource in the FormView DataBound event? Rewrite the form so I can control opening and closing of the connection?
Thanks in advance.How about disconnecting on the page.OnUnload event?
Close the connection?
Hi, I've created a simple hit counter in my Session_Start event...
Dim myDataSource As New SqlDataSource
myDataSource.ConnectionString = ConfigurationManager.ConnectionStrings("DatabaseConnectionString1").ToString
myDataSource.UpdateCommand = "UPDATE Stats SET Hits = Hits + 1"
myDataSource.Update()
It works fine but do I need to close the connection after I've finished with it or is this ok?
Thanks for your help.
It's ok, since myDataSouce will go out of scope at the end of your procedure and it (should) clean itself up.
However, if you would be better served by skipping the sqldatasource and going directly to sqlconnection and sqlcommand. It's lighter weight, and would perform slightly better.
|||Great, thanks a lot Motley. I just needed steering in the right direction!
Come to think of it,I have five seperate SqlDataSource's on another page and keep getting timeouts. Maybe I should try converting everything to the hard coded method.
|||SqlDatasources are really meant for binding to data controls. If you are doing everything in code, it's probably better to just use sqlconnection/sqlcommand. Although, I'm curious if sqldatasources that are instantiated that way are able to cache any content, which may make them useful, but I've never tried it.|||
Motley:
It's ok, since myDataSouce will go out of scope at the end of your procedure and it (should) clean itself up.
Actually, you should go ahead and dispose it. If you don't, when the GC runs, it gets handed over to the finalizer thread. It won't be eligible for GC until after the finalizer finalizes it, and then it's been promoted to the level 2 GC cache. This is a (weak) memory leak.
|||In .NET 2.0 best practice is to wrap connection with Using statement which will call dispose automatically.|||
Caddre:
In .NET 2.0 best practice is to wrap connection with Using statement which will call dispose automatically.
I don't think that vb.net has a using statement. Otherwise I would've suggested it.
|||
The Using statement was added to VB.NET 2.0. Try the link below for details.
http://pluralsight.com/blogs/fritz/archive/2005/04/28/7834.aspx
|||Actually, the sqldatasource control should be able to cache the results (If you enable it, which it is disabled by default).
Secondly, I checked the source code for the sqldatasource and it closes itself after executing the update. The "using" statement will help free some memory quicker than letting it get cleaned up when the procedure goes out of scope. All in all, you won't see much of a difference in speed by either converting to sqlcommand/connection or by changing to the using statement. My comment was more just an FYI -- incase you ever had to worry about the minor performance differences between the two (and because I hate seeing when people programmatically use the sqldatasource as their only data retrieval method). It's much like watching someone instantiate a textbox control everytime they wanted to store a string.
|||I don't know about VB but in C# the only thing better than a Using statement on classes that implement IDisposable is Dispose Bool and the difference is not minor.Close existing connection before deleting/restore database
ThankHi,
see my blog entry here:
http://sqlserver2005.de/SQLServer2005/MyBlog/tabid/56/EntryID/9/Default.aspx
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
Close discussion
We have a sharepoint <\\ces\cesgypdav> that is a WebDAV connection, not an actual fileshare. A SSRS Subscription fails on file write ... "Failure writing file <name here > : The network path was not found" ... to this path.
Can SQL Reporting write to a WebDAV sharepoint?
WebDAV issue is known, need to 'work around'.This helps: http://sqljunkies.com/WebLog/tpagel/archive/2005/12/23/17682.aspx
Saturday, February 25, 2012
Close connection of SQLExpress!
Hi,
I write a .NET Windows Form that connect to SQLExpress datafile. After updating data, I want to zip the .mdf file and send email. However, I got an exeption that the .mdf file is used by other thread so I cant zip. Even I try to close all connection, I still cant zip.
Is there any way to detach/unlock .mdf file connecting by SQLExpress?
MA.
Hi,
if you are sure you closed down all conenctions, you can use the sp_detach command to detach the database. if you want to close all connection from the server side first you will have to use the ALTER DATABASE command first and change the state of the database to a SINGLe or admin mode.
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||Hi,
Unfortunaterly, I dont control the connection but I want to force to close all connection from the client side (using C# code).
MA.
|||Hi MA,
Jens is exactly correct, you'll need to force the database into single user mode:
ALTER DATABASE pubs
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE
This will rollback all transactions and then you can detach the database as you like. I'm not sure what you mean you don't control the connections. If you can not connect to the database, then you can not close it's connections and you will not be able to close the connections.
Mike
Close all open connections
Before I can drop an mdf file form the server, all connections needs to be closed. how can I force to close this connection. The solution explained on this blog don't seems to work in my case http://sqlserver2005.de/SQLServer2005/MyBlog/tabid/56/EntryID/9/Default.aspx
I'm using SQL express, with visual studio pro 2005.
Thx for you quick responses
best regards
Luc N
please verify the code I've used
Dim svr As Server
svr = Nothing
svr = New Server(".\SQLEXPRESS")
'attach database
Dim con As New SqlConnection(svr.ConnectionContext.ConnectionString)
Dim com As New SqlCommand("sp_detach_db", con)
Dim d As Database
con.Open()
For Each d In svr.Databases
If Not d.IsSystemObject Then
'com.CommandType = Data.CommandType.StoredProcedure
'com.Parameters.Add(New SqlParameter("@.dbname", d.Name))
'com.ExecuteNonQuery()
'MsgBox(d.UserName.ToString())
d.DatabaseOptions.UserAccess = DatabaseUserAccess.Restricted
SqlConnection.ClearAllPools()
d.Drop()
'com.CommandText = "DROP DATABASE " & d.Name.ToString
'com.CommandType = CommandType.Text
'com.ExecuteNonQuery()
'End If
End If
Next
com.Connection.Close()
Why do you think that the information form the blog is not working for you ?Jens K. Suessmeyer
http://www.sqlserver2005.de
|||
I've still got the message 'cannot drop the database because.......................'
I've modified my code , which seems to be working,
please reply your comments on this code
thx Luc
Try
Dim svr As Server
svr = Nothing
svr = New Server(".\SQLEXPRESS")
'attach database
Dim con As New SqlConnection(svr.ConnectionContext.ConnectionString)
Dim d As Database
con.Open()
For Each d In svr.Databases
If Not d.IsSystemObject Then
Exit For
End If
Next
If InStr(d.Name, "exp", CompareMethod.Text) <> 0 Then
svr.KillAllProcesses(d.Name)
d.DatabaseOptions.UserAccess = DatabaseUserAccess.Restricted
SqlConnection.ClearAllPools()
d.Drop()
con.Close()
End If
Catch ex As Exception
' MsgBox(ex.Message)
End Try
|||As I pointed out in the comment, they fixed the behaviour in the Service Pack, so KillDatabase should work for you.
Cllient Unable to establish connection
Others are also not able establish connection - they get a General Network error when trying to connecting to my server.
Think the Blue screen death corrupted some SQL driver in the process. Now am apprehensive about uninstalling and re-installing the SQL server since am unable to backup the databases.
Can anybody help please?SQL 2k?
I find it very unlikely...did you bounce the box?
Did and admin revoke your rights?
Blue screen of death? Haven;'t seen that in a loong while.
What o/s and what patches?|||SQL 2K with SP 3. Running on Win 2k (SP4) Server. There has been no change in the admin rights. it just stopped working after the crash.
that's why its confusing.. not much help from Miscrosoft either.
Originally posted by Brett Kaiser
SQL 2k?
I find it very unlikely...did you bounce the box?
Did and admin revoke your rights?
Blue screen of death? Haven;'t seen that in a loong while.
What o/s and what patches?|||Check your Client Config utility ? Try creating an alias using TCP/IP ..
What SQl Client you are using from where you accessing SQL Server ..?|||Tried the Client Network Utility - the TCP/IP option is not enabled when i try to add an alias. Only the Multiple Protocol, Apple Talk, VIA and "Other" options are enabled.
The server is installed in my laptop and am accessing from the same machine using the SQL Query Analyser. The laptop is a Win2k Server (SP4).
Originally posted by aashu
Check your Client Config utility ? Try creating an alias using TCP/IP ..
What SQl Client you are using from where you accessing SQL Server ..?
Friday, February 24, 2012
Client/Server Connection
I m trying to create Merge Replication. I was able to create the
replication on the same machine, however my aim is to use client
machine and do all the neessary work on the client machine and then
synchronize to the server. Thus, I have installed client version of SQL
2000, I connected to the database server, the thing is when I go off
line I lose connection. Is there any way to create the subscription in
to the client machine as an off line user then synchronize it ?Or DO I
have create my shopshot on the client machine?
If someone can help me I would really appreciate
Regards
AsI think the problem is with how you are connecting to the server.
Instead of using the network name when you register the server, use
<local> or '.' Your subscription must be created on the server.
Client user timeout
Used Mssql 5 exp. On win 2003 server
my problem,
client user time out 15 minute by sql server,
Client user inside my program, connection closed,
logout program and relogin program work again,
no network problem, no closed network connection
How can i do,There are several reasons depending upon how the connection process is set
up. For a brief review see: http://vyaskn.tripod.com/watch_your_timeouts.htm
Anith
Client unable to establish connection Encryption not supported on SQL Server. (Microsoft SQL Nat
On Windows XP systems I get the following issue when trying to browse the MSDB folder in SSIS
Client unable to establish connection
Encryption not supported on SQL Server. (Microsoft SQL Native Client)
I have noticed another post where several others have noticed the same issue. It appears to only occur on Windows XP installations. Is there a workaround or fix for this?
Is the SQL 2005 instance the default or named instance? If it is named instance you need to edit SSIS service configuration file to point to appropriate instance. The process is described in SQL Books Online.|||It is the default instance.Sunday, February 19, 2012
client to client connection
clients pc are winxp..is it possible to connect from one client to one client pc using the sql express?
thanksBy default, SQL Server Express is not configured to accept remote connections, which helps reduce the risk of attack via the SQL Server service. If you do need to access your Express server from other machines, you can enable remote connections using the Surface Area Configuration tool.
You will probably need to open the TCP port your Express servers are listening to in your firewall as well. The default port number is 1433.
client setup
SQL server 2000?
All you need is an ODBC driver or OLE DB Provider for SQL Server. Once one
of them is in place, you need a tool like Query Analyzer or Enterprise
Manager to connect to SQL Server. All of them (client tools) can be
installed using the SQL Server setup CD.
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"brbaskets" <anonymous@.discussions.microsoft.com> wrote in message
news:944a01c4337c$8f2dc800$a501280a@.phx.gbl...
Can anyone tell me how to setup a client connection to
SQL server 2000?
|||Hi,
Install SQL Server client software coming along with SQL Server Installation CD. While installation select the "client only".
After the installation use any of the below tools to connect to SQL Server
1. Query Analyzer
2. Enterprise manager
3. OSQL / ISQL command line utilities
Note:
If you are not able to connect to servers or if the SQL server name is not automatically displayed in the server list then create a Alias name using "CLIENT NETWORK Utility" by providing the Protocol, IP ADDRESS and PORT number. Then using the Alias name
created you can connect to SQL Server.
Thanks
Hari
MCDBA
-- brbaskets wrote: --
Can anyone tell me how to setup a client connection to
SQL server 2000?
|||If you are asking about client connectivity via an application; you have
everything you need already installed. MDAC contains all necessary
components to connect to SQL Server, except the application to connect. You
can use Query Analyzer or Enterprise Manager or any other application that
connects to SQL Server.
Rand
This posting is provided "as is" with no warranties and confers no rights.
|||simply run the connectivity tools which is avalable in sql server cdrom.
"brbaskets" <anonymous@.discussions.microsoft.com> wrote in message
news:944a01c4337c$8f2dc800$a501280a@.phx.gbl...
> Can anyone tell me how to setup a client connection to
> SQL server 2000?
Thursday, February 16, 2012
Client Network Utility cannot create alias for VPN SQL server connection?
SQLServer11 in Domain A and SQLServer22 in domain B. This is through a VPN
connection. Domain A has the VPN server. On SQLServer22 I could ping
SQLServer11.mydomain.local at IP address 192.168.100.50. On SQLServer22 I
use the client network utility to create an alias for SQLServer11 as
follows:
Network Libraries: TCP/IP
Server name: 192.168.100.50
Port No: 1433
Server alias: SQLServer11
Then I registered the new SQLServer11 in enterprise manager. But I keep
getting the error message "SQL server does not exist or access
denied.ConnectionOpen(Connect())" .
Why is this so? And how can I rectify the problem'If you use ping -a <ip address> does it bring back the correct name for the
server? If you ping SQLServer11 does it return the proper ip address? If
you are using NT authentication to register then try SQL authentication..
Verify that it is using port 1433 and that SQL Server is actually listening
on TCP/IP.
Rand
This posting is provided "as is" with no warranties and confers no rights.
Tuesday, February 14, 2012
Client Failover Problems
Hi,
I encountered 2 problems when my application reconnects to the mirror database after the principle database is not available.
My Connection String:
Data Source=ServerA;Failover Partner=ServerB;Initial Catalog=TestFailover;Persist Security Info=True;User ID=sa;Connect Timeout=45
Firstly, the following exception will be prompted when failover occurs:
A transport-level error has ocurred when received results from the server. The specified network name is no longer available
Q1: Is it normal to have this exception? Otherwise, how can I avoid this exception?
Secondly, I tried to capture the exception and retry the operation, then failover successed but the time is very slow. A simple update operation takes about 2 mins to complete which can be finished within a second under normal situation. I tried to set the Connect Timeout to 30s, but the application pending for long long time.
Q2: How can I improve the time need for failover?
A1: I don't know if you can avoid the exception.
A2: What version of the software are you using? Sounds like there is a timeout that is taking its time, either a connection timeout or a Tcp timeout. How are you testing the redirect? Try crashing the principal server with a SHUTDOWN WITH NOWAIT command.
Thanks,
Mark
|||If you are on RTM, then upgrading to SP1 should fix your problem. In RTM a dead machine caused a stall in TCP waiting for a default TCP timeout of 30 secs which is longer than the default login timeout of 15 secs.
Thanks to Chris for the information.
Mark