Friends! We have a lot of primary databases with their physical standby databases in Data Guard configurations on servers. Each primary database on single server and each physical standby on single server. In EM12c we've configured scheduler jobs for backup our primary databases. Unfortunately, when server is really busy, Agent suspends backup execution and we haven't backup according to out schedule.
So, we disabled our backup jobs from EM12c and want to perform backups on Physical standby using procedure DBMS_SCHEDULER.CREATE_JOB
.
As Physical Standby is read only database and per-block copy of Primary Database, I have to create schedule job on Primary and it applied to standby.
So, the question is: Is it possible? And if, yes - how to realize this in script??
Something like this:
check database_role
if role='PHYSICAL STANDBY'
then execute backup script
else nothing to do..
If it's not possible, which solution is the best for resolve this task? Is there a way to solve this problem without create cron task with single script on each server? Is it possible to use one global script from recovery catalog database?
Kris said, that I can't run scheduled jobs from physical standby database. So, I'll schedule my linux script with crontab. My linux script is:
#! /usr/bin/bash
LOG_PATH=/home/oracle/scripts/logs; export LOG_PATH
TASK_NAME=backup_database_inc0; export TASK_NAME
CUR_DATE=`date +%Y.%m.%d-%H:%M`; export CUR_DATE
LOGFILE=$LOG_PATH/$TASK_NAME.$CUR_DATE.log; export LOGFILE
rman target / catalog rmancat/<pswd>@rmancat script 'backup_database' log $LOGFILE
if [ $? -eq 0 ]
then
mail -s "$ORACLE_UNQNAME Backup Status: SUCCESS" [email protected]< $LOGFILE
exit 0
else
mail -s "$ORACLE_UNQNAME Backup Status: FAILED" [email protected]< $LOGFILE
exit 1
I don't want to create linux file on each host to call backup global script from my recovery catalog. Is it possible to configure centralized backups execution schedule on all hosts? Can i configure ssh from one host to all database hosts and execute my linux script for backup?
Thanks in advance for your answers.