cancel
Showing results for 
Search instead for 
Did you mean: 

How do you configure your Oracle policies?

Nick_Morris
Level 6
Partner    VIP    Certified
Hiya,

Just trying to find the best way to setup Oracle backup policies and have come to a stumbling block, so i am just seeing how everyone else is doing it so we can get the right outcome here with the most little effort and administrative overhead needed. I have tried to contact support but they have been as useful as a chocolate teapot to be honest with saying this is how it is so live with it!

Current Situation

Policy 1 - Oracle backup - defined schedule and default application for mon-thu daily backups and weekly friday backups. last friday of the month has been excluded for all months in schedules)

Policy 2 - Oracle backup_monthly - defined to just backup on last friday of month


Our weekly and monthly backup schedules have the same backup time window and this cannot be changed due to this is how the business wants to backup and the fact we are a mon-fri business and cannot use other days.

When for example Oracle backup_monthly runs, it kicks off the schedule and starts to run the script but as Oracle backup default application backup as this is the first alphabetically it runs this default application and thus the wrong retention level and backup fails.


Has anyone else experienced this? How did you get around it? Support has basically told me to write 2 scripts for the 2 policies and write in the script the schedule specifically. This is all well and good if you have a small scale amount of servers and databases, but we have multiple databases on multiple servers and what they are asking us to do is double our administrative overhead by doubling the amount of scripts we have (we use 1 script for both policies). Is there any way to script this into 1 script and not 2 as they have said?

Sorry if it is a bit of a ramble or unclear. I can try to explain better if needed.

Cheers,

Nick
1 ACCEPTED SOLUTION

Accepted Solutions

NBUTSE
Level 4
Employee Accredited Certified
Nick,
Unless RMAN tells NetBackup which policy and schedule combination to use, the master server will pick one for you, and in your case it sounds like that's happening, and not picking the policy/schedule combination you want.

So in the actual RMAN command you can add the SEND statement, it goes inbetween the ALLOCATE CHANNEL and BACKUP statements.

The SEND statement should look like:
SEND 'NB_ORA_POLICY=<DesiredPolicyName>,NB_ORA_SCHED=<DesiredApplicationBackupSchedule>';

So let's say we want to backup to the policy called OracleServers, and to the application backup schedule called EndOfMonth, your SEND statement would look like:

SEND 'NB_ORA_POLICY=OracleServers,NB_ORA_SCHED=EndOfMonth';

So that's handy, but now you're asking yourself how do I do this all from the same script, well you've got to add some logic to your scripts, and then change around those values inside of the SEND statement.  When NetBackup kicks off an Oracle type backup from the scheduler, or from a manually initiated backup from the NetBackup Administration Console some variables are passed to your script.  The most valuable variables are NB_ORA_POLICY, and NB_ORA_PC_SCHED.  NB_ORA_POLICY is passed with the name of the policy which has been run, and NB_ORA_PC_SCHED is passed the name of the Automatic schedule.  Seemingly based upon the names of the policy and schedule starting the backups you could then configure the NB_ORA_POLICY, and NB_ORA_SCHED values in the SEND statement.

View solution in original post

3 REPLIES 3

lu
Level 6
We use an external scheduler to run RMAN scripts. The script then determines the 'schedule' thus the retention based on the backup level, the date, etc. Anyway you should be able to merge your 2 policies, into one, set up 2 schedules with exclude dates.

Symontec
Level 5
I have had the same problem through the years and the one solution is to write the EXACT name of the policy in the script but one of them backed up and delete archive logs and the other didnt delete them.

In your case, if your are using the same script in both policies (due to schedule requirements) you can have only one policy with three schedules, the Default-Application and two Full named different (now you are merging both policies).

Regards,
SAF

NBUTSE
Level 4
Employee Accredited Certified
Nick,
Unless RMAN tells NetBackup which policy and schedule combination to use, the master server will pick one for you, and in your case it sounds like that's happening, and not picking the policy/schedule combination you want.

So in the actual RMAN command you can add the SEND statement, it goes inbetween the ALLOCATE CHANNEL and BACKUP statements.

The SEND statement should look like:
SEND 'NB_ORA_POLICY=<DesiredPolicyName>,NB_ORA_SCHED=<DesiredApplicationBackupSchedule>';

So let's say we want to backup to the policy called OracleServers, and to the application backup schedule called EndOfMonth, your SEND statement would look like:

SEND 'NB_ORA_POLICY=OracleServers,NB_ORA_SCHED=EndOfMonth';

So that's handy, but now you're asking yourself how do I do this all from the same script, well you've got to add some logic to your scripts, and then change around those values inside of the SEND statement.  When NetBackup kicks off an Oracle type backup from the scheduler, or from a manually initiated backup from the NetBackup Administration Console some variables are passed to your script.  The most valuable variables are NB_ORA_POLICY, and NB_ORA_PC_SCHED.  NB_ORA_POLICY is passed with the name of the policy which has been run, and NB_ORA_PC_SCHED is passed the name of the Automatic schedule.  Seemingly based upon the names of the policy and schedule starting the backups you could then configure the NB_ORA_POLICY, and NB_ORA_SCHED values in the SEND statement.