Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: shutdown immediate or abort for cold-backup?
"Hemant K Chitale" <hkchital_at_singnet.com.sg> wrote in message
news:9m0d6u$53v$1_at_coco.singnet.com.sg...
> You would need to do a RECOVER database
> after a SHUTDOWN ABORT if ...
> you were running an Online Backup and one
> more tablespaces were in BEGIN BACKUP mode
> when the database was shutdown.
>
> You do NOT need to restore datafiles. Most times,
> the recovery should go through from the online redo logs
> unless there has been a lot of activity on the tablespaces
> in backup mode and the activity has already been archived
> out.
Actually you don't even need to do a recover database. Just identify the datafiles that are in back mode and do an "alter database datafile end backup" on them.
I have a unix shell script that automates this in 8i. Should be easily convertible to 9i.
#!/bin/ksh
# Run this script after db restart to take files out of backup mode
svrmgrl <<! | awk -F\; '$1 ~ "^alter" {print $1 "\;"}' > end_backup.sql
connect internal
set charwidth 200
select 'alter database datafile '''||f.name||''' end backup;'
from v\$backup b, v\$datafile f
where b.file# = f.file#
and b.status = 'ACTIVE';
!
svrmgrl <<!
connect internal
@end_backup.sql
alter database open;
!
begin 666 end_backup.sh
M(R$O8FEN+VMS: T*(R!2=6X@=&AI<R!S8W)I<'0_at_869T97(@9&(@<F5S=&%R
M="!T;R!T86ME(&9I;&5S(&]U="!O9B!B86-K=7 @;6]D90T*<W9R;6=R;" \
M/"$@?"!A=VL@+49<.R G)#$@?B B7F%L=&5R(B![<')I;G0@)#$@(EP[(GTG
M(#X_at_96YD7V)A8VMU<"YS<6P-"F-O;FYE8W0@:6YT97)N86P-"G-E="!C:&%R
M=VED=&@@,C P#0IS96QE8W0@)V%L=&5R(&1A=&%B87-E(&1A=&%F:6QE("<G
M)WQ\9BYN86UE?'PG)R<@96YD(&)A8VMU<#LG#0IF<F]M('9<)&)A8VMU<"!B
M+"!V7"1D871A9FEL92!F#0IW:&5R92!B+F9I;&4C(#T_at_9BYF:6QE(PT*86YD
M(&(N<W1A='5S(#T@)T%#5$E612<[#0HA#0IS=G)M9W)L(#P\(0T*8V]N;F5C
M="!I;G1E<FYA; T*0&5N9%]B86-K=7 N<W%L#0IA;'1E<B!D871A8F%S92!O
)<&5N.PT*(0T*
`
end
Received on Wed Aug 22 2001 - 09:08:25 CDT