Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> How to automate process to get out of backup mode if a server crashes?
I have inherited some 8.1.7.4 databases on Windows from a new company
acquired. We have had the servers crash recently during the hot backup
processing. This means doing the ALTER DATABASE END BACKUP after
getting back to the command prompt before opening the database.
My Question: Has anyone been successfully at using a DATABASE event trigger to fix this sort of thing without DBA intervention?
Basically, I would add code similar to the below to resolve.
SQL*Plus: Release 8.1.7.0.0 - Production on Tue Jul 12 11:16:24 2005
(c) Copyright 2000 Oracle Corporation. All rights reserved.
ERROR:
ORA-01033: ORACLE initialization or shutdown in progress
REM - --------------------------------------------------------- - REM - Find hot backup datafiles that are active after crash - REM - Also, create script to resolve issue after database mount - REM - JAW - 03-03-2003 - REM - --------------------------------------------------------- -
SELECT V1.FILE#, NAME
FROM V$BACKUP V1, V$DATAFILE V2
WHERE V1.STATUS = 'ACTIVE' AND V1.FILE# = V2.FILE# ;
set heading off
set feedback off
set linesize 150
SPOOL c:\temp\end_backup.sql
prompt set heading on
prompt set feedback on
SELECT 'ALTER DATABASE DATAFILE ''' || NAME || ''' END BACKUP;'
FROM V$BACKUP V1, V$DATAFILE V2
WHERE V1.STATUS = 'ACTIVE' AND V1.FILE# = V2.FILE# ;
spool off
@c:\temp\end_backup.sql
alter database open; Received on Tue Jul 12 2005 - 10:29:39 CDT