alt
Advertisement
Online Training
Career Series
Exforsys
Exforsys arrow Career Series arrow Interview Notes arrow Oracle Interview Preparation Notes Part 12
Site Search


Oracle Interview Preparation Notes Part 12
DATABASE RECOVERY SCENARIOS:
FROM COLD BACKUP…
1. Shutdown the database.
2. Recover all datafiles, controlfiles (online redos) from tape.
3. STARTUP MOUNT
4. ALTER DATABASE RENAME FILE if necessary (new file locations).
5. ALTER DATABASE OPEN RESETLOGS (if online redos are not restored);

FROM HOT BACKUP…

Complete / Initially Open / Closed (Mounted) – (System or RBS lost, or majority of datafiles).

1) Close the database if not already closed.

2) Restore the necessary files from backup.

3) STARTUP MOUNT;

4) RECOVER DATABASE or RECOVER DATAFILE ‘file’;

5) ALTER DATABASE OPEN;

Complete / Initially Open / Open – (File corruption or media failure, database is still open and available)

1) Take tablespaces and/or datafiles to be recovered offline if not already offline.

2) Restore necessary datafiles.

3) RECOVER DATAFILE ‘file’ or RECOVER TABLESPACE tsname;

4) Bring the tablespace or datafile online

5) ALTER DATABASE DATAFILE ‘file’ ONLINE or ALTER TABLESPACE tsname ONLINE;

Complete / Initially Closed / Open – (media or hardware failure has brought the db down).

1) Mount the database.

2) If files are online, ALTER DATABASE DATAFILE ‘file’ OFFLINE;

3) Open the database, ALTER DATABASE OPEN;

4) Restore the necessary datafiles.

5) RECOVER DATAFILE ‘file’ or RECOVER TABLESPACE tsname;

6) Bring the tablespace or datafile online

ALTER DATABASE DATAFILE ‘file’ ONLINE or ALTER TABLESPACE tsname ONLINE;

Complete / Initially Open / Open / Loss of file with no backup (must have all archives from point of original creation).

1) Take the file offline if not already.

2) Recreate the file: ALTER DATABASE CREATE DATAFILE ‘file1’

3) Apply archive logs to this file – RECOVER TABLESPACE ts1

4) Bring tablespace online – ALTER TABLESPACE ts1 ONLINE;

Incomplete: (To recover from user error or if all archives are not available or loss of all control files).

1. Shutdown and backup entire database.

2. Restore ALL datafiles – all datafiles must be restored to a prior point in time. Do not restore control file, redo logs, password files, or parameter files.

3. Mount the database.

4. RECOVER DATABASE

UNTIL CANCEL | UNTIL TIME ‘YYYY-MM-DD:HH24:MI:SS’ | UNTIL CHANGE scn#

(Query V$LOG_HISTORY to get the SCN number)

USING BACKUP CONTROLFILE; –

· If all controlfiles are lost and cannot be recreated.

· If current controlfile does not match structure of db at point you are recovering to.

· In a disaster recovery situation (no current control files are available).

5. ALTER DATABASE OPEN RESETLOGS;

6. Backup the database.


To restore to a different location, Mount db, ALTER DATABASE RENAME DATAFILE, Open db.

To enable automatic recovery:

· SET AUTORECOVERY ON

· Enter AUTO when prompted for an archive log

· RECOVER AUTOMATIC …


Trackback(0)
Comments (0)add comment

Write comment

busy
 
< Prev   Next >
Exforsys Offers
© 2008 Exforsys.com
Joomla! is Free Software released under the GNU/GPL License.
Page copy protected against web site content infringement by Copyscape