Monday, May 30, 2011

RMAN DATABASE BACKUPS TO TAPE

How to backup a database using RMAN to tape. First verify the tape configuration from the following commands …

view sourceprint?
01 $ tdpoconf showenvironment

02 $ tdpoconf showENVironment -TDPO_OPTfile=tdpo.opt

03

04 IBM Tivoli Storage Manager for Databases:

05 Data Protection for Oracle

06 Version 5, Release 5, Level 2.0

07 (C) Copyright IBM Corporation 1997, 2009. All rights reserved.

08

09 Data Protection for Oracle Information

10 Version: 5

11 Release: 5

12 Level: 2

13 Sublevel: 0

14 Platform: 64bit TDPO Linux86-64

15

16 Tivoli Storage Manager Server Information

17 Server Name: TDPAURORA

18 Server Address: GBTSMSERVER

19 Server Type: AIX-RS/6000

20 Server Port: 1500

21 Communication Method: TCP/IP

22

23 Session Information

24 Owner Name: oracle

25 Node Name: tdpb600e6tr01

26 Node Type: TDPO Linux86-64

27 DSMI_DIR: /opt/tivoli/tsm/client/api/bin64

28 DSMI_ORC_CONFIG: /opt/tivoli/tsm/client/oracle/bin64/dsm.opt

29 TDPO_OPTFILE: tdpo.opt

30 Password Directory: /opt/tivoli/tsm/client/oracle/bin64

31 Compression: FALSE

32 License Information: License file exists and contains valid license data.

33

34 [oracle@b600e6tr01 tdpo]$
In this demo i am showing RMAN consistant backup , so shutdown the database and start it again in mount stage.

Then connect to database using rman with catalog database …

view sourceprint?
01 [oracle@b600e6tr01 bkup]$ rman target / catalog rman/rman@rmancat

02

03 Recovery Manager: Release 10.2.0.4.0 - Production on Mon May 2 08:51:22 2011

04

05 Copyright (c) 1982, 2007, Oracle. All rights reserved.

06

07 connected to target database: TESTDB (DBID=38948753088)

08 connected to recovery catalog database

09

10 RMAN>run

11 {

12 allocate channel t1 type 'SBT_TAPE' parms="ENV=(TDPO_OPTFILE=tdpo.opt)";

13 allocate channel t2 type 'SBT_TAPE' parms="ENV=(TDPO_OPTFILE=tdpo.opt)";

14 allocate channel t3 type 'SBT_TAPE' parms="ENV=(TDPO_OPTFILE=tdpo.opt)";

15 backup as compressed backupset check logical incremental level 0 database format 'backup_%d_%I_set%s_piece%p_copy%c_%T_%U' TAG=FULL_BACKUP;

16 backup current controlfile TAG=CURR_CTLFILE;

17 backup spfile TAG=CURR_SPFILE;

18 delete obsolete;

19 }
This will complete the backup of database. But in case if you get any error messages due to tape configuration problems, RMAN will not give you any useful error message. All you have to do is, go to the log file location specified in the configuration file tdpo.opt ( parameter DSMI_LOG ) and review the logfiles. If you dont have this directory created, the default location for tape log files is $ORACLE_HOME/dbs. These log files will give you some useful error messages.

Rectify the issues and execute the RMAN backup script again.

Example error messages from RMAN session :

view sourceprint?01 Starting restore at Apr 13 2011 07:41:20

02 using channel ORA_AUX_SBT_TAPE_1

03 using channel ORA_AUX_DISK_1

04

05 RMAN-00571: ===========================================================