but sqlplus script in shell not work. why?
I can see log says "26588:20170116:191030.380 Executing command '/opt/scripts/alert_xxx.sh'", and shell command works fine. But sqlplus scripts in shell scripts not work, why?
my shell scripts as follow:
[oracle@devdb scripts]$ cat alert_xxx.sh
#!/bin/bash
export ORACLE_SID=devdb11
ifconfig > /opt/scripts/test.txt
sqlplus -S / as sysdba @/opt/scripts/tbs_xxx.sql
[oracle@devdb scripts]$ cat tbs_xxx.sql
ALTER TABLESPACE XXX ADD DATAFILE '/oracle/oradata/devdb11/xxx061.dbf' SIZE 10M AUTOEXTEND OFF;
exit
[oracle@devdb scripts]$
I can see log says "26588:20170116:191030.380 Executing command '/opt/scripts/alert_xxx.sh'", and shell command works fine. But sqlplus scripts in shell scripts not work, why?
my shell scripts as follow:
[oracle@devdb scripts]$ cat alert_xxx.sh
#!/bin/bash
export ORACLE_SID=devdb11
ifconfig > /opt/scripts/test.txt
sqlplus -S / as sysdba @/opt/scripts/tbs_xxx.sql
[oracle@devdb scripts]$ cat tbs_xxx.sql
ALTER TABLESPACE XXX ADD DATAFILE '/oracle/oradata/devdb11/xxx061.dbf' SIZE 10M AUTOEXTEND OFF;
exit
[oracle@devdb scripts]$
Comment