Saturday, December 5, 2009

Database Archival Exercises


Successful database recovery relies on the database being in ARCHIVELOG mode. This is what enables the database to recover data that was lost due to a media failure, loss of power or any other type of disaster. Each time the online line redo logs fill up in a log group the DBMS issues a log switch that will move the log writer process from the current redo log group to the next one in line. If the database is in ARCHIVELOG mode then the archive background process then begins archiving the data in the full online log group files to the archive log files. This is done simultaneously for each log file in the group. If media recovery is needed at the time that the database needs recovery then the DBMS will search through the archived log files to find the ones that need to be used.
In this exercise you will go through the process of putting your database instance in ARCHIVELOG mode. The destination for the archived log files has already been determined; you simply need to enable the process to begin.
IMPORTANT: Be sure that you complete this exercise BEFORE doing the lab for this week.
Now let's get started.
I N D I V I D U A L     E X E R C I S E S
HANDS-ON #1: Putting the database in ARCHIVELOG mode

The first thing that must be done before dong any type of database backup is to ensure that the database is in Archive Log mode. To do this you will need to make some changes the init.ora file for you database instance as well as issue some commands with the database in mount mode put archiving in motion. Your OFA structure already has a folder named backup in it and this will be the destination for all of your backup files. Go through the following steps to set up archiving.
a. You must first shutdown the database by issuing a SHUTDOWN IMMEDIATE command.
b. Now go into Windows Explorer and open up your initdb###.ora file in the pfile directory of your OFA structure. You need to uncomment each of the five lines found in the section of the parameter listing titled Redo Log and Recovery. When finished then save the changes you have made.
c. Next start up your database in MOUNT mode using your initDB###.ora file. Once the database is opened in MOUNT mode then issue the following command:
ALTER DATABASE ARCHIVELOG;
d. Now issue and ALTER statement to open the database. Once the database is open then issue an ARCHIVE LOG LIST command to see the parameter settings that are associated with the Archive process. You output should look similar to the following:
Database log mode Archive Mode
Automatic archival Enabled
Archive destination F:\DBM\SPRINGB\DB1000\oracle\
admin\backup
Oldest online log sequence 1252
Next log sequence to archive 1253
Current log sequence 1253

No comments:

Post a Comment