Showing posts with label scripts. Show all posts
Showing posts with label scripts. Show all posts

Aug 10, 2023

Error Powershell "Attempt to load Oracle client libraries threw BadImageFormatException"


If you have this issue at connect to oracle database from powershell using [Reflection.Assembly]::LoadWithPartialName("System.Data.OracleClient"), error:

"Attempt to load Oracle client libraries threw BadImageFormatException.  This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed."

That is because you have oracle client library 32 bits version on windows SO 64 bits version.

The Solution for this is use the powershell 32 bits version. So you must to replace from your command line:

powershell -executionpolicy bypass -file script_powershell.ps1


to this:

C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe  -executionpolicy bypass -file script_powershell.ps1


That's all, i hope this will help.

NOTE: pls don't forget use try/catch commands in your powershell script for view issues or errors like this case, example:

    catch{
        echo "ERROR"
        Write-Host $_
        Write-Host $_.ScriptStackTrace
    }

Nov 22, 2019

AWR to text with filter and sections



Hi,

 here bring for you a new script for get information about AWR performance, but right now applying certain filter for review only sections like: "Top Timed Foreground Events", "Database Summary", etc.. For my script i use the package DBMS_WORKLOAD_REPOSITORY.AWR_GLOBAL_REPORT_TEXT with some aggregate functions (warning before you execute this script you should care about your license, you need diagnostic pack License )

source script:
https://github.com/felipower/scripts_oracle/blob/master/FDB_Oracle_AWR_summary_filtered.sql

Example (screenshots for execution)


Enjoy the script and share it.