I'm trying setup a proof of concept for a client but I€™m having issues with mirroring and replication.
With the help of http://technet.microsoft.com/en-us/library/ms151799.aspx I€™ve done the following..
The setup is as follows, I have several instances of SQL Server
A+B are mirrored with each other, with A being the principle and B the mirror
C is the distributor
E is subscribes to A, with parameters for PublicationFailoverPartner set to B
The mirroring between A+B works fine, I can manually fail each and the databases keep in step.
Without testing the mirroring failover, the replication between A+C+E also works.
However when I test the mirror to failover between A+B no transactions are replicated though to E. The publication moves from A to B in the Server Management Studio.
The logs state that the log reader agent can not gain access to A, however nothing is recorded regarding any attempts to contact B. In the replication monitor the error message
"The concurrent snapshot for publication ABCXYZ is not available because it has not been fully generated of the Log Reader Agent is not running to activate it. If generation of the concurrent snapshot was interrupted, the Spapshot Agent for the publica..." (cut off).
"the process could not execute 'sp_replcmds' on 'A'
I have checked that the SQL Server Agents are running on all agents,
I have checked that that server B is set at the PublisherFailoverPartner on server C agent configuration, I'm now at a lost as to what is wrong,
Every once in a while a scheduled restore of a production database backup to a development server will fail with the following error.
RESTORE cannot operate on database 'XXX' because it is configured for database mirroring or has joined an availability group
While it is true the production database is involved in database mirroring, the development server does not have database mirroring enabled. This error tells me something within the backup is telling the development server the database is configured for database mirroring.
However the perplexing part for me is that we only receive this error maybe 5% of the time, if that, and only on a couple of our databases. We have numerous other restores of mirrored production databases to development servers that have never produced this error. So my question is what is causing this error to occur, and why is it not happening all of the time? We get around this error by deleting the DEV database and re-running the restore job.
I am trying to setup mirrored subcriber in Transactional Replication in SQL 2005. I am not able to do so as it don't work after failover.However I am able to setup mirrored publisher with distribution property "PublisherFailoverPartner" for snapshot and log reader agent profiles and it works even after failover.
However I need to know, do we have something called "Subscriberfailoverproperty" or any other method to set up mirrored subscriber in Transactional Replication in SQL 2005.
Can you help me to resolve my problem ? I have to do a simple daily backup system. Source : Flat File; Destination : SQL Server. I want to use the Slowly Changing Dimension component to backup only the new and updated row from my source (Flat File) and put them into SQL Server.
But how can I do to detect deleted rows from my source ?
Any suggestions ?
If it's not clear enough, please ask for more details !
Hi. I am trying to extract the data returned from a store procedure to a flat file. However, it fail to execute this package in the OLE DB Source. I select the SQL Command in the Data Access Mode, then use:
USE [SecurityMaster] EXEC [dbo].[smf_ListEquity]
It runs ok in the Preview, but not in the Run. Then the system returns during executing the package:
Error: 0xC02092B4 at Load TickerList, OLE DB Source [510]: A rowset based on the SQL command was not returned by the OLE DB provider. Error: 0xC004701A at Load TickerList, DTS.Pipeline: component "OLE DB Source" (510) failed the pre-execute phase and returned error code 0xC02092B4.
We run std 2008 r2. I'm trying out the commandtimeout property of an oledb source. I set it to 30 expecting 30 seconds. if connection and or execution exceed that threshold, will the pkg fail?  Either way is there a way I can detect that the threshold was exceeded?Â
I have configured three transactional replication one from DC - Data center & DB for database
DC1-DB1 to DC2-DB1 -- 1 DC2-DB1 to DC2-DB2 --2 DC2-DB2 to -DC2-DB3 --3
Before synching the data on DC2 databases I wanted to truncate / drop the objects on 1 and 2 setup as these are already participating in replication. Setup 1 and 2 are publisher as well as subscriber. I am not able to reinitialize these tables on these setup. I cannot use SSIS.
My company is moving to a SQL Server-based packaged application early next year. We€™re planning our SQL Server architecture but have some questions that I can€™t readily find answers for. I€™m hoping someone here can point me in the right direction.
We have three servers, I€™ll call them A, B, and C. We want to duplicate all changes to certain databases on server A to server B, then duplicate changes to selected databases and tables on server B to server C.
Ideally we€™d run SQL Server 2005 Enterprise Edition on all three servers, but the packaged application vendor does not support SQL Server 2005 yet, only SQL Server 2000. Our license agreement with them does not allow us to use replication on server A. We€™re free to do whatever we want on our other SQL Servers, but server A must sit alone, untouched, like a monolith on a far-away moon. (I€™m lobbying to have the server named Tycho, or TMA2.) Stranger still, they€™re OK with log shipping from server A to other servers. We€™ve tried to explain that replication and log shipping are both core function built into SQL Server, and that if one is acceptable, then both should be. Their fear is that replication could cause performance and stability problems, and to eliminate this possibility they€™re ruling out replication on server A.
Given these constraints we€™re resigned to using SQL Server 2000 Enterprise Edition on servers A and B, and SQL Server 2005 Enterprise Edition on server C. We plan on periodically shipping logs from server A to server B and applying them at server B.
We€™d like to know if it is possible to also use transactional replication on server B to duplicate changes from server B to server C. I€™ve used log shipping and replication in the past, but never at the same time. My understanding is that a database goes into recovery mode while a transaction log is being applied and that any user changes to the database after the log has been applied will cause later log applications to fail. The scripts I€™ve seen that are used to apply the transaction logs put the database into single user mode after the log has been applied to prevent this.
This raises a few questions:
If we try to RESTORE a log to a database being used as a source for transactional replication articles, will the RESTORE fail? Or will the RESTORE start and break the transactional replication? I€™ll test this on my own, but it€™d be nice to know if anyone has already experienced this.
Is it possible for us to have a database in read-only mode serve as the source for transactional replication articles? (I can€™t imagine why not, ever though it seems counter-intuitive - why would you want to replicate transactions from a database that has no transactions?)
If the answer to number two is yes, can we suspend transactional replication on a database, RESTORE a log to the database, put the database into read-only mode after the RESTORE, and restart the replication on the database? Thanks in advance for sharing your wisdom, everyone!
Hello:I have 2 MS SQL Servers 2000 Developer edition.Both have same settings and databases. I'd like to have them as mirroredservers - all transaction on one server must be performed on the otherautomatically. More than that I'd like to get possible if something happenedto one server, all transactions will be performed on another one.Please, give me a hint how to do that.Thanks,GB
I use different udls for a website which is partly asp pages and partly aspx pages. Every database is mirrored, so each udl indicates a "failover partner". However we decided recently that one of the database would not be mirrored anymore. For this database we still use in the udl a "failover partner" to redirect the connection to the second database in case of a failover. For the asp pages the failover works fine even if the database is not mirrored, but it doesn't work for the aspx pages.
It would be great if anyone had an idea why the behaviour is not the same for the aspx pages, and if we can still use a "failover partner" in udls even if the database is not mirrored.. if not, what should we use to connect to another database?
SQL Configuration: Two 2003 Servers (OS Std ver) with SQL 2005 (Std ver) configured for db mirroring. (The servers aren't clustered.) Web.config configuration string is using "ServerA". If we fail Server A, then Server B will change roles to "primary" in about 20 seconds (we have confirmed this via SQL Mgt Console). BUT...our web app is still pointing to Server A and doesn't seem to know there is a fail over. SO - how can I make the web app aware of the failure? Server A and Server B aren't in a cluster - and I understand a cluster's virtual server would be referenced in the connection string. Is there a way to make the web app automatically switch to Server B (without a cluster configuration)? From what I understand, the cluster configuration would require Ent Ed. of OS and SQL and a big fat check!! Thanks. -Kevin
hi.I've seen ways to delete duplicate rows.Can someone give me some sql to do this?I have a table with varchar table_name_start, varchar column_name,varchar table_name_end;it has rows like this:table1 col1 table2table1 col2 table 3table2 col1 table1I'd lke to delete the rows if they exist with the names swappedaround, i.e. like above since the first and third share a column nameand the table_name_start/end matches the others table_name_end/start,I'd like to delete one and leave the other.I'm scratching my head trying to figure this out.thanks
I currently have 2 mirrored servers and would like to implement a backup solution using an existing TSM server. The first thing that comes to mind is using the TSM client or Litespeed by Quest, but I'd like to know the effects of performing backups on principal and mirrored servers first.
Will using one of these products cause errors or problems should the backup client try to backup a mirrored database? Can anyone make any recommendations on the effects of using TSM client or Litespeed for a mirrored environment?
The following problem occurs when trying to mirror multiple databases using SQL Server 2005:
After mirroring about 40 databases, an error occurred concerning a lack memory availability on the mirror-server. I added the parameter /3GB to the boot.ini file and enlarged virtual memory space.
Now I was able to mirror a total of 59 databases. When trying to add the 60th database on the principal server, it won't get through. I don't get any error message, neither the mirror starts. However the SQL Server Management Studio on the mirror-server doesn€™t seem to respond to any commands given until the mirror is again removed for one or more databases on the principal server. Adding the parameter /PAE to the boot.ini file, or enlarging the virtual memory again didn't bring the solution.
Both principal- and mirror-server are dual processor servers.
The principal is a Windows 2003 Server Standard x64 Edition service Pack 1 and runs:
SQL SERVER 2005: Microsoft SQL Server Management Studio 9.00.2047.00 Microsoft Analysis Services Client Tools 2005.090.2047.00 Microsoft Data Access Components (MDAC) 2000.086.1830.00 (srv03_sp1_rtm.050324-1447) Microsoft MSXML 2.6 3.0 5.0 6.0 Microsoft Internet Explorer 6.0.3790.1830 Microsoft .NET Framework 2.0.50727.42 Operating System 5.2.3790
It has 4GB of memory.
The mirror is a 32-bit Windows 2003 Server Enterprise service Pack 1 and runs:
SQL SERVER 2005: Microsoft SQL Server Management Studio 9.00.2047.00 Microsoft Analysis Services Client Tools 2005.090.2047.00 Microsoft Data Access Components (MDAC) 2000.086.1830.00 (srv03_sp1_rtm.050324-1447) Microsoft MSXML 2.6 3.0 4.0 5.0 6.0 Microsoft Internet Explorer 6.0.3790.1830 Microsoft .NET Framework 2.0.50727.42 Operating System 5.2.3790
I am in the process of architecting SQL 2005 HA options and of course mirroring is at the top of the list. Does anybody know what the requirements are regarding upgrading mirrored databases, for example, applying hotfixes and service packs? Is it a requirement for the principal and mirror (and witness if applicable) to be at the same build level? Is there any requirement to upgrade one first and then the other as there is with replication topologies?
I had a look in BOL but can't find anything covering this (perhaps I missed it).
Today, I became an involuntary DBA until my company finds someone else. We have an SQL R2 DB that is mirrored that failed dur to the transaction log growing and filling up the disk. As a band aid remedy, I was able to add 20GB to the disk (it is a VM) and then I backed up the Transaction log and did select log_reuse_wait_desc from sys.databases where name = 'mydb' and the result showed that the backup was successful (NOTHING, I think was the result).
After this I was able to resume the mirror and everything has been running fine. What I need to do now is to shrink the Transaction log so that if it starts to grow again, I will get an alert and can avoid today's issue. From what I have read, I can just use DBCC SHRINKFILE [logname] after I do a backup and the changes will be reflected on the mirror as well. I have shrunk the T-log in non-mirrored servers before, just don't know if there are any key differences.
We have a mirror setup, with a third server that needs to be linked to this mirrored setup. The link server setup only allows you to specify the primary server. How will the linked server setup know what the secondary server is? Thanks
The database in Mirrored server is always in the state of restoring only.
the database in mirrored server is restored with norecovery
then we started mirroring.
the status of mirroring is successfull and is synchronized.
but the Mirrored server is always in the state of restoting
not allowing use to open the database.
could any one know why this problem is comming and give some solution for this problem so that the mirrored database can be accessible opened and queryed to really verfiy that the changes made in principal database is mirrored to Mirrored database.
We have a mirrored db setup, with a third server that needs to be linked to this mirrored setup as a linked server. The link server setup only allows you to specify the primary server. How will the linked server setup know what the secondary server is? Thanks
Executing the statement: select * from test2.database.dbo.table
gives the following error:
Server: Msg 7356, Level 16, State 1, Line 1 OLE DB provider 'SQLNCLI' supplied inconsistent metadata for a column. Metadata information was changed at execution time. OLE DB error trace [Non-interface error: Column 'IsActive' (compile-time ordinal 2) of object '"database"."dbo"."table"' was reported to have changed. The exact nature of the change is unknown].
If i change the statement to
select * from openquery(test2,'select * from database.dbo.table')
It works. I don't really want to have to go and refactor all the SQL though!
I've seen similar posts related to Oracle and SQL2k5 64bit but they don't seem to be relevant to this situation.
Here's the version info:
2000 server (SP3):
Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05 Copyright (c) 1988-2003 Microsoft Corporation Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 2)
2005 mirrored servers (SP2 3054):
Microsoft SQL Server 2005 - 9.00.3054.00 (Intel X86) Mar 23 2007 16:28:52 Copyright (c) 1988-2005 Microsoft Corporation Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 1)
I've also tried applying the following to the 2005 servers: sp2(3159) sp2(3161) but makes no difference.
I'm having a problem with SQL2005 Database mirroring.
I have an ASP application that loops for a certain amount of interations and in each iteration I create a SQL Connection object and use the failover partner in the connection string. The object then writes a simple record and then the connection is closed and the process starts again.
About half way through my loop I force a failover to the server mentioned as the failover partner in the connection string. At this point my application encounters a SQL Exception error and the application fails.
I read in this article, http://msdn2.microsoft.com/en-us/library/ms366199.aspx, that this is expected and that you shoud request a new connection using the same connection string but this isn't working for me and unfortunately no examples are given anywhere.
I would appreciate any help. Thanks
Luis Bonilla
Here is a sample of my code:
Dim k As Integer = 1 Dim constring As String = "Server=SVR01.XXX.XXX.comInstanceName;Failover Partner=SVR02.XXX.XXX.comInstanceName;" _ & "Database=test;" _ & "Integrated Security=SSPI;"
Do Until k = 60 Using con As New SqlConnection(constring)
Dim cmd As New SqlCommand()
Try con.Open() '<--------This is where the exception occurs Catch ex As SqlException Dim en As String = ex.ErrorCode Dim em As String = ex.Message Dim emm As String = ex.Number Dim enn As Integer = ex.State End Try
Simple question, I hope. I need to add a column to a table of a database that is mirrored. How do I have to do that? Do I need to stop mirroring? Is it sufficient to simply pause mirroring? If I make the change on the principal db, what do I need to do the make the same change on the mirror?
We are planning to change the location of the log files from my production server. We have setup the mirroring also for those databases. I know for the databases without mirroring job i could detach the database, copy the log file to the target location and attach the database with the new logfile location. But for the mirroring databases I don't have any idea how to do that. Could some body guide me thorugh the process on how to do this task? thank you very much for all your help!
I have a mirred database and have snapshot created from the mirroed database. I can do data selecting from the snapshot. But when the pricipal server is down , I can re-active the mirroed database.( I did succesfully upto this). Then I need to restore the database from snapshot and which failing with following error message.
Code Snippet Msg 5123, Level 16, State 1, Line 3 CREATE FILE encountered operating system error 3(error not found) while attempting to open or create the physical file 'E:sql_datadevitst_mirrorlog st_mirror_log.ldf'. Msg 5024, Level 16, State 2, Line 3 No entry found for the primary log file in sysfiles1. Could not rebuild the log. Msg 5028, Level 16, State 2, Line 3 The system could not activate enough of the database to rebuild the log. Msg 3013, Level 16, State 1, Line 3 RESTORE DATABASE is terminating abnormally.