Showing posts with label cause. Show all posts
Showing posts with label cause. Show all posts

Saturday, February 25, 2012

.NET /script/T-SQL Code to deliberately cause Cluster Failover

I'm looking for help in locating a script that would allow deliberately
causing a cluster to failover. (For demonstration and testing purposes.)
And ideas or suggestions would be appreciated.
Thanks,
Arnie Rowland
You can use the CLUSTER.EXE command from the command line prompt to force a
failure. Look up Cluster.exe in the on-line help files for Windows Server.
Everything you can do from the GUI, you can do from the command-line.
Example:
Cluster MyClusterName resource MYSQLCluster Resource /fail
Will cause the specific resource to fail. You can then watch how the
cluster reacts.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Arnie Rowland" <arnie@.1568.com> wrote in message
news:uyoFczoHFHA.1528@.TK2MSFTNGP09.phx.gbl...
> I'm looking for help in locating a script that would allow deliberately
> causing a cluster to failover. (For demonstration and testing purposes.)
> And ideas or suggestions would be appreciated.
> Thanks,
> Arnie Rowland
>
>
|||Thanks Geoff,
I forget that it was also command line! Du-oh...
-Arnie
"Geoff N. Hiten" <SQLCraftsman@.gmail.com> wrote in message
news:#7m#$FpHFHA.1172@.TK2MSFTNGP12.phx.gbl...
> You can use the CLUSTER.EXE command from the command line prompt to force
a
> failure. Look up Cluster.exe in the on-line help files for Windows
Server.
> Everything you can do from the GUI, you can do from the command-line.
> Example:
> Cluster MyClusterName resource MYSQLCluster Resource /fail
> Will cause the specific resource to fail. You can then watch how the
> cluster reacts.
> --
> Geoff N. Hiten
> Microsoft SQL Server MVP
> Senior Database Administrator
> Careerbuilder.com
> I support the Professional Association for SQL Server
> www.sqlpass.org
> "Arnie Rowland" <arnie@.1568.com> wrote in message
> news:uyoFczoHFHA.1528@.TK2MSFTNGP09.phx.gbl...
>
|||That's OK. I goofed up the example and put RESOURCE in there twice. I
should know better than to answer posts right after lunch.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Arnie Rowland" <arnie@.1568.com> wrote in message
news:OBwY0HpHFHA.3612@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> Thanks Geoff,
> I forget that it was also command line! Du-oh...
> -Arnie
>
> "Geoff N. Hiten" <SQLCraftsman@.gmail.com> wrote in message
> news:#7m#$FpHFHA.1172@.TK2MSFTNGP12.phx.gbl...
force[vbcol=seagreen]
> a
> Server.
deliberately[vbcol=seagreen]
purposes.)
>
|||Yeah, I caught that part. ;-)
"Geoff N. Hiten" <SQLCraftsman@.gmail.com> wrote in message
news:ePtnyJpHFHA.2740@.TK2MSFTNGP12.phx.gbl...
> That's OK. I goofed up the example and put RESOURCE in there twice. I
> should know better than to answer posts right after lunch.
> --
> Geoff N. Hiten
> Microsoft SQL Server MVP
> Senior Database Administrator
> Careerbuilder.com
> I support the Professional Association for SQL Server
> www.sqlpass.org
> "Arnie Rowland" <arnie@.1568.com> wrote in message
> news:OBwY0HpHFHA.3612@.TK2MSFTNGP09.phx.gbl...
> force
> deliberately
> purposes.)
>

.mdf and .ldf files

Hi All,
One of my databases has .ldf file that is bigger in size than .mdf file. Is it a problem? If yes, what can cause this problem? And how to fix it? I looked at all the other ones and the .ldf files are smaller than .mdf files. Thanks.You probably forgot to change the Recovery Model from FULL to SIMPLE. After you've fixed that, dump the transaction log. From Query Analyzer

ALTER DATABASE myDb SET RECOVERY SIMPLE
GO
BACKUP LOG myDb WITH TRUNCATE_ONLYBe sure to change myDb to your database name.

-PatP|||Thank you.|||...Except doing so will not change the size of the log device.

Right-click on the database and see if you have any LOG (and FULL for that matter) backups done. After confirming that you have, determine what is the business requirement for database recoverability after a failure (1 hour, 6 hours, 24 hours, or "I don't care"), determine the volume of activity against the database (you can use perfmon Transactions/sec counter), and set up a transaction log dump job. Set up an alert to notify you when the space used on the log device exceeds the full size of the data device, and run for a day under this set of settings. Only then you can intelligently say what the actual size of the log should be, and can safely shrink the file to that size.|||...Except doing so will not change the size of the log device.Hmmm... Maybe I mis-read the description of the TRUNCATE_ONLY option in the BOL for BACKUP LOG (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ba-bz_35ww.asp), but it sure looks like it will reduce the size of the device. Empirically, it works as described in BOL for me.

I will agree with you (rdjabarov) that a DBA should not willy-nilly truncate the log or change the logging options. This is definitely something that should be considered before you just blindly hack away.

-PatP