oracle中使用logminer工具進行不完全恢複

來源:互聯網
上載者:User

在進行不完全恢複案例演練之前,我們要先學會如何使用logminer工具。該工具主要對redo log 進行挖掘,找出在某個時間點所作的DDL 或DML 操作(包括:時間點、datablock scn 、sql語句)

1、對DML 分析

SQL> select * from scott.tb01;

ID

----------

1

2

3

3 rows selected.

SQL> delete from scott.tb01;

3 rows deleted.

SQL> commit;

Commit complete.

SQL> insert into scott.tb01 values(111);

1 row created.

SQL> insert into scott.tb01 values(222);

1 row created.

SQL> insert into scott.tb01 values(333);

1 row created.

SQL> commit;

Commit complete.

SQL> select * from scott.tb01;

ID

----------

111

222

333

3 rows selected.

(1)查看當前日誌組

SQL> select * from v$log;

GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARCHIVED  STATUS     FIRST_CHANGE# FIRST_TIME

---------- ---------- ---------- ---------- ---------- --------- ---------- ------------- -------------------

1          1          1  104857600          3 YES       INACTIVE          846224 2012-03-22 15:46:28

4          1          0  104857600          3 YES       UNUSED                 0

3          1          3  104857600          3 NO        CURRENT           847894 2012-03-22 16:30:10

2          1          2  104857600          3 YES       INACTIVE          846225 2012-03-22 15:47:06

SQL> alter system archive log current;——使當前日誌組歸檔

System altered.

SQL> select * from v$log;

GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARCHIVED  STATUS     FIRST_CHANGE# FIRST_TIME

---------- ---------- ---------- ---------- ---------- --------- ---------- ------------- -------------------

1          1          5  104857600          3 NO        CURRENT           849696 2012-03-22 17:36:01

4          1          4  104857600          3 YES       ACTIVE            849665 2012-03-22 17:34:34

3          1          3  104857600          3 YES       ACTIVE            847894 2012-03-22 16:30:10

2          1          2  104857600          3 YES       INACTIVE          846225 2012-03-22 15:47:06

4 rows selected.

*********************************以上接案例1***********************************

2、啟用logmnr

(1)添加database補充日誌

17:13:47 SQL> alter database add supplemental log data; ——不添加後面會出錯

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.