bat执行sqlplus语句,省去@xx.sql过程

bat文件中执行写sqlplus连接,再@调用自己,sql登录成功后,会忽略掉第一行sqlplus xxx,转而执行下方的sql语句

----------------------------------------------------------------------------------------

sqlplus aixm/aixm@aixm @连接数.bat

select * from
(
select terminal,count(*) CNT   from v$session where username ='AIXM'
group by terminal
union
select 'TOTAL', SUM(count(*) )
from v$session where username ='AIXM'
group by terminal
)
order by decode(terminal,'TOTAL',1,0),cnt
;

posted on 2018-07-15 16:38  mol1995  阅读(1246)  评论(0编辑  收藏  举报

导航