AJAY3
Contributor
Contributor

Read output of Invoke a Powershell script as a variable in a Vrealize orchestrator - Oracle ODG

I am writing a workflow for Oracle ODG " Switchover and Switch back". I am able to connect the Primary database and ran the query successfully. However, when I am adding secondary database it is showing not in view or open mode as secondary standby database is in mount state. So I decided to connect the Secondary database from OS with Powershell to which I am successful.
I have a script on Secondary system which can fetch the name and mode of the database successfully. When I ran the workflow to invoke the powershell script; it runs and give me the output in logs as shown below. Now I am not able to capture this session output in variable; so that I can compare it and then pass it for my be next action or workflow. The script is written as bat file and runs successfully on local server through powershell and also from Vrealize orchestrator workflow "invoke the powershell script". I want to capture just status of DB as Mounted and if it is true then need to execute next workflow or action
Just also wanted to update I am using Service name to connect the database of Secondary

Logs from VRO:

2021-09-05 21:31:06.327 +05:30INFO__item_stack:/item0
2021-09-05 21:31:12.438 +05:30DEBUGInvoke command in session feb25ca8-0565-4dc6-a37a-1569626bca17
2021-09-05 21:31:14.105 +05:30INFO
C:\Users\Administrator>cls
\u000C
C:\Users\Administrator>set ORACLE_HOME=K:\Oracle\product\12202\db_1

C:\Users\Administrator>set ORACLE_SID=TCITDB

C:\Users\Administrator>sqlplus "sys/oracle@TCITDR as sysdba" @C:\Users\Administrator\Desktop\Report\TCITDB_Report\Script\TCITDR_CHECK.sql

SQL*Plus: Release 12.2.0.1.0 Production on Sun Sep 5 21:31:12 2021

Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

NAME OPEN_MODE
--------- --------------------
TCITDB MOUNTED

Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
2021-09-05 21:31:14.145 +05:30INFO__item_stack:/item5

0 Kudos
0 Replies