#echo "Start install now!!!"
sqlplus "/ as sysdba" << EOF
set serveroutput on
spool btf.log
conn omcr/lte;
@create_bak_tab.sql
@create_tab.sql
@sp_add_btytabrec.sql
@sp_cell_up_drop_btf.prc
@sp_create_lte_bty_proc.prc
call sp_create_lte_bty_proc();
call PKG_BTY_RPT.recreate_fast_rpt_proc();
call PKG_BTY_RPT.recreate_fast_rpt_job();
@wkm_guideline.sql
spool off
exit
EOF
第一行 #echo "Start install now!!!" 注释了
一般情况下,第一行应该写:#!/bin/sh
第二行 sqlplus "/ as sysdba" << EOF 登录数据库,直接登录到管理员,建议使用sqlplus /nolog + conn tiger/scott
https://blog.csdn.net/wwlhz/article/details/73296430
注意第二行末尾的<< EOF,<<EOF表示重定向输入,将我们输入的命令字符串作为一个执行程序的输入,这样,我们就不需要在那个程序环境中手工输入命令,以便自动执行我们需要的功能:
https://blog.csdn.net/iamlaosong/article/details/40509399
第三行 set serveroutput on 打开oracle自带的输出方法dbms_output。在执行set serveroutput on以后,使用dbms_output方法可以输出信息.例如:dbms_output.put_line('This is');
没理解具体有什么用:
https://zhidao.baidu.com/question/337957008.html
第四行 spool btf.log
spool是oracle 下sqlplus 的命令,不是sql 语法里面的.
基本示例:
spool 路径+文件名
sql语句;
spool off
这样就把包含在spool块中的sql语句的执行结果保存在"路径+文件名"中了.
https://zhidao.baidu.com/question/161434229.html
其他行都是在sqlplus下,执行sql脚本。
网友给出的脚本的例子: