cancel
Showing results for 
Search instead for 
Did you mean: 

ORACLE media needed - based on RMAN bk value

David_McMullin
Level 6

I know I can run a command to see what media I need to restore an oracle backup, using commands like this:

bpimagelist -media -U -d 04/10/2010 -e 04/12/2010 -policy "RMAN.POLICY.NAME" | sort -k1n


My oracle DBA want to find which media are needed for a specific RMAN piece designated in THEIR logs as this:

bk_153767_1_660546245


I used to be able to run this command on the source client:

bpclntcmd -ml /bk_153767_1_660546245 -ct Oracle -s 01/01/10

with output like this:
1 1 001328

Which would tell me that tape 001328 had the data.

This command is not working for me anymore - does anyone have any thoughts on how to generate the media the data is on?



Thanks!


NBU 6.5.4 on Solaris 10
writing to EMC 4206 VTL
duplicating to LTO2 in SL8500
ACSLS 7.3.0
1 ACCEPTED SOLUTION

Accepted Solutions

David_McMullin
Level 6

From:enterprise_support@symantec.com [mailto:enterprise_support@symantec.com]
Sent: Tuesday, August 19, 2008 3:32 PM
To: David McMullin
Subject: Case 291-053-107 (Needs media that matches the restore on Oracle DBA...)
Mr. McMullin,

Good afternoon. My name is Brice Avila, and I am the Symantec technical support engineer currently assigned to your case 291-053-107 concerning how to identify the media needed for an oracle restore. My contact information is below. While I plan to contact you soon, I thought I would first send you an email of commands to try. Please note:

* The Oracle RMAN utility, referencing the control files or RMAN catalog database, knows what backupsets are needed for a restore.
* While there is an RMAN command that will list the images that a particular backupset resides on, but this list is incomplete if an image spans several media. (MY EMPHASIS)
* Only RMAN knows what backup pieces are needed for a restore.
* If we know what backup pieces are requested, we can use NetBackup commands to locate the media these backup pieces reside on.

Using your list of backup piece ids, probably the best command to use is 'bpclntcmd'. Unfortunately this command is undocumented and unsupported, but it has been known to work well. It must be executed from the Oracle client either as user root or the owner of the Oracle backup images(MY EMPHASIS) (see output from bplist -l). For example:
 
    /usr/openv/netbackup/bin/bpclntcmd -ml <filename> -ct Oracle

    $ bpclntcmd -ml /bk_1727_1_588103217 -ct Oracle
    1 1 DLT004
    1 2 DLT004
    1 3 DLT004
    1 4 DLT004
    1 5 DLT004

The search can be made more concise by specifying the start and end times for the search.  The default is to look from time = 0 to the present.
 
    $ bpclntcmd -ml /bk_1727_1_588103217 -ct Oracle -s 04/01/06 -e 04/19/06

Please note that with a slightly different syntax it can expire the image, deleting it from the NetBackup catalog.

    $ bpclntcmd -di /bk_1727_1_588103217 -ct Oracle

More about this bpclntcmd command can be found on page 47 of the ‘NetBackup 6.5 Troubleshooting Guide for UNIX, Linux and Windows’ located at ‘http://support.veritas.com/docs/290230’. More about the bplist command can be found on page

* 178 of the ‘NetBackup 6.5 Commands for UNIX’ located at ‘http://support.veritas.com/docs/290234’
* 170 of the ‘NetBackup 6.5 Commands for Windows’ located at ‘http://support.veritas.com/docs/290235’

There are two other ways to make a good educated guess:

1. One of the easiest ways would be display the ‘Images On Media’ report and specify the narrowest criteria to isolate the client, policy, schedule, and date range when the backup(s) occurred.
 
     bpimmedia -L -client name -policy name -sl sched_name -d date -e date

More about this bpimmedia command is found on page

* 145 of the ‘NetBackup 6.5 Commands Guide for UNIX and Linux’ located at ‘http://support.veritas.com/docs/290234’
* 138 of the ‘NetBackup 6.5 Commands for Windows’ located at ‘http://support.veritas.com/docs/290235’

2. A less user friendly listing can be obtained using the following command.  However, it supports some additional command options that can be used to further filter the image selection criteria

     bpimagelist -l -client name -pt Oracle | grep FRAG | cut -f9 -d' ' | sort | uniq
or
     bpimagelist -L -client name -pt Oracle | egrep ' ID:|Backup Time:'

More about this bpimagelist command is found on page

* 137 of the ‘NetBackup 6.5 Commands Guide for UNIX and Linux’ located at ‘http://support.veritas.com/docs/290234’
* 131 of the ‘NetBackup 6.5 Commands for Windows’ located at ‘http://support.veritas.com/docs/290235’

View solution in original post

4 REPLIES 4

Andy_Welburn
Level 6
When did it work? A previous NB version?

Looking at the man page for bpclntcmd I cannot see options -ct nor -s.

-ml still appears to be a valid option. Does it work just with this option?

David_McMullin
Level 6
Here is my note from 2008: It helps to speed it up if I give a start date - when I added the date it made a tremendous difference. for i in bk_153767_1_660546245 bk_153768_1_660546245 bk_154929_1_660616496 bk_154930_1_660616496 bk_154931_1_660616496 bk_154932_1_660616496 bk_155153_1_660632920 bk_155154_1_660632920 do echo $i bpclntcmd -ml /$i -ct Oracle -s 01/01/08 done bk_153767_1_660546245 1 1 001328 bk_153768_1_660546245 1 1 004381 bk_154929_1_660616496 1 1 004423 bk_154930_1_660616496 1 1 004423 bk_154931_1_660616496 1 1 004423 bk_154932_1_660616496 1 1 004423 bk_155153_1_660632920 1 1 002063 bk_155154_1_660632920 1 1 004423 # Looks like 1328, 4381, 4423, 2063 Here is what I would normally do: # bpimagelist -media -U -d 07/20/2008 -e 07/21/2008 -policy "RMAN_ICCON_arch" | sort -k1n -------- ---------------- ---------- Media ID Last Written Server 001328 07/20/2008 05:04 leon 001408 07/20/2008 05:04 leon 002063 07/21/2008 05:32 leon 004381 07/20/2008 05:15 lenny 004423 07/21/2008 05:22 leon 004763 07/21/2008 19:26 lenny 004930 07/21/2008 19:05 leon 005458 07/21/2008 19:05 lorenzo Gives more tapes, but a lot faster and easier for me to provide - all I need is the policy and the dates. One command vs running the bpclntcmd multiple times and then having to remove duplicates.

David_McMullin
Level 6

From:enterprise_support@symantec.com [mailto:enterprise_support@symantec.com]
Sent: Tuesday, August 19, 2008 3:32 PM
To: David McMullin
Subject: Case 291-053-107 (Needs media that matches the restore on Oracle DBA...)
Mr. McMullin,

Good afternoon. My name is Brice Avila, and I am the Symantec technical support engineer currently assigned to your case 291-053-107 concerning how to identify the media needed for an oracle restore. My contact information is below. While I plan to contact you soon, I thought I would first send you an email of commands to try. Please note:

* The Oracle RMAN utility, referencing the control files or RMAN catalog database, knows what backupsets are needed for a restore.
* While there is an RMAN command that will list the images that a particular backupset resides on, but this list is incomplete if an image spans several media. (MY EMPHASIS)
* Only RMAN knows what backup pieces are needed for a restore.
* If we know what backup pieces are requested, we can use NetBackup commands to locate the media these backup pieces reside on.

Using your list of backup piece ids, probably the best command to use is 'bpclntcmd'. Unfortunately this command is undocumented and unsupported, but it has been known to work well. It must be executed from the Oracle client either as user root or the owner of the Oracle backup images(MY EMPHASIS) (see output from bplist -l). For example:
 
    /usr/openv/netbackup/bin/bpclntcmd -ml <filename> -ct Oracle

    $ bpclntcmd -ml /bk_1727_1_588103217 -ct Oracle
    1 1 DLT004
    1 2 DLT004
    1 3 DLT004
    1 4 DLT004
    1 5 DLT004

The search can be made more concise by specifying the start and end times for the search.  The default is to look from time = 0 to the present.
 
    $ bpclntcmd -ml /bk_1727_1_588103217 -ct Oracle -s 04/01/06 -e 04/19/06

Please note that with a slightly different syntax it can expire the image, deleting it from the NetBackup catalog.

    $ bpclntcmd -di /bk_1727_1_588103217 -ct Oracle

More about this bpclntcmd command can be found on page 47 of the ‘NetBackup 6.5 Troubleshooting Guide for UNIX, Linux and Windows’ located at ‘http://support.veritas.com/docs/290230’. More about the bplist command can be found on page

* 178 of the ‘NetBackup 6.5 Commands for UNIX’ located at ‘http://support.veritas.com/docs/290234’
* 170 of the ‘NetBackup 6.5 Commands for Windows’ located at ‘http://support.veritas.com/docs/290235’

There are two other ways to make a good educated guess:

1. One of the easiest ways would be display the ‘Images On Media’ report and specify the narrowest criteria to isolate the client, policy, schedule, and date range when the backup(s) occurred.
 
     bpimmedia -L -client name -policy name -sl sched_name -d date -e date

More about this bpimmedia command is found on page

* 145 of the ‘NetBackup 6.5 Commands Guide for UNIX and Linux’ located at ‘http://support.veritas.com/docs/290234’
* 138 of the ‘NetBackup 6.5 Commands for Windows’ located at ‘http://support.veritas.com/docs/290235’

2. A less user friendly listing can be obtained using the following command.  However, it supports some additional command options that can be used to further filter the image selection criteria

     bpimagelist -l -client name -pt Oracle | grep FRAG | cut -f9 -d' ' | sort | uniq
or
     bpimagelist -L -client name -pt Oracle | egrep ' ID:|Backup Time:'

More about this bpimagelist command is found on page

* 137 of the ‘NetBackup 6.5 Commands Guide for UNIX and Linux’ located at ‘http://support.veritas.com/docs/290234’
* 131 of the ‘NetBackup 6.5 Commands for Windows’ located at ‘http://support.veritas.com/docs/290235’

Andy_Welburn
Level 6
Thanks for the update.

Be a good idea if we could have these undocumented commands & options documented! wink