JAMS enables you to run Oracle SQL Windows Jobs by using the Oracle activities in a Workflow Job or the Oracle tasks in a Sequence Job. If you need to use more complex PowerShell commands in your Oracle SQL Windows Jobs, you can create an Execution Method by following the instructions below.
- Click Execution Methods from the JAMS Shortcuts menu. Click More if you do not see this option.
- Click + to add an Execution Method.
- Type a name for the Execution Method, such as PowerShell_OracleSQLPlus.
- Select PowerShell as the Base Method.
- Click Ok. The properties of the Execution Method window opens.
- Click the Template tab and copy and paste the information listed in the template below.
Set-Alias sqlplus "C:\Program Files\Oracle\SqlPlus.exe"
Write-Host "Executing SQL Script"
@"
<<JAMS.Source>>
"@ | sqlplus -Silent <<OraUsername>>/<<OraPassword>>@<<ORACLE_SID>>
NOTE: <<OraUsername>>, <<OraPassword>>, and <<ORACLE_SID>> are Parameters on the Execution Method.
- Click the Parameters tab.
- Click + to create the OraUsername, OraPassword, and ORACLE_SID Parameters with Text as the Type. The Default Value will be the username, password, and the SID for your Oracle instance.
NOTE: A central username and password can be stored in the OraUsername and the OraPassword Parameters on the Execution Method, Folder, or individual Job levels for any of the Jobs you choose to use this Execution Method.
- Click Save and Close.
- Create a new JAMS Job using your new Oracle SQL Execution Method.
- Enter your SQL Source directly in the Job's Source tab.
- Click Save and Close.
Comments