Showing posts from November, 2013

Simple Script to return Table from CSV in Oracle

That's T-SQL a 'select ... where @tablevar' can be over int or string. But in Oracle the IN will only work over number values, thus we must cast TO_NUMBER. That was fun =).

SELECT TO_NUMBER(column_value) FROM XMLTABLE(<csv_string>)

Migrate from SQL Server to Oracle in .NET using Devart

Steps to migrate from SQL Server to Oracle for Shuts Project.
1.Download and install Oracle Database 11g – Personal Edition – this edition offers the full feature set of Enterprise Edition and is targeted for development/staging.
2.Download and install JDK 7.
3.Upgrade the SQL Developer from 2.x to
4.Launch SQL Developer and use the Migration workbench to capture an external database.
a.Click tools -> migration -> Create database capture scripts
5.Copy the capture scripts to the target server. Execute OMWB_OFFLINE_CAPTURE.BAT and pass in parameters for username/password and target db.
rem%1 DBA login id
rem%2 password
rem%3 database name
rem%4 database server name
6.Copy output of capture Oracle server.
7.Create a new oracle database ‘orclshuts’ using the Data Configuration Assistant.
8.Create a new oracle database ‘repo’ using the Data Configuration Assistant.
9.Using SQL Developer login to the newly created database
a.Right click on the new connection

SharePoint Set Locale Region on All Web Applications and Site Collections

A quick script works on both SharePoint 2010 and 2013. Make sure to update en-AU to the target locale you are after =).


$farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
$websvcs = $farm.Services | ? -FilterScript {$_.GetType() -eq [Microsoft.SharePoint.Administration.SPWebService]}
$webapps = @()
foreach ($websvc in $websvcs)
$NewLocale = "en-AU"
foreach ($webApp in $websvc.WebApplications)
foreach ($site in $webApp.Sites)
Write-Host "Updating Site -" $site -ForegroundColor "Green"

$Webs = $site.AllWebs
ForEach ($Web In $Webs)
   If ($Web.locale -ne $NewLocale)
      Write-Host $Web.title "- " -NoNewLine; Write-Host "changing from" $Web.locale "to" $NewLocale -ForegroundColor "Green"
      $Web.Locale = $NewLocale
   Else { Write-Host $Web.title "- " -NoNewLine; Write-H…