This shell script can help you schedule RMAN full backup from the Crontab:
https://www.dropbox.com/home?preview=schedule_rman_full_bkp.sh
In case you are interested in an interactive script to run it manually then use this script:
https://dba-tips.blogspot.com/2017/03/rman-backup-script.html
For the first script before you schedule it to run in the crontab you have to do the following:
Modify the following mandatoryparameters at the top of the script to match your database environment details you want to back up:
ORACLE_SID=orcl The instance name you want to back up. i.e. orcl
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 The Oracle Home location i.e. /u01/app/oracle/product/11.2.0/dbhome_1
BACKUPLOC=/backup The Backup location "Full path". i.e. /backup
If you still have time you can modify the optionalparameters:
COMPRESSION=Y In case you want to enable compression i.e. enabled
BKP_RETENTION=7 Backups older than 7 days will be deleted. [MAINTENANCEFLAG must =Yfor this parameter to take effect]
ARCH_RETENTION=7 Archivelogs older than 7 days will be deleted. [MAINTENANCEFLAG must =Yfor this parameter to take effect]
CTRL_AUTOBKP_RETENTION=7 Controlfile autobackup files older than 7 days will be deleted. [MAINTENANCEFLAG must =Y for this parameter to take effect]
MAINTENANCEFLAG=N If enabled it will perform the following tasks: [Default Disabled]
- Enable CONTROLFILE AUTOBACKUP mode.
- Enable backups to be resumed if crashed.
- Maintain the good naming of the CONTROLFILE backup piece.
- Crosscheck old backups.
- Crosscheck Archivelog files.
- Delete Expired old backups from the disk. [Based on the Backup retention you defined]
- Delete Obsolete backups which are no more exist from the catalog.
- Delete the old Archivelogs. [Based on the Archivelog retention you defined]
- Delete the old Controlfile backups. [Based on the Controlfile retention you defined]
That's all!
This script is part of the DBA BUNDLE, to read more about it please visit this link:
http://dba-tips.blogspot.ae/2014/02/oracle-database-administration-scripts.html
DISCLAIMER: THIS SCRIPT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY. IT IS PROVIDED "AS IS".
GitHUB Version:
https://www.dropbox.com/home?preview=schedule_rman_full_bkp.sh
In case you are interested in an interactive script to run it manually then use this script:
https://dba-tips.blogspot.com/2017/03/rman-backup-script.html
For the first script before you schedule it to run in the crontab you have to do the following:
Modify the following mandatoryparameters at the top of the script to match your database environment details you want to back up:
ORACLE_SID=orcl The instance name you want to back up. i.e. orcl
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 The Oracle Home location i.e. /u01/app/oracle/product/11.2.0/dbhome_1
BACKUPLOC=/backup The Backup location "Full path". i.e. /backup
If you still have time you can modify the optionalparameters:
COMPRESSION=Y In case you want to enable compression i.e. enabled
BKP_RETENTION=7 Backups older than 7 days will be deleted. [MAINTENANCEFLAG must =Yfor this parameter to take effect]
ARCH_RETENTION=7 Archivelogs older than 7 days will be deleted. [MAINTENANCEFLAG must =Yfor this parameter to take effect]
CTRL_AUTOBKP_RETENTION=7 Controlfile autobackup files older than 7 days will be deleted. [MAINTENANCEFLAG must =Y for this parameter to take effect]
MAINTENANCEFLAG=N If enabled it will perform the following tasks: [Default Disabled]
- Enable CONTROLFILE AUTOBACKUP mode.
- Enable backups to be resumed if crashed.
- Maintain the good naming of the CONTROLFILE backup piece.
- Crosscheck old backups.
- Crosscheck Archivelog files.
- Delete Expired old backups from the disk. [Based on the Backup retention you defined]
- Delete Obsolete backups which are no more exist from the catalog.
- Delete the old Archivelogs. [Based on the Archivelog retention you defined]
- Delete the old Controlfile backups. [Based on the Controlfile retention you defined]
That's all!
This script is part of the DBA BUNDLE, to read more about it please visit this link:
http://dba-tips.blogspot.ae/2014/02/oracle-database-administration-scripts.html
DISCLAIMER: THIS SCRIPT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY. IT IS PROVIDED "AS IS".
GitHUB Version: