Skip to content
English
  • There are no suggestions because the search field is empty.

KB: Automate the adding / removing / updating of a Oracle connection (Using the powershell DevOps module)

Automate Oracle connections using PowerShell

Applies to: Opslogix Oracle Management Pack (all versions)
Last updated: October 2026 · Latest version: 26.4.4517.0

See also: Upgrade guide for 26.4.4517.0 · Version support · Release notes

If you manage many Oracle database connections, adding and removing them one by one in the "Opslogix Oracle Configuration Dashboard" takes a lot of time. Since V21.09 the Oracle Management Pack includes a PowerShell module for this. With the module you can add, update and remove connections, and assign instance licenses. The examples below handle one connection, but you can easily extend the script to handle many.

The module contains these commands:

  • Add-SCOMOracleConnection: add or update an Oracle connection
  • Get-SCOMOracleConnections: list all current Oracle connections
  • Get-SCOMOracleInstanceLicences: list all current instance license assignments
  • Remove-SCOMOracleConnection: delete an Oracle connection
  • Set-SCOMOracleInstanceLicences: assign or unassign instance licenses

You need a valid Oracle license, imported with the licensing dashboard.

The module is part of the software bundle. Copy the folder "OpsLogix Oracle PowerShellModule" from the installation media to the SCOM management server where the collector is installed, and import it there.

Add-SCOMOracleConnection parameters: -ServerName, -InstanceName, -Port (default 1521), -Username, -PlainPassword, -Role (SYSDBA, SYSOPER, SYSDG or empty for a normal user), -ResourcepoolName (display name of the SCOM resource pool) and the optional -OpsMgrSDK (SCOM management server to connect to, default localhost).

Example script

## Automate the adding / removing / updating of an Oracle connection (using the PowerShell module)
## Notice: run on a SCOM server where the Opslogix Oracle collector is installed.
## Notice: copy the folder "OpsLogix Oracle PowerShellModule" from the installation media.

# load the module (change the path to the location of the installation package)
Import-Module "C:\Install\OpsLogix Oracle PowerShellModule\OpsLogix.IMP.Oracle.PowerShellModule.dll"

# check that the module is loaded and list its commands
Get-Module 'OpsLogix.IMP.Oracle.PowerShellModule'
Get-Command -Module 'OpsLogix.IMP.Oracle.PowerShellModule'

# connection details
$ServerName = "oradb01.contoso.com"
$InstanceName = "ORCL19"
$Port = 1521
$Username = "opslogix"
$PlainPassword = "secretpassword"
$Role = "" # SYSDBA | SYSOPER | SYSDG, or "" for a normal user
$ResourcepoolName = "OpsLogix Resource Pool for the Oracle Management Pack"

# add the connection (an existing connection is updated)
Add-SCOMOracleConnection -ServerName $ServerName -InstanceName $InstanceName -Port $Port -Username $Username -PlainPassword $PlainPassword -Role $Role -ResourcepoolName $ResourcepoolName

# give SCOM time to process the change
Start-Sleep -Seconds 120

# list the Oracle connections and select one
$instances = Get-SCOMOracleConnections
$instances | Where-Object -Property MonitoringObject -Match 'oradb01.contoso.com:ORCL19' | Select-Object MonitoringObject

# assign instance licenses
# use a regular expression in -ConnectionRegEx to select connections; this assigns only ORCL19
Set-SCOMOracleInstanceLicences -ConnectionRegEx "(ORCL19)"
# without a filter, every connection gets a license as long as licenses are available
Set-SCOMOracleInstanceLicences

# unassign a license with -Assign $false
Set-SCOMOracleInstanceLicences -ConnectionRegEx "(ORCL19)" -Assign $false

# show the current license assignments
Get-SCOMOracleInstanceLicences

# remove an Oracle connection
Remove-SCOMOracleConnection -ServerName oradb01.contoso.com -InstanceName ORCL19