Restoring a BACKUP FILE to a Database --- Urgently?

  • Hi friends,

    In this forums all are giving their valuable answers and advices . Let us give ur answer for this also.

    See I am having a Database named Database1 and i take up the Backup (Database1.bak)for that database.The database is working fine.I know How to restore a database with the backup file(Database1.bak) when my DB gets corrupted but i want to do it ones practically(Restoring a Corrupted DB). Can anybody advice me how to corrupt the existing DB (Database1) and restore it with its Back up file.

    Give me an idea of Restoring the Database Practically.

    Thank you all,

    Venu Gopal.K
    Software Engineer
    INDIA

  • Firstly, your title is Software Engineer so you should be as away as possible from databases and ask a DBA for help when needed.

    Secondly, if you are training yourself to become a DBA and assuming you are talking about a test or lab server there are lots of ways of corrupting your database to simulate a catastrophic situation.

    The easiest one is just to imagine your database got corrupted so you go ahead and restore it.

    If for some untold reason you really want to corrupt it look at the O/S level for the mdf file and overwrite it with a text file -or any file you want.

    Last but not least, in your post you say you know how to restore it so; restore it.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • Venu--

    It sounds like you are on the right track. It is definitely a good idea to practice restoring your backups.

    I would suggest that you create a test database to work with. That way you could practice a side-by-side restoration (restore the backup file as "Database2" to exist alongside Database1); you could over-ride the existing (corrupted) Database1 (by using the REPLACE command in your script), and you could learn about differential backups and point in time restorations.

    These are all good tools, but you really should not experiment with a production database.

    I'm not sure what you are asking for with regards to testing a "corrupt" database. With a test database you could perform many actions to simulate potential mistakes. You could delete entire tables, you could "accidently" delete a user, or you could test your ability to restore to a point in time by having a job which inserted record into a test table every minute. You could then delete some of those records and try to recover the data by using differential or log backups.

    Be sure to look at Microsoft Books On Line (BOL) for ideas and commands for these options.

    Cheers,

    Elliott

  • Thank u for u r suggestions ,

    Let me know this one ---- Suppose my DB gets corrupted(after taking the backup)? For restoring the database which files i required to have? Is the backup file *.bak is only enough to restore or else we also have necessary of .mdf, .ldf files.

    Tell me how to corrupt a DB and restore it with its backup file which was already taken?

    Thank U all,

    Venu Gopal.K
    Software Engineer
    INDIA

  • Let me know this one ---- Suppose my DB gets corrupted(after taking the backup)? For restoring the database which files i required to have? Is the backup file *.bak is only enough to restore or else we also have necessary of .mdf, .ldf files.

    Thank U all,

    You can create a new blank database and restore it from the .bak file you have. you can delete the currepted database and keep the newly created DB.

  • One more Question ,

    1)What is the use of Log shipping transaction ?

    2)Can we restore a corrupted database by using these log shipping transaction files?

    3)Tell me the procedure hoe to restore a DB if we can restore a corrupted database by using these log shipping transaction files?

    Thank you,

    Venu Gopal.K
    Software Engineer
    INDIA

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply