.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Database mirroring trouble configuring 2 connections

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :

I am trying to set up the following. 


I have configured the sql server side no problem.  i am having issue getting the application that uses the database to connect to the mirrored server in the event of  failure.

The application that utalises the database connects through the data sources (ODBC), System DSN, SQL driver.  I see no option in the configuration for the addition of a 2nd IP.  Many of the technical references i have read refer to the data source connection string, i cannot find this in the registry however.  Please help!

I am used to a 3rd party mirroring software where you connect to a logical IP address which then routes through to whichever database is running.

View Complete Post

More Related Resource Links

TDE key rotation in the database mirroring situation.

I have set up database mirroring for TDE enabled database and they worked fine as far as I got all the key infrastructure identical on both Principal and mirrored SQL servers. Now it is coming to our yearly key rotation practice for compliance.  After I regenerate the DEK on principal server and also encrypt it with a newer certificate,  the mirroring is suspended and I am not able to resume it any more.  (Although I have added this newer certificate to the mirrored server too.) It is understandable because now the DEK is out of sync.  However, what are the correct steps to do the key rotation in the mirroring scenario? The bottom line is:  I DO NOT want to set up mirroring again since our backups are huge and take very long time to copy the backups from principal server to mirrored server. thanks for any input in advance.  

Trouble Connecting to a Database

I downloaded a sample DB from here: http://msftdbprodsamples.codeplex.com/releases/view/4004   Specifically, this is the ‘ AdventureWorksLT.msi ’ So, I loaded it into my SSMSE, right-click Databases > Attach > Database > Attach > etc., etc.   Now, in C# (Express) I goto Add new Datasource > Database > Next > New Connection > Browse . . . navigate to the folder that holds the AdventureWorksLT.mdf Select it and click Open and then I get this message: AdventureWorksLT_Data You don’t have permission to open this file Contact the file owner or an administrator to obtain permission.   I don’t think I’ve ever seen this message before, and I am the administrator.  What am I doing wrong here?  Also, what so I need to do to get this working? Thanks! Ryan---

Database Mail configuring the maximum mail size (not attachment 'MaxFileSize')

Hi can anyone tell me if it's possible to configure the maximum size of an email when using database mail?  I know it's possible to use sysmail_configure_sp to set 'MaxFileSize', I want to prevent an email being sent the size of the body of the email is very large. In my case the body is based on a query result set inserted as html. Thanks      

Problems with SSRS 2008 Install when configuring a back-end database on a SQL Server 2008 R2 environ

We are tyring to configure SQL Server Reporting Services (SSRS 2008) not the R2 version with a SQL Server 2008 R2 version of database. We are facing error when the configuration manager within SSRS tries to execute its scripts against the database. Do you think that SSRS 2008 may have trouble using a SQL Server 2008 R2 version as the back-end? Also, what kind of permissions does the ID installing SSRS needs to have on the SQL Server database ?  Not much is available in the documenation or online.

If one database goes down in database mirroring then other will come up but because there is no Virt

In database Mirroring can I have a virtual IP... Please tell fast.. Actually we were trying to install the sql server cluster but thats not possible bcoz it is in production of Domino Server.My confusion is "If one database goes down in database mirroring then other will come up but because there is no Virtual IP type of thing in this then how my application will connect to another without manual interruption of IP change..."     "SQLSERVER DBA" "INDIA"

SQL Server 2008 Database Restore(Database Mirroring)

HI,I tried to impliment Database mirrorin in SQL Server 2008.I have 3 Sqlserver 2008 Eneterprise Edition in 3 diiferent computers with same domain.Pricnicipal server =TCP://SPHDev.sphinet.com.sg:5022.Mirror=TCP://SPHPrimary.sphinet.com.sg:5022 and witness =TCP://wsc211.sphinet.com.sg:5022.But when i click start mirroring button i got an error TITLE: Database Properties------------------------------ An error occurred while starting mirroring. ------------------------------ADDITIONAL INFORMATION: Alter failed for Database 'SPH_MSCRM'.  (Microsoft.SqlServer.Smo) ------------------------------ An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) ------------------------------ The server network address "TCP://SPHPRIMARY.sphinet.com.sg:5022" can not be reached or does not exist. Check the network address name and that the ports for the local and remote endpoints are operational. (Microsoft SQL Server, Error: 1418).This is the error message i got from Error Log"2009-06-03 17:01:08.89 spid27s     Database mirroring connection error 2 'DNS lookup failed with error: '11001(No such host is known.)'.' for 'TCP://SPHPRIMARY.sphinet.com.sg:5022"I restored Principal server DB  by using RESTORE WITH NORECOVERY and now this  database in mirror server is now look like as DBName(Restoring....).How i can identify

I have to do it manually or is there any other way...?to transfer the users in database mirroring

One issue in database mirroring: In Primary server every week 2-3 users will additionally added.How will these users gone to Mirror Server database?I have to do it manually or is there any other way...? One more thing is that Primary server is llve  and 24 hours users connected, If I want to migrate users on other server then I have to make mirror server as primary server and then run SP_rev_login , it is automatic failover then  the newly created users will not be at the mirror server??then problem"SQLSERVER DBA" "INDIA"

In database Mirroring:

In database Mirroring: I have found that there is a "mirror Server" option in System DSN ,Sql Native Client configuration but one confusion is here that : Should I have to create the same DSN configuration on Mirror server without giving "mirror Server" name in this case??"SQLSERVER DBA" "INDIA"

Database Mirroring: How To Set Up Servers?

  Hi, I am currently reading into Database Mirroring... A few questions regarding the transaction log came up my mind when trying to find a setup/disaster recovery strategy:   Imagine this situation: I am already running a SQL Server database... Now I want to add synchronized database mirroring by adding a mirror database to the setup. Which prerequisites are required on the mirror database? Is it sufficient to use an empty database? Or do I need to restore a backup of the principal database first?   Same for disaster recovery: Imagine the primary database goes offline and the Witness designates the mirror database as the principal database. After re-installing Windows/SQL Server on the former principal machine, which prerequisites are required to let it become the mirror of the new principal database? Do I need to create a current backup of the new principal database? Or will an old backup of the old principal database do? Or will even an empty database on the new machine do the job?   Finally, this is a more general question I have, regarding the transaction log: The mirror database is fed from the principal database's transaction log... How can I make sure that all necessary transaction log records are still available in the transaction log? I couldn't find information on how records are deleted from the transaction log file... Does the transaction

Add Database through App_Data Error- Connections to SQL Server Files (*.mdf) require SQL Express


I am trying to add a new database via the App_Data Folder and I receive an error described below.

I had attached an mdf file to try to use it in SQL Server 2008 Developer and Visual Studio 2010, which was is included in a book's lesson.  Whenever I try to add a database within the App_Data Folder I get an error.

I can create a db by attaching an mdf via SQL Server Mgmt Studio, it connects fine, and I can see tables.

Mgmt Studio- Right Click Databases, Attach, Add, then once mdf is located:

The mdf file location, Database Name, Attach As, -- are all the same:


Do I need to change the Database Name?

Visual Studio- Server Explorer connects fine to mdf OR regular Database, I can see the tables.

However when I attempt to add ANY TYPE OF SQL SERVER DATABASE through the App_Data folder I receive this error "Connections to SQL Server Files (*.mdf) require SQL Server Express 2008 to function properly.  Please verify the installation of the component or download from the URl."

I tested this for both a normal dbo (non mdf) and the mdf.dbo I attached before, with the same error!

Im running XP SP3 w/ Visual Studio 2010 and SQL Server 2008 R2 Developer.  I had previously removed SQL Server Express.

Creating and configuring a Web Application with pre-created content database


I recently looked at the very interesting Technet article named "Deploy by using DBA-created databases (SharePoint 2010)"; I've noticed something strange in the following section:

To create and configure the portal site Web application

  1. [DBA] Create the portal site Web application content database using the LATIN1_General_CI_AS_KS_WS collation sequence and set the database owner (dbo) to be the Setup user account.

  2. [DBA] Using SQL ServerManagement Studio, add the service application service account to the Users group and then to the db_owner role for the portal site Web application content database.

  3. [Setup] From the SharePoint 2010 Management Shell, use the New-SPWebApplication and Get-SPWebApplication cmdlets to configure the portal site Web application content database. Use the following example as a guide.

    New-SPWebApplication -Name "Contoso Internet Site" -Port 80 -HostHeader "http://sharepoint.contoso.com" -URL "https://www.contoso.com" -ApplicationPool "ContosoAppPool&q

    Having Trouble Inserting into a MySQL Database



    I was recently using an Access Database for a .NET application however, I was coming across the problem that it wasn't allowing me to Insert any new data into the table.  So, I switched to a MySQL database but I am encountering the same issues.  Below is my could in which the information is gathered and submited to the table.  Thanks in advanced for your help.

    Protected Sub AddProd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles AddProd.Click
     Dim pid As String
     pid = Request.QueryString("pid")
      Dim conn As New OdbcConnection("DRIVER={MySQL ODBC 3.51 Driver}; SERVER=*server*; PORT=3306; DATABASE=*database*; UID=*user*; PASSWORD=*password*; OPTION=3;")
     Dim query As New OdbcCommand("SELECT Price, Shipping FROM Products WHERE ItemNum = '" & pid & "'", conn)
     Dim reader As OdbcDataReader = query.ExecuteReader
     If reader.Read() Then
     Dim Today As String
     Today = Date.Today
     Dim IP As String
     IP = Request.ServerVariables("REMOTE_HOST")
     Dim Price As Double = reader.Item("Price")
     Dim Shipping As Double = reader.Item("Shipping")
     Dim ItemNum As String = pid
     Dim Quanity As String = Request.Form("txtQuanity")
     Dim EngraveLine1 As String = ""
     Dim EngraveLine2 As Strin

    Configuring ODBC Database connection in Sharepoint Designer 2010


    We are trying to connect the simple way from Sharepoint Designer 2010 to an external Pervasive SQL version 10 database.

    Normally this is a trivial excercise in any other development tool, you supply an ODBC connection and away you go.

    Using Sharepoint Designer 2010 (or the previous version) it is not possible to get a working connection that will get you past the "Configure Database Connection" dialog. We have to use the "Use custom connection string option" as that is the only place there appears to be a Provider for ODBC or OleDB.

    No connection string works, I have tried connection strings that work fine in Visual Studio, no joy.



    Trouble configuring PerformancePoint with SSL


    Hi, we are experiencing difficulty with the above. This is SharePoint 2010 RTM, multi-server farm, WFE one on VM, Service Apps on another VM. We have a cert on our Front-end server, but Performance Point runs on the App server. We are able to connect to data sources outside of SharePoint. When we try to connect to any SharePoint list, we get the following error:

    An operation failed because the following certificate has validation errors...The root of the certificate chain is not a trusted root authority...PerformancePoint Services could not connect to the specified data source. Verify that either the current user or Unattended Service Account has read permissions to the data source, depending on your security configuration. Also verify that all required connection information is provided and correct.  System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

    The certificate is from a trusted root authority and installed correctly. All other SP services are running fine. After doing some research ans seeing similar problems with Kerberos installations, I turned on the Claims to Windows Token service first on App Server, then WFE, then both. No luck.

    Can anyone help us with confiuring PerformancePoint for our SSL installation?





    Does ALTER DATABASE SET RESTRICTED_USER block until connections are killed?


    Hi, we have a database restore script that runs an ALTER DATABASE [Database] SET RESTRICTED_USER WITH ROLLBACK IMMEDIATE command.  The next statement is a WAITFOR DELAY with 30 seconds.  This is to ensure any non compliant connections are killed before continuing.

    However, I'm wondering if the WAITFOR is actually necessary?  Would the ALTER DATABASE command not block until all connections have been killed?


    database mirroring "log records from bulk-logged operations cannot be sent to mirror database"?


    does this mean only when bulk recovery model or apply to full recovery model as well? if applys to full recovery model, how the mirror database be synchronized after bulk operation?

    Error when configuring Report Server Database - Wizard is trying to create Database on a non existen


    I'm trying to setup SSRS using the Reporting Services Configuration Manager.  Everything seems to be working except the database creation.  When I click on the Database (3rd option down) then Change Database I run through the wizard.  Put in proper SA credentials.  Accept the defaults clicking next through and when it gets to running the script to create the data base I get the Error I pasted below.  We do not have a G drive so I went into SSMS and changed the Default Database settings to point to the F drive (where our other DBs reside) - I got that tip off of this forum but it didn't fix my issue. Any ideas what to try next?  Do I need to stop and restart a service or something?  Thanks for any help you guys can offer.

    System.Data.SqlClient.SqlException: Directory lookup for the file "G:\mssql\data\ReportServer.mdf" failed with the operating system error 3(The system cannot find the path specified.).

    CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateO

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend