小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

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

 Lucia‘s doc 2012-05-10

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

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

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

(2) 模擬用戶誤操作

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

(4) 使用 FLASHBACK DATABASE 命令恢復(fù)數(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)關(guān)閉。
已經(jīng)卸載數(shù)據(jù)庫。
ORACLE 例程已經(jīng)關(guān)閉。
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
當(dāng)前日期: 2009-02-19 星期四
輸入新日期: (年月日)

SQL> host time
當(dāng)前時間: 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

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

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

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

RMAN> shutdown immediate

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

RMAN> startup mount

已連接到目標(biāo)數(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ì)的恢復(fù)
介質(zhì)恢復(fù)完成, 用時: 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)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多