日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

20.4?使用FLASHBACK?DATABASE?恢復數(shù)據(jù)庫到先前狀態(tài)

 Lucia‘s doc 2012-05-10

FLASHBACK DATABASE 不能用于恢復介紹失敗,并且使用 FLASHBACK DATABASE 具有以下限制:

  • 數(shù)據(jù)庫必須處于 ARCHIVELOG 模式
  • 必須激活數(shù)據(jù)庫的 FLASHBACK 特征
  • 必須合理配置初始化參數(shù) db_flashback_retention_target,該初始化參數(shù)用于控制可以恢復到的最早時間點

(1) 配置數(shù)據(jù)庫支持

(2) 模擬用戶誤操作

(3) 確定 FLASHBACK DATABASE 可以恢復到的最早 SCN 值或時間

(4) 使用 FLASHBACK DATABASE 命令恢復數(shù)據(jù)庫到先前狀態(tài)

 

SQL*PLUS 中使用 FLASHBACK DATABASE 命令:

SQL> conn / as sysdba
已連接。
SQL> select current_scn from v$database;

CURRENT_SCN
-----------
     660880

SQL> drop table scott.emp;

表已刪除。

SQL> select oldest_flashback_scn,oldest_flashback_time from v$flashback_database_log;

OLDEST_FLASHBACK_SCN OLDEST_FLASHBA
-------------------- --------------
              659643 19-2月 -09

SQL> shutdown immediate
數(shù)據(jù)庫已經(jīng)關閉。
已經(jīng)卸載數(shù)據(jù)庫。
ORACLE 例程已經(jīng)關閉。
SQL> startup mount
ORACLE 例程已經(jīng)啟動。

Total System Global Area  209715200 bytes
Fixed Size                  1248116 bytes
Variable Size              71304332 bytes
Database Buffers          130023424 bytes
Redo Buffers                7139328 bytes
數(shù)據(jù)庫裝載完畢。
SQL> flashback database to scn 660880;

閃回完成。

SQL> alter database open resetlogs;

數(shù)據(jù)庫已更改。

SQL> select count(*) from scott.emp;

  COUNT(*)
----------
        14

 

RMAN 中使用 FLASHBACK DATABASE 命令:

C:\>set nls_date_format=yyyy-mm-dd hh24:mi:ss

C:\>sqlplus sys/orcl@demo as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 2月 19 23:50:47 2009

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

連接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> host date
當前日期: 2009-02-19 星期四
輸入新日期: (年月日)

SQL> host time
當前時間: 23:51:11.81
輸入新時間:

SQL> drop table scott.emp;

表已刪除。

SQL> select oldest_flashback_scn,oldest_flashback_time from v$flashback_database_log;

OLDEST_FLASHBACK_SCN OLDEST_FLASHBACK_TI
-------------------- -------------------
              659643 2009-02-19 23:24:56

SQL> exit
從 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options 斷開

C:\>rman target sys/oracle@demo nocatalog

恢復管理器: Release 10.2.0.1.0 - Production on 星期四 2月 19 23:52:02 2009

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

連接到目標數(shù)據(jù)庫: DEMO (DBID=3422263240)
使用目標數(shù)據(jù)庫控制文件替代恢復目錄

RMAN> shutdown immediate

數(shù)據(jù)庫已關閉
數(shù)據(jù)庫已卸載
Oracle 實例已關閉

RMAN> startup mount

已連接到目標數(shù)據(jù)庫 (未啟動)
Oracle 實例已啟動
數(shù)據(jù)庫已裝載

系統(tǒng)全局區(qū)域總計     209715200 字節(jié)

Fixed Size                     1248116 字節(jié)
Variable Size                 71304332 字節(jié)
Database Buffers             130023424 字節(jié)
Redo Buffers                   7139328 字節(jié)

RMAN> flashback database to time '2009-02-19 23:51:11';

啟動 flashback 于 2009-02-19 23:53:26
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: sid=155 devtype=DISK

正在開始介質(zhì)的恢復
介質(zhì)恢復完成, 用時: 00:00:15

完成 flashback 于 2009-02-19 23:53:44

RMAN> alter database open resetlogs;

數(shù)據(jù)庫已打開

RMAN> run {host 'sqlplus scott/tiger@demo';}

SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 2月 19 23:54:37 2009

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

連接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> select count(1) from emp;

  COUNT(1)
----------
        14

    本站是提供個人知識管理的網(wǎng)絡存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多