Comandos RMAN

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

-- Respaldos RMAN

-- listar backups
list backup;

-- eliminar respaldos anteriores


delete obsolete;

-- eliminar archives
CROSSCHECK ARCHIVELOG ALL;
DELETE ARCHIVELOG UNTIL TIME 'sysdate -1';
DELETE ARCHIVELOG ALL BACKED UP;
BACKUP ARCHIVELOG ALL DELETE INPUT;

-- espacio cuento y depurar acorde al escenario que poseo.

select space_limit/1024/1024 "Limit MB", space_used/1024/1024 "Used MB",


space_reclaimable/1024/1024 "Reclaimable MB"
from v$recovery_file_dest;

select force_logging from v$database;


select force_logging from dba_tablespaces;

--
#!/bin/sh

FECHA=`date +%d-%m-%y`
export ORACLE_HOME=/oracle/app/product/12.1.0/db_1
export ORACLE_SID=$1
export LOG=/home/oracle/scripts/log/
LOG1=/$LOG/bkp_full_$1_$FECHA.log

echo "Backup Full Database $1" >> $LOG1


rman target / <<EOF >> $LOG1
backup as compressed backupset incremental level 1 DATABASE plus archivelog form
at '/resprman/respaldos/$1/full_db_%d_%U_%s_%p' include current controlfile;

run
{
allocate channel c2 device type disk format '/resprman/respaldos/$1/archive_%d_%
s_%p_%t';
backup archivelog all delete all input;
release channel c2;
}

exit;
EOF
echo "Backup Completed"

You might also like