Backup filenames - need help

Posted on 2013-01-22
Last Modified: 2013-01-22
Is there a way to tell what type of backup it is by just the file name?

I have a directory where all my backup files are and I don't kow which ones to use for restore since I know some are full backups, some incremental level 0, and some differential level 1 backups. Is there a way to tell?

Here are some examples:

-rw-r-----    1 oracle   dba       297289216 Jan 18 13:59 o1_mf_annnn_TAG20130118T135917_8hm6w5tb_.bkp
-rw-r-----    1 oracle   dba       712884224 Jan 18 13:59 o1_mf_nnndf_TAG20130118T135920_8hm6w93h_.bkp
-rw-r-----    1 oracle   dba         7798784 Jan 18 13:59 o1_mf_ncsnf_TAG20130118T135920_8hm6wk9l_.bkp
-rw-r-----    1 oracle   dba            3072 Jan 18 13:59 o1_mf_annnn_TAG20130118T135930_8hm6wlhl_.bkp
-rw-r-----    1 oracle   dba       713162752 Jan 18 14:14 o1_mf_nnnd0_TAG20130118T141414_8hm7r70g_.bkp
-rw-r-----    1 oracle   dba         7798784 Jan 18 14:14 o1_mf_ncsn0_TAG20130118T141414_8hm7rh65_.bkp
-rw-r-----    1 oracle   dba       144826368 Jan 22 10:41 o1_mf_nnnd1_TAG20130122T104113_8hxdrsp8_.bkp
-rw-r-----    1 oracle   dba         7798784 Jan 22 10:41 o1_mf_ncsn1_TAG20130122T104113_8hxds1t9_.bkp

Open in new window

Question by:YZlat
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38806086
For can control some aspects of the file names generated.

check the docs:

You will need to check your backup script to see what variables you are currently setting.
LVL 35

Author Comment

ID: 38806091
for backup I used RMAN commands




that's all
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38806122
I'm not sure what the 'default' format is.  The doc link I provided should tell you this.

If you want anything other than the default, you will have to specify the format.

You should be able to use a REPORT or LIST rman command that will tell you what file is part of what backup.

Report link:

List link:
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 35

Author Comment

ID: 38806274
I looked over the document you have provided but still can't figure out how to figure out backup type from the filename created by default. COuld you please break it down for me?
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38806310
In the doc link it states the 'default' naming:
%U    Specifies a system-generated unique file name (default).

From my scan of that doc, it doesn't look like you can tell from the file name itself.  I also didn't see where it has a varialbe that does.

You might need to set up individual tags for the different types of backups to get this as part of the file names.

Otherwise the list or report commands should have them.
LVL 35

Author Comment

ID: 38806533
how do you usually specify the backup filename from your BACKUP command?

And do you just run a command from the command line or do you have a separate backup script?
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38806555
You should create an RMAN script to handle your backups.

The BACKUP command accepts a format parameter:
LVL 35

Author Comment

ID: 38806712
could you give me an example of an RMAN script? I am new to all this
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38806811
Sorry but no.  The script will need to represent your specific backup requirements.  What works for one database will likley not work for another.  Therefore, no two scripts will likely be alike.

There are a ton of examples out there on rman scripts that show different ways of doing things.  Once you have decided on a backup and recovery strategy that works for your requirements, it is just coming up with the commands and placing them in a file.

An example requirement that you need to decide on:  For your incrementals, will you be using block change tracking?

I can say that I've chosen to use a rolling incremantal method.  This takes the last incremental backup and rolls it into the full (level 0).  Then I only ever need to recover one full and possible one incremental no matter what day the crash happens on.

The docs talk aobut this.
LVL 35

Author Comment

ID: 38806829
So I tried specifying the TAG in order to recognize better my backups, and I tried usingg incremental backup, level 0 and level 1 differential.

I ran:


but then when I ran


I kept getting an error on the word database. It only worked when I specified the same tag as for the level 0 backup:


Why is that? And how, in this case, can I tell apart level 0 and level 1 backups?
LVL 77

Accepted Solution

slightwv (䄆 Netminder) earned 500 total points
ID: 38806864
TAG's was just a thought.  You may not be able to use them to distinquish the different levels.

You will just need to read about them and play a little.  I don't have the requirement to tell the difference between a full and incremental in my files so I've never tried.

>>Why is that?

Not sure.  I can only go by what the docs tell me:

In practice, tags are often used to distinguish a series of backups created as part of a single strategy, such as an incremental backup strategy. For example, you might create a weekly incremental backups with a tag like BACKUP TAG weekly_incremental. Many forms of the BACKUP command let you associate a tag with a backup, and many RESTORE and RECOVER commands let you specify a tag to restrict which backups to use in the RESTORE or RECOVER operation.

>>And how, in this case, can I tell apart level 0 and level 1 backups?

I don't know that you can tell from this.  It may require a LIST or REPORT from RMan.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question