Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

Quick Oracle Backup via Templete

Created: 14 Jul 2011 • Updated: 21 Jul 2011 | 10 comments
Language Translations
Zahid.Haseeb's picture
+1 3 Votes
Login to vote

Today we are going to discuss the oracle databases Backup Activity via Veritas Netbackup Server. In this Activity we will discuss how to take the Backup of Oracle Databases.

Environment

Veritas Netbackup Server = 7.1

OS of Netbackup Server = win2003 R2

Netbackup Client version = 7.1

Client product = Oracle 11g r2

OS of Client = rhel 5.6

 

In this activity we will do the backup step by step as mentioned below.

  1. Some important Prerequisite
  2. Verify that RMAN is working
  3. Start Backup Archive and Restore and Creation of backup Script
  4. Mention script in Oracle Netbackup Policy
  5. Trigger Veritas Netbackup Policy for Backup

 

Some important Prerequisite

Link RMAN with Netbackup Server

In this Some Important Prerequisite topic we link the Oracle with Netbackup API library. We need to run the oracle_link script which automatically link Oracle with Netbackup API library. See the below snaps for to know how to run the script.

(Shutdown all oracle instances before running the oracle_link script. See the attached snaps in the end of Article to know how to shutdown the Oracle instances and how to start when the script run via Oracle Enterprise Manager)

 

Verify Archive Mode is ON

We need to ON the archive Mode ON so we can take the online hot backup of Oracle. To verify that the Archive Mode is ON run the archive log list command from SQL prompt. see the below snaps for reference.

Verify host file enteries of RHEL and Netbackup

      a.) Host file entry of Veritas Netbackup Server

Insert the hostname and ip address of RHEL machine in the host file under the below path

"windows home\system32\drivers\etc"

      b.) Host file entry of RHEL

Same thing we did in rhel OS. See the below snap of host file enteries of Veritas Netbackup Server and RHEL machine for reference:

Verify that RMAN is working

In this topic we will verify that the RMAN is working properly via taking the native backup of Oracle tablespace and a datafile because Netbackup uses RMAN. But first we will do minimal configuration of RMAN, Verify backup path, connect to RMAN and trigger backup of datafile and tablespace.

Configure RMAN

Connect to Oracle Enterprise Manager and go to the Policy tab under Backup Setting. See the below snap for reference. The first check box explains that the Control File and the parameter file (also means SPFILE) also backed up while backup of database.

The Second check box (in the above snap)means that the changed blocks (after a full backup) already known before triggering the incremental backups which make incremental backup process speedy as the backup activity will not read first how many blocks are changed after a full backup.

As you can see Disk Backup Location in the Device tab under Backup Setting which is the location where RMAN keeps backup (in native RMAN backup case). See the below snap for reference:

 

You will also see the Test Disk Backup button (in the above snap) which means that you can check the backup location is properly configured. Here also need the credentials of oracle user which must mention to check the Test Disk Backup. See the below snap for reference.

Disk Backup Test Successful will also be shown if the test will successful. See the below snap for reference:

Connect to RMAN

Now we will connect to RMAN to trigger the backup. See the below snap for reference

 

  

Trigger Backup

  1. Backup of data files

We need to know the datafile no. for backup of particular data file. See the below three snap for reference:

 

Snap # 1

 

 

Snap #2

 

 

Snap #3

 

  1. Backup of tablespace

Now In the below snap we take the backup of a single tablespace. In the first snap we will see the existing tablespace and in the second snap we will take the backup of one table space. See the below two snaps (Snap 3 and 4) for reference:

Snap # 3

 

 

Snap # 4

 

Start Backup Archive and Restore and Creation of backup Script

In this topic we will first create a backup script which we mention in the Backup Selection tab under the backup policy of Netbackup Server.

Start Backup Archive and Restore

Login to RHEL os with oracle user.

Now run the jbpsa  from the below higilighted directory

(Note: Make sure that the Oracle database is in the mount or open state.)

 

Now here you will see the Backup Archive and Restore and enter the oracle user credentials and the instance must be started

(Note: On UNIX systems, how you log onto NetBackup depends on how your Oracle

authentication is configured)

 

At this point you are logged in. Now here select the Oracle as the Policy Type. See the below snap for reference: 

 

Script Creation

Now at this point we will go to create the Oracle Backup script which we will mention in the oracle policy under Veritas Netbackup Server. As you can see in the below snap select the orcl (make sure that the sub folders will also be selected as shown in the below snap too) and click the Backup button

 

( Note:

1.) The NetBackup for Oracle backup wizard does not support all of the RMAN

commands and options that Oracle provides. Write a shell script if a template

does not provide all the functionality you require. 

2.) You can use the bpdbsbora command to create a script from a backup template  )

 

Click on NEXT

Here you mention the sysdba credentials as shown in the below snap.

Now as shown in the below snap select the check box of "include archived redo log in backup" which will also take the backup of archive logs. Makesure if you dont want to delete archive log un check the "Delete archived redo log after are backed up"

 

Leave this setting as default and click on Next three times.

 

Now this is the last window where the script will be saved as per your mention name. In our case we save the sccript as oracle-nbu name. Now click on Finish to close this wizard.

 

Mention script in Oracle Netbackup Policy

Now we will mention the above created script in the Oracle Policy under Veritas Netbackup Server. I hope all knows how to create the Backup Policy in Veritas Netbackup Server. Creation of Backup Policy is not our cup of tea at this Article.

 

Trigger Veritas Netbackup Policy for Backup

Now its time to start taking the backup of Oracle via Veritas Netbackup Server. Take the backup of Oracle and verify in the Netbackup Catalog OR (I have created a tablespace name "ts1" and a data file "df1" in my test environment and triggered the backup policy. See the below snap as reference for backup verification.

I hope its very easy from this Article to understand how to take the Oracle Backup. I tried to make this Article very easy for all sort of viewers so that they can understand easily. Any comments will be appriciated. 

 

Some useful links

http://www.symantec.com/business/support/index?pag...

Comments 10 CommentsJump to latest comment

Tahir Ahmed's picture

smiley thanx for sharing ...

0
Login to vote
Tmy_70's picture

From the Netbackup for Oracle SysAdmin
 
Linking NetBackup for Oracle with RMAN
 
Linking RMAN with a library provided by NetBackup for Oracle on UNIX is the only
 
NetBackup requirement. Before writing to sequential devices such as tape, you must link
 
the Oracle Server software with the media management API library installed by
 
NetBackup for Oracle on UNIX. Oracle uses this library when it needs to write to, or read
 
from devices supported by Media Manager.
 
¥ To link Oracle with NetBackup for Oracle on UNIX
 
1. Become the Oracle user.
 
su - oracle
 
2.
Shutdown all of the Oracle instances (SIDs). The user must connect as sysdba, either
 
using OS Authentication or Oracle Authentication (set up in the Oracle password
 
file). The following example is for Oracle9i.
 
Set the ORACLE_SID environment variable to the first SID.
 
Connect as sysdba using OS Authentication:
 
sqlplus /nolog
 
connect / as sysdba
 
shutdown immediate
 
exit
 
Connect as sysdba using Oracle Authentication (via password file):
 
sqlplus /nolog
 
connect userid/password as sysdba
 
shutdown immediate
 
exit
 
Change the ORACLE_SID environment variable to any other SID that uses this Oracle
 
installation and repeat above commands.
 
3.
Set up automatic linking.
 
a.
Change directory to install_path/netbackup/bin/
 
b.
Run the oracle_link script:
 
./oracle_link
 
This script determines the Oracle version level and then links Oracle to
 
NetBackup accordingly. All output from this script will be captured in a
 
/tmp/make_trace.pid file. To change the trace file location, change the
 
MAKE_TRACE
variable in the oracle_link script.

If this post has helped you, please vote or mark as solution. MBA. TC Venezuela Consultor Power

0
Login to vote
Arvind Yadav's picture

Thanks Zahid,

     Can you use same steps in NBU 7.0 version? 

   Very Nice Article on Oracle backup configuration!!

 

 

 

Thanks & Best Regards,

Arvind Yadav.

0
Login to vote
tarmizi's picture

Hi Zaheed.Haseeb,

May I know where the template reside?I am asuming it would be reside in the master backup server. Am I right?

Thank you

0
Login to vote
shiraz_mj@yahoo.com's picture

hi Zaheed,

Thanks for this info.  However, when I open the BAR, the oracle check box is greyed out and I cannot expand it.  I tried with the root user and also with the oracle user, but the result is the same.  What could be wrong?

sm

0
Login to vote
Vickie's picture

Thanks Zahid for such an nice document, it is very usefull to understand the step by step process.

I really appreciate your input on this topic.

I have a query : Where is the RMAN script exist and what exactly do we need to put in backup selection of policy (is it actual path where RMAN script exist or only name of RMAN script).

Your input would be much appreciated and supportive.

 

Thanks & Regards,

Vickie :-)

0
Login to vote
Zahid.Haseeb's picture

Hello Vickie,

what exactly do we need to put in backup selection

we will select the templete.

 

I hope this will help you..

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

0
Login to vote
Vickie's picture
Thanks Zahib,
But
I was looking at a Oracle policy, but that policy doesn't contains any backup selection (it is blank)
 
Not sure about it, please assist.
0
Login to vote
Zahid.Haseeb's picture

As I have mentioned above. Under the Backup Selection you will need to select Oracle_RAM from Templete Set box. After selecting this you will see the templete (with a .tpl extension) which you already created under  Template.

 

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

0
Login to vote
Vickie's picture
Okay, what  Iget to know is..... if backup selection is blank, that means the DBA will execute the backup from their end using script for particular instance they need.
Is that correct ?
0
Login to vote