我已经制作了这个unix文件,但我没有正在生成的日志。它应该生成日志sds.log
以下是我的脚本,任何人都可以告诉我,为什么日志不会产生?
#!/bin/bash
tr -s '\n' < /home/scripts/input.txt | sed "s/.*/'&'/g" | tr '\n' ',' | sed 's/^\(.*\),$/\1/g' > /home/scripts/newinput.txt
read -p "Please provide SDS Database username:-" username
stty -echo
read -p "Password:-" password
stty echo
while read line
do
$ORACLE_HOME/bin/sqlplus -s $username/$password >> table_sds.log <<!
set serveroutput on size 100000;
DELETE FROM BKP_ACDAGENT WHERE DATASOURCEAGENTID IN ($line);
DELETE FROM BKP_CSRESOURCEGROUPASSIGN WHERE MANAGEDRESOURCEID IN (SELECT managedresourceid FROM csresource WHERE nativemanagedresourceid IN ($line));
DELETE FROM BKP_CSRESOURCE WHERE nativemanagedresourceid IN ($line) and resourcetypeid = 'agents';
COMMIT;
/
!
done </home/scripts/newinput.txt