Without looking at the actual code this may be difficult.
Are you using oradim?? to accomplish the shutdown. If you shut both
the
instance and the service, this should work without problem.
The other solution is calling svrmgr?? using a command line like
svrmgr23 @shutdown.sql
However, in this case, the services will still be running, and files
left
open.
As far as Oracle suppport tolds and AFAIK they're closed when instance
is shut down. Tested this also by using the NT-copy command to copy
db-files to another destination without any sharing violation. Yes,
listener related files will be open, 'cause service is running.
Try:
Call server manager to run the SQL-script:
c:\programm\orant\bin\SVRMGR23.EXE @c:\cmd\sql\down_bac.sql
SQL-script would look like:
CONNECT <dba>/<pwd>
SHUTDOWN IMMEDIATE;
STARTUP RESTRICT; -- instance recovery
alter rollback segment rb1 SHRINK;
alter rollback segment rb2 SHRINK;
alter rollback segment rb3 SHRINK;
alter rollback segment rb4 SHRINK;
alter rollback segment rb5 SHRINK;
alter rollback segment rb6 SHRINK;
alter rollback segment rb7 SHRINK;
alter rollback segment rb8 SHRINK;
alter rollback segment rb9 SHRINK;
alter rollback segment rb10 SHRINK;
alter rollback segment rb11 SHRINK;
alter rollback segment rb12 SHRINK;
alter rollback segment rb13 SHRINK;
alter rollback segment rb14 SHRINK;
alter rollback segment rb15 SHRINK;
alter rollback segment rb16 SHRINK;
alter rollback segment rbbig SHRINK;
ALTER SYSTEM SWITCH LOGFILE; -- number of logfiles
in group times
ALTER SYSTEM SWITCH LOGFILE;
ALTER SYSTEM SWITCH LOGFILE;
ALTER SYSTEM SWITCH LOGFILE;
ALTER SYSTEM SWITCH LOGFILE;
ALTER SYSTEM SWITCH LOGFILE;
ALTER SYSTEM SWITCH LOGFILE;
ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
SHUTDOWN;
Then run your backup. The cmd-file could also be run as the pre-job
of
your backup-software.