how can find slow runing query and how can resolve , how can find reasons..?
Thanks
vijay
how can find slow runing query and how can resolve , how can find reasons..?
Thanks
vijay
I have one generic question.
In average, I have stored procedure with 5 parameters(I believe this is normal case). Because of this, parameter sniffing is very common problem (causes also a lot of sort warnings). There are a couple of ways how to deal with it:
1. Create local variables - which in fact doesn't solve anything, since you have generic plan which can force index scan even when index seek would be ideal.
2. Create more stored procedures for different parameter values. Since SP have 5 parameters in average, that would create so many combinations that it is almost impossible to deal with it.
3. Recompile SP every time.
I have found out that recompile every time works the best. From number of problems because of non optimal plans, you reduce the problem to only one - slightly greater CPU because of recompilation. But compare to all other problems, it is negligible. It is also smart if you have default maxdop setted to 1 - it will make much more easier for CPU to deal with every recompilation and only for some large queries(reports are very common) add hint: MAXDOP 0.
I guess this should be default SQL setting. I know there are cases when recompilation should be avoided but in general I think you have better results if you recompile every procedure(with parameters) every time and only deal with cases, where this is not allowed.
Any comments or some better directives?
Thanks,
Simon
Hi guys
We have created Maintenance plan running on Primary Server and still no maintenance plan created on Mirror Server. So when the manintenance plan runs for Index Rebuild and DB Integrity checks it also runs for Mirror server Database ? or have to create seperate maintenance plans on Mirror server ?
Thanks
Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach A.Shah
Hi,
when the database snapshot is created in database mirroring after creating database mirroring before creating database mirroring
Hi all,
i know how to create the deadlock graph using sql profiler
is there any other way create the deadlock graph in sql server?
Hi,
I'm relatively new to SQL administration and (still) I am trying to set up mirroring for a number of databases.
My predecessor left some instructions to change the database owner of the mirrored database but this doe not work.
I am using the command (after the restore, before the mirroring) ALTER AUTHORIZATION ON DATABASE:: database TO [domain\account]
I then get the message "Database X cannot be opened. It is in the middle of a restore".
How to change the dbo? Is it even necessary to change the dbo?
Hello all,
I have been tasked to look into HA solutions for our implementation of Dynamics AX. I decided to begin researching High Safety mode without automatic failover. One of the caveats I read on msdn about mirroring is that it could not be used if the FILESTREAM feature is being used by the principal database.
So my first question is, has anyone implemented mirroring on Dynamics AX 2009? Anyone know if Dynamics uses this FILESTREAM feature mentioned on msdn?
Thanks and I look forward to reading your responses.
Hello!
I am having some trouble getting the C# SQL Connection to transfer smoothly when doing a failover from the principal to the mirror SQL Server.
This works LIKE A CHARM (sub-second) when doing it the OTHER way, e.g. doing a failover from the failover partner to the master database machine.
Connection string: "Data Source=192.168.IP.001;Failover Partner=192.168.IP.002;Initial Catalog=my_database_name;Persist Security Info=True;User ID=my_login_name;Password=my_password;Connect Timeout=120"
Summarizing:
1. Executing a failover from IP.001 to IP.002 makes the C# SQL Connection time out. When doing a (web page) reload again, it does connect to the mirror server. Hence it seems there is some issues with getting the existing (pooled) Connections to failover.
2. Executing a failover from IP.002 to IP.001 makes the C# SQL Connection jump over to the IP.001 machine instantly when previously being connected to IP.002.
I have been doing some lowlevel Wireshark analysis. When trying to connect via C# immediately after executing a database failover, then now-mirror machine responds with a "Cannot open database 'bleh_bleh' requested by the login. The login failed" = very correct as the machine now has a non-loginable mirror copy. I am very unsure why the Connection reconnects to the correct IP when doing failover one way but NOT THE OTHER WAY. When working correctly, I just see a TCP FIN from the mirror machine to the c# client, followed by a SYN packet towards the principal machine from the C# client = no magic 'go-over-there-instead' messaging.
The back-end SQL 2008 R2 setup works great; I have logins/users having the same SID and I'm using certificates for the inter-database connections (no AD). I am also using a Witness.
What am I doing wrong?
Kind regards,
Ulf
Sweden
Copy\Sync Data from Table A to Table B.
Database1:TableA to Database2:TableB
I have data in Database1 Table A and would like to synchronise the data to Database 2 Table B. Both databases are on the same server.
Is there an option in SSMS to do this as a scheduled daily task?
Thanks
Hi Experts,
I want to know how the transactions are actually moved from principle to the mirror server in a Mirroring setup. I have read about mirroring endpoints, but some how I am not able to figure out how the transactions are taken to the mirror server and how do thy get applied onto the Mirror server.
Like in log shipping we have jobs, in replication we have agents... what do we have in Mirroring
Thanks...
hi,
I have three servers to implement Database mirroring, " [withHigh safety with automatic failover] Mirror type".
("A","B","C") servers.
That is"A" server as Principal, "B" server as Mirror and "c" server as witness.
And I want to always remain "A" server as Principal Server,after "A" server disconnect and then connect.
For Example:
If "A" server go to Failover state, then "B" mirror server comes up as principal.
And now we want to: if problem of "A" server was solved, then "A" server automatically return to Principal Mode.
Thank you.
Experience is the best teacher.
Hie
I have a database mirroring server with Sql server 2012 service pack 1 standard edn on windows server 2012 standard edition Processor Intel Xeon I350 and 8 GB of Ram on both principle and mirror server and witness server on the mirror server.
Whenever I try to connect to the principal serve to the mirror server the connections are very slow as is vice-versa
I have check latency and database error logs along with any other hardware related issues but it is all proper
Also if I try to connect to Principal and Mirror server form a 3rd PC then it works properly
But the interconnections between on the server is very slow
What can be the cause of the issue
I need to perform SQL 2008 backup to remote site?
I can simply do a Windows Server Backup across the network to your DR site.
Then your recovery would require that you rebuild from the backup.
Or I can set up SQL mirroring to another SQL VM located in the DR site. I need more details on how to set that up this process
Hi All,
We are using sql 2008r2 (sp2) Enterprise edition, mirroring has to be configured as per the requirement but after checking the database properties & tasks- mirror it is known that this feature is not available in this instance. first why this option is not in this instance, second can we have any option to bring this feature back.
Please share your view on this.
Regards,
Shiva
hi,
how to ping through command prompt b/n principal, mirror and witness
im trying to measure the amount of CPU used in a backup and restore, using the SQL Server Databases: Backup Restore counter in Perfmon.
I can select The counter, but it does not let me select an instance database to monitor.
see image:
I have 3 instances on my machine, 2 sql 2005 and 1 sql 2008. why do these instances not appear? i dont know how to set up this monitoring.
if i type LOCALHOST or 127.0.0.1 in the "Select counters from computer" text box i can see all databases under my sql 2005 instances, but not the ones under the 2008 instances. I have disabled all sql server 2005 services and can confirm none of the sql 2008 instance databases are showing up.
this is a huge problem, especially for when i start stress testing sql server 2008 in preperation for upgrading.
anyone any ideas on why i cannot see sql server 2008 instances in perfmon? I have tried from a remote pc also with the same results.
Hello,
i want to install Windows Server 2008 R2 with dynamic disks mirroring for system partition (including database and logs on seperate partitions) and want to install MS SQL Server on it, can that make some trouble?
thanks for answering.
greetings
Akshay Pate
Server Administrator