shell如何调用sqlplus(各种情况示例)

 时间:2024-10-13 16:30:55

1、最简单的shell里调用sqlplus.$ vi test1.sh#!/bin/bashsqlplus -S /nolog <<EOFset heading off feedback off pagesize 0 verify off echo offconn test/testselect * from tab;exitEOF$ chmod +x test1.sh$ ./test1.sh

shell如何调用sqlplus(各种情况示例)

3、把sqlplus执行结果传递给shell方法二$ vi test3.sh#!/bin/bashsqlplus -S /nolog <<EOFset h髫潋啜缅eading off feedback off pagesize 0 verify off echo off numwidth 4conn test/testcol coun new_value v_counselect count(*) coun from tab;exit v_counEOFVALUE="$?"echo "The number of rows is $VALUE."$ chmod +x test3.sh$ ./test3.sh

shell如何调用sqlplus(各种情况示例)

5、为了安全要求每次执行shell都手工输入密码$ vi test5.sh#!/bin/bashecho -n "Enter password for u_test:"read PASSWDsqlplus -S /nolog <<EOFconn test/$PASSWDselect * from tab;exitEOF$ chmod +x test5.sh$ ./test5.sh

shell如何调用sqlplus(各种情况示例)
  • 苹果13手机如何打开喜马拉雅app个性化广告推荐
  • 牛油果的功效及作用
  • 金十数据怎么关闭退出后台自动小窗口播放
  • opera如何开启扩展的使用情况统计
  • 怎么设置苹果13提醒事项角标
  • 热门搜索
    阳萎怎么治 鲅鱼圈旅游攻略 孕妇可以吃葡萄吗 小米驱动怎么安装 宝宝多大可以刷牙 轩辕剑4攻略 经期可以吃香蕉吗 河南工程学院怎么样 旅游股 蛲虫怎么治