Ticket # 198981
Resource Needed: Oracle DBA
Database Name: PrimeDG
Database IP: 192.168.0.223
Task:
- Create a RMAN script to take a full backup of Oracle Database
- This script should be able to accept the database name as input so that same script can be used to take backups of different databases.
- Script location should be /home/oracle/scripts/RMAN
Solution:
1. Create a script called adhoc_backup.sh in /home/oracle/scripts/RMAN
#!/bin/bash
export ORACLE_SID=$1
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
export PATH=$PATH:$ORACLE_HOME/bin
rman target / cmdfile=/home/oracle/scripts/RMAN/adhoc_backup.rcv msglog /home/oracle/scripts/RMAN/adhoc_backup.log
|
2. Create a script called adhoc_backup.rcv in /home/oracle/scripts/RMAN
Run
{
backup database plus archivelog;
};
|
3. Change permission to 744 adhoc_backup.sh
chmod 744 adhoc_backup.sh
|
4. Run the backup script in back ground. Be sure to put the name of the database you like to backup.
cd /home/oracle/scripts/RMAN
nohup ./adhoc_backup.sh PrimeDG &
|
--Moid Muhammad
Thanks a lot, really helpful
ReplyDelete