Skip to Main Content
  • Questions
  • Partially cloning databases using RMAN or Hot backups

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Simon .

Asked: March 25, 2001 - 9:24 am UTC

Last updated: January 21, 2009 - 12:10 pm UTC

Version: 8.1.6

Viewed 10K+ times! This question is

You Asked

Hi Tom,

I have 2 questions hovering over my head:
1. Can I clone a source database to a target database using RMAN dumps?Assuming that the target database is on a different server and with a differenct DB_NAME, but on the same platform, same blocksize, same character set.
2. Using hot backups of a particular tablespace, can I restore the tablespace to another database? Assuming both databases are of the same version and on the same platform, same blocksize and same char set.

Any answers or hints are much appreciated!
Simon

and Tom said...

1) yes, there is a whole chapter on this called
Creating a Duplicate Database with Recovery Manager
in the RMAN guide:
</code> http://docs.oracle.com/cd/A81042_01/DOC/server.816/a76990/dupdb.htm#441628

2) not a HOT backup.  You can transport a tablespace using EXP and IMP.  See
http://docs.oracle.com/cd/A81042_01/DOC/server.816/a76955/ch01.htm#40944 <code>

for details. You can take a HOT backup, restore what you want to another machine, detach the tablespace from that database and attach it to another database if you do not want to have to put the primary databases tablespace into read only mode for a moment.



Rating

  (22 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

methods of db cloning

jianhui, June 19, 2003 - 2:52 pm UTC

I dont use rman duplicate command, instead, i take a rman backup from production and then restore it to a different host for testing. This way the DBID is the same as production. Since i dont user catalog database, so i need to restore the control files first then restore and recover the whole database. If using catalog database, then the DBID should not be the same and i need to use rman duplicate command.

There are some other methods can be used to do database level cloning, For example, hot or cold backup without using rman.

For tablespace level or user level, exp & imp can come into play, Transportable TBS is another good option which has better performance.

For table level, use DBlink and write PL/SQL or SQL in SQL*PLUS can do the work.


rman duplicate command

jianhui, June 23, 2003 - 6:00 pm UTC

Tom,
I want to clone DB1 in HOST1 to HOST2 with different directory structure.

Following the Ch7 of the duplicate database to remote host with different directory, i've done steps 1-5 sucessfully, but the step6 i got problem.

When I used rman duplicate to clone the database, i got the message says that the rman is not able to find the backup or image copy of the datafiles.

I have rman backup of DB1 in HOST1 's local disk, and my allocate channel command points the format to HOST1's local disk, RMAN also runs in HOST1.

1)So, the question is why doesnt RMAN see the backup set? Because RMAN use target control file as repository in my case, so it knows the location of the backup set. This location is in the same HOST1 where rman runs, so rman should be able to find the backup set. I'm totally lost.

Besides, i also copy the backup set to HOST2, and tried to allocate the auxiliary channel to HOST2's directory, but i got the same error message.

2) question, assume HOST2 cant see HOST1's file system, then where should i put the backup set? The document says it should be seen by the machine where RMAN is running.



A reader, August 08, 2004 - 7:51 am UTC

Is is possible to use hotbackups to clone a database?

I'm being tasked to duplicate a prod db to a test db. The test DB would be located in the same machine. I'm not allowed to do cold backups as this is a 24*7 application

On my first try, I got to the part of "recover database using backup controlfile" I was a bit surprised when the recoverystarted prompting for archived redo logs that are newer that those produeced when i "alter system switch logfile".

Thanks.

Tom Kyte
August 08, 2004 - 9:58 am UTC

sure.

recover database using backup controlfile UNTIL CANCEL;
^^^^^^^^^^^^

and cancel when you've applied the *last* archive you want to apply.

Thanks

RJV, August 08, 2004 - 11:56 am UTC

(i'm the reader who posted the last followup)

I was able to do it using your other answers from other earlier queries. (kudos to your excellent search engine). Maybe I just missed something in my first try.

I'm going home earlier tonight. :p thanks



reader

A reader, June 17, 2005 - 10:39 am UTC

</code> http://download-east.oracle.com/docs/cd/A81042_01/DOC/server.816/a76955/ch01.htm#40944 <code>

Resynchronizing the Duplicate Database with the Target Database

It is not very clear whether duplicate database uses it own
controlfile or just startup nomount. Then issue duplicate
command. Also it is not very clear if the backupsets
have to be copied to auxiliary host before issuing
duplicate command

Tom Kyte
June 17, 2005 - 3:54 pm UTC

so, why are we pointing at 8.1.6 transportable tablespace documentation?

reader

A reader, June 18, 2005 - 7:21 am UTC

Sorry, took the wrong link from your answer to the original
posting.
</code> http://download-east.oracle.com/docs/cd/A81042_01/DOC/server.816/a76990/dupdb.htm#441628 <code>

During duplication of database using RMAN, we
1. copy the backupsets to remote
2. connect to primary database, remote database and catalog
and type the duplicate command.

What exactly is the significance for connecting to primary.
Since all the information is at remote site, what exactly
is the significance of connecting to primary also. If
primary is PRODUCTION, is there any performance impact to
production during duplicate

Tom Kyte
June 18, 2005 - 7:18 pm UTC

it is trying to duplicate the database up as far as it can -- all archived redo on the source is used.

If you don't want such a "current copy", you could certainly just do a restore out of RMAN of a backup to another host.

Duplicate Database

Rahul, August 24, 2005 - 9:47 am UTC

Hi Tom,

can please list the steps for creating the duplicate database.

what i thing is to copy all datafile and logfiles the duplicate database location and then connect to the recovery coatalog and then connect to the target duplicate database.

but some thing is missing at my end or i'm doing wrong process ?
can you please list the steps from first, means what to do?

Tom Kyte
August 24, 2005 - 2:23 pm UTC

</code> http://docs.oracle.com/docs/cd/B10501_01/server.920/a96566/rcmconc2.htm#462471 <code>

if you are trying to use rman, best to check out its docs and use it to do it.

Using RMAN to clone the Subset of the historical database

Krish, March 01, 2007 - 1:18 am UTC

Hello Tom,
I need to clone a 9i production database to my small test environment.Say,If the user has accidently dropped the package.
So in this case I want to clone only my system,undo and the other needed tablespace using RMAN so that I can bring up the subset of my production database on a test environment and extract the package definition.

I have copied the RMAN backup to my test environment,set the dbid,restored spfile,controlfile,restored tablespaces "SYSTEM","UNDO".

Now I am stuck and not able to do point in time recovery on database as it asks to restore the rest of the datafile(huge) which I dont want to.

Please let me know how to proceed further.

Thank You

Duplicate database

A reader, August 26, 2008 - 10:30 am UTC

Tom,

I am going to "clone" our very important prod database using rman duplicate command.

I already created rman backup set of prod and shipped the files to the test server and created a parameter file on test. Now I am going to start "duplicate target database" command from rman prompt (on the test host).

Oracle documentation says that I first need to connect to prod database (connect target) with the user sys.

I am a bit concerned starting this process because I don't know what impact this will have on my prod database. I was not able to find in the Oracle documentation what type of commands wil be executed against my prod database during duplicating (again - it is very and very important database). We are not using catalog, but control file.

My second question is why do I need connection to the prod database at all (as I have full backup of prod including control files and archivelogs on the test server).
If it possible I will exclude access to the prod database from the test host at all (in the future developer should be able to refresh test database using only copy of backupsets and they should not access prod db.)
Tom Kyte
August 26, 2008 - 9:32 pm UTC

it'll try to figure out "where" in time the production database is.

If you don't care where production is, why not just RESTORE to a point in time, production?

that'll not touch production at all

Cloning database

A reader, August 27, 2008 - 11:16 am UTC

Restoring prod on the test machine could be an option - but we want that our test database has a different database name and db id. Is this possible to change both after restoring?
Tom Kyte
August 29, 2008 - 11:48 am UTC

$ nid

DBNEWID: Release 10.2.0.2.0 - Production on Fri Aug 29 11:26:48 2008

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Keyword     Description                    (Default)
----------------------------------------------------
TARGET      Username/Password              (NONE)
DBNAME      New database name              (NONE)
LOGFILE     Output Log                     (NONE)
REVERT      Revert failed change           NO
SETNAME     Set a new database name only   NO
APPEND      Append to output log           NO
HELP        Displays these messages        NO



http://docs.oracle.com/docs/cd/B19306_01/server.102/b14220/utility.htm#sthref1804

another reader

reebokdiver, August 27, 2008 - 11:49 am UTC

After you restore the database there are many ways to change the name and DBID. One way is to read chapter 16 "DBNEWID Utility" in the "Utilities Manual" that allows you to change both the name and DBID at the same time. On the server were you restored the database make entries in the tnsnames.ora file for the old and new names before you proceed.

Alexander, January 05, 2009 - 2:28 pm UTC

Hello Tom,

I am looking into improving the process for which we refresh production data to test environments. Currently we manually export/import, which as you know is quite slow not to mention exp is going away.

I am considering using duplicate database because a book a got recently said this could easily be scripted to run whenever you wanted. Some questions for you are, would this be your approach? Would it be relatively easy to take inputs to only do specific tablespaces? From the reading I've done so far, it looks like bringing the database down is unaviodable unless I data pump.

Since right now we are on 10g, I would have to take a backup on the production, copy it to the test node, and restore from there. This sounds possible, but I don't know how "easy" it would be. Not sure how to go about copying files in an RMAN script for example, got any suggestions? Thanks a lot.
Tom Kyte
January 05, 2009 - 2:41 pm UTC

I would even suggest "restore a backup"

that will prove you can, that you know how to, and will test the integrity of your backups.

the duplicate database will do it as well, but a restore of a backup will get it very nicely and test your ability to recover at the same time.

bringing down the database would not be necessary - not for duplicate, not for a restore - where did you get the impression otherwise? any links?


if you don't know how to restore your backups to another machine - this is a good chance to learn. It should not really involve the current production machine at all. Ask yourself "what would I do if production failed totally, what steps would I undertake"

and then do them.

And if you do not know what you would do - perfect - you now have an excuse to get that together.

Alexander, January 05, 2009 - 3:07 pm UTC

The main purpose for doing this would be to automate the process. We have entire exercises 4 times a year dedicated to practicing disaster recoveries.

I went with duplicate database because I was thinking it might be easier to script the dynamic inputs (full vs. tablespace restores) by using the skip clause.

To restore into test, I have to shut it down, I didn't mean the production system. But now that you mention it, I could use existing backups to do this and not have to touch the production database.

If you got requests to do this multiple times a week you wouldn't want to do it manually every time right?
Tom Kyte
January 05, 2009 - 4:33 pm UTC

an rman script to restore isn't very manual - not sure what manual steps you are referring to - you would have it scripted to do this, sure.

Alexander, January 05, 2009 - 4:48 pm UTC

Right, that's what I'm shooting for but I'd like to be able to make it as portable as possible so it could be used on any database. I was thinking of a shell script that calls a RMAN script.

I am drawing a blank about accessing the production backups from the script I'd be calling on the test box programactically. Actually, I can run host commands via RMAN right? So I could scp the files I needed over. Does this sound like the right track, am I making sense?
Tom Kyte
January 05, 2009 - 6:25 pm UTC

tell me this:

production machine fails, water pipe over it burst.

how do you restore to machine X sitting over there in the corner, what is your process for that, how do the rman backups get onto that machine.

A reader, January 05, 2009 - 11:40 pm UTC

If we lost everything (datafiles, redo logs, control files) we'd restore from tape (the database resides on a SAN not the server) which is totally not what I want to do here.

Tape = slow, inefficient, unreliable. But that's our last resort. If you are talking about media failure, we do backup to disk in which case I would just run a restore for whatever needs fixing.
Tom Kyte
January 06, 2009 - 8:41 am UTC

if tape = unreliable, you think you would really want to 'test it' - often.

if you have a backup to disk
and that backup is on a san
isn't that backup available to this other machine?

Alexander, January 06, 2009 - 11:24 am UTC

Is well tested, it tests consistently bad. We are in the process towards moving to a disk based storage system that works infinitely better, but we're not quite there yet.

We are not using an RMAN catalog, the only way I know of do to what you are saying is to overlay test with the prod control files from backup and restore whatever.

I'd like to have the option of restoring the entire database, or just a tablespace(s), based on inputs. Do you favor this over duplicate database?
Tom Kyte
January 06, 2009 - 12:52 pm UTC

why are you not using the catalog?

you can restore the control files from the backup and do a cancel based recovery. You don't need to touch production for this.



... I'd like to have the option of restoring the entire database, or just a
tablespace(s), based on inputs. Do you favor this over duplicate database? ...

I neither favor nor disfavor either approach - duplicate database can do it just as well

Alexander, January 07, 2009 - 10:20 am UTC

I got here, no one was using a catalog. Oracle is relatively new to this organization. What are the benefits? I know you can do multiple point in time recoveries.

Can you clarify something about duplicate database for me. The metalink note I was reading said you need to copy the backup you want to use for the refresh from the source machine to the target. However, the 11g RMAN Recipe book I have makes no mention of this. If I connect to both instances in RMAN, will it be smart enough to figure out what backups to use? (Remember I am on 10g, I don't mean that new feature that allows you to avoid using backups for duplicate database.)

Thanks again.

Alexander, January 20, 2009 - 2:35 pm UTC

Tom, can you please help me get duplicate database working.

I am running this

run{
allocate channel c1 device type disk;
allocate channel c2 device type sbt_tape;
allocate auxiliary channel c3 device type disk;
allocate auxiliary channel c4 device type sbt_tape;

SET NEWNAME for tempfile 1 to '/ocms01d/data/temp01.dbf';

DUPLICATE TARGET DATABASE TO ocms01d
SKIP TABLESPACE USERS, FTCS_FO_DATA, FTCS_QA_DATA
  LOGFILE
    GROUP 1 ('/ocms01d/data/redo01.log','/ocms01d/data/redo02.log','/ocms01d/data/redo03.log') SIZE 200M REUSE, 
    GROUP 2 ('/ocms01d/backup/redo01.log','/ocms01d/backup/redo02.log','/ocms01d/backup/redo03.log') SIZE 200M REUSE;

}

I configured these

CONFIGURE AUXNAME FOR DATAFILE 1 to '/ocms01d/data/system01.dbf';
CONFIGURE AUXNAME FOR DATAFILE 2 to '/ocms01d/data/undotbs01.dbf';
CONFIGURE AUXNAME FOR DATAFILE 3 to '/ocms01d/data/sysaux01.dbf';
CONFIGURE AUXNAME FOR DATAFILE 5 to '/ocms01d/data/FTCS_DATA.dbf';
CONFIGURE AUXNAME FOR DATAFILE 6 to '/ocms01d/data/FTCS_BC_DATA.dbf';


But I'm getting this on all the datafiles

channel c4: starting datafile backupset restore
channel c4: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /ocms01d/data/system01.dbf
restoring datafile 00002 to /ocms01d/data/undotbs01.dbf
restoring datafile 00003 to /ocms01d/data/sysaux01.dbf
restoring datafile 00005 to /ocms01d/data/FTCS_DATA.dbf
channel c4: reading from backup piece backup_OCMS01T_fpk3rks2_1_1
ORA-19870: error reading backup piece backup_OCMS01T_fpk3rks2_1_1
ORA-19507: failed to retrieve sequential file, handle="backup_OCMS01T_fpk3rks2_1_1", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
   ANU2614E Invalid sequence of function calls to Data Protection for Oracle
failover to previous backup

released channel: c1
released channel: c2
released channel: c3
released channel: c4
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 01/20/2009 14:16:55
RMAN-03015: error occurred in stored script Memory Script
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 5 found to restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 2 found to restore
RMAN-06023: no backup or copy of datafile 1 found to restore

I'm following this document

< http://download.oracle.com/docs/cd/B19306_01/backup.102/b14191/rcmdupdb.htm#i1006946 >
Tom Kyte
January 20, 2009 - 3:40 pm UTC

...
RMAN-06023: no backup or copy of datafile 5 found to restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 2 found to restore
RMAN-06023: no backup or copy of datafile 1 found to restore
....

did you see those messages?
can you comment on those messages? do you think you have backups of those files?

Alexander, January 20, 2009 - 3:51 pm UTC

[oracle@x602kdc ~]$ rman target /

Recovery Manager: Release 10.2.0.3.0 - Production on Tue Jan 20 15:44:56 2009

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: OCMS01T (DBID=154361649)

RMAN> list backup summary;


List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
2552    B  F  A SBT_TAPE    03-JAN-09       1       1       NO         TAG20090103T030122
2553    B  A  A SBT_TAPE    03-JAN-09       1       1       NO         TAG20090103T032528
2554    B  F  A SBT_TAPE    03-JAN-09       1       1       NO         TAG20090103T032532
2561    B  A  A SBT_TAPE    04-JAN-09       1       1       NO         TAG20090104T030106
2562    B  F  A SBT_TAPE    04-JAN-09       1       1       NO         TAG20090104T030111
2563    B  A  A SBT_TAPE    04-JAN-09       1       1       NO         TAG20090104T032407
2564    B  F  A SBT_TAPE    04-JAN-09       1       1       NO         TAG20090104T032411
2571    B  A  A SBT_TAPE    05-JAN-09       1       1       NO         TAG20090105T030107
2572    B  F  A SBT_TAPE    05-JAN-09       1       1       NO         TAG20090105T030112
2573    B  A  A SBT_TAPE    05-JAN-09       1       1       NO         TAG20090105T032428
2574    B  F  A SBT_TAPE    05-JAN-09       1       1       NO         TAG20090105T032432
2581    B  A  A SBT_TAPE    06-JAN-09       1       1       NO         TAG20090106T030115
2582    B  F  A SBT_TAPE    06-JAN-09       1       1       NO         TAG20090106T030120
2583    B  A  A SBT_TAPE    06-JAN-09       1       1       NO         TAG20090106T032425
2584    B  F  A SBT_TAPE    06-JAN-09       1       1       NO         TAG20090106T032430
2591    B  A  A SBT_TAPE    07-JAN-09       1       1       NO         TAG20090107T030102
2592    B  F  A SBT_TAPE    07-JAN-09       1       1       NO         TAG20090107T030107
2593    B  A  A SBT_TAPE    07-JAN-09       1       1       NO         TAG20090107T032213
2594    B  F  A SBT_TAPE    07-JAN-09       1       1       NO         TAG20090107T032217
2601    B  A  A SBT_TAPE    08-JAN-09       1       1       NO         TAG20090108T030103
2602    B  F  A SBT_TAPE    08-JAN-09       1       1       NO         TAG20090108T030107
2603    B  A  A SBT_TAPE    08-JAN-09       1       1       NO         TAG20090108T032423
2604    B  F  A SBT_TAPE    08-JAN-09       1       1       NO         TAG20090108T032427
2611    B  A  A SBT_TAPE    09-JAN-09       1       1       NO         TAG20090109T030108
2612    B  F  A SBT_TAPE    09-JAN-09       1       1       NO         TAG20090109T030113
2613    B  A  A SBT_TAPE    09-JAN-09       1       1       NO         TAG20090109T032449
2614    B  F  A SBT_TAPE    09-JAN-09       1       1       NO         TAG20090109T032453
2621    B  A  A SBT_TAPE    10-JAN-09       1       1       NO         TAG20090110T030109
2622    B  F  A SBT_TAPE    10-JAN-09       1       1       NO         TAG20090110T030113
2623    B  A  A SBT_TAPE    10-JAN-09       1       1       NO         TAG20090110T032509
2624    B  F  A SBT_TAPE    10-JAN-09       1       1       NO         TAG20090110T032513
2631    B  A  A SBT_TAPE    11-JAN-09       1       1       NO         TAG20090111T030108
2632    B  F  A SBT_TAPE    11-JAN-09       1       1       NO         TAG20090111T030113
2633    B  A  A SBT_TAPE    11-JAN-09       1       1       NO         TAG20090111T032239
2634    B  F  A SBT_TAPE    11-JAN-09       1       1       NO         TAG20090111T032243
2641    B  A  A SBT_TAPE    12-JAN-09       1       1       NO         TAG20090112T030056
2642    B  F  A SBT_TAPE    12-JAN-09       1       1       NO         TAG20090112T030101
2643    B  A  A SBT_TAPE    12-JAN-09       1       1       NO         TAG20090112T032507
2644    B  F  A SBT_TAPE    12-JAN-09       1       1       NO         TAG20090112T032511
2651    B  A  A SBT_TAPE    13-JAN-09       1       1       NO         TAG20090113T030113
2652    B  F  A SBT_TAPE    13-JAN-09       1       1       NO         TAG20090113T030117
2653    B  A  A SBT_TAPE    13-JAN-09       1       1       NO         TAG20090113T032623
2654    B  F  A SBT_TAPE    13-JAN-09       1       1       NO         TAG20090113T032627
2661    B  A  A SBT_TAPE    14-JAN-09       1       1       NO         TAG20090114T030111
2662    B  F  A SBT_TAPE    14-JAN-09       1       1       NO         TAG20090114T030115
2663    B  A  A SBT_TAPE    14-JAN-09       1       1       NO         TAG20090114T032421
2664    B  F  A SBT_TAPE    14-JAN-09       1       1       NO         TAG20090114T032425
2671    B  A  A SBT_TAPE    15-JAN-09       1       1       NO         TAG20090115T030105
2672    B  F  A SBT_TAPE    15-JAN-09       1       1       NO         TAG20090115T030109
2673    B  A  A SBT_TAPE    15-JAN-09       1       1       NO         TAG20090115T032615
2674    B  F  A SBT_TAPE    15-JAN-09       1       1       NO         TAG20090115T032619
2681    B  A  A SBT_TAPE    16-JAN-09       1       1       NO         TAG20090116T030105
2682    B  F  A SBT_TAPE    16-JAN-09       1       1       NO         TAG20090116T030109
2683    B  A  A SBT_TAPE    16-JAN-09       1       1       NO         TAG20090116T032405
2684    B  F  A SBT_TAPE    16-JAN-09       1       1       NO         TAG20090116T032410
2691    B  A  A SBT_TAPE    17-JAN-09       1       1       NO         TAG20090117T030057
2692    B  F  A SBT_TAPE    17-JAN-09       1       1       NO         TAG20090117T030101
2693    B  A  A SBT_TAPE    17-JAN-09       1       1       NO         TAG20090117T032607
2694    B  F  A SBT_TAPE    17-JAN-09       1       1       NO         TAG20090117T032612
2701    B  A  A SBT_TAPE    18-JAN-09       1       1       NO         TAG20090118T030108
2702    B  F  A SBT_TAPE    18-JAN-09       1       1       NO         TAG20090118T030113
2703    B  A  A SBT_TAPE    18-JAN-09       1       1       NO         TAG20090118T032349
2704    B  F  A SBT_TAPE    18-JAN-09       1       1       NO         TAG20090118T032353
2711    B  A  A SBT_TAPE    19-JAN-09       1       1       NO         TAG20090119T030105
2712    B  F  A SBT_TAPE    19-JAN-09       1       1       NO         TAG20090119T030109
2713    B  A  A SBT_TAPE    19-JAN-09       1       1       NO         TAG20090119T032625
2714    B  F  A SBT_TAPE    19-JAN-09       1       1       NO         TAG20090119T032629
2717    B  F  A DISK        20-JAN-09       1       1       YES        TAG20090120T030022
2718    B  F  A DISK        20-JAN-09       1       1       YES        TAG20090120T030022
2719    B  A  A DISK        20-JAN-09       1       1       YES        TAG20090120T030113
2720    B  F  A DISK        20-JAN-09       1       1       NO         TAG20090120T030115
2721    B  A  A SBT_TAPE    20-JAN-09       1       1       NO         TAG20090120T030126
2722    B  F  A SBT_TAPE    20-JAN-09       1       1       NO         TAG20090120T030130
2723    B  A  A SBT_TAPE    20-JAN-09       1       1       NO         TAG20090120T032836
2724    B  F  A SBT_TAPE    20-JAN-09       1       1       NO         TAG20090120T032841


Tom Kyte
January 20, 2009 - 3:54 pm UTC

you cannot answer the question?

do you have backups of those files, can you prove to yourself you have backups of those files.

Alexander, January 20, 2009 - 4:02 pm UTC

Well we back it up every night and we get emailed when the backup script fails, other than that? What did you have in mind? I have no way to query the external storage system (TDP in this case), I would need to talk to our storage engineering people but I have no reason to think they aren't there.

But for the local disk....
(x602kdc:oracle)> rman target /

Recovery Manager: Release 10.2.0.3.0 - Production on Tue Jan 20 15:56:55 2009

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: OCMS01T (DBID=154361649)

RMAN> SHOW ALL ;

using target database control file instead of recovery catalog
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/ocms01t/backup/backup_files/%d_%F.bkp';
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE 'SBT_TAPE' TO '%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 1 BACKUP TYPE TO BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE 'SBT_TAPE' TO 1;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE 'SBT_TAPE' TO 1;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   '/ocms01t/backup/backup_files/%d_%U' MAXPIECESIZE 8192 M;
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' FORMAT   'backup_%d_%U' PARMS  'ENV=(TDPO_OPTFILE=/database/oracle/ctl/OCMS01T.opt)';
CONFIGURE MAXSETSIZE TO UNLIMITED;
CONFIGURE ENCRYPTION FOR DATABASE OFF;
CONFIGURE ENCRYPTION ALGORITHM 'AES128';
CONFIGURE AUXNAME FOR DATAFILE '/ocms01t/data/system01.dbf' TO '/ocms01d/data/system01.dbf';
CONFIGURE AUXNAME FOR DATAFILE '/ocms01t/data/undotbs01.dbf' TO '/ocms01d/data/undotbs01.dbf';
CONFIGURE AUXNAME FOR DATAFILE '/ocms01t/data/sysaux01.dbf' TO '/ocms01d/data/sysaux01.dbf';
CONFIGURE AUXNAME FOR DATAFILE '/ocms01t/data/FTCS_DATA.dbf' TO '/ocms01d/data/FTCS_DATA.dbf';
CONFIGURE AUXNAME FOR DATAFILE '/ocms01t/data/FTCS_QA_DATA.dbf' TO '/ocms01d/data/FTCS_BC_DATA.dbf';
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/product/10.2/dbs/snapcf_OCMS01T.f'; # default

RMAN> exit


Recovery Manager complete.

/database/oracle/ctl
(x602kdc:oracle)> ls -la /ocms01t/backup/backup_files
total 225400
drwxr-xr-x  2 oracle dba      4096 Jan 20 03:01 ./
drwxrwxr-x  5 oracle dba      4096 Apr 18  2008 ../
-rw-r-----  1 oracle dba   9011200 Jan 20 03:01 OCMS01T_c-154361649-20090120-00.bkp
-rw-r-----  1 oracle dba  30400512 Jan 20 03:00 OCMS01T_kuk58f66_1_1
-rw-r-----  1 oracle dba 190373888 Jan 20 03:01 OCMS01T_kvk58f66_1_1
-rw-r-----  1 oracle dba    544256 Jan 20 03:01 OCMS01T_l0k58f7p_1_1



Tom Kyte
January 20, 2009 - 7:22 pm UTC

have you ever restored.
have you ever tested (validated) what you have:

channel c4: reading from backup piece backup_OCMS01T_fpk3rks2_1_1
ORA-19870: error reading backup piece backup_OCMS01T_fpk3rks2_1_1
ORA-19507: failed to retrieve sequential file, handle="backup_OCMS01T_fpk3rks2_1_1", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
   ANU2614E Invalid sequence of function calls to Data Protection for Oracle


Alexander, January 20, 2009 - 10:44 pm UTC

Yep, sure have.

I saw some metalink notes that maybe suggest I need to set some env variables so it knows to copy the files from one host to the other, but I don't really know.
Tom Kyte
January 21, 2009 - 12:10 pm UTC

it is a function of your media manager, have you ever restored to another machine (that would be what you really need to test - what happens when the machine you are using blows up)

Alexander, January 21, 2009 - 4:25 pm UTC

I looks like I can't access backups from our remote storage for a different host. I will have to work with a different group to get that straighten out.

Since a majority of our databases go to tape, which is very slow, I would like to use disk backups for duplicate database.

Can you just provide the few steps needed to do this, I'm having problems finding consistent instructions for this.

What I have done is, backup test, scp to dev, and tried to catalog them, however....

RMAN> catalog start with '/ocms01d/backup/duplicate_database';

using target database control file instead of recovery catalog
searching for all files that match the pattern /ocms01d/backup/duplicate_database

List of Files Unknown to the Database
=====================================
File Name: /ocms01d/backup/duplicate_database/OCMS01T_c-154361649-20090121-00.bkp
File Name: /ocms01d/backup/duplicate_database/OCMS01T_ldk5b3i2_1_1
File Name: /ocms01d/backup/duplicate_database/OCMS01T_lek5b3i2_1_1
File Name: /ocms01d/backup/duplicate_database/OCMS01T_lfk5b3jb_1_1

Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
no files cataloged

List of Files Which Where Not Cataloged
=======================================
File Name: /ocms01d/backup/duplicate_database/OCMS01T_c-154361649-20090121-00.bkp
  RMAN-07518: Reason: Foreign database file DBID: 154361649  Database Name: OCMS01T
File Name: /ocms01d/backup/duplicate_database/OCMS01T_ldk5b3i2_1_1
  RMAN-07518: Reason: Foreign database file DBID: 154361649  Database Name: OCMS01T
File Name: /ocms01d/backup/duplicate_database/OCMS01T_lek5b3i2_1_1
  RMAN-07518: Reason: Foreign database file DBID: 154361649  Database Name: OCMS01T
File Name: /ocms01d/backup/duplicate_database/OCMS01T_lfk5b3jb_1_1
  RMAN-07518: Reason: Foreign database file DBID: 154361649  Database Name: OCMS01T



More to Explore

Backup/Recovery

Check out the complete guide to all of the Backup & Recovery techniques in the Oracle Database.