• oracle课堂随笔--第二十五天


    通过不完全恢复解决用户的误操作:

    SQL> archive log list

    备份前工作:

    SQL> create table t1(x varchar2(50)) tablespace users;

    SQL> insert into t1 values ('before backup');

    SQL> commit;

    备份:

    RMAN> backup database tag 'weekend_DB_full_backup';

    备份后:

    SQL> insert into t1 values ('after backup, before delete');

    SQL> commit;

    误操作:

    SQL> select sysdate from dual;

    SQL> select dbms_flashback.get_system_change_number from dual;查看号码

    SQL> delete t1;

    SQL> commit;

    SQL> create table after_delete (x int); 正确的操作

    SQL> insert into after_delete values (1);

    SQL> commit;

    恢复:

    RMAN> run {

    startup force mount;

    set until scn= 1806683;

    restore database;

    recover database;

    alter database open resetlogs;

    }

    set until time=’2015-10-26 11:13:23’; 基于时间点恢复

    SQL> select * from t1;

    SQL> select * from after_delete; 丢失

    SQL> select group#, sequence#, status, archived from v$log;

    通过不完全恢复解决归档日志不连续:

    SQL> archive log list

    备份前:

    SQL> create table t1(x varchar2(50)) tablespace users;

    SQL> insert into t1 values ('before backup');

    SQL> commit;

    备份: 

    RMAN> backup database tag 'weekend_DB_full_backup';

    备份后:

    SQL> select GROUP#, SEQUENCE#, STATUS, archived from v$log;

    SQL> insert into t1 values ('after backup, logseq 1, archived');

    SQL> commit;

    SQL> alter system switch logfile;

    SQL> insert into t1 values ('after backup, logseq 2, archived');

    SQL> commit;

    SQL> alter system switch logfile;

    SQL> insert into t1 values ('after backup, logseq 3, archived');

    SQL> commit;

    SQL> alter system switch logfile;

    SQL> insert into t1 values ('after backup, logseq 4, archived');

    SQL> commit;

    SQL> alter system switch logfile;

    SQL> insert into t1 values ('after backup, logseq 5, current');

    SQL> commit;

    SQL> alter system checkpoint;

    故障:

    SQL> shutdown abort

    $ rm /u01/app/oracle/oradata/orcl/users01.dbf

    $rm/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2016_03_01/o1_mf_1_5_cfbcxo84_.arc

    恢复:

    SQL> startup

    先尝试只恢复一个数据文件失败。

    RMAN> run {

    startup force mount;

    set until sequence 4;

    restore database;

    recover database;

    alter database open resetlogs;

    }

    SQL> select * from t1;

  • 相关阅读:
    Math.pow
    css3正方体
    制作一个百度换肤效果
    排他思想
    js栈和堆的区别
    js创建对象的几种方式(工厂模式、构造函数模式、原型模式)
    短网址
    this
    作用域
    JS 函数基础
  • 原文地址:https://www.cnblogs.com/Matilda/p/7383922.html
Copyright © 2020-2023  润新知