【发布时间】:2018-03-24 17:13:06
【问题描述】:
我写的shell脚本是:
#!/bin/bash
#shell script for recovery testing
$ORACLE_HOME/bin/rman target/ <<EOF >rman.log
shutdown immediate;
startup mount;
run
{
recover database;
}
sql 'alter database open read only';
exit;
EOF
$ORACLE_HOME/bin/sqlplus '/as sysdba' <<_EOF1_ >sql.log
spool '/home/oracle/test1.log'
select * from hr.employees;
spool off;
exit;
_EOF1_
,但是无法获取sql查询的spool输出,如何解决?
【问题讨论】:
-
更详细地描述您的问题。预期的输出是什么? “无法获得”是什么意思?你遇到了什么错误?
-
第一部分,EOF 到 EOF 工作,但第二部分 EOF1,uanble 运行
-
运行脚本时,RMAN 部分成功完成,但出现错误:./rmanrecover.sh: line 19: warning: here-document at line 13 delimited by end-of-file (wanted `_EOF1_') ,并且不运行 sqlplus 部分,但是虽然 rman 部分是用一个脚本编写的,而相同的 sqlplus 部分是用另一个脚本编写的,并从 rman 脚本调用 sqlplus 脚本,但成功运行。
-
不要在 cmets 中发布澄清,而是编辑问题以包含该信息。