Lesson 7
NOARCHIVELOG Recovery Conclusion in Oracle
In this module you learned about the concept of recovery and the required data structures to restore a NOARCHIVELOG database.
The implications of recovery without archiving were explained as well as the steps to recover a database without archiving when a media failure occurs. Having completed this module, you should be able to:
Identify data structures required for restore
- Identify data structures required for recovery
- Describe the implications of recovering a NOARCHIVELOG database
- Recover a database in NOARCHIVELOG mode
- Restore files to a different location if media failure occurs
Glossary
This module introduced you to the following terms:
- Restore: To restore means to bring back an original copy of a file from backup by issuing the operating system COPY command. Before recovery is performed, you need to restore the database.
- Recover: To recover means to make all the restored files current to the same point in time.
- Rolling forward: The process of recovering datafiles and control files by applying the redo logs is also known as rolling forward.
- Log Writer (LGWR): Log Writer writes Redo Entries into the online redo logs. After a log fills, a log switch occurs.
A minimum of two online redo logs is required by LGWR. Each log switch causes a new log sequence number to be used and assigned to the current log file.
Recover Noarchivelog Database
The steps in the simulation are as follows:
- To make sure you are connecting to database ORCL, you need to set Oracle SID. Enter
SET ORACLE_SID=ORCL
at the prompt. When you finish, press Enter.
- Type
SVRMGR30
to access Server Manager. When you finish, press Enter.
- At the prompt, type
CONNECT INTERNAL
to access the database ORCL as sysdba. The password ORACLE is entered for you. After you finish, press Enter.
- Now you start the restore process. Type
SHUTDOWN ABORT
at the prompt. After you finish, press Enter.
- To access the operating system, enter
HOST
at the prompt. After you finish, press Enter.
- To perform the backup, you can run the batch file you created. Suppose the batch file is stored directly in the ORANT folder. Type
DO_RESTORE
at the prompt and press Enter.
- To access Server Manager, type
EXIT
at the prompt. After you finish, press Enter.
- To start the database, type
STARTUP OPEN PFILEC:\ORANT\DATABASE\INITORCL.ORA
at the prompt. After you finish, press Enter.
- This is the end of the Simulation.
Mount Mode first
Sometimes in test environments you may not enable archiving. However, it is still possible to use RMAN to back up the database as long as the database is placed in mount mode first.
$ rman target /
RMAN> shutdown immediate;
RMAN> startup mount;
RMAN> backup database;
RMAN> alter database open;
You can restore a noarchivelog database only to the point at which it was backed up. There is no roll forward of transactions because there are no archived redo log files to apply. This type of restore and recovery is commonly used to reset a test environment database to a baseline point in time. Since the online redo log files are not included in the RMAN backup, you must issue alter database open resetlogs to create new online redo log files, as well as to synchronize the control files and data files in terms of their checkpoint SCNs.
For additional practice in recovering a NOARCHIVELOG database, read the following section on how to Backup and Recover a Database.
Backup and recover a NOARCHIVELOG database
An "On Your Own" practice session is a good way for you to practice the skills you have just learned in this module.
It is a practice session that you can execute if you have access to the optional hardware and software for this course.
The suggested results for this "practice session" are listed below under the heading Instructions.
Background Information
In this exercise you will be typing in command lines to backup and recover a NOARCHIVELOG database.
You will need to have an Oracle database running on an Windows Platform and you need to have sysdba privileges
to access this database.
Instructions
For each of the steps outlined below, type in the command you should use to begin backing up and restoring a NOARCHIVELOG database.
- Create a trace file by typing in the correct command.
Hint: You will use the information in this file to compose a backup command file.
- Make a full backup by performing the following steps:
- Create a backup directory
- Edit your trace file and save it in your backup directory under the name do_backup.bat (on Windows Platform).
Hint: You need to put an individual COPY
command for each file you find in your trace file. You also need to add lines for your initSID.ora and control files.
- Shutdown the database Hint: Do not forget the correct shutdown option.
- Run the batch file you created.
- Perform some data entry.
Hint: Enter some data you can easily find later.
- Simulate media failure by doing the following:
a. Delete a datafile.
Hint: If you get a sharing error, shut down the service on your Windows Platform or you can rename the datafile if you do not want to delete it.
b. Try to restart the database. What error message do you get? Why?
- Perform full restore.
- Shutdown the database using the correct command.
- Copy the backup files to the original location.
- Open the database with the correct command.
- Try to locate the data you entered in Step 3. Do you know what happened to your data and why?
Optional: If you decide to restore the files to a different location, do the following for Step 5 and then continue on to Step 6:
a. Shutdown the database with the correct command.
b. Copy the backup files to the new location.
c. Enter your init.ora with a new file location for the control files.
Hint: Do you remember where you find the initSID.ora file? Which line do you need to edit?
d. Mount your database. What startup command do you use?
e. Update your control file with the new file location for the required files.
- What commands do you use to update the control file with the new file locations?
- What are the affected files?
f. Open the database. What command do you use if you restore files to a different location?
In the next module, you will learn how to recover a database running in ARCHIVELOG mode. Before you go on to the next module,
use the following Quiz to check your understanding of the concepts presented in this module.
Recovery Scenario - Quiz
Click the Quiz link below to review your understanding of recovering a database without archiving.
Recovery Scenario - Quiz
Ad Oracle RMAN Backup and Recovery