< Back

Ping-OracleDB

Thu Jan 16, 2020 8:38 am

NAME Ping-OracleDB



SYNOPSIS

Checks that the database is reachable by leveraging TNS Ping





SYNTAX

Ping-OracleDB [-TargetDB] <String[]> [-Full] [[-Timeout] <Int32>] [[-Parallelism] <Int32>] [<CommonParameters>]





DESCRIPTION

This function returns $true if the tnsping is successful, $false otherwise





PARAMETERS

-TargetDB <String[]>

It can check several databases at once



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Full [<SwitchParameter>]

Flag to get full output or only boolean



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Timeout <Int32>

Parallelism degree desired



Required? false

Position? 2

Default value 15

Accept pipeline input? false

Accept wildcard characters? false



-Parallelism <Int32>

Parallelism degree desired



Required? false

Position? 3

Default value 1

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>if (Ping-OracleDB -TargetDB orcl) {



Write-Output "Database pinged successfully"

<Some commands>

}









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>if (Ping-OracleDB -TargetDB orcl -Full | Select-Object -Property PingStatus) {



Write-Output "Database pinged successfully"

<Some commands>

} else {

Write-Warning Ping-OracleDB -TargetDB orcl | Select-Object -Property PingResult

}











RELATED LINKS