Solved

Backup filenames - need help

Posted on 2013-01-22
11
416 Views
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

0
Comment
Question by:YZlat
  • 6
  • 5
11 Comments
 
LVL 76

Expert Comment

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

check the docs:
http://docs.oracle.com/cd/E11882_01/backup.112/e10643/rcmsubcl010.htm#RCMRF195

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

Author Comment

by:YZlat
ID: 38806091
for backup I used RMAN commands

BACKUP INCREMENTAL LEVEL 0 DATABASE;

and

BACKUP INCREMENTAL LEVEL 1 DATABASE;

that's all
0
 
LVL 76

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:
http://docs.oracle.com/cd/E11882_01/backup.112/e10643/rcmsynta2006.htm#i84684

List link:
http://docs.oracle.com/cd/E11882_01/backup.112/e10643/rcmsynta027.htm#i82460
0
 
LVL 35

Author Comment

by:YZlat
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?
0
 
LVL 76

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.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 35

Author Comment

by:YZlat
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?
0
 
LVL 76

Expert Comment

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

The BACKUP command accepts a format parameter:
http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmbckba.htm#CEGBCICH
0
 
LVL 35

Author Comment

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

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.
0
 
LVL 35

Author Comment

by:YZlat
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:

BACKUP INCREMENTAL LEVEL 0 TAG 'inc_level_0_' DATABASE;

but then when I ran


BACKUP INCREMENTAL LEVEL 1 TAG 'inc_level_1_diff_' DATABASE;

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

BACKUP INCREMENTAL LEVEL 1 TAG 'inc_level_0_' DATABASE;

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

Accepted Solution

by:
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:

http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmbckba.htm#CEGGGDIJ

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.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
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 how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

706 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now