Backing up Oracle databases configured using Data Guard
Ok, so I'm not huge into Netbackup (NBU), or Oracle, but our backup group has been dragged into issue, and I have been recruited to help solve it.
We are running NetBackup 7.6.0.1. Its going mostly well. We are doing file level backups successfully, and oracle backups successfully using our RMAN catalog and such.
However, we have recently been tasked to back up an Oracle database that has been configured with data guard. This means this:
- There are two databases, with two different SIDs
- The databases are identical, configured as such that if one database fails, the other database covers as a failover database
- One database is the Primary database, and one is set as the Standby database
We have NetBackup set up to backup both databases. When the backups run, the Primary database succeeds with no issues. The secondary database fails with
(5407) Database is in the wrong state (must be OPEN) for the requested action
So, here are the difficulties:
- Netbackup requires an instance name when setting up a oracle instance for backup - which should be equal to the SID. We could just rely on our TNSNAMES.ora file to connect to the proper instance, but since NBU requires the SID when setting up the instance, and the primary and standby databases have different SIDs we cannot rely on the TNSNAME alone
- We don't manage the databases set up in the data guard configuration, so there is no way to tell if a failover event occurs until we get a failed backup on the main backup, which is not ideal
There should be a way to have one policy in NetBackup that covers this Oracle DB setup. We should be able to back up whatever database is currently the "Primary" without worrying about ORACLE_SIDs.
Let me know if I need to provide more info for this issue to be discussed.
The ideal would be to have a virtual hostname and IP address associated with the online Instance.
This way you would only have one hostname with one policy configured.
The alternative would be to use crontab on each client to start the script.
The script would then first check if the database is up, and only then start the backup.