1> #!/bin/ksh
2>
3> sqlplus /nolog < /dev/null
4>
5> connect USER/PASSWORD@DATABASENAME
6>
7> WHENEVER SQLERROR EXIT 5
8> WHENEVER OSERROR EXIT 10
9>
10> @ONE.sql
11>
----------------------------------------------
given snippet will connect to the database--line # 3 n 5
and sql script (ONE.sql) will be executed-- line #10
However, other methods are also there to connect to the database
----------------------------------------------
sqlplus -s USER/PASSWORD@DATABASE << ENDSQL
sqlplus -S USER/PASSWORD@DATABASE <<-! 2>&1
----------------------------------------------