DBAsupport.com Forums - Powered by vBulletin
Results 1 to 9 of 9

Thread: Create new database from existing hot backup

  1. #1
    Join Date
    Jun 2000
    Posts
    417
    I want to create a new database (or really open an existing one) from an existing hot backup. I know it's easy with a cold backup, just copy the data files and re-create the control files.

    Can I do the same thing with a hot backup?

    Put all the backed up tablespaces in place, and create the control files the same as I would for a cold backup? After which I should just have to 'alter database recover until cancel'? I haven't had to recover much lately and since I'm a DBA on the side I haven't run through a test recovery for a while.

    Will it want the archived logs in the arch directory of the old database, or the new one?

    Thanks for some quick steps.

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Sure, you can do it, as long as you have your archived redo logs from the database that was backed up. The key will be to make sure your archived log files span the time period from the begining of your backup to past the end of your backup.

    1. restore your datafiles to the same location they originally resided.
    2. perform an incomplete recovery with your backup control file.

    See:
    http://metalink.oracle.com/metalink/...T&p_id=69468.1 for exact details.
    Jeff Hunter

  3. #3
    Join Date
    Jun 2000
    Posts
    417
    Right, I've got all the archived logs but I'm not really recovering the database the backup was taken from, I'm creating another instance from the same data.

    I'd use a cold backup but I don't want to kick developers out while I do it.

    So I can't really use the backup controlfile because that points to the old paths, not the new ones for the other instance. Can I just run a create controlfile script and then recover the database with the archived logs or will that create inconsistances and the controlfile won't know what to do to recover?

    Actually that sounds about right, if I re-create the controlfiles with new paths, it won't have the information from the other instance & recovery.

  4. #4
    Join Date
    Aug 2000
    Location
    Belgium
    Posts
    342
    If you have multiple systems,

    you could perform the recovery on a clone of the db on a second machine.

    steps

    > copy everything to the second system. ( data files , control files, redo log, archive log )
    > do recovery
    > if needed recreate controlfile to rename the db.

    I hope somebody else has a better solution.

    Regards
    Gert



  5. #5
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Originally posted by pwoneill
    Actually that sounds about right, if I re-create the controlfiles with new paths, it won't have the information from the other instance & recovery.
    Especially since you will have to open the database with resetlogs once it is renamed.

    Maybe you could:
    1. restore your db to a new directory
    2. shutdown the real database
    3. recover the new database
    4. rename the new database
    5. startup the real database

    It will put your developers out of commission for about 30 minutes, or you could do it after-hours...
    Jeff Hunter

  6. #6
    Join Date
    Jun 2000
    Posts
    417
    They had a meeting today so I just shut it down and did it with a cold backup. When I have an environment where I can set up some small peronal test instances I'll give that a try and see how it goes.

    Thanks for the responses guys.

  7. #7
    Join Date
    Mar 2000
    Location
    CA
    Posts
    317
    You dont have to shutdow the primary database inorder to clone.

    Take the hotbackup. Backup the controlfile to trace

    Edit the controlfile to reflect the new database name, path name , REUSE to SET,noreset to resetlogs

    Copy the hotbackup files to new location

    Start the instance at new location with nomount
    recover the database until cancel

    Open the database

    You are all set to go
    Thanks
    Kishore Kumar

  8. #8
    Join Date
    Jun 2000
    Posts
    417
    Right that's what I thought, but if you don't recreate the control files before recovery, aren't the control files pointing to the old datafile locations?

    If you do re-create the control files before recovery, the control files don't have the recovery info any more since they were re-created.

    Or is that wrong?

  9. #9
    Join Date
    Mar 2000
    Location
    CA
    Posts
    317
    You will recreate the control file before recovery. Don't even worry about controlfile having recovery information. You can start applying all the archive logfiles till there are no more of them. Then open the database


    Thanks
    Kishore Kumar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width