-
-
I’ve just returned from the User Group Meeting in Edinburgh by train. Ok I have a masochistic streak that maybe I should see a shrink about, but when my last connection didn’t turn up, today’s journey ended up being an 8.5 hour nightmare.
My first two trains ran on time, and although they were a bit crowded I managed to get a seat and read my book. I did note that I could have travel to London on my first train in two hours less than my planned journey time.
On the third connection people were standing up the length of the train. This was a two unit train when four would have been a better size. Running trains and computing have a lot of similarities they are both networks and you can learn a lot by not following the example of Network Rail and the train providers.
When we came into the station, the guard announce that he was “Sorry for any inconvenience to passengers who had had to stand for their journey” which was kind of nice although he could have sounded a bit more sincere, “The problem is due to too many customers on the service”.
-
-
I was looking at the topic “How to: Enable or Disable a Server Network Protocol (SQL Server PowerShell)” books online to enable the TCP protocol for a SQL Server instance using Powershell. So I started up SQLPS from object explorer and posted the following script into the window.
$wmi = new-object ('Microsoft.SqlServer.Management.Smo.WMI.ManagedComputer') .
$uri = "ManagedComputer[@Name='" + (get-item env:\computername).Value + "']/ServerInstance[@Name='MSSQLSERVER']/ServerProtocol"
$tcp = $wmi.getsmoobject($uri + "[@Name='Tcp']")
$tcp.IsEnabled = $true
$tcp.alter()
$tcp
Unfortunately this gave me an error:
Exception calling "Alter" with "0" argument(s): "Alter failed. "
At line:1 char:11
+ $tcp.alter( <<<< )
I was dumbfounded!!! How could books online be promoting incorrect code? So I trawled the internet and came up with nothing :( Then a flash of inspiration came to me (hopefully not my last!) and that was to run Powershell as an administrator. Et voila it worked.
This raised the problem of how do you start SQLPS from the Object Explorer as an administrator. The solution is to start Management studio as an administrator and the script will work.
So the only question remaining is "Why does this error occur when it's a permissions issue?"
-
-
Thanks to everyone who came to the user group meeting in Edinburgh last night. We had a great atmosphere and lots of interaction made a great meeting. Congratulations to the competition winners I hope you enjoy the books and find them useful.
Rob gave a very interesting talk on SQLDiag, SQL Nexus and PAL so I hope you will go off an play with them so when you hit your own performance problems you can resolve them quickly and easily. Rob's going to post useful links on his blog http://blogs.technet.com/rob/ so you can easily find everything.
There was good feedback on Powershell and I hope you are stimulated into finding out more. There are plenty of posts on this blog about scripting and many other articles readily available on the internet, but if you do have a powershell problem let me know and I will try and blog about it.
You can find my slide deck here.