Previous Table of Contents Next


After the system error/hardware failure is corrected, you can recover your Oracle database.

Load all the media from the backup. Restore all the physical tablespace files, control files, init.ora parameter files, and possibly the SQL*Net configuration files. Listing 23.14 shows how to restore all the files from a cold backup.

Listing 23.14. Restoring a cold backup.


1: Unix> cat >cold_rest.sh<<EOF_1

2: #!/bin/sh

3: tar xvf <tape device>

4: EOF

5:

6: Unix>

The following command can be used to start the database:


Unix> svrmgrl <<EOF

connect internal

startup

exit

EOF

Remember that all work since your last cold backup is lost unless some form of incremental backup has been done. Therefore, you would next have to recover your hot backups, or import any exports of changed objects.

Hot backup recovery is accomplished by recovering the damaged or lost tablespace files and applying the necessary archive log files. In Oracle7.3 and Oracle8, there are two dynamic tables, V$RECOVERY_STATUS and V$RECOVERY_FILE_STATUS, that can assist with determining the extent of recovery that is needed. If a restore of a tablespace is needed, it should be offline already; however, the following script will ensure that it is indeed offline.


Unix> svrmgrl <<EOF

connect internal

alter tablespace <TABLESPACE NAME> offline normal;

exit

EOF

Next, restore the last known hot backup. This will utilize techniques just like those in Listing 23.14.

Issue the following sequence of statements to initiate recovery:


Unix> svrmgrl <<EOF

connect internal

set autorecovery on;

alter database recover tablespace <TABLESPACE NAME>;

  *** dialog with operator prompting for required archive log files ***

alter tablespace <TABLESPACE NAME> online;

exit

EOF

The alter database recover tablespace <TABLESPACE NAME>; statement will begin a dialog with the operator, prompting the operator for the required archive log files. Consult your Oracle Server Manual for further details and recovery options.

Summary

This chapter reviewed the many issues involved in protecting data from a variety of hardware and software problems that could render the data inaccessible or unusable. This chapter also reviewed various hardware and Oracle options required to create a complete backup and recovery plan. All backup scenarios are based on data-availability requirements dictated by the business needs of the data. Various methods of backup, the syntax, Oracle options, and methods of automating the backup process were all discussed.


Previous Table of Contents Next
Используются технологии uCoz