We are running AlwaysOn on three replicas. The primary and first secondary are synchronous for failover purposes. The second secondary is a read-only asynchronous server for reporting. The only thing we don't have a good handle on is SQL Agent jobs on failover. I've seen a few solutions from others, but nothing I thought was really slick. How do you handle SQL Agent jobs on a secondary replica that is intended for failover?
I'm looking for best practice in dealing with scheduled SQL Server Agent jobs in SQL Server 2012 availability groups. Maybe I missed something, however at the current state I feel that SQL Server Agent is not really integrated with this great SQL2012 feature.  How can I make a scheduled SQL agent job aware of a node switch?  For example I have a job running on the primary node which loads data each hour. Now if the primary goes down, how can I activate the job on the secondary which now becomes primary?   If I schedule the job always on the secondary it fails because then the secondary is read-only.
list files and store it in variables I'm new with shell programming. My goal is to give the user a selection which file should be run. I catch all available scripts in one var with:  var=$(find script*)   so far so good, this is the output:      echo $var     script1 script2 script3 scr...   now I want to store each file in a singel variable to run it in later selection  select SEL in script1 script2 script3 .......... case $SEL in         $Script1) echo ($Script1 will start) &amp;&amp; ./$script1 ;;         $Script2) echo ($Script2 will start) &amp;&amp; ./$script2 ;;         $Script3) echo ($Script3 will start) &amp;&amp; ./$script3 ;;         $Sc..) echo ($Scr.... will start) &amp;&amp; ./$scrip.... ;;         $Sc...) echo ($Sc...... will start) &amp;&amp; ./$scrip..... ;;         *) echo "choose on of the availabel files";;     esac done   I don't have a clue how should I should separate all files if I don't know how many and the exactly length of each file.  I tried to split with echo ${var[1]} and echo $var[1] but this dosn't work. I recive either a empty output or the whole string. HDD SMART interpretation - Possible impending drive failure I've just had an issue pop up related to my drives.  First things first, I was working in my case when I clumsily shifted the foot of the case off of my desk. Case shifted and hit the desk somewhat hard, but only fell an inch or two. It had been properly shut down so this may not have anything to do with the issue.  After booting up, I noticed that when playing a video from my F: Drive (Seagate), it produced a whine, almost a chirping sound coming from the hard drive bay. I think I may have heard this before the drop, but quieter.  Fearing impending failure I downloaded GSmartControl and inspected the drive information. The Seagate drive displayed a high Raw Read Error Rate, as well as a high Seek Error Rate.  I've read some of these values can be high on Seagate drives from the start. This drive is about 6 months old and the producer of the noise.  I also checked my Toshiba drive, which came with a refurbished prebuilt I bought about a year ago. It showed more normal SMART data, but displayed some concerning statistics (2 "Mechanical Start Failures" and 2 "Reported Uncorrectable Errors").  Both of the drives passed the basic SMART test, but the noise was quite alarming. It would stop as soon as a paused the video and start right up again as soon as I resumed playing.  Here is an album with 3 photos of the SMART data, the Seagate did not display statistics.  Could I please have help interpreting the SMART data, and whether this may indicate an impending failure?   Thank you for your time.   Here are images of the SMART data. I am wondering why matrix factorization techniques in the machine learning domain almost always expect the provided matrix to be non-negative. What is the advantage of this constraint?  Background: I want to use matrix factorization algorithms for a sparse user-item matrix containing positive and negative implicit feedback. Is there any another possibility to set interactions with negative indications apart from fields that denote that no interaction happened between the user and the item? What is the limit of $n \sin (2 \pi \cdot e \cdot n!)$ as $n$ goes to infinity? Why would Louise telling the Chinese commander about his wife's last words change his mind? In the future in Arrival, the commander says that he changed his mind about going to war with the aliens because Louise called his private number and told him his wife's dying words. My question is what did Louise say to him (like in English) and why did it change his mind? Possible Duplicate:          For example the following are the same  # /usr/bin/php updateDatabase.php  # php updateDatabase.php   But how would I infer the location of the php command to be in /usr/bin? Why would one limit username format? Many websites when ask you to create a new "username", will limit you in some way, most often like "username should only contain letters and underscores" or something alike.  This results in inability to use my email as username and forces me to come up with new unique string all the time.  What is the rationale behind this?  Why not just let users use their emails, as a simple to remember and always unique?   What is generally wrong with having symbols like *&amp;%$#@ as a part of username? “The group of fifty people {is / are} going to arrive Thursday” - which is preferred? Isn't the following sentence grammatically correct?     The group of fifty people are going to arrive Thursday.   What's wrong with it? Someone said it should be      The group of fifty people is going to arrive Thursday.   Why? People is plural so why is people is better than people are? I propose to let users vote on closing activities of moderators and other users with closevoting power.  Like this:       closed as exact duplicate by Michael Mrozek, waiwai933, Arjan, YOU, Yi Jiang 6 hours ago      This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question.   Make it like this:     closed as exact duplicate by Michael Mrozek, waiwai933, Arjan, YOU, Yi Jiang 6 hours ago   fair/unfair close? [agree] [disagree]      This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question.   Then the system will gather statistics and automatically grant more closing powers to those users who enjoy support of the community and revoke those powers from those mostly casting contradictory votes.  It would seem that granting the same powers to everybody has not resulted in balance but in public disorder. Perhaps it is reflective of American lifestyle (everybody has the right and means to shoot anybody), but it's not the best way to run a society by far.  What I'm trying to say is that while granting powers to everybody in advance is generous, the maturity to wheel these powers in a fair way must be proven. By introducing community feedback this assessment process can be automatized. I forgot my iPhone 5 passcode when I was changing the code. A window appeared on the device screen saying that iPhone is disabled.  I have Apple ID and password for it. After signing in to iCloud I have erased the device in order to remove the passcode from my iPhone but it still says that device will be erased when device will connect to internet. What would i have to do? find and print file path, without filename I tried this in mysql:  mysql&gt; alter table region drop column country_id;   And got this:  ERROR 1025 (HY000): Error on rename of './product/#sql-14ae_81' to './product/region' (errno: 150)   Any ideas? Foreign key stuff? What are path and contour integrals? I am very confused on what path and contour integrals actually represent. I tried looking for an answer on Google but the only examples were related to Quantum Mechanics. For instance, real Riemann integrals can be thought as &quot;the area under the curve&quot;. What about path/contour integrals? Also, is there a difference between path and contour integrals, or are they the same thing? I've been thinking of contour integrals as path integrals where the path is a &quot;closed loop&quot;, but I'm not sure if that's the case. It's all so confusing, and not being able to visualise these concepts makes it feel like I'm just memorising formulas and theorems without any reason. I have been thinking about path integrals as integrating over a curve in three dimensions. For example, in an $xyz$ coordinate system (with $y$ pointing “up”), we have a path on the $x$-&quot;$z$&quot; plane and integrate over that path. That is, instead of integrating over and along &quot;$y=0$&quot;, we integrate over a certain path. But I don't know if this is a correct way to think of path integrals. This issue has been frustrating me a lot because I'm now studying theorems that involve path/contour integrals and I just can't understand what they really do or mean. By path integral I mean $$\int_{\gamma\vert_{[a,b]}}f(z)\hspace{0.2em}dz = \int_{a}^{b}f(\gamma(t))\cdot\gamma'(t)\hspace{0.2em}dt$$ where $f:U\subseteq\mathbb{C}\rightarrow\mathbb{C}$ is a function that satisfies all conditions for complex integration and $\gamma:[a,b]\rightarrow U\subseteq\mathbb{C}$ is at least a piece-wise regular path. Any help would be appreciated. Ideal column width for paragraphs online There is nothing worse than coming across a website with paragraphs that span the width of your screen resolution. They are usually so hard to read, I don't even bother.  A lot of web designers use generic grid and column systems, but I don't feel these have been optimised for readability, they are more of design guide on general aesthetics.  I guess it comes down to words per line. Are the rules that apply to print media the same for screen media?  Are there any type of guidelines to help me size the width of paragraphs on the screen?  I want to take into consideration:   Major web font faces (i.e. Arial, Verdana, Georgia, Times) A range font sizes (i.e. 8px-24px) Space between columns Questions on perfect squares I recently attended a test which ask me two question based on perfect squares; here they are:  $1.$ How many even perfect squares between $1000$ and $5000$ are divisible by both $5$ and $9$?  $2.$ Can there be a perfect square whose digits consists of exactly $4$ ones, $4$ twos and $4$ zeroes in any order?  I haven't done anything much on perfect squares so I was reluctant to attempt them during exams, although as I had some spare time after finishing the other questions, I tried thinking about the first problem and I noticed that only $3600$ seems to satisfy the conditions, which is correct, but I don't know how to get this mathematically? And for the second problem, I don't have any clue till now.  Unfortunately they haven't given me any solutions for the questions, nor any ideas as to how to solve them (mathematically)? Understanding slice notation I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it. Every subsequence of $x_n$ has a further subsequence which converges to $x$. Then the sequence $x_n$ converges to $x$. Using Replace Geometry to replace selected feature with circle in ArcGIS Desktop? I have a polygon shapefile and I want replace every irregular polygon with a circle.  I think I can do it with the Replace Geometry tool. But once the Replace Geometry tool is selected, draw a polygon mode is immediately entered. If I select the circle tool in the Draw tool window, the Replace Geometry tool becomes inactive.  Is there any way to use the Replace Geometry tool to draw a circle polygon? Capitalization for a bullet list I know $4p^4+1$ can't be square number, cause $4p^4&lt;4p^4+1&lt;4p^4+4p^2+1$ for all natural number p. But I don't know the way to prove $3p^4-3p^2+1$ can(not) be square number. Is there a well known way to prove it?