Beginning with Oracle Database 11g Release 1, the Scheduler can run jobs based on whether a database is a primary database or a logical standby in an Oracle Data Guard environment.
For a physical standby database, any changes made to Scheduler objects or any database changes made by Scheduler jobs on the primary database are applied to the physical standby like any other database changes.
For the primary database and logical standby databases, there is additional functionality that enables you to specify that a job can run only when the database is in the role of the primary database, or can run only when the database is in a logical standby role. You do this using the
DBMS_SCHEDULER.SET_ATTRIBUTE procedure to set the
database_role job attribute to one of two values:
STANDBY'. (To run a job in both roles, you can make a copy of the job and set
'PRIMARY' for one job and to
STANDBY' for the other). On switchover or failover, the Scheduler automatically switches to running jobs specific to the new role. DML is replicated to the job event log so that on failover, a record of what had run successfully on the primary database until it failed is available.
"Examples of Setting Attributes" for an example of setting the