How To Get CDatabase To Reconnect After SQL Server Restart

Jan 26, 2007

I have an old application to maintain that uses CDatabase to connect to SQL Server. If SQL Server is stopped and restarted, such as in a cluster failover (i.e. move group), then the CDatabase connection needs to reconnect. It seems that it's not capable of doing this on it's own so I need to check the state some how. Various methods, such as IsOpen, seem to be useless as far as determining if I have a "good" connection.

Any thoughts?

View 3 Replies


ADVERTISEMENT

Reconnect Linked Server

Apr 23, 2002

Hi,

I'm using Oracle 8.1.7 as linked server on SQL Server 2000. Everything works fine. But if is Oracle server is down while executing an query to linked server an errormessage is returned (correct).

When Oracle after that is available and I try to execute the query again the same errormessage is returned again. The only way is to restart the SQL Server.

Is there a better way to reconnect to linked server ???

Thanks.

View 1 Replies View Related

ODBC SQL Server Database Reconnect Questions

Aug 22, 2005

I have an ODBC 3.0 Application on Windows NT Server maintaining aconnection to a SQL Server 2000 database on the same machine. When anerror occurs, I'd like to be able to determine whether the error isserious enough that the database connection has been lost, so I canhave the application try to reconnect automatically. My understandingis that any error of severity 20 or above includes a broken connection,but I'm having difficulty retrieving the error severity through ODBC.So my first question is, how do I retrieve the error severity throughODBC?Also, as a test, I stopped the database while my application is stillrunning, and the first error I received had a native error code of 55.There is no 55 error in the sysmessages table, so I'm confused as towhat the severity of the error is. Can anyone shed some light on why Iwould be receiving an error code that is not in the sysmessages table,and where I might be able to find more information about the error?Thanks in advance,Abram

View 2 Replies View Related

MFC CDatabase And ODBC Version

Aug 9, 2007

Hi all,

I created a CDatabase object, called OpenEx and checked the ODBC version with:

unsigned int version;
SQLGetEnvAttr(AfxGetHENV(),SQL_ATTR_ODBC_VERSION,&version,0,0);

and the version is 2. I want to make it 3 and I tried:

SQLSetEnvAttr(AfxGetHENV(),SQL_ATTR_ODBC_VERSION,(void*)SQL_OV_ODBC3,0);

It fails and I suppose it is because OpenEx already have an HDBC created. Does that mean I cannot use CDatabase and I have to write my own ODBC wrapper class? Thanks.

Kevin

View 4 Replies View Related

JDBC Disconnects, Can't Reconnect

Feb 11, 2008

Hi,


Our environment is:
Windows Server 2003, Service Pack 2
SQL Server Express 2005
SQLServer JDBC driver 1.2
Sun JDK 1.6 (we tried this on JDK 1.5 as well)
There is no virus protection software on the host, and no firewall is enabled.


Our problem is that the JDBC connection running on the localhost periodically gets disconnected, and then we can't reconnect to the database at all, unless we physically power cycle the server. The error message we receive is: "Software caused connect on abort: recv failed"


This is a very strange situation, and to illustrate, I created the following command-line program:


public class DBTest {

public static void main(String[] arg) throws Exception {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Connection conn =
DriverManager.getConnection("jdbcqlserver://127.0.0.1:1433;databaseName=datamart",
"username", "password");
System.out.println("Connected");
conn.close();
}
}


Essentially, this program verifies that a database connection can be made to the SQL Server instance on the local host.


Executing this from the command line works the vast majority of the time.


However, once the Web application running on the same host encounters the JDBC disconnection issue, executing this program from the command line results in the following exception:


C:Documents and Settingsfrank>java -cp sqljdbc.jar;. DBTest
Exception in thread "main" com.microsoft.sqlserver.jdbc.SQLServerException: Software caused connect on abort: recv failed
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSChannel.read(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at DBTest.main(DBTest.java:7)


There is no way to obtain further access to the database, except by power-cycling the machine. Shutting down and then re-starting the SQL Server instance does not help, nor does restarting any individual process on the server.


Something permanently disables connection to the database server, and only a hard reset of the OS solves that problem.

Any suggestions would be most appreciated, as this is a serious, mission-criticial problem for us right now.


Thanks,

-- Frank

View 6 Replies View Related

Does Openrowset Reconnect Everytime?

Apr 18, 2008

Hi,

I'm testing performance of OPENROWSET,

I executed OPENROWSET 3 times in a sequence. But in Profiler i see only following events..

Audit Login
Batch Started
Batch Completed
RPC:Completed.
RPC:Completed.
:
:
:
:

RPC:Completed.


I'm intersted only to see if the login happens three time, but i'm not able to see that. Also, there was no Audit Logout.
Does SQL Server automatically pool connections ?
If i run Openrowset 3 times, shouldn't it open & close connection 3 times ?

Please clarify.

Thanks.
Sandeep.

View 3 Replies View Related

Auto-restart SQL Server?

Sep 13, 2004

how can I configure the SQL server to automatically restart selected services on a regular basis?

View 1 Replies View Related

Unexpected Server Restart

Sep 27, 2000

Has anyone ever experienced the SQL Server unexpectedly rebooting?

Yesterday my SQL Server 7 installation rebooted itself and the error log seemed fine as did the restart. The only evidence I can find was a message in the event viewer's application log stating the the MSSQLServer service terminated unexpectedly. Any ideas are appreciated.


Thanks,

- D

View 2 Replies View Related

Intermittent Restart Of SQL Server 6.5

Apr 3, 2001

I've a SQL server that intermittently restarts itself mostly during. Its a SQL Server 6.5 SP4 running NT 4.0 SP6. It really has no rhyme or reason to it happening. The are no indications in either the SQL or the Nt events logs.
Has anyone heard of this?

Thanks inadvance

View 2 Replies View Related

Restart Linked Server

Aug 21, 2006

Hi,

I have a linked server set up to a proprietarty temporal DB through an OLEDB provider. From time to time and for various reasons the OLEDB provider crashes with "Error 7302 Could not create an instance of OLE DB Provider 'IhOLEDBProvider.iHistorian.1'. OLE DB Trace [Non Interface Error: CoCreate of DSO for IhOLEDBProvider.iHistorian.1 returned 0x80070008"

Up till now, to re-initilize the connection we have just restarted the SQL Server service. However, some automated processes are now feeding data into this server and more users and have started coming online so restarting for this issue has become a big deal.

Getting the OLEDB provider sorted out isn't an option at present so my question is:

Is there a way to re-initalise a failed linked server other that restarting the SQL Service?

Thanks,

Eamon.

View 2 Replies View Related

Sql Server Restart Automatically

Feb 18, 2004

Hi,

I have SQL server running on windows Adv Server 2000. Since last couple days whole computer restart every one hours. Only thing I remember doing was to shrink database db size is 200+GB.

How can I fix this problem.

Any help will be highly appreciated?

Thanks.

Samir

View 1 Replies View Related

Server Restart Problem

Apr 7, 2008

Hi,

I've got a table with a column that contains the status of available licenses to the user, i.e. they are either in use or are available. If the server goes down, then when it is restarted I need to make sure all the rows in this column describe each license as being available.

So the question is how can I ensure data in a table is, if you like, initialized, each time the server is restarted? Is there a system defined stored proc or trigger than is executed when a server is restarted?

Thanks.

View 4 Replies View Related

Sql Server Restart After Locking

Mar 27, 2007

Hi...

i hv a database (sql server 2000) where i got locking on many tables and my application was down.

I restarted the sql server and the application was fine but after five minutes the same locking issue started happening. I did a index rebuild the next time on all indexes and everything was fine.But i cannot relate how locking occured and why it was not after index rebuild.Can anyone shed some light on this or anyone had similar experience... cos i cannot figure out a way on this.

Thanks in advance

View 4 Replies View Related

How To Restart MSSQL SERVER Service

Feb 20, 2006

hello,

View 1 Replies View Related

How To Restart A Sql Server With Different Locale Id From Box It's Running

Jan 5, 2001

I acciently change the locale id of my sql server using sp_configure. After i stop the server it now can not be re-started. Any help is appreciated.

View 1 Replies View Related

Sql Agent Would Not Restart After Restarting Sql Server

Mar 18, 2002

Hello everybody

I setup Sql agent for autostart with sql server and autorestart if stoped
but after rebooting NT or after stoping SQL server it never starts ,I have to start it manualy

Where to look for problem ?

View 2 Replies View Related

How Do U Fix @@servername = NULL Without Restart SQL Server ?

Apr 27, 2004

@@servername sometimes returns NULL depending on how you have been messing around with replication and various other settings.

The simple solution offered to fix this is to delete the entries in the system tables and sp_addserver 'servername','local' and then restart the SQL service.

This is fine but what do you do in the situation where the SQL server is a 24/7 production box ? Does anyone know of a method / hack to fix this without stopping the service ?

Thanks

s

View 2 Replies View Related

Failed Restore And Server Restart

Jun 6, 2008

We were trying to restore our production server db backup in test server over LAN (due to space shortage on test server) . Test server hanged and did not respond for abt more than 15 hours (backup file 40 GB ) . The we restarted the server (resetting the power button) . Now it's showing the status 'Restoring' . According to me it's not doing anything (as seen in task manager workload ) . So how can I go ahead with checking the db .

Due to 'restoring' status I get following error
------------------------------------
Msg 927, Level 14, State 2, Line 1
Database 'envdb' cannot be opened. It is in the middle of a restore.
----------------------------------

View 3 Replies View Related

Indexes Need Rebuild After Restart Server???

Oct 4, 2007

Hi All.

Our inhouse app used to run on a SQL2000, but we've recently moved it to 2005.
The move was done by way of backup and restore (it was on a whole new server).

After the move, an odd problem showed up: once in a while, the server seems incapable of finding/using its indexes: everything starts working slowly, until I run a maintenance plan that rebuilds its indexes etc.
In the database/server all relevant options seem to be ok (auto update statictiscs etc.), and my conclusion that it doesn't use its indexes comes from the fact that:
* it gives the results from certain select statements in a totally different order (although the set of rows is the same),
* performance is (all of a sudden) very slow (seconds turning to minutes!!)

This happens:
* at least after a reboot of the server
* sometimes just in the middle of the day

The only way I've found to solve the matter, is by running the maintenance plan to rebuild the indexes, but sometimes this only seems to work the second time.


Does anybody share this experience, or know what to do about it?

Thanks,

Nick.

View 2 Replies View Related

How To Restart The Sql Server Services Remotely

Nov 12, 2007

I am unable to login to the sql server as I would like to reboot the server, please let me know how I can do the following remotely in such a scenario:
1. Reboot the sql server
2. Restart the mssqlserver and sqlserveragent services
Thanks.

View 7 Replies View Related

Cannot Restart Sql Server And Agent 2005

Oct 31, 2007



I've installed an SSL certificate via IIS. I stopped sql server and agent but cannot restart them. I'm getting the following message in the error log:

2007-10-31 21:24:53.63 Server Error: 17182, Severity: 16, State: 1.
2007-10-31 21:24:53.63 Server TDSSNIClient initialization failed with error 0x2, status code 0x38.
2007-10-31 21:24:53.63 Server Error: 17182, Severity: 16, State: 1.
2007-10-31 21:24:53.63 Server TDSSNIClient initialization failed with error 0x2, status code 0x1.
2007-10-31 21:24:53.63 spid9s Starting up database 'model'.
2007-10-31 21:24:53.63 Server Error: 17826, Severity: 18, State: 3.
2007-10-31 21:24:53.63 Server Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately preceding this one in the error log.
2007-10-31 21:24:53.63 Server Error: 17120, Severity: 16, State: 1.
2007-10-31 21:24:53.63 Server SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.


I've tried removing the SSL certificate but with no success.

Help! I'm starting to think that the only solution is to uninstall sql server 2005 and reinstall.

View 14 Replies View Related

Unable To Connect To SQL Server After Service Restart

Oct 19, 2004

Hi

We have been having a problem with on of our servers, applications connecting to it are experiencing poor performance, even though the server is only running at a peak of 50%.

The odd thing is that after a sql service restart we couldnt connect at all on the SQL port. We were only able to re-connect after rebooting the actuall box. Is there anything that can be done about this? Its strting to look like a network related problem instead of SQL

View 5 Replies View Related

Do We Have Restart The Server If The Database Maintainence Plan Changes?

May 3, 2002

We changed the database maintainence plan, after changes do we have to restart the server in order to effect the new changes.

View 2 Replies View Related

Server Service Is Getting Stopped Even After Manual Restart

Jan 27, 2015

I have got the error “a network related or instance specific error occurred sql server 2012 “.I have enabled tcp/ip, restarted the services. The sql server service is getting stopped even after the manual restart. I have checked in event viewer and I noticed a error. Here is the error...The log scan number (43:456:1) passed to log scan in database ‘model’ is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication.

View 1 Replies View Related

SQL Server 2008 :: Max Concurrent Sessions Since Last Restart

Feb 2, 2015

Is there a way to find the max number of sessions that were on a sql server since its last restart? I know how to get how many total connections there were since last restart, and the current number of sessions, but not the max number of sessions that were running since last restart. Also, opinion on the optinum number of allowable sessions, or a good way to figure out the balance?

View 0 Replies View Related

Service Dependency On SQL Server And Restart/Restore

Jun 26, 2007

I have a service that depends on SQL Server service. Basically we make sure that our service only starts after SQL server service started. Unfortunately this dependency does not ensure that database is available.

Basically I observed in Application log that SQL server reports that it started to listen on a port. And then I see that recovery process started. As I understand SQL server is not available while database is in the recovery state.



Note: I might have not used a correct terminology to describe SQL server recovery process as I don't have access to Application log with the exact message at the moment. I can verify the message if necessary.

Because SQL server service is started our service starts and attempts to connect to the database. Service fails to connect to database, because of the restoration process. Once restoration is done service connects successfully.

I observed that restoration process starts every time machine is rebooted. It only takes a few minutes to run, but it is enough to generate a number of error messages in event log about failed SQL connections.

My first question is: Is it normal for database to enter into recovery state every time machine is rebooted?

My second question is: If it is a normal operation, is there any way to detect that SQL server is truly available, so our code does not have to try retry establishing connection many times

View 6 Replies View Related

Unable To Restart MSSQL Server After Changing My NT Password

Nov 22, 2000

I have recently changed my NT password and since then one of my machines has not been able to start MSSQL server. When I re-boot the machine it lets me know that it was unable to start MSSQL server. If I right click on the SQL server group in EM and try to manually start the service, it tells me that I have a login failure. I don't understand how changing my NT password would affect one machine and not the others. When I right click on the "edit SQL service registration properties" tab, all of the machines are using the NT password selection as opposed to the SQL server authentication password. Any ideas would be greatly appreciated

View 1 Replies View Related

SQL Server 2008 :: Log Shipping Report Not Running After Restart?

May 13, 2015

When trying to open the log shipping status report, I get an error: user must be in the master database. The jobs appear to be running correctly.

View 0 Replies View Related

SQL Server 2008 :: How To Avoid Restart After Applying Patching

Aug 28, 2015

I am going to apply SQL ServicePack 3 in our production Server . Is it possible to avoid restart ?

View 2 Replies View Related

TempDb Drops User Account On Server Restart?

Sep 11, 2007

Please forgive my ignorance, I am by no means a SQL Expert, but have encountered a strange issue.

I have 6 SQL Servers, Primarily SQL 2005 (one older SQL 2000) all loaded on Windows Server 2003 SP1.

We use the servers for a proprietary database that we created which is the backend to a software package we sell.

The issue I have is: We have added a Security account to the servers, and in one case we have granted rights for this account to the TempDB system database. However, whenever we restart this server SQL drops this user account, thus severing connectivity for the app that is relying on that account.

I have set the account as DB-Owner etc, but nothing sems to keep it on re-start.

Any input would be greatly appreciated.

View 4 Replies View Related

Access Halta On Saving Records, Restart Server Req

Oct 4, 2007

Running SQL 2005 on a dedicated Dual Xeon 8MB RAM AND 6x 160GB HDDS RAID-5. Front end App Access 2002. I have to main concerns. 1. When users are enter data and saving all of a sudden all users get stuck upon saving and requires to reboot the server to operate again. Th eproblem is that this happens 3 to 5 times a day. Also searching records with one word takes very long time sometimes even minutes, but queries having two or more words come up fast. Also single word queries come up with erratic results, sometimes 200 titles and than a second search comes up with 31,000. *** Can anyone come up with any ideas "off the cuff" on how I canstart to resolve these issues. Can these issues be related?

View 5 Replies View Related

SQL Server 2000 Named Instance/sp4 Install: Restart Later

Jun 26, 2007

We are trying to quickly put together what needs to be accomplished to install a named instance of SQL Server 2000 on an existing production server (also running SQL Server 2000). It appears as if the install will require a reboot. Can the reboot be postponed until after-hours without impacting the default instance of SQL Server?

Also, I see that if certain services are stopped prior to installing sp4 that you can avoid a reboot. However, if we are unable to stop these services (DTC, for example) without impacting the default instance of SQL Server, will the default instance of SQL Server experience any issues if we postpone the post-sp4 reboot until after hours?

Thanks!

Michelle

View 3 Replies View Related

Restart Of SQL Server Agent Restarts SQL Server

May 24, 2006

Whenever I restart the Sql Server Agent, it causes SQL Server to restart also - is this correct ? I thought the dependency was the other way around i.e. restarting SQL Server would cause the agent to restart ? Any insights gratefully accepted.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved