Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RV: Cold Backup Script

RV: Cold Backup Script

From: Juan Miranda <j.miranda_at_sermatica.es>
Date: Tue, 1 Nov 2005 20:59:36 +0100
Message-Id: <20051101195627.9167D104B8@smtp-01.servidoresdns.net>

Backup.sh

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

echo -------------- Generando script copia archivos | tee -a
/ora_exports/exports/_backup_cold.log

su - oracle -c "sqlplus -s \"/ as sysdba\" @/oracle/scripts/backup_cold.sql" | tee -a
/ora_exports/exports/_backup_cold.log

echo -------------- shutdown oracle | tee -a
/ora_exports/exports/_backup_cold.log

caa_stop oracle_orcl | tee -a /ora_exports/exports/_backup_cold.log sleep 30

echo -------------- Ejecutando copia de archivos | tee -a
/ora_exports/exports/_backup_cold.log

chmod +x /tmp/copy1.ksh
/tmp/copy1.ksh | tee -a /ora_exports/exports/_backup_cold.log
sleep 10

echo -------------- startup oracle | tee -a
/ora_exports/exports/_backup_cold.log

caa_start oracle_orcl | tee -a /ora_exports/exports/_backup_cold.log

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

/oracle/scripts/backup_cold.sql:

set feed off pages 0 head off echo off line 250 trimspool on spool
/tmp/copy1.ksh select ' cp -p '||file_name|| '
/ora_indices/cold_backup/' from sys.dba_data_files; select ' cp -p
'||name ||' /ora_indices/cold_backup/' from v$controlfile; select ' cp -p '||member ||' /ora_indices/cold_backup/' from v$logfile; select ' cp -p '||name ||' /ora_indices/cold_backup/' from v$tempfile; spool off exit

-----Mensaje original-----
De: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] En nombre de Powell, Mark D Enviado el: martes, 01 de noviembre de 2005 20:24
Para: oracle-l_at_freelists.org
Asunto: RE: Cold Backup Script

Thomas probably just got carried away in responding, but I want to point out that you do not need to backup the tempfiles. Part of the purpose of Oracle creating the feature was so you do not have to back them up. The feature saves backup run time and disk space since the Oracle rdbms will recreate them every time the instance starts.

HTH -- Mark D Powell --

-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Thomas Fox Sent: Tuesday, November 01, 2005 1:50 PM To: cemail_219_at_hotmail.com; oracle-l_at_freelists.org Subject: Re: Cold Backup Script

Well, I cannot send you an entire script, but if you go into SQL*Plus, you can
use:

sqlplus -S '/ as sysdba' <<-ENDSQL
spool files2backup.txt
select name from v\$datafile;
select name from v\$controlfile;
select member from v\$logfile;
select name from v\$tempfile;
spool off
exit
ENDSQL to get the files. Then use a while loop to copy each file to a particular
location:

cat files2backup.txt | while read line ; do   cp $line /var/opt/backup
done

Tom

> Does anyone have a cold backup script for 9i that they would be 
> willing to send to me that is in Korn shell and copies files/backups 
> to disk and then compresses the files?
> I just need something that can be quickly setup and run a couple of
times.
> I would really appreciate it.  The OS is AIX.
> 
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today - it's
FREE!
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> 
> --
> http://www.freelists.org/webpage/oracle-l
> 
> 
> 



	
		
__________________________________

Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com
--
http://www.freelists.org/webpage/oracle-l


--
http://www.freelists.org/webpage/oracle-l


--
http://www.freelists.org/webpage/oracle-l
Received on Tue Nov 01 2005 - 13:58:32 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US