Tuesday, September 3, 2013

Configuring Data Guard with a Broker with a non-default port

My current site has a number of databases that are using Data Guard, but have not been set up with the broker, and I've been asked to set them up to use it.

Simple, I thought.

Ha.

The actual set up is quite straight forward if the databases use port 1521, I followed this Oracle Support Document: Step By Step How to Recreate Dataguard Broker Configuration (Doc ID 808783.1).

However, when I did a "show configuration", "show database verbose "ORCLP" and "show database verbose "ORCLS" I got the following errors:

Warning: ORA-16607: one or more databases have failed

Error: ORA-16778: redo transport error for one or more databases

Error: ORA-12541: TNS:no listener

After poking around for a while I decided to see if they could be created with OEM (V12C), so logged in there and went to the "Availability / DataGuard Administration" screen.

When going through the process, it popped up a message to the effect "you're not using the default port, you need to set up the local_listener parameter".

So I ran this command on the databases:

Primary:
 alter system set local_listener='(ADDRESS=(PROTOCOL=tcp)(HOST=primary)(PORT=1528))';

Standby:
alter system set local_listener='(ADDRESS=(PROTOCOL=tcp)(HOST=standby)(PORT=1528))';

I also had to set the property on the Primary in dgmgrl:

DGMGRL> disable configuration

edit database "ORCLP" set property LocalListenerAddress='(ADDRESS=(PROTOCOL=tcp)(HOST=primary)(PORT=1528))';

edit database "ORCLS" set property LocalListenerAddress='(ADDRESS=(PROTOCOL=tcp)(HOST=primary)(PORT=1528))';

enable configuration

After a few minutes it all fell into place - check the alert log of the standby, and you can see the logs getting applied, and also a "show configuration" and "show database" in DGMGRL should show "SUCCESS":

DGMGRL> show configuration

Configuration
  Name:                ORCLDGB
  Enabled:             YES
  Protection Mode:     MaxPerformance
  Fast-Start Failover: DISABLED
  Databases:
    ORCLP      - Primary database
    ORCLS - Physical standby database

Current status for "ORCLDGB":
SUCCESS