Thursday, April 15, 2021

SQL Developer Dropping Connections – Solved

The solution is to add this following line:
AddVMOption -Doracle.net.disableOob=true
to the sqldeveloper.conf file.

The root cause is explained in the following article.
Brendan Tierney – Oralytics Blog: SQL Developer is dropping connections

Monday, April 5, 2021

Filtering Empty Values in PowerShell

This information is from Jeffery Hicks’s The Lonely Adminstrator website. All credits go to the him and all the blog contributors. I added here so I can remember the tips for myself.

The posted tip used an example where you wanted to find processes where the company name is defined. The way suggested in the tip, and a technique I see often goes something like this:
PS C:\> get-process | where {$_.Company -ne $Null} | Sort Company| Select Name,ID,Company
While it mostly works, this is a better PowerShell approach, in my opinion.
PS C:\> get-process | where {$_.Company} | Sort Company| Select Name,ID,Company”
When I run the first technique, I still got a blank company name. The tip offers a work around for this situation like this:
PS C:\> get-process | where {$_.Company -ne $Null -AND $_.company -ne ”} | Sort Company| Select Name,ID,Company
This gives the same result as my suggested approach. My approach uses Where-Object to say, if the Company property exists, pass on the object. If you wanted to find processes without a company name, then use the -NOT operator.
PS C:\> get-process | where {-Not $_.Company}
I use a similar technique to filter out blank lines in text files.
get-content computers.txt | where {$_} …
While we’re on the subject, a related filtering technique I often see involves boolean properties. You don’t have to do this:
PS C:\> dir | where {$_.PsIsContainer -eq $True}
PsIsContainer is a boolean value, so let Where-Object simply evaluate it:
PS C:\> dir | where {$_.PsIsContainer}
As above, use -Not to get the inverse. Don’t feel you need to explicitly evaluate properties in a Where-Object expression. I see this is a VBScript transition symptom that I hope you can break.