The method of recording and -sqlplus connection with oracle text sql
oracle sql 1 written to be performed
test.sql written to be performed in Oracle, the acquired data into the data.txt.
set line 4100
set pagesize 0
set feedback off
set heading off
set trimspool on
set trims on
set trimout on
set echo off
set colsep $$$
set termout off
spool data.txt
select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;
spool off
exit
2 Write the script dsql
Dsql write scripts test.dsql, it will connect using sqlplus oracle execution test.dsql
.os rs0=`sqlplus dbName/user@10.0.0.0:0/passwd @test.sql `
.IF ERRORCODE <> 0 THEN .QUIT 12;
3 writing shell scripts and script execution dsql
Dsql -c $logon.file -f test.dsql >> $log 2>&1
$ Logon.file is login and password file
4 in the shell to view the captured data
cat data.txt