Sample Header Ad - 728x90

How to call 'ALTER SESSION' inside a sqlplus call in shell script

0 votes
0 answers
929 views
I have a requirement to call ALTER SESSION command within an existing shell script's SQLPlus block. When I tried to call it as EXECUTE IMMEDIATE 'alter session set optimizer_dynamic_sampling=5', it didn't work: I get the ORA error ERROR at line 1: ORA-00922: missing or invalid option. What am I doing wrong here ? Below is the snippet. sqlplus -s << EOS $CONNECT_STRING Whenever SqlError Exit 45; **EXECUTE IMMEDIATE 'alter session set optimizer_dynamic_sampling=5';** exec PACKAGE.PROCEDURE EOS TIA
Asked by Aaron Morales (11 rep)
Oct 31, 2019, 07:18 PM
Last activity: Oct 31, 2019, 11:10 PM