如何屏蔽shell脚本中sqlplus的回显?

[复制链接]
查看11 | 回复4 | 2006-5-6 22:39:09 | 显示全部楼层 |阅读模式
在linux的bash脚本中,简化有如下
su - "$ORACLE_USER" SQL> SQL> SQL> SQL> SQL> SQL> SQL> dgdb
SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Data Mining and Real Application Testing options
请问如何屏蔽: 
1:SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> 这些?
2,sqlplus 的登录信息 SQL*Plus: Release 10.2.0.5.0 - Production on Sun Nov 21 23:42:25 2010 这些?
回复

使用道具 举报

千问 | 2006-5-6 22:39:09 | 显示全部楼层
脚本保存为文件引用即可
回复

使用道具 举报

千问 | 2006-5-6 22:39:09 | 显示全部楼层
$ORACLE_HOME/bin/sqlplus -s'/as sysdba'<<EOF
set feedback off heading off verify off timing off
SELECT count(*) from v\\\$session;
exit
回复

使用道具 举报

千问 | 2006-5-6 22:39:09 | 显示全部楼层
sqlplus -S 即可
回复

使用道具 举报

千问 | 2006-5-6 22:39:09 | 显示全部楼层
给一个我们平台执行脚本的样本你看看,使用方法是exec_sql_utf8_AUTHSERV.sh test.sh,屏蔽回显是sqlplus -s
[oracle@yswebdb lkdir]$ cat exec_sql_utf8_AUTHSERV.sh
#!/bin/bash
export ORACLE_SID=AUTHSERV
export NLS_LANG="AMERICAN_AMERICA.UTF8"
sqlplus -s readonly/xxxxxx << EOF
spool ${1}.log
@${1}
spool off
EOF
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行