关于 oracle恢复的 概论

原创 2012年03月28日 15:15:19

There are two type ways of backup:

  After completing this lesson, you should be able to do the following:
 
1: Describe media recovery.
2: Perform recovery in NOARCHIVELOG mode.
3: Perform complete recovery in ARCHIVELOG node.
4: Restore datafiles to different locations.
5: Relocate and recover a tablespace by using archived redo log files.
6: Describe read-only tablespace recovery.

Step1:
  Restoration:
  1: Restore files using operating system commands.
  2: Recovery files using the SQL*Plus recover command.
 
  Recovery in NOARCHIVELOG:
 
  You must restore the following database files:
  --All datafiles
  --Control files
 
  You can also restore the following files:
  --Redo log files  (When you shutdown the database gracefully,
                     the redo log file already write into the datafiles,
                     so this is not neccessary to backup)
  --Password file
  --parameter file
 
  This advantages:
  1: Easy to perform, with low risk of error.
  2: Recovery time the time it takes to restore all files
 
  Disadvantages:
  1: Data is lost and must be reappied manually
  2: The entire database is restored to the point of last whole closed backup.
 
--------------
  If you are required to recovery the database , the mainly steps are below:
 
  1: create pfile from spfile
  2: backup the original spfile
  3: vi pfile (update the control file path if the original disk is damaged).
  4: startup mount;
  5: select name from v$datafile;
    alter database rename file '/u01/oradata/morewood/users01.dbf' to '/u01/oradata/md/users01.dbf';
  6: select name from v$tempfile;
    alter database rename file '/u01/oradata/morewood/temp01.dbf' to '/u01/oradata/md/temp01.dbf';
  7: select member from v$logfile;
    alter database rename file '/u01/oradata/morewood/redo01.log' to '/u01/oradata/md/redo01.dbf';
  8: alter database open;
 

Step2:
  If you do not have any redo log files backup, what will you do?
 
  Below is detailed command:
 
  1: shutdown the instance.
  2: Restore the datafiles and the control files from the most recent whole database backup.
  3: Perform cancel-based recovery.
  4;Open the database with the resetlogs open.
 
  The recovery steps:
 
  1: startup mount;
  2: recover database until cancel using backup controlfiles; (cancel);
  3;alter database open resetlogs;
 
Notice:
  Please figure out when you should use the "using backup controlfile".
 

Step3:
  Study how to recovery the database in archivelog mode:
 
  Complete Recovery:
  1: Uses redo data or incremental backups
  2: Updates the database to the most current point time.
  3:Applies all redo changes.
 
  Incomplete Recovery:
  -- Uses backup and redo logs to produce a nocurrent version of the database.
 
  Details:
 
  Complete Recovery:(Archivelog Mode)
  -- make sure that datafile for restore are offline.
  -- Restore only lost or damanged datafiles.
  -- Do not restore the control files, redo log files. password files, or parameter files.
  -- Recover the datafiles.
 
  Advantages:
 
  1: Only need to restore lost files.
  2: Recovery all data to the time of failure using all redo and archive logs.
  3: Recovery time is the time it takes to restore lost files and appy all archive log files.
 
  Disadvantages:
  Must have all archived log files since the backup from which you are restoring.
 
----------

  Let us take a look at some important view about recovery:
 
  1: v$recover_file:
    This view is to determine which datafiles need recovery.
   
  2: v$archived_log:
    This is a list of all archvied redo log files for the database.
   
  3: v$recovery_log:
    This view is for a list of all archived redo log files required for recovery.
   
Notice 1:
  To determine which archived redo log files are needed, query v$archived_log and
  v$recovery_log. V$archived_log lists filenames for all archvied logs.
  v$recovery_log lists only that archived redo logs that the database needs to perform
  media recovery. It aslo incudes the probable names of the files, using LOG_ARCHIVE_FORMAT.
 
Notice 2:
  If the control file is not the current control file, the information from v$recover_file
  is not correct.
  So you can not use v$recover_file with a control file restored from backup or a
  control file that was re-created after the time of media failure.
 

Step4:
  Take a look at below recovery command:
 
  1: Recovery a mounted database:
  sql>recover database;
  sql>recover datafile '/u01/oradata/user01.dbf';
 
  2: Recover an open database:
  this time can not recover database
  sql>recover tablespace user;
  sql>recover datafile '/u01/oradata/user01.dbf';
 
-------------
  There are foure types of database recovery:
 
  1: Closed database recovery for:
   -- System datafiles
   -- Undo segment datafiles
     (above file is lost , should ensure the database in mounted mode)
    
   -- Whole database.
  
  2: Open database recovery, with database initially opened (for file lost).
 
  3: Open database recovery with database initially closed (for hardware failure).
 
  4: Data file recovery with no datafile backup.
    (using all the archived log files).
   

Step5:
  If you want to backup one tablespace when the database open, below command is needed:
 
  1: alter tablespace tablesapce_name begin backup;
  2: cd /u01/oradata/
  3: cp tbs01.dbf ./hot_bak/
  4: alter tablespace tablespace_name end backup;
 

浅析Oracle数据恢复操作

以下是我看见的两篇文章,我觉的不错在此装载下,希望对你有用哈!! 1. 恢复delete掉的表中数据 select * from sys.smon_scn_time t order b...
  • iongzhidun1
  • iongzhidun1
  • 2015年06月02日 14:18
  • 531

oracle数据库delete删除数据恢复的方法

本文我是在论坛上看过收集整理测试过。  SCN(系统改变号),它的英文全拼为:System Change Number ,它是数据库中非常重要的一个数据结构。   SCN提供了Oracle的内部时...
  • wangdinghai365
  • wangdinghai365
  • 2013年02月20日 11:51
  • 16420

oracle的备份与恢复

oracle的备份与恢复 dba的职责: 1、安装和升级oracle数据库 2、建库、表空间、表、视图、索引... 3、制定并实施备份与恢复计划 4、数据库权限管理,调优,故障排...
  • q547550831
  • q547550831
  • 2015年11月27日 21:14
  • 9859

oracle常规恢复实例

1. 数据库关闭时的恢复(冷备) a. shutdown immediate b. 冷备整个数据文件 SQL> select file#,name from v$dbfile;      FILE...
  • gumengkai
  • gumengkai
  • 2016年11月23日 15:25
  • 591

oracle数据库完全恢复和不完全恢复以及执行用户管理辈分恢复

比较完全恢复和不完全恢复: 一、完全恢复:将数据库恢复到当前最新状态,包括直至请求恢复时进行的所有已提交的数据更改 二、不完全恢复:将数据库恢复到请求恢复操作之前指定的过去时间点   ...
  • demonson
  • demonson
  • 2014年09月29日 15:47
  • 1690

Oracle异机恢复处理

Oracle异机恢复处理   在平时工作中,我们可能会或多或少遇到数据迁移问题,比如:数据库之前在windows机器上,然后我们由于更换新服务器,想把数据迁移到新服务器上,新服务器安装的是linu...
  • qq_22935429
  • qq_22935429
  • 2016年01月22日 00:08
  • 717

Oracle数据库备份与恢复 - RMAN恢复

RMAN恢复原理首先还是得理解Oracle数据库恢复的一个原理。数据库恢复是指将数据库恢复到一个一致性的状态,整个恢复操作可以分为两个步骤,数据库修复(RESTORE)和恢复(RECOVER)。Ora...
  • pan_tian
  • pan_tian
  • 2015年07月15日 17:16
  • 6917

误删oracle表,恢复表结构及数据方法

1、本人是通过drop的方式误删了所有正式库的所有表,瞬间崩溃了; 2、oracle是10g版本,晚上说只有该版本有回收站的概念,这个未去深究过; 3、去回收表中查看下被你误删的表是否还存在? ...
  • qq584852076
  • qq584852076
  • 2013年04月09日 23:42
  • 3658

oracle跳过丢失的归档恢复datafile

偷学自大神Roger博客:http://www.killdb.com/2012/04/14/use-bbed-tool-to-skip-lost-archive-log-then-recover-da...
  • zhengwei125
  • zhengwei125
  • 2016年06月16日 15:36
  • 1163

ORACLE11g 重装系统后根据dbf恢复数据库

1.安装一个和原系统一致的oracle 环境,主要包括版本、数据名sid、实例名、路径和数据库编码一致 2.修改listener.ora的参数SID_LIST_LISTENER = (SID_LI...
  • ywswen
  • ywswen
  • 2017年01月02日 12:57
  • 2921
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:关于 oracle恢复的 概论
举报原因:
原因补充:

(最多只允许输入30个字)