Error 46 initializing SQL plus on windows 2012

Hi Experts,
could you help me with this error pls

Trying to execute oracle sql from windows batch file using sqlplus

I thought of trying manually first before integrating with windows batch file. I get below error

C:\Temp\scripts>SQLPLUS
Error 46 initializing SQL*Plus
HTTP proxy setting has incorrect value
SP2-1502: The HTTP proxy server specified by http_proxy is not accessible

Open in new window


However, I can connect ODBC connection pointing to the same db and able to test connect and perform other activities.

Thanks in advance
enthuguyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slightwv (䄆 Netminder) Commented:
Check your windows environment for variables: http_proxy and no_proxy.  Unset them if you don't need them.


http://www.enhisecure.com/isecureblog/2017/04/14/solved-http-proxy-setting-has-incorrect-value/

Before you ask:  We don't know if you need them or not.  You would need to check with your DBA and/or System Administrator.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
enthuguyAuthor Commented:
Thanks,
it was already unset, I mean to null
och_env_variable.jpg
0
enthuguyAuthor Commented:
I removed those variable and it worked

thanks very much
0
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

enthuguyAuthor Commented:
sorry, while executing the sql within batch file...I get same error :(
0
enthuguyAuthor Commented:
e.g
:update_workflow_not_in_use
      echo  "Executing SQL to update all applicable workflow to Not In Use..."
      echo "cd %script_dir%"
      cd "%script_dir%"
      powershell -noprofile -executionpolicy bypass -file "%l_och_build_powershell_util_filepath%"
      sqlplus oracle/welcome123@TESTDB @select.sql
      exit /b 0
      REM goto :EOF



Above "sqlplus oracle/welcome123@TESTDB @select.sql" fails with below
00:17:03 Error 46 initializing SQL*Plus
00:17:03 HTTP proxy setting has incorrect value
00:17:03 SP2-1502: The HTTP proxy server specified by http_proxy is not accessible
0
slightwv (䄆 Netminder) Commented:
If it is the exact same error then it is the exact same solution.  Make sure the Powershell environment doesn't have those parameters set.  I'm not a Powershell expert so I'm not sure where all it pulls environment settings when executed.
0
enthuguyAuthor Commented:
using batch file. updated file but still no luck.

:update_workflow_not_in_use
      SET http_proxy=""
      SET https_proxy=""
      echo  "Executing SQL to update all applicable workflow to Not In Use..."
      echo "cd %script_dir%"
      cd "%script_dir%"
      powershell -noprofile -executionpolicy bypass -file "%l_och_build_powershell_util_filepath%"
      sqlplus oracle/welcome123@TESTDB @select.sql
      exit /b 0
      REM goto :EOF
0
enthuguyAuthor Commented:
Thanks below worked

:update_workflow_not_in_use
     SET "http_proxy="
      SET "https_proxy="

      echo  "Executing SQL to update all applicable workflow to Not In Use..."
      echo "cd %script_dir%"
      cd "%script_dir%"
      powershell -noprofile -executionpolicy bypass -file "%l_och_build_powershell_util_filepath%"
      sqlplus oracle/welcome123@TESTDB @select.sql
      exit /b 0
      REM goto :EOF
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.