Skip to main content

Posts

Showing posts from 2013

Juniper VPN Client causes RDP connection isses

On Windows 8 running RDP over Juniper client causes connectivity lost every couple of seconds. To fix this issue you need to disable UDP when accessing the servers via RDP protocol. In Local Group Policy editor (gpedit.msc) navigate to Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Connection Client -> and then enable the 'Turn Off UDP on client" policy. And then you can reliably reconnect  via RDP

Visual Studio 2012 - "Class already exists" when opening Model.bim

When opening Model.bim in Visual Studio 2012 (with update 2 installed) I got an error                    Class already exists and in the application log the Event ID 25 was also logged saying The description for Event ID 25 from source MSOLAP$LocalCube cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer. If the event originated on another computer, the display information had to be saved with the event. The following information was included with the event:  msmdsrv.rll 4105 4105 is locale ID corresponding to English (Canada). When I changed the language settings in Control Panel to English(US) the errors is gone and I can successfully open Model.bim file

Disable animation in Office 2013

If you have the animation in Office 2013 application you can disable it by modifying the registry (it will disable animation in all office 2013 applications). Navigate to this key HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common\Graphics and add a new DWORD value DisableAnimations Set it to 1 to disable the animation (you'll need to close and re--launch the application) or change it back to 0 to re-enable it

A simple script to test server performance based on number of small SQL transactions

For testing the performance impact of enabling synchronous replica on AlwaysOn 3-node cluster (see  http://smizrohi.blogspot.ca/2013/01/sql-2012-alwayson-synchronous-vs.html ) I used s simple test script presented here. The first part of the script is a CMD file called DB_Load.CMD If you use this script then you need to change the parameters defined by the SET statements within the script: SRV is a name of the SQL server to connect to (SQLDEVCLUSTER1) DBNAME is a name of a test database (Test_DB3) TIMEINTERVAL - defines the initial delay in ShowStats and then each loop is also paused by that amount of seconds NumOfClients is the number of concurrent sessions MODE means: MODE=1 means Creating the DB, the Tables, and the Procedures MODE=2 means Creating the Tables, and Procedures (the DB has already been created) MODE=3 means Creating the Procedures (the DB has already been created) And check if SQLCMD path on you server is the same as defined by the SQLCMD param

SQL Server 2012 partitioned table statistics update behavior change when rebuilding index

Jack Li from MS SQL Server support blogged about the change in http://blogs.msdn.com/b/psssql/archive/2013/03/19/sql-server-2012-partitioned-table-statistics-update-behavior-change-when-rebuilding-index.aspx Here is what he said: In past versions, when you rebuild an index, you will get statistics update equivalent to FULLSCAN for free.    This is true regardless if the table is partitioned table or not. But SQL Server 2012 changed the behavior for partitioned table.    If a table is partitioned, ALTER INDEX REBUILD will only update statistics for that index with default sampling rate.  In other words, it is no longer a FULLSCAN.  This is documented in  http://technet.microsoft.com/en-us/library/ms188388.aspx .  But lots of users do not realized that.  If you want fullscan, you will need to run UPDATE STATISTCS WITH FULLSCAN .   This change was made because we started to support large number of partitions up to 15000 by default.  Previous versions did support 15000 partition

Testing Connection String with PowerShell

To test a connection string (in my case with MultisubnetFailover parameter) I used this simple PowerShell script: $ConStr=' Server=SQLdevCluster1;Database=TESTDB1;Trusted_Connection=yes;Provider=SQLNCLI11;MultisubnetFailover=TRUE ' $conn = New-Object System.Data.OleDb.OleDbConnection $conn.ConnectionString = $ConStr $conn.Open() $Tables = $Conn.GetOleDbSchemaTable([System.Data.OleDb.OleDbSchemaGuid]::tables,$null)  $Tables | FT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE,DATE_CREATED | More $conn.Close() The server must have SQL 2012 native client installed and the account you use to run this script must have permissions to connect to the SQL server (SQLDEVCluster1) and access the database (TESTDB1)

PowerShell scripts to upload/download files to/from SharePoint 2010 Library

to download all files from a SharePoint library Function Get-FilesFromSPSLibrary { Param ( [string] $FolderPath, [string] $SiteURL, [string] $ListTitle ) if (-NOT (Test-Path $FolderPath -PathType 'Container'))  {            write-host "`n[$($FolderPath)] is not a valid folder or you have no access to it`n`n"  return         } [net.httpWebRequest] $req = [net.webRequest]::create($SiteURL) $req.Method = "HEAD" $Req.UseDefaultCredentials = $true; try { [net.httpWebResponse] $res = $req.getResponse() } Catch {   write-host "`nSite [$SiteURL] is inaccessible`n" return } $MySite = Get-SPWeb -Identity $SiteURL $Mylist = $MySite.Lists[$ListTitle]  if ($Mylist -eq $null)  {  write-host "Unable to open list [$ListTitle] at [$SiteURL]" return }  ForEach ($Fl in $MyList.Items) { $fname=$Folderpath+$fl.Name write-host "Downloading [$($Fl.url)] ..." $binary=$My

Recursive Report to Traverse Time Hierarchy

I need to create a report that allows end-users to select multiple items from the Date hierarchy (e.g., Year-2007, Q4-Year-2006, November-2007) and then the report should show a chart and a table with measures for the selected periods like this one (using the Adventure Works cube from SQL 2012) And the next requirement is to allow users to click on the date in the table (e.g., Q4 CY 2006) and the reports will show the same information but for all direct children of the selected time period  (e.g., Oct 2006, Nov 2006, Dec 2006) like this one: And if a user clicks on the month it will get the report for all dates in the selected month. I started with Query designer and placed "Internet Sales Amount", Category (from the Product dimension) , and the Date.Calendar hierarchy. I also add the Date.Calendar hierarchy to the parameters panel. When I changed the design mode the MDX script generated by the Query Designer is this (slightly reformatted) SELECT  NON EM

SQL 2012 AlwaysOn - Recovery from a Disaster

We have configured 3 SQL server in an AlwaysOn Availability group (see  here) Two servers (SQLDEV1 and SQLDEV2) are configured for automatic failover. To test how long it takes for SQL Server to fail over from SQLDEV1 to SQLDEV2 we connect to the availability group listener name (sqldevcluster1) and on the "Additional Connection Parameters" tab we need to add Multisubnetfailover=TRUE We can check the current status of the servers in the availability group with this query select rs . role_desc , rs . connected_state_desc , rs . synchronization_health_desc , cs . replica_server_name from sys . dm_hadr_availability_replica_states AS rs JOIN sys . dm_hadr_availability_replica_cluster_states as CS ON rs . replica_id = cs . replica_id and it returns If we connect to SQLDEV2 and initiate manual failover ALTER AVAILABILITY GROUP AG1 FAILOVER ; this statement takes 17 seconds to complete. And if we check the status of the a