I am running SQLcl verion
SQL> version
Oracle SQLDeveloper Command-Line (SQLcl) version: 19.1.0.0
The following script works
echo @test/oracle_sql_cl/read_schema.sql | sql -S ${USER}/${PASSWORD}@${TNS_NAME}
A timeout parameter is needed.
Here are some examples tired but without success
echo @test/oracle_sql_cl/read_schema.sql | sql -S -t 5 ${USER}/${PASSWORD}@${TNS_NAME}
The above command fails.
Also updated the TNS_NAME var like so
export TNS_NAME="(DESCRIPTION=(TRANSPORT_CONNECT_TIMEOUT=5)(CONNECT_TIMEOUT=5)(RETRY_COUNT=1)(RETRY_DELAY=1)(ADDRESS_LIST=(ADDRESS=...
But connection still reties the connecion.
Any ideas would be much appreciated :~)
Solution
Update the connection string to include
export TNS_NAME="(DESCRIPTION=(TRANSPORT_CONNECT_TIMEOUT=2)...
And modify the invocation to
echo @test/oracle_sql_cl/read_schema.sql | sql -S ${USER}/${PASSWORD}@${TNS_NAME}
ps
command.