Home » SQL & PL/SQL » SQL & PL/SQL » How to simulate crash database? (Oracle 12c Release 2)
|
|
|
Re: How to simulate crash database? [message #674325 is a reply to message #674322] |
Mon, 21 January 2019 09:17   |
 |
EdStevens
Messages: 1376 Registered: September 2013
|
Senior Member |
|
|
You can 'crash' the database with 'shutdown abort'. Or you can kill the pmon background process (if on *nix). But as Black Swan said, Oracle is very good at performing a crash recovery on the next startup. A much more likely need for recovery from backup is a media failure. A corruption of a data file.
But if all you want to do is practice recovery from rman backup, you don't have to actually create the failure. That said, you can easily create a genuine media failure. Shut down the database, then delete a data file. Or open a data file with a text editor and change something. It won't matter that the file is binary and the data won't present ans nice clean records and fields. Just change something, preferrably in the first few bytes, where the block header of the file header block is located. This will certainly corrupt the file. Then try to restart the database and observe the error. Since this whole exercise is to learn to do an rman recovery, you certainly want to do this on a database that you can afford to lose completely, in case you are unable to recover it.
BTW, I gave you two terms that I expect you to have enough curiosity to follow up on yourself: "instance failure" vs. "media failure"
|
|
|
|
|
|
Re: How to simulate crash database? [message #674332 is a reply to message #674326] |
Mon, 21 January 2019 11:31   |
 |
EdStevens
Messages: 1376 Registered: September 2013
|
Senior Member |
|
|
petar97 wrote on Mon, 21 January 2019 09:23Thanks a lot, I've learn to restore and recovery only theoretically, so I need a bit of practical examples.
First, create yourself a database just for practicing:
https://edstevensdba.wordpress.com/category/personal-test-systems/
Once you have a test system created on a vm, shut down the vm, then back up the entire vm. I do that simply by creating a zip file of the entire directory containing the vm. On a Windows host (the host machine on which you installed Vbox), that simply means 'send directory to compressed file'. Then in the event of need to recover the entire vm (say, because you couldn't recover the database), you restore the entire vm from the zip file.
This section from the Database Backup and Recovery User's Guide should be your guide to recovery .. as well as creating the scenarios from which to recover. No, it won't tell you HOW to create the scenarios. But once you see the scenario described, that shouldn't be too hard to figure out.
|
|
|
|
Goto Forum:
Current Time: Fri May 23 15:42:38 CDT 2025
|