13c OMS Schedule Backup
Overview
Let's configure Oracle 13c OMS that is running with the following details:-
Operating System Oracle Linux 6.10 (el6uek.x86_64)
Database SID testdb
Database Version Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
Oracle 13c OMS Ver Oracle Enterprise Manager Cloud Control 13c Release 3
Following is the script for taking weekly cold backup for 13c OMS Server in a Linux environment
Step 1
Create a script with cold.sh as per my sample script
Script
echo
echo
date
echo
echo "Shutting Down OMS Services of 13c Monitoring Cloud Control for Cold Backup ......."
echo
echo
echo
export ORACLE_HOME=/u01/db/dbhome_1
export ORACLE_SID=testdb
export OMS_HOME=/u01/cloud/middleware
export AGENT_HOME=/u01/cloud/agent/agent_13.3.0.0.0
$OMS_HOME/bin/emctl stop oms -all
/u01/cloud/agent/agent_13.3.0.0.0/bin/emctl stop agent
echo "Shutting Down Database and Listener Services of 13c Monitoring Cloud Control for Cold Backup ......."
echo
echo
echo
#$ORACLE_HOME/bin/sqlplus "/ as sysdba" <<EOF1
#shutdown immediate;
#EOF1
#sqlplus "/ as sysdba" <<EOF1
#shutdown immediate;
#EOF1
#$ORACLE_HOME/bin/lsnrctl stop
date
echo
sleep 10;
date
echo "All Services are down for 13c Monitoring Cloud Control Cold Backup ......."
echo
echo
echo
date
echo "Starting Tar Backup for 13c Monitoring Cloud Control with Database"
echo
echo
echo
AS1=Oracle13c-OMS-TAR_$(date +%d-%m-%Y).tgz
#AS2=Oracle13c-DB-TAR_$(date +%d-%m-%Y).tgz
#AS3=Oracle13c-DBInventory-TAR_$(date +%d-%m-%Y).tgz
echo
/bin/tar -cvzf /u01/backup/cold/$AS1 /u01/cloud
#/bin/tar -cvzf /u01/backup/cold/$AS2 /u01/db
#/bin/tar -cvzf /u01/backup/cold/$AS3 /u01/oraInventory
echo
echo
date
echo
echo "Backup Successfully Completed for 13c Monitoring Cloud Control"
echo "Starting 13c Monitoring Cloud Control Services ......."
$ORACLE_HOME/bin/lsnrctl start
$ORACLE_HOME/bin/sqlplus "/ as sysdba" <<EOF1
startup;
EOF1
$OMS_HOME/bin/emctl start oms
/u01/cloud/agent/agent_13.3.0.0.0/bin/emctl start agent
date
echo "All Services are Up after 13c Monitoring Cloud Control Cold Backup Completion ......."
echo
echo
Step2
Create a crontab schedule job for running the above script on a weekly basis
01 00 * * 6 /home/oracle/backup/scripts/cold.sh > /home/oracle/backup/logs/cold.log
Conclusion
This script will run at 00:01 on Saturday Night, you may change it accordingly as per your desired time.