Hi all,
I have a task where i need to configure database mirroring for 400 databases at a time. I need a single TSQL Script to restore all the databases full backups with no recovery mode at a time.
QUick answer will be really appreciated.
Hi all,
I have a task where i need to configure database mirroring for 400 databases at a time. I need a single TSQL Script to restore all the databases full backups with no recovery mode at a time.
QUick answer will be really appreciated.
We have a SQL Server 2005 database mirroring configuration on two Windows Server 2008 R2 servers. There is a SQL Agent job that is triggered by a WMI Event Alert, using the query "SELECT * FROM DATABASE_MIRRORING_STATE_CHANGE WHERE State=8 AND DatabaseName=[DB]".
The first step in the SQL job triggered by the alert is to execute a stored procedure in the database [DB] that has now just become principal on this server. On a recent automatic failover test, forced by rebooting the principal server, the mirror-turned-principal fired the above alert, but the first job step failed with the error: "Unable to connect to SQL Server '(local)'. The step failed."
Subsequent job steps that executed other stored procedures in the same database were successful.
Some time line information:
9:50:34 SQL Log entry: "The mirrored database [DB] is changing roles from MIRROR to PRINCIPAL due to Auto Failover."
9:50:45 Alert fired
9:50:46 Job step 1 failed "Unable to connect to SQL Server '(local)'. The step failed."
9:51:32 Job step 2 "Changed database context to [DB]" (and the step succeeded)
This alert/SQL job combination has never failed in this manner on a similarly configured pair of mirror servers.
Can anyone shed light on why that first step would fail? Could the failover time be long enough that the database is not yet accessible? Yet the error refers to the server itself, not the database.
Since this is a production database, I have limited access to test the failover sequence, but any suggestions on what caused this job step to fail are welcome.
Hi,
I want to know if restarting the mirrored server (standby server)will have any effect on mirroring configuration. Is it the same as pausing and resuming mirroring from principle server.
Or is it advisable that mirroring be paused from primary server before mirroring server (standby server) is restarted.
Thanks
I have a log shipping configuration and its working and restoring to another server just fine. What Im wanting to do is connect a client to that standby database and test how to switch to the backup box in case of failure. How do I do that? And, once Im done, does shipping just pick up where it left off?
Thank you.
How do I generate a dbml file?
In a Visual Studio file, A project contains a DBML file that, when opened, shows a very cool representation graphical of a database and all the interconnections between the tables.
I want that for another project for documentation purposes. The database already exists. So how do I get from the sql server database with all the key relationships and the proverbial whole nine yards to the cool graphic represenataion of ta DBML file as seen in visual studio.
I did some searching on the internet with several search engines and so far everything I see is working in the other direction such as "create database from DBML file? "
Hi,
In a synchronous mirroring session data commit on mirror first and then on the primary. But in a scenarion that data has commited on Mirror but when it goes to commit on primary then then primary server goes down or via any behaviour it is not able to commit on primary. then what is the flow, how we will get that data commit on primary.
Thanks in Advance.
Regards, Ashish Tripathi
hi,
i am getting the below error when i am trying to start mirroring.
below is the screen shot.
sal
Hi Everyone,
I doing some test on SQL DB Mirroring. I have set two VM one as principal server and another as mirror server. I can setup for High Safety mode to test Manual failover. The problem arise when i try to setup a witness to test auto failover. When i try to setup using SSMS, i encounter the below error.
"The alter database command could not be sent to the remote server instance 'TCP://Mywitnessserver:5022". The database mirroring configuration was not changed. Verify the server is connected and try again.(SQL Server, Error 1456)."
I have try to ping the witness server from both principal and mirror server and the result is succesful. I also try to telnet the witness from both pricipal and witness server and the result is succesful.
I also have created same sql server user for all principal, witness and mirror server but still the same error come out.
When i checked the SQL Server error log in witness server it shows the below error.
"Database Mirroring login attempt failed with error Connection handshake failed. An OS call failed (8009030c) 0*8009030c(The login attempt failed) State 67.
Details:
Principal Server : Windows 2012 , Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (X64) Jul 9 2008 14:17:44 Copyright (c) 1988-2008 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (VM)
Mirror Server : Windows 2012, Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (X64) Jul 9 2008 14:17:44 Copyright (c) 1988-2008 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (VM)
Witness Server : Windows Server 2008, Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (X64) Jul 9 2008 14:17:44 Copyright (c) 1988-2008 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (VM)
Can anyone have idea on how to solve this error? I will apreciate your help.
I want to change the service account of my both sql server services on which mirror is setup in live environment.
What precautions & steps do i need to follow. please tell me in details.
We run an inventory management and order management software on a Dell server that runs win 2008.
It runs 24/7/365 and uses SQL for the database. Everything is located on the one server. The database and the software.
About 30 people connect to it all day and about 5 at night along with constant streams of multiple API connections all day and night.
output is 5gb per day and input is 2gb per day.
It has yet to happen but if the server breaks, goes down etc our entire company will go down. We have a constant backup running so we can get up and running without losing data but we would be down until we can either get a new server in or fix the server.
I want to somehow have something always running and duplicating the current server so if that goes down everything switches over to the backup server like a RAID 1 would do for a HDD.
Lets say the MB dies on the server it shoudl switch over to server 2 that already has the exact same data on there and we would have no down time.
I know it is simply database mirroring but can we benefit from the 2nd server while it is just being used as a live backup similar to striping hard drives? Have the 2nd server not only be a mirror but also share the load of the main server.
hi team,
How can shrink the transaction log file in primary server can any body please guide me.
Tx
0 | Hi, Scenario: Server 1 : Principal Server 2 : Mirror Server 3 : Witness Mode: High-Performance (synchronous) Qs. 1 - As I understand, witness is used for automatic failover. However, in our scenario we do not want that to happen (due to some network restrictions) If witness is installed, both automatic failover is possible (initiated by witness itself) and manual failover (done from principal/mirror using SSMS or T-SQL). Is there a way to do ONLY manual failover using witness? i.e. Can we prevent automatic failover to happen even when witness is configured? According to me, this is not possible. Can someone please help clarify this? Thanks, Regards, Mandar |
Hi
We are fetching data from MSSQL 2012 from MS Excel - 2013 using MS Query. While querying the data from Excel, we are observing some ASYNC_NETWORK_IO entries in the activity monitor and the corresponding application is hanging and throwing error. The Task State is showing as suspended and wait resource as "External External Resource = ASYNC_NETWORK_IO".
Please suggest
Hi,
Facing an issue. Whenever I create a table in a database(for ex TEST) under one SQL instance(for ex, MSSQLSEVER), it is getting replicated in TEST under another SQL instance(for ex MSSQLSERVER\TEST).
I don't know why is this happening.
Please note- All the databases under MSSQLSEVER and MSSQLSERVER\TEST has the same number and name.
I checked replication option on each database but it is not enabled.
Kindly advise.
Regards
Jim
We are running on SQL Server 2008R2 ent. as a VM on an ESX.
We are planning to get a flash disk device (intel 910) to connect to our ESX and have the mdf/ldf files of our database migrated to it.
Since flash disk is not as as reliable as a SAN/NAS raid we wanted to have some kind of HA in place so we decided to try SQL's mirroring feature.
We set up mirroring with async mode since we do not want the slow disk of the mirror server to be a bottleneck.
Manual failover works fine when done through T-SQL (ALTER DATABASE database_name SET PARTNER FAILOVER) or through SMSS.
But the whole point of this is to be able to relatively quickly fail (manual or automatic) to the mirror server when hardware disaster occurs.
3 scenarios in mind:
1. only the DB (mdf/ldf) is on the flash disk and the disk crashes
2. all the VM is on the flash disk and the disk crashes
3. either DB only or whole VM is on disk but there is a different issue (networking/ESX server)
In none of those scenarios it apears that I can somehow take advantage of the mirror server.
when I tested offlining the flash disk while only the DB was on it and trying to manually failover I get this message:
Nonqualified transactions are being rolled back. Estimated rollback completion: 100%.
Msg 5120, Level 16, State 101, Line 2
Unable to open the physical file "G:\xxxx.MDF". Operating system error 3: "3(The system cannot find the path specified.)".
File activation failure. The physical file name "G:\xxxx_log.ldf" may be incorrect.
Which makes sense since the disk is down but as far as SQL server sees it there is no reason to failover
I think the other 2 scarious are no different as I cannot failover when the SQL server itself is not available.
It seems like I am missing something fundamental about this feature and how it should be used.
How exactly is this HA?
Any help would be greatly appreciated.
Thanks!
Hi,
Can anyone please share some mirroring issues faced in ur experience and how u resolved them in a detailed step by step process. It would be helpful for my interviews.
Hi,
What is the major difference between CDC and Trigger.