Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Restoring a BACKUP FILE to a Database --- Urgently? Expand / Collapse
Author
Message
Posted Monday, May 11, 2009 6:29 AM


SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Wednesday, April 20, 2011 6:43 AM
Points: 99, Visits: 243
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
Post #714027
Posted Monday, May 11, 2009 7:44 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Tuesday, January 28, 2014 8:15 AM
Points: 3,068, Visits: 4,639
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.
Post #714119
Posted Monday, May 11, 2009 11:16 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, July 22, 2014 9:05 PM
Points: 256, Visits: 2,004
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
Post #714360
Posted Monday, May 11, 2009 9:35 PM


SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Wednesday, April 20, 2011 6:43 AM
Points: 99, Visits: 243
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
Post #714692
Posted Tuesday, May 12, 2009 1:17 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 10:34 PM
Points: 1,504, Visits: 2,528
[b]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.


Post #714752
Posted Tuesday, May 12, 2009 2:56 AM


SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Wednesday, April 20, 2011 6:43 AM
Points: 99, Visits: 243
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
Post #714788
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse