关于 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)块锁:ITL等待,一个数据块的事务达到上限,其他会话需要修改这个数据块,需要等待其他事务释放这个数据块的事务槽才行; (2)一般大量进程同时更新同一条记录,或者特定...

Oracle数据库概论

  • 2011-05-10 15:52
  • 1.93MB
  • 下载

[数据库系统概论] SQL中容易混淆的Group By和Order By

原文地址:http://www.cnblogs.com/rainman/archive/2013/05/01/3053703.html 一、概述 “Group By”从字面意义上理解就是根据“By...

人工智能学习笔记 - 预备篇之中学统计学概论

这段时间复习初中和高中的数学时惊喜的看到其中有不少关于统计学的一些介绍,我已经不记得当年学习的时候是否有相关的内容了,不过这些基础的概念还是蛮不错的,所以也做了这个笔记记录下来。统计统计思想的基础知识...

第一章 统计学习方法概论

统计学习 统计学习是基于数据构建模型,并运用模型对数据进行预测和分析的一门学科。 统计学习对数据的基本假设是同类数据具有一定的统计规律性,即可以用概率统计方法来学习。 监督学习的假设是训练数据和测试数...

软工视频(1~20)-概论、计划、设计和方法

软工断断续续地看了二十集

数据库系统概论 学习笔记(二)

第二章     关系数据库本章要点:            1、掌握关系模型的三个组成部分及相关的概念知识   ...

数据库系统概论第五版学习笔记数据库完整性 第五章

一、基本内容 1. 定义:数据的正确性和相容性 2. 内容涉及    1)提供定义完整性约束条件的规则   ‚2)提供完整性检查的方法    3)进行违约处理 3. 分类 实体完整性...
  • M_Eve
  • M_Eve
  • 2016-12-04 16:46
  • 535

PX4 InertialNAV Filter 与 EKF2概论

本文是作者于2017年1月8日在长安大学向广大无人机研发从业者、研究人员所开设的课程讲稿。当中有一处错误,即第五页中的DCM微分方程等号右边需添加一负号,详细情况可参考文末相关文献。
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

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