1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Recover entire database when online backup is available.

Discussion in 'Security, Backup and Recovery' started by rahul kumar, Jan 15, 2015.

  1. rahul kumar

    rahul kumar Guest

    Hi all.
    Am having online backup taken as follows
    sql>alter database begin backup;
    ]$cp test/* hotbkp/
    sql>alter database end backup;
    Then i create a tablespace TBS after which i have'nt taken any backup.
    Now i lost all the database files including controlfiles and redolog files.
    Archived redos are at bdump which are safe.
    Please help me to recover the database including the tablespace TBS.
  2. zargon

    zargon Community Moderator Forum Guru

    Likes Received:
    Trophy Points:
    Aurora, CO
    You should be using RMAN, not your own script that implements antiquated procedures.

    According to what you have posted you have ONLY the datafiles, in an inconsistent state, copied to a new location, nothing more. You didn't bother to copy the archived redo logs so you'd have those if they were also lost. You then created a NEW tablespace, did NOT include that in your set of datafiles, and you expect US to restore a tablespace you have no hope of recovering. Obviously you do not understand the backup and recover concept.

    Your 'online backup' is worthless with respect to this new tablespace, and if you've lost any of the archived redo logs you'll never get this database back to the state it was when you 'lost' all of the data files.

    Here is what you SHOULD have done:

    Taken your backup with RMAN; the commands are simple --

    incremental level 0
    filesperset 4
    FORMAT '/hotbkp/%d/%d_%T_%U'
    include current controlfile ;
    archivelog all
    filesperset 10
    FORMAT '/hotbkp/%d/%d_%T_%U'
    delete input ;

    This would ensure you could restore and recover your database with little effort. This same process should have been followed AFTER you created your new tablespace so it would also be restored and recovered.

    The absolute best you can do with your 'online backup' is restore and recover your database to the point when you made your 'backup' presuming you still have all of the archived redo logs present when that 'backup' was taken. You have absolutely no hope of restoring/recovering this new tablespace you failed to back up.