RMAN> show all;
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
CONFIGURE BACKUP OPTIMIZATION OFF;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/b01/backup/%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/b01/backup/%d_DB_%u_%s_%p';
CONFIGURE MAXSETSIZE TO UNLIMITED;
CONFIGURE ENCRYPTION FOR DATABASE OFF;
CONFIGURE ENCRYPTION ALGORITHM 'AES128';
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/db10g/dbs/snapcf_control.f';
--Full
{backup as compressed backupset incremental level 0 database
plus archivelog delete input;
crosscheck archivelog all;
crosscheck backupset;
delete noprompt obsolete;
delete expired archivelog all;
delete expired backupset;}
--Incremental - Todos os blocos alterados desde o mais recente backup incremental.
{backup as compressed backupset incremental level 1 database
plus archivelog delete input;
crosscheck archivelog all;
crosscheck backupset;
delete noprompt obsolete;
delete expired archivelog all;
delete expired backupset;}
-- Cumulativo - Todos os blocos usados desde o mais recente backup FULL.
{backup as compressed backupset incremental level 1 cumulative database
plus archivelog delete input;
crosscheck archivelog all;
crosscheck backupset;
delete noprompt obsolete;
delete expired archivelog all;
delete expired backupset;}
-- Exemplo de schedule do backup usando CRONTAB
crontab -l
#############################################################
# BACKUP POR RMAN #
#############################################################
0 02 * * sat "/b01/scripts/./bckinc1_r1.sh"
0 02 * * sun "/b01/scripts/./bckinc0_r1.sh"
0 02 * * mon "/b01/scripts/./bckinc1_r1.sh"
0 02 * * tue "/b01/scripts/./bckinc1_r1.sh"
0 02 * * wed "/b01/scripts/./bckinc1c_r1.sh"
0 02 * * thu "/b01/scripts/./bckinc1_r1.sh"
0 02 * * fri "/b01/scripts/./bckinc1_r1.sh"
-- Script
denilson@localhost:~> cat "/b01/scripts/./bckinc0_r1.sh"
#####################################
# Script backup rman #
# 06-10-2008 #
# editado: denilson #
# #
#####################################
export ORACLE_HOME=/u01/app/oracle/product/db10g;
export PATH=$PATH:$ORACLE_HOME/bin;
export ORACLE_SID=orcl;
log=`echo $ORACLE_SID`_FULL_`date +%Y_%m_%d_rman.log`
$ORACLE_HOME/bin/rman target / @/b01/scripts/bckinc0_r0.sql >> /b01/logs/orcl/banco/logs/$log 2>> /b01/logs/orcl/banco/logs/$log
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
CONFIGURE BACKUP OPTIMIZATION OFF;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/b01/backup/%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/b01/backup/%d_DB_%u_%s_%p';
CONFIGURE MAXSETSIZE TO UNLIMITED;
CONFIGURE ENCRYPTION FOR DATABASE OFF;
CONFIGURE ENCRYPTION ALGORITHM 'AES128';
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/db10g/dbs/snapcf_control.f';
--Full
{backup as compressed backupset incremental level 0 database
plus archivelog delete input;
crosscheck archivelog all;
crosscheck backupset;
delete noprompt obsolete;
delete expired archivelog all;
delete expired backupset;}
--Incremental - Todos os blocos alterados desde o mais recente backup incremental.
{backup as compressed backupset incremental level 1 database
plus archivelog delete input;
crosscheck archivelog all;
crosscheck backupset;
delete noprompt obsolete;
delete expired archivelog all;
delete expired backupset;}
-- Cumulativo - Todos os blocos usados desde o mais recente backup FULL.
{backup as compressed backupset incremental level 1 cumulative database
plus archivelog delete input;
crosscheck archivelog all;
crosscheck backupset;
delete noprompt obsolete;
delete expired archivelog all;
delete expired backupset;}
-- Exemplo de schedule do backup usando CRONTAB
crontab -l
#############################################################
# BACKUP POR RMAN #
#############################################################
0 02 * * sat "/b01/scripts/./bckinc1_r1.sh"
0 02 * * sun "/b01/scripts/./bckinc0_r1.sh"
0 02 * * mon "/b01/scripts/./bckinc1_r1.sh"
0 02 * * tue "/b01/scripts/./bckinc1_r1.sh"
0 02 * * wed "/b01/scripts/./bckinc1c_r1.sh"
0 02 * * thu "/b01/scripts/./bckinc1_r1.sh"
0 02 * * fri "/b01/scripts/./bckinc1_r1.sh"
-- Script
denilson@localhost:~> cat "/b01/scripts/./bckinc0_r1.sh"
#####################################
# Script backup rman #
# 06-10-2008 #
# editado: denilson #
# #
#####################################
export ORACLE_HOME=/u01/app/oracle/product/db10g;
export PATH=$PATH:$ORACLE_HOME/bin;
export ORACLE_SID=orcl;
log=`echo $ORACLE_SID`_FULL_`date +%Y_%m_%d_rman.log`
$ORACLE_HOME/bin/rman target / @/b01/scripts/bckinc0_r0.sql >> /b01/logs/orcl/banco/logs/$log 2>> /b01/logs/orcl/banco/logs/$log
Opa Denilson.
ResponderExcluirMuito boa a sua dica.Sou DBA Jr.
Abraços;