shell脚本大致内容如下:
#!/bin/bash

ORACLE_BASE=/app/oracle/
export ORACLE_BASE
ORACLE_HOME=/app/oracle/product/db11gr2
export ORACLE_HOME
PATH=${PATH}:/app/oracle/product/db11gr2/bin
export PATH
NLS_LANLG=AMERICAN_AMERICA.ZHS16GBK
export NLS_LANG
LANG=zh_CN.GB2312
export LANG
LANGUAGE=zh_CN.GB18030 : zh_CN.GB2312 : zh_CN
export LANGUAGE
nls_date_format=“yyyymmdd hh24:mi:ss”
export nls_date_format

#获取数据库密码
. ./dbpwd_config.sh #circapp
db_conn=“$db”
#db_conn="rpt_tmp/Own_"tfc

sqlplus -s ${db_conn}<<EOF

delete from table 表名 where 条件;
commit;
insert into table 表名 where 条件;
commit;

end;

#/

exit;
EOF

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐