阅读背景:

Shell 调用SQLPLUS_moscot_wu的博客_shell 调用sqlplus

来源:互联网 
#!/bin/bash
export ORACLE_SID=PROD
export ORACLE_HOME=/u01/sq/ora_1/db/12.1.0.2

$ORACLE_HOME/bin/sqlplus -S "test/test" <<EOF
spool rt.log
select sysdate from dual;
PROMPT "COUNT T1 RESULT";
select count(1) from test.t1;
PROMPT "DELETE T1 RESULT"
delete from test.t1 where created_date> sysdate -6;
PROMPT "CONFIRM RECORDS"
select count(1) from test.t1;
commit;
spool off
exit;
EOF
date
echo "Delete sucess!"
#!/bin/bash
export ORACLE_SID=PROD
export ORACL



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: