Tuesday, April 10, 2018

Why is Powershell blocking scripts from UNC paths?

If you are seeing errors and warnings trying to execute Powershell scripts from UNC paths on Windows 2012 and you have the IE enhanced security turned on  Powershell won't' automatically execute your scripts.

You will get a prompt like so; 'Run only scripts that you trust'.


The reason for this is that Windows treats the UNC paths as being from the internet and therefore doesn't trust anything on the UNC path

There are two solutions to this issue.

1. Add the UNC paths to the trusted sites list (either Via Regedit or GUI)
or
2. Turn off the Enhanced security
As a side note; some sites recommend using the unblock-file cmdlet but I've found that it doesn't address the issue of trusting the UNC paths.

If you find this article useful please leave me a comment.

Wednesday, March 21, 2018

Why haven't we automated trains yet?

It seems it would be easier to automate trains before we automate cars. what's the holdup Sydney?

If you find this article useful please leave me a comment.

Friday, March 16, 2018

Android Wear changing to WearOS

So Google is changing the name of Android Wear into WearOS. big whoop.


https://wearos.google.com/


If you find this article useful please leave me a comment.

Thursday, March 08, 2018

SQL Server – Check Index Fragmentation on ALL Indexes in a Database | My Adventures in Coding

SQL Server – Check Index Fragmentation on ALL Indexes in a Database | My Adventures in Coding: "Check Index Fragmentation on ALL Indexes in a Database"



I found this quite useful. Only thing I wish I had taken a before screenshot before rebuilding the indexes using Ola Hallgren scripts.



'via Blog this' If you find this article useful please leave me a comment.

Monday, February 26, 2018

Carnival Legend: How to make cruises great again

Carnival Legend: How to make cruises great again:



Dear Scott,



 I believe your opinion of Carnival is gravely misplaced.



 Personally, I can think of plenty of other things worse than a cruise holiday.  I travelled on the Carnival Spirit last year and I did not find our family of 5 packed into like sardines at all. I found my holiday pleasant and the staff friendly and the island hopping was a fantastic experience.



I travelled safe and sound throughout my whole holiday. Yes, I had seen plenty of news reports about gastro outbreaks on cruise ships. I must have been one of the lucky ones that escaped without a gastro incident just like the 1000's of others that travelled with me last year. 



I've also been to Airlie Beach and I can see the two holidays are completely different and simply can't be related to anything but saying they are both holidays.. one is mostly on land where the other is mostly on the sea.



During my travels with Carnival, I found most people nice and friendly or had travelled from overseas just to cruise. Most of the time it was just families, couples and singles wanting to have a good time and create some great memories.



Simply put if you get on a ship looking for a fight you shouldn't be there in the first place. but unfortunately, there will be dickheads no matter where we go on this planet.



'via Blog this' If you find this article useful please leave me a comment.

Wednesday, February 14, 2018

Maybe don't set your database to 100% growth.

It's not a good idea to set your databases to  % growth anyway but setting them to 100% is just horrible. Every time your database has to grow when setting to 100% it will double in size a couple of those growth cycles and you'll be out of storage real soon.

Better to set to an actual MB limit based on the size of your HDD. I.e if your Database drive is 1000MB only set it to 64MB or 128MB growth. that way you can see your DB grow over time



If you find this article useful please leave me a comment.

Monday, January 08, 2018

Remove SQL 2012 performance dashboard

Microsoft in a recent update to SSMS put the Performance Dashboard directly into SSMS so you no longer need to manually install it on remote servers. Microsoft hasn't included a script to remove it, the easiest way to remove it is to manually edit the original script and rerun it

 Lucky for you I can save you 5 minutes of editing


USE [MSDB]
if OBJECTPROPERTY(object_id('MS_PerfDashboard.tblConfigValues'), 'IsUserTable') = 1drop table MS_PerfDashboard.tblConfigValuesgo
if object_id('MS_PerfDashboard.usp_CheckDependencies', 'P') is not null drop procedure MS_PerfDashboard.usp_CheckDependenciesgo
if not exists (select * from sys.schemas where name = 'MS_PerfDashboard') exec('create schema MS_PerfDashboard')go
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_WaitTypeCategory'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_WaitTypeCategorygo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_QueryTextFromHandle'), 'IsTableFunction') = 1 drop function MS_PerfDashboard.fn_QueryTextFromHandlego
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_hexstrtovarbin'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_hexstrtovarbingo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_DatediffMilliseconds'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_DatediffMillisecondsgo

if object_id('MS_PerfDashboard.usp_Main_GetCPUHistory', 'P') is not null drop procedure MS_PerfDashboard.usp_Main_GetCPUHistorygo

if object_id('MS_PerfDashboard.usp_Main_GetMiscInfo', 'P') is not null drop procedure MS_PerfDashboard.usp_Main_GetMiscInfogo
if object_id('MS_PerfDashboard.usp_Main_GetSessionInfo', 'P') is not null drop procedure MS_PerfDashboard.usp_Main_GetSessionInfogo
if object_id('MS_PerfDashboard.usp_Main_GetRequestInfo', 'P') is not null drop procedure MS_PerfDashboard.usp_Main_GetRequestInfogo
if object_id('MS_PerfDashboard.usp_Main_GetRequestWaits', 'P') is not null drop procedure MS_PerfDashboard.usp_Main_GetRequestWaitsgo
if object_id('MS_PerfDashboard.usp_GetPageDetails', 'P') is not null drop procedure MS_PerfDashboard.usp_GetPageDetailsgo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.usp_GetPlanGuideDetails'), 'IsProcedure') = 1 drop procedure MS_PerfDashboard.usp_GetPlanGuideDetailsgo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.usp_TransformShowplanXMLToTable'), 'IsProcedure') = 1 drop procedure MS_PerfDashboard.usp_TransformShowplanXMLToTablego
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanBuildColumnReference'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanBuildColumnReferencego
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanBuildColumnReferenceList'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanBuildColumnReferenceListgo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanBuildDefinedValuesList'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanBuildDefinedValuesListgo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanBuildOrderBy'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanBuildOrderBygo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanBuildRowset'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanBuildRowsetgo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanBuildScalarExpression'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanBuildScalarExpressiongo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanBuildScalarExpressionList'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanBuildScalarExpressionListgo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanBuildScanRange'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanBuildScanRangego
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanBuildSeekPredicates'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanBuildSeekPredicatesgo

if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanBuildSeekPredicatesNew'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanBuildSeekPredicatesNewgo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanBuildSeekPredicate'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanBuildSeekPredicatego
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanBuildObject'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanBuildObjectgo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanBuildWarnings'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanBuildWarningsgo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatAssert'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatAssertgo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatBitmap'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatBitmapgo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatComputeScalar'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatComputeScalargo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatConcat'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatConcatgo

if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatCollapse'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatCollapsego
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatConstantScan'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatConstantScango
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatDeletedInsertedScan'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatDeletedInsertedScango
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatFilter'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatFiltergo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatHashMatch'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatHashMatchgo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatMerge'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatMergego

if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatNestedLoops'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatNestedLoopsgo

if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatParallelism'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatParallelismgo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatSimpleUpdate'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatSimpleUpdatego
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatRemoteQuery'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatRemoteQuerygo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatRemoteScan'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatRemoteScango
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatRemoteModify'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatRemoteModifygo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatSort'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatSortgo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatSplit'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatSplitgo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatStreamAggregate'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatStreamAggregatego
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatSegment'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatSegmentgo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatSpool'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatSpoolgo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatTableScan'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatTableScango
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatTop'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatTopgo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatTVF'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatTVFgo

if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatUDX'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatUDXgo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatUpdate'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatUpdatego
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatRIDLookup'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatRIDLookupgo
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanFormatGenericUpdate'), 'IsScalarFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanFormatGenericUpdatego
if OBJECTPROPERTY(object_id('MS_PerfDashboard.fn_ShowplanRowDetails'), 'IsTableFunction') = 1 drop function MS_PerfDashboard.fn_ShowplanRowDetailsgo
if object_id('MS_PerfDashboard.usp_DatabaseOverview', 'P') is not null drop procedure MS_PerfDashboard.usp_DatabaseOverviewgo

if object_id('MS_PerfDashboard.usp_LargeIOObjects', 'P') is not null drop procedure MS_PerfDashboard.usp_LargeIOObjectsgo
if object_id('MS_PerfDashboard.usp_DBFileIO', 'P') is not null drop procedure MS_PerfDashboard.usp_DBFileIOgo
if object_id('MS_PerfDashboard.usp_DmOsWaitStats', 'P') is not null drop procedure MS_PerfDashboard.usp_DmOsWaitStatsgo
if object_id('MS_PerfDashboard.usp_MissingIndexes', 'P') is not null drop procedure MS_PerfDashboard.usp_MissingIndexesgo

if object_id('MS_PerfDashboard.usp_QueryText', 'P') is not null drop procedure MS_PerfDashboard.usp_QueryTextgo
if object_id('MS_PerfDashboard.usp_MissingIndexStats', 'P') is not null drop procedure MS_PerfDashboard.usp_MissingIndexStatsgo
if object_id('MS_PerfDashboard.usp_QueryAttributes', 'P') is not null drop procedure MS_PerfDashboard.usp_QueryAttributesgo
if object_id('MS_PerfDashboard.usp_ShowplanAttributes', 'P') is not null drop procedure MS_PerfDashboard.usp_ShowplanAttributesgo
if object_id('MS_PerfDashboard.usp_PlanParameters', 'P') is not null drop procedure MS_PerfDashboard.usp_PlanParametersgo
if object_id('MS_PerfDashboard.usp_QueryStatsTopN', 'P') is not null drop procedure MS_PerfDashboard.usp_QueryStatsTopNgo
if object_id('MS_PerfDashboard.usp_QueryStatsTopN1', 'P') is not null drop procedure MS_PerfDashboard.usp_QueryStatsTopN1go
if object_id('MS_PerfDashboard.usp_QueryStatsRecentActivity', 'P') is not null drop procedure MS_PerfDashboard.usp_QueryStatsRecentActivitygo
if object_id('MS_PerfDashboard.usp_SessionRequestActivity', 'P') is not null drop procedure MS_PerfDashboard.usp_SessionRequestActivitygo
if object_id('MS_PerfDashboard.usp_RequestDetails', 'P') is not null drop procedure MS_PerfDashboard.usp_RequestDetailsgo
if object_id('MS_PerfDashboard.usp_SessionData', 'P') is not null drop procedure MS_PerfDashboard.usp_SessionDatago
if object_id('MS_PerfDashboard.usp_SessionRequests', 'P') is not null drop procedure MS_PerfDashboard.usp_SessionRequestsgo
if object_id('MS_PerfDashboard.usp_LastBatchForIdleSession', 'P') is not null drop procedure MS_PerfDashboard.usp_LastBatchForIdleSessiongo
if object_id('MS_PerfDashboard.usp_SessionDetails', 'P') is not null drop procedure MS_PerfDashboard.usp_SessionDetailsgo
if object_id('MS_PerfDashboard.usp_TraceEventColumns', 'P') is not null drop procedure MS_PerfDashboard.usp_TraceEventColumnsgo
if object_id('MS_PerfDashboard.usp_Blocking', 'P') is not null drop procedure MS_PerfDashboard.usp_Blockinggo
if object_id('MS_PerfDashboard.usp_RequestIoWaits', 'P') is not null drop procedure MS_PerfDashboard.usp_RequestIoWaitsgo
if object_id('MS_PerfDashboard.usp_LargestIoRequests', 'P') is not null drop procedure MS_PerfDashboard.usp_LargestIoRequestsgo
if object_id('MS_PerfDashboard.usp_RequestWaits', 'P') is not null drop procedure MS_PerfDashboard.usp_RequestWaitsgo
if object_id('MS_PerfDashboard.usp_LatchStats', 'P') is not null drop procedure MS_PerfDashboard.usp_LatchStatsgo
if object_id('MS_PerfDashboard.usp_RequestsWithLatchWaits', 'P') is not null drop procedure MS_PerfDashboard.usp_RequestsWithLatchWaitsgo
if object_id('MS_PerfDashboard.usp_XEventSessions', 'P') is not null drop procedure MS_PerfDashboard.usp_XEventSessionsgo
if object_id('MS_PerfDashboard.usp_QueryStatsDetails ', 'P') is not null drop procedure MS_PerfDashboard.usp_QueryStatsDetails go





If you find this article useful please leave me a comment.