Did you Know #15 – Role Based Stuff

If you are using Data Guard and standby databases, you probably need to do stuff based on the database role. For example, have some services start on the primary database, whichever that is. You might want to update some tables upon failover/switchover and more.

There are two mechanisms for that in Oracle databases:

  • For services, if you use GI and Data Guard Broker, you can configure services based on the database role. When you create the service using “srvctl”, specify the -l (lowercase L) flag. Available values are PRIMARY, PHYSICAL_STANDBY, LOGICAL_STANDBY and SNAPSHOT_STANDBY.
  • For any other case you can configure a database trigger on “AFTER DB_ROLE_CHANGE” event. This trigger will fire when the database is opened for first time after the role change

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s