Guys
Trying to automate rman cold backups using sql*plus versus svrmgrl. RMAN is local and target databases are remote.
Executing the following (just from a script seems to work just fine interactively):
$ORACLE_HOME/bin/sqlplus /nolog <<-EOD
connect system/password;
@tst2.sql;
shutdown abort
@tst2.sql;
startup pfile=$ORACLE_HOME/dbs/init$DBNAME.ora;
spool $STATUSFILE
select status from v\$instance where status = 'MOUNTED';
spool off
EOD
SQL> Connected.
SQL> Connected to an idle instance.
SQL> ORACLE instance shut down.
SQL> Connected to an idle instance.
SQL> ORA-01031: insufficient privileges
SQL> not spooling currently
SQL> select status from v$instance where status = 'MOUNTED'
*
ERROR at line 1:
ORA-01034: ORACLE not available
SQL> not spooling currently
SQL> SP2-0042: unknown command "EOD" - rest of line ignored.
SQL> SQL> Disconnected
irm00swas04:oracle:/usr/oracle/tools/backups/callscripts
