shell 调用 sqlplus】的更多相关文章

Unix/Linux下,shell脚本调用sqlplus的几种方式介绍: 一.最简单的shell调用sqlplus #!/bin/bash sqlplus -S /nolog > sqlplus.log <<EOF    conn scott/scott    select sysdate from dual;    quit EOF 二.sqlplus返回执行结果给shell 方法一: #!/bin/bash biz_date=`sqlplus -S scott/scott <&…
一.最简单的shell里调用sqlplus. $ vi test1.sh #!/bin/bashsqlplus -S /nolog > result.log <<EOFset heading off feedback off pagesize 0 verify off echo offconn u_test/iamwangncselect * from tab;exitEOF $ chmod +x test1.sh$ ./test1.sh 二.把sqlplus执行结果传递给shell方法…
在最近的工作中,经常需要批量执行一些DML, DDL, PL/SQL语句或导入一些Function, Procedure.因为support的国家比较多,常常需要一个登陆到一个国家的数据库上执行完成后再登陆到另一个国家执行,很是麻烦.今天得空就写了个shell来批量处理. #Env.sh中定义一常用的变量,ORACLE_SID,$AU_USER,$AU_PWD等. . /home/oracle/shell/Env.sh AU="$AU_USER/$AU_PWD" CN="$C…
2014-06-20  Created By BaoXinjian…
[20170617]vim中调用sqlplus.txt --//以前写过一篇emacs下调用sqlplus的文章,一直想学emacs,受限制自己掌握vim,对学习它没有兴趣,原链接如下:--//http://blog.itpub.net/267265/viewspace-1309032/ --//实际上vim也有插件连接数据库,我觉得不好用,一直没这样用. --//今天在整理vim相关设置时,发现我自己以前也定义一些方法,自己也拿出来分享: noremap  <Leader>q1 Yp!!sq…
1.shell调用python脚本,并且向python脚本传递参数: shell中: python test.py $para1 $para2 python中: import sys def main($canshu1, $canshu2) ..... main(sys.argv[1], sys.argv[2]) 2.使用shell调用python中的函数: python脚本如下: test.py: import ConfigParser config = ConfigParser.Config…
最近遇到一个需求,需要通过shell调用python中的一个函数,发现其实也挺简单的: python脚本如下: test.py: import ConfigParser config = ConfigParser.ConfigParser() config.read("test.conf") def get_foo(): return config.get("locations", "foo") def get_bar(): return con…
shell调用:(管道符前加#号,执行shell用!) import sys.process._ "ls -al" #| "grep x" ! 正则表达式:(r表示正则表达式) val numPattern = """[0-9]+""".r for (matchString <- numPattern.findAllIn("99 bottles, 98 bottles")){ pr…
[20190920]完善vim调用sqlplus脚本.txt --//以前写的http://blog.itpub.net/267265/viewspace-2140936/=>[20170617]vim中调用sqlplus.txt --//本来自己想写一个转化oracle 数字的脚本,对于我来讲难度有点大.使用utl_raw.cast_to_number函数相对简单,缺点就是有--//数据库可供使用. $ cat sql.vim" oraclenoremap  <Leader>…
#!/bin/bash sqlplus dc_file_data_js/dc_file_data_js << EOF1 set linesize 500; set pagesize 10000; spool bts.csv select * from user_tables; spool off EOF1 1.使用某个标识符(此处用EOF1,一般用EOF)标志Oracle调用的开始与结束,当遇到一行单独的标识符时,表明sqlplus调用结束.…