Sunday, October 7, 2018

Création du script de sauvegarde sous Linux


Exemple :

#!/bin/sh 
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 
export ORACLE_SID=orcl 
PATH=$ORACLE_HOME/bin:$PATH 

rman <<EOF 
connect target / 
RUN 
{  
ALLOCATE CHANNEL disk_iub DEVICE TYPE DISK;  
RECOVER COPY OF DATABASE WITH TAG daily_iub;  
BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG daily_iub DATABASE; 

exit 
EOF


Par exemple,

If your script is in the file /u01/app/oracle/rman/daily_backup.sh,

Puis entrez cette commande:

/u01/app/oracle/rman/daily_backup.sh

If the script is in the file /u01/app/oracle/rman/daily_backup.sh, then the .crontab file must contain: MAILTO=first.last@example.com

# MI HH DD MM DAY CMD
00 2 * * * /u01/app/oracle/rman/daily_backup.sh

In a command window, change directory to your home directory and enter the following command:

crontab .-e edit the cron details.

crontab -l to check the cron details



No comments:

Post a Comment

Selectivity and Cardinality

 Selectivity and Cardinality (detailed, with formulas & examples) Cardinality = how many distinct values (or how many rows), Selectivit...