Simulating a database failure (the NOARCHIVELOG mode)
Now that we have a valid backup in place, let us simulate a database failure. Let us use the hr_test table created earlier in this book for our test. We have five records in the hr_test table, as shown in the following screenshot:
For this test, we will perform the following steps to simulate a database failure:
1. Take a full database backup.
2. Insert a record in the hr_test table. (Any changes to the database after the backup will be lost once we restore the database. So, we will lose this record in the recovery process.)
3. Insert the following line of code into hr_test:
VALUES (6, 'test record', sysdate, 100); Shutdown database
4. Rename datafiles folder—
ORADATA/XE
toORADATA/XE-BACKUP
.5. Create a new empty folder—
XE
.6. Start the database now. (Oracle instance starts up in
NOMOUNT
mode and fails to mount the database, as Oracle is not able to find the control file while mounting the database.)