Hello Arevind,
WFA has readonly databases that is pulls from OCUM/DFM, but it does not have OCI as a datasource.
Therefore when you try to pull information from WFA, it does not connect to the OCI datawarehouse.
In order to connect to the OCI datawarehouse and run a query, you need some powershell code. The following code can retrieve your query, just paste it on a new command, it will write the results on c:\temp\ocitest.csv
You will need to change the $MySQLHost variable.
function Invoke-MySQL {
Param(
[Parameter(
Mandatory = $true,
ParameterSetName = '',
ValueFromPipeline = $true)]
[string]$Query
)
$MySQLAdminUserName = 'dwhuser'
$MySQLAdminPassword = 'netapp123'
$MySQLDatabase = 'dwh_inventory'
$MySQLHost = 'OCIDWHSERVER.yourdomain.com'
$ConnectionString = "server=" + $MySQLHost + "; port=3306; uid=" + $MySQLAdminUserName + "; pwd=" + $MySQLAdminPassword + "; database="+$MySQLDatabase
Try {
[void][System.Reflection.Assembly]::LoadWithPartialName("MySql.Data")
$Connection = New-Object MySql.Data.MySqlClient.MySqlConnection
$Connection.ConnectionString = $ConnectionString
$Connection.Open()
$Command = New-Object MySql.Data.MySqlClient.MySqlCommand($Query, $Connection)
$DataAdapter = New-Object MySql.Data.MySqlClient.MySqlDataAdapter($Command)
$DataSet = New-Object System.Data.DataSet
$RecordCount = $dataAdapter.Fill($dataSet, "data")
$Command.Dispose()
#$Table=$DataSet.Tables["data"] | FT -auto
$DataSet.Tables["data"] | Export-Csv "c:\temp\ocitest.csv"
Get-WFALogger -Info -message $("OCI query result" + $DataSet.Tables["data"] )
}
Catch {
throw "ERROR : Unable to run query : $query `n$Error[0]"
}
Finally {
$Connection.Close()
}
} # end function Invoke-MYSQL
$result = Invoke-MySQL -Query " select * from dwh_inventory.volume "
Let me know if it helped.