In my
first article, I wrote about installing oracle agent, Now we are going to Configure a Policy to take a successful backup
> Check and verify that you have a license for oracle backups
> Create a new policy with type as Oracle
All database backups create a default application type schedule with the name 'Default-Application-Backup'. There is nothing wrong with this schedule being 24x7, as Netbackup scheduler will never start this schedule. To schedule your backups, you have to create a new schedule "Automatic backups", give it a name that you would like eg full-backup.
Note that Netbackup scheduler will start a backup job based on Automatic schedule type. You can modify the Default-Application-Backup schedule, to match the Automatic Backup schedule window. Be careful here. There will be numerous jobs that would come from the client . If the Default-Application-Schedule is not wide enough to cover all the jobs, some jobs will fail [with 196 or 199 error codes]
For example, I want oracle backups to be taken every 3 days, and I want these backups to go to a particular volume pool with a specific retention period, I will have to modify the Default-Application-Backup schedule to coincide with my Automatic backup schedule, and I'll select the "Override policy storage selection", and "Override policy volume pool"
Backups taken every 3 days will he held for 10 days, and will go to a volume pool named Oracle-3days
I Also want a Full Weekly Backup to be taken on Sunday, and I'd like it to be retained for 2 months:
> Client name should be the name of the oracle server.
> Backup selection would be the name of the script that XBSA client would start. This script contains the rman commands to backup the database.
Sample rman scripts are available in the /usr/openv/netbackup/ext/db_ext/oracle/samples/rman
We'll configure the hot_database.sh script. But first for convenience sake, we'll copy this script in /opt/oracle/scripts directory. Change the following parameters in the script
RMAN_LOG_FILE=${0}.out
This specifies the file where the output of the script would be logged.
NOTE: It is not necessary to change this parameter (rman output logging), but I've seen with Oracle 10gR2 that the backup fails immediately with a error message
RMAN-01005: syntax error: found "dot": expecting one of: "double-quoted-string, equal, identifier, single-quoted-string"
http://seer.entsupport.symantec.com/docs/249670.htm
Hence, I'd recommend to change the rman logging to be hard coded to a file name such as /opt/oracle/oracle-backup.out
Other parameters to be modified in the script:
ORACLE_HOME=<YOUR ORACLE_HOME PATH>
export ORACLE_HOME
ORACLE_SID=<SID>
export ORACLE_SID
ORACLE_USER=oracle (OS User who is the Oracle Owner)
TARGET_CONNECT_STR=sys/<password>
It is a good practice to specify the backup policy name in the script
set NB_ORA_POLICY=Oracle-Policy
export NB_ORA_POLICY
To verify if your database is running in ARCHIVELOG mode or NOARCHIVELOG mode, run this command as oracle user:
sqlplus "sys/PASSWORD@SID as sysdba"
On the sqlplus prompt, run
select log_mode from v$database;
(Ref: http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/archredo008.htm)
If this returns ARCHIVELOG , Good, we are almost ready to take online, hot backups of the database through the script we modified
LOG_MODE
------------
ARCHIVELOG
If your database is in NOARCHIVELOG mode, you can either configure cold database backups, or change the database to ARCHIVELOG mode.
Ensure that can contact bprd on the master server from the oracle client i.e. You need to open 13720 port in the firewall. You can also configure more than 2 channels for backup, but that requires TCP/IP tweaking to be done as database backups consume more ports than a standard filesystem backup.
Ok, so we start the script from the client , or let the netbackup scheduler start the backup, you should see backup jobs in Activity monitor now. These jobs would be using the Default-Application-Backup schedule, and the retention specified in that schedule.