Called through chef recipe, SQLPLUS unable to identify Oracle_Home environment variable in Windows 12R2

Hisat

New Member
#1
I am running a chef recipe using chef client, which sets ORACLE_BASE, ORACLE_HOME and ORACLE_SID environment variables and then executes oracle sql scripts to create a database instance.

Environment variables are set using a windows batch file (.bat)
Mã:
SET ORACLE_BASE=C:\<ora_base>
SET ORACLE_HOME=C:\<ora_base>product\12.2.0
Then the sql script file is executed in the same batch file.
Mã:
<Dir>\path\product\12.2.0\dbhome_1\bin\sqlplus /nolog @C:\files\myscript.sql
I used chef resource 'batch' with the above code as well, still the same error was thrown. Sqlplus is unable to see the oracle_home environment variable.
STDERR: Error 6 initializing SQL*Plus
SP2-0667: Message file sp1.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
Why does the oracle_home is not visible to the chef recipe execution ? Can some one please provide a solution to execute the sql scripts without getting this error.
 

Admin

Administrator
Thành viên BQT
#2
Your ORACLE_HOME doesn't match the path you're launching SQL*Plus from. It's a little hard to be sure as you've different shortened versions, but you seem to have just left the dbhome_1 part off:
Mã:
SET ORACLE_BASE=C:\<ora_base>
SET ORACLE_HOME=C:\<ora_base>\product\12.2.0\dbhome_1
or possibly, if they are different:
Mã:
SET ORACLE_BASE=<Dir>\path
SET ORACLE_HOME=<Dir>\path\product\12.2.0\dbhome_1
 
OP
OP
H

Hisat

New Member
#3
Thanks so much !!! That was the cause, I had added ORACLE_HOME=C:\<ora_base>\product\12.2.0 instead of ORACLE_HOME=C:\<ora_base>\product\12.2.0\dbhome_1 which is the correct path.
 
Top