Simulating a database failure (the ARCHIVELOG mode)
Now it's time to start playing with our database. We have recovered our database (NOARCHIVELOG
) from a simulated database failure earlier in this chapter. We will repeat a similar approach with our database in the ARCHIVELOG
mode.
For this test we will be performing the following steps to simulate a database failure:
1. Take a full database backup.
2. Insert a record in the
hr_test
table:SQL>INSERT into hr_test VALUES (6, 'test record', sysdate, 100); SQL> COMMIT;
3. Switch the archive logs:
SQL> ALTER SYSTEM SWITCH LOGFILE;
4. Back up the archive logs:
RMAN> backup archivelog all;
5. Shut down the database.
6. Rename the datafiles folder—
ORADATA/XE
toORADATA/XE-ARCH-BACKUP
.7. Create a new empty folder—
XE
.8. Start the database now. (Oracle instance starts up in
NOMOUNT
mode and fails to mount the database, as Oracle is not able to findcontrolfile
while mounting the database.)