I’d like to run a sqlplus script from a cron job.
I thought I could put a line like:
CONNECT "myuser/mypass@mydb"
within the script and then just execute it with:
sqlplus @myscript
However, when I do so, I get:
SP2-0306: Invalid Option
SP3-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
Am I misunderstanding the usage of the connect command?
When running
CONNECTinsideSQL*Plus, remove the quotes:They double quotes are required if you are passing the credentials as an argument to
sqlplus:, for the shell to parse
myuser/mypass@mydbas a single argument if you have spaces in your connection identifier or use additional options likeAS SYSDBA.