• No se han encontrado resultados

Gestión del Enriquecimiento Semántico y el Razonamiento Espacial

Desarrollo de un Prototipo del Modelo de Integración de las

4.2 Instrumentación del Componente de Gestión

4.2.3 Gestión del Enriquecimiento Semántico y el Razonamiento Espacial

Complete Recovery

When media failure occurs with a database in ARCHIVELOG mode, in order to recover completely up to the time of failure, you must have the following:

• A valid backup containing the lost or damaged data files after database was set in ARCHIVELOG mode.

• All archived logs from the backup you are restoring to the present time. • The redo log files that contain the transactions that are not archived yet.

How to Recover from a Media Failure

If you meet the above requirements for complete recovery, then follow these steps to recover data files:

1 Make sure that files to be overwritten are not opened during restore. Query the V$DATAFILE and V$TABLESPACE views to ascertain the status of the file. 2 Make sure you only restore from backup the file that is now lost or damaged. Remember, restoring all files will take your database back in time. Make sure that you do not restore the online redo log files.

Copyright  Oracle Corporation, 1999. All rights reserved.

Media Failure and Recovery: ARCHIVELOG Mode

• Failure: loss of disk, data file, or corruption • Recovery

Data files for restore must be offline.

Restore only lost or damaged data files.

Do not restore the control files, redo log files, password files, or parameter files.

...Complete Recovery

Advantages and Disadvantages

The following are advantages and disadvantages of running your database in ARCHIVELOG mode.

Advantages

• Only need to restore lost or damaged files.

• No committed data is lost. Restoring the files, then applying archived and redo logs, brings the database to the current point-in-time.

• The total recovery time is the length of time your hardware can restore the required files and apply all archived and redo logs.

• Recovery can be performed while the database is open (except system tablespace files and data files containing online rollback segments).

Disadvantage You must have all archived logs from the time of your last backup to the current time. If you are missing one, you cannot perform a complete recovery, since all archives need to be applied in sequence; that is, archived log 144, then 145,

Copyright  Oracle Corporation, 1999. All rights reserved.

Recovery in ARCHIVELOG Mode (Complete Recovery)

Advantages

• Only need to restore lost files

• Recovers all data to the time of failure

• Recovery time is the time it takes to restore lost files and apply all archived log files

Disadvantage

Must have all archived log files since the backup from which you are restoring

Complete Recovery Methods

There are four methods for performing complete recovery:

Method 1: Recovering a Closed Database This method of recovery generally uses either the RECOVER DATABASE or RECOVER DATAFILE commands when:

• The database is not operational a 24 hour a day, 7 days a week.

• The recovered files belong to the system or rollback segment tablespace. • The whole database, or a majority of the data files, need recovery.

Method 2: Recovering an Opened Database, Initially Opened This method of recovery is generally used when:

• File corruption, accidental loss of file, or media failure has occurred, which has not resulted in the database being shut down.

• The database is operational a 24 hour a day, 7 days a week. Downtime for the database must be kept to a minimum.

• Recovered files do not belong to the system or rollback tablespaces.

Copyright  Oracle Corporation, 1999. All rights reserved.

Complete Recovery Methods

• Closed database recovery for:

System data files

Rollback segment data files

Whole database

• Opened database recovery, with database initially opened: for file loss

• Opened database recovery with database initially closed: for hardware failure

...Complete Recovery

Complete Recovery Methods (continued)

Method 3: Recovering an Opened Database, Initially Closed This method of recovery is generally used when:

• A media or hardware failure has brought the system down.

• The database is operational a 24 hour a day, 7 days a week database. Down-time for the database must be kept to a minimum.

• The restored files do not belong to the system or rollback tablespace.

Method 4: Recovering a Data File with No Backup This method of recovery is generally used when:

• Media or user failure has resulted in loss of a data file that was never backed up. • All archived logs exist since the file was created.

• The restored files do not belong to the system or rollback tablespace.

Note: During recovery, all archived logs files need to be available to the Oracle server on disk. If they are on a backup tape, you must restore them first.

Recover Syntax

One of the following commands may be issued to recover the database: • RECOVER [AUTOMATIC] DATABASE

Can only be used for a closed database recovery.

RECOVER [AUTOMATIC] TABLESPACE <NUMBER> | <NAME> Can only be used for an opened database recovery.

RECOVER [AUTOMATIC] DATAFILE <NUMBER> | <NAME> Can only used for both an opened and closed database recovery. where: automatic automatically applies archived and

redo log files.

Note: ALTER DATABASE may be placed in front of the RECOVER command. This is not recommended because some error messages get suppressed and do not show up on screen during recovery.

Copyright  Oracle Corporation, 1999. All rights reserved.

Recover Syntax

SQL> recover database;

SQL> recover datafile ‘/disk1/data/df2.dbf’; SQL> alter database recover database;

Recover a mounted database:

SQL> recover tablespace USER_DATA; SQL> recover datafile 2;

SQL> alter database recover datafile 2; SQL> recover tablespace USER_DATA; SQL> recover datafile 2;

SQL> alter database recover datafile 2;