Skip to main content

pre post

Thread needs solution

hi!

I can not turn off oracle db (shutdown db)
when executing the bat file in windows cmd - all ok
when executing the bat file in Acronis - error

bat file:
@echo off
sqlplus.exe "sys/oracle@gas as sysdba" @shutdown immediate

or

bat file:
@echo off
sqlplus.exe "/ as sysdba" @shutdown immediate

0 Users found this helpful

Does this error occur if you run this command from Acronis Backup using 'test' button as well as during plan execution? Does it change if you use .cmd file instead of .bat ?

> writes - "unable to open file shutdown.sql"

Try to monitor the execution using procmon, and check if parameters for sqlplus.exe process launch differ.

> Acronis looking sql file ?

Not sure what you mean. If the command is .cmd file it's just executed using commnad interpreter, Acronis doesn't know anything about sql files referenced there.

checked on *.com and *.bat file, error is one - "unable to open file shutdown.sql" - it error is SQL interpreter, that is connection is established, and then ?

attach logs files procmon (i don't now that there to look)

logfilebat.zip - log with *.bat file

logfilecom.zip - log with *.com file

Attachment Size
173555-112468.zip 326.92 KB
173555-112471.zip 196.35 KB

in both logs sqlplus.exe process is running with the following arguments
(in entry properties: process: command line:)
C:\oracle\ora92\bin\sqlplus.exe "sys/oracle@gas as sysdba" @shutdown

it searches for shutdown.sql in two places - in C:\WINDOWS\system32\shutdown.sql and in C:\oracle\ora92\dbs\shutdown.sql and fails to find it there. The only difference is lack of 'immeidate' at the end of the line. I don't know why it was lost.

Try to insert the following command in the .cmd file
echo "sys/oracle@gas as sysdba" @shutdown immediate > c:\log.txt
and check if the log.txt is different when the script is executed as the pre/post command and when is run manually.

use the following command

echo "sys/oracle@gas as sysdba" @shutdown immediate > c:\log.txt

in the log file

connected to:
oracle 9i ...
jserver ...

SP2-0310: unable to open file "shutdown.sql"
SQL>

all too most