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.
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:
a. Create a backup directory
b. 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.
c. Shutdown the database Hint: Don't forget the correct shutdown option.
d. 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.
a. Shutdown the database using the correct command.
b. Copy the backup files to the original location.
c. 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?