歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux編程 >> SHELL編程

Linux下Shell腳本與Oracle交互腳本

wc -l 7*.txt

. ~/.bash_profile

cd /data/intfdata/ba/gtdata

database_pass=`cat /home/gmcc/database_work.conf`

---簽約
sqluldr user=$database_pass query="select distinct servnumber||'||||' from tb6_lh_hhf_gj_temp8 where sfzshf='是' and lb='A' and amt=300 " field="|" file="7月份數據_簽約_a類_300.txt"
sqluldr user=$database_pass query="select distinct servnumber||'||||' from tb6_lh_hhf_gj_temp8 where sfzshf='是' and lb='A' and amt=800 " field="|" file="7月份數據_簽約_a類_800.txt"
sqluldr user=$database_pass query="select distinct servnumber||'||||' from tb6_lh_hhf_gj_temp8 where sfzshf='是' and lb='A' and amt=1000 " field="|" file="7月份數據_簽約_a類_1000.txt"
sqluldr user=$database_pass query="select distinct servnumber||'||||' from tb6_lh_hhf_gj_temp8 where sfzshf='是' and lb='A' and amt=1200 " field="|" file="7月份數據_簽約_a類_1200.txt"
sqluldr user=$database_pass query="select distinct servnumber||'||||' from tb6_lh_hhf_gj_temp8 where sfzshf='是' and lb='A' and amt=2000 " field="|" file="7月份數據_簽約_a類_2000.txt"
                                                                                    
sqluldr user=$database_pass query="select distinct servnumber||'||||' from tb6_lh_hhf_gj_temp8 where sfzshf='是' and lb='B' and amt=300 " field="|" file="7月份數據_簽約_b類_300.txt"
sqluldr user=$database_pass query="select distinct servnumber||'||||' from tb6_lh_hhf_gj_temp8 where sfzshf='是' and lb='B' and amt=800 " field="|" file="7月份數據_簽約_b類_800.txt"
sqluldr user=$database_pass query="select distinct servnumber||'||||' from tb6_lh_hhf_gj_temp8 where sfzshf='是' and lb='B' and amt=1000 " field="|" file="7月份數據_簽約_b類_1000.txt"
sqluldr user=$database_pass query="select distinct servnumber||'||||' from tb6_lh_hhf_gj_temp8 where sfzshf='是' and lb='B' and amt=1200 " field="|" file="7月份數據_簽約_b類_1200.txt"
sqluldr user=$database_pass query="select distinct servnumber||'||||' from tb6_lh_hhf_gj_temp8 where sfzshf='是' and lb='B' and amt=2000 " field="|" file="7月份數據_簽約_b類_2000.txt"
                                         
sqluldr user=$database_pass query="select distinct servnumber||'||||' from tb6_lh_hhf_gj_temp8 where sfzshf='是' and lb='C' and amt=300 " field="|" file="7月份數據_簽約_c類_300.txt" 
sqluldr user=$database_pass query="select distinct servnumber||'||||' from tb6_lh_hhf_gj_temp8 where sfzshf='是' and lb='C' and amt=800 " field="|" file="7月份數據_簽約_c類_800.txt" 
sqluldr user=$database_pass query="select distinct servnumber||'||||' from tb6_lh_hhf_gj_temp8 where sfzshf='是' and lb='C' and amt=1000 " field="|" file="7月份數據_簽約_c類_1000.txt"
sqluldr user=$database_pass query="select distinct servnumber||'||||' from tb6_lh_hhf_gj_temp8 where sfzshf='是' and lb='C' and amt=1200 " field="|" file="7月份數據_簽約_c類_1200.txt"
sqluldr user=$database_pass query="select distinct servnumber||'||||' from tb6_lh_hhf_gj_temp8 where sfzshf='是' and lb='C' and amt=2000 " field="|" file="7月份數據_簽約_c類_2000.txt"

Copyright © Linux教程網 All Rights Reserved